Class: Rubber::Configuration::ConfigDescriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/rubber/generator.rb

Overview

Instances of this object are used accept settings from with a config file for when it is transformed by Generator

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#additiveObject

Sets transformation to be additive, only replaces between given delimiters, e/g/ additive = [“## start”, “## end”]



174
175
176
# File 'lib/rubber/generator.rb', line 174

def additive
  @additive
end

#groupObject

The group the output file should have, e.g. “system”



170
171
172
# File 'lib/rubber/generator.rb', line 170

def group
  @group
end

#optionsObject

use sudo to write the output file attr_accessor :sudo options passed in through code



180
181
182
# File 'lib/rubber/generator.rb', line 180

def options
  @options
end

#ownerObject

The owner the output file should have, e.g. “root”



168
169
170
# File 'lib/rubber/generator.rb', line 168

def owner
  @owner
end

#pathObject

The output path to write the transformed config file to



160
161
162
# File 'lib/rubber/generator.rb', line 160

def path
  @path
end

#permsObject

The permissions the output file should have, e.g. 0644 (octal, leading zero is significant)



172
173
174
# File 'lib/rubber/generator.rb', line 172

def perms
  @perms
end

#postObject

The command to run after generating the config file if it has changed



166
167
168
# File 'lib/rubber/generator.rb', line 166

def post
  @post
end

#read_cmdObject

The command to use for reading the original config file from (e.g. “crontab -l”)



162
163
164
# File 'lib/rubber/generator.rb', line 162

def read_cmd
  @read_cmd
end

#skipObject

Lets one dynamically determine if a given file gets skipped during transformation



176
177
178
# File 'lib/rubber/generator.rb', line 176

def skip
  @skip
end

#write_cmdObject

The command to use for piping the transformed config file to (e.g. “crontab -”)



164
165
166
# File 'lib/rubber/generator.rb', line 164

def write_cmd
  @write_cmd
end

Instance Method Details

#get_bindingObject



182
183
184
# File 'lib/rubber/generator.rb', line 182

def get_binding
    binding
end

#rubber_envObject



186
187
188
# File 'lib/rubber/generator.rb', line 186

def rubber_env()
  Rubber::Configuration.rubber_env
end

#rubber_instancesObject



190
191
192
# File 'lib/rubber/generator.rb', line 190

def rubber_instances()
  Rubber::Configuration.rubber_instances
end