Class: Rubber::Configuration::ConfigDescriptor
- Inherits:
-
Object
- Object
- Rubber::Configuration::ConfigDescriptor
- 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
-
#additive ⇒ Object
Sets transformation to be additive, only replaces between given delimiters, e/g/ additive = [“## start”, “## end”].
-
#backup ⇒ Object
Backup file when transforming, defaults to true, set to false to prevent backup.
-
#generator ⇒ Object
allow access to calling generator so can determine stuff like fake_root.
-
#group ⇒ Object
The group the output file should have, e.g.
-
#options ⇒ Object
use sudo to write the output file attr_accessor :sudo options passed in through code.
-
#owner ⇒ Object
The owner the output file should have, e.g.
-
#path ⇒ Object
The output path to write the transformed config file to.
-
#perms ⇒ Object
The permissions the output file should have, e.g.
-
#post ⇒ Object
The command to run after generating the config file if it has changed.
-
#read_cmd ⇒ Object
The command to use for reading the original config file from (e.g. “crontab -l”).
-
#skip ⇒ Object
Lets one dynamically determine if a given file gets skipped during transformation.
-
#write_cmd ⇒ Object
The command to use for piping the transformed config file to (e.g. “crontab -”).
Instance Method Summary collapse
- #get_binding ⇒ Object
-
#initialize ⇒ ConfigDescriptor
constructor
A new instance of ConfigDescriptor.
- #rubber_env ⇒ Object
- #rubber_instances ⇒ Object
Constructor Details
#initialize ⇒ ConfigDescriptor
Returns a new instance of ConfigDescriptor.
190 191 192 |
# File 'lib/rubber/generator.rb', line 190 def initialize @backup = true end |
Instance Attribute Details
#additive ⇒ Object
Sets transformation to be additive, only replaces between given delimiters, e/g/ additive = [“## start”, “## end”]
177 178 179 |
# File 'lib/rubber/generator.rb', line 177 def additive @additive end |
#backup ⇒ Object
Backup file when transforming, defaults to true, set to false to prevent backup
181 182 183 |
# File 'lib/rubber/generator.rb', line 181 def backup @backup end |
#generator ⇒ Object
allow access to calling generator so can determine stuff like fake_root
188 189 190 |
# File 'lib/rubber/generator.rb', line 188 def generator @generator end |
#group ⇒ Object
The group the output file should have, e.g. “system”
173 174 175 |
# File 'lib/rubber/generator.rb', line 173 def group @group end |
#options ⇒ Object
use sudo to write the output file attr_accessor :sudo options passed in through code
185 186 187 |
# File 'lib/rubber/generator.rb', line 185 def @options end |
#owner ⇒ Object
The owner the output file should have, e.g. “root”
171 172 173 |
# File 'lib/rubber/generator.rb', line 171 def owner @owner end |
#path ⇒ Object
The output path to write the transformed config file to
163 164 165 |
# File 'lib/rubber/generator.rb', line 163 def path @path end |
#perms ⇒ Object
The permissions the output file should have, e.g. 0644 (octal, leading zero is significant)
175 176 177 |
# File 'lib/rubber/generator.rb', line 175 def perms @perms end |
#post ⇒ Object
The command to run after generating the config file if it has changed
169 170 171 |
# File 'lib/rubber/generator.rb', line 169 def post @post end |
#read_cmd ⇒ Object
The command to use for reading the original config file from (e.g. “crontab -l”)
165 166 167 |
# File 'lib/rubber/generator.rb', line 165 def read_cmd @read_cmd end |
#skip ⇒ Object
Lets one dynamically determine if a given file gets skipped during transformation
179 180 181 |
# File 'lib/rubber/generator.rb', line 179 def skip @skip end |
#write_cmd ⇒ Object
The command to use for piping the transformed config file to (e.g. “crontab -”)
167 168 169 |
# File 'lib/rubber/generator.rb', line 167 def write_cmd @write_cmd end |
Instance Method Details
#get_binding ⇒ Object
194 195 196 |
# File 'lib/rubber/generator.rb', line 194 def get_binding binding end |
#rubber_env ⇒ Object
198 199 200 |
# File 'lib/rubber/generator.rb', line 198 def rubber_env() Rubber::Configuration.rubber_env end |
#rubber_instances ⇒ Object
202 203 204 |
# File 'lib/rubber/generator.rb', line 202 def rubber_instances() Rubber::Configuration.rubber_instances end |