Class: FPM::Fry::Plugin::Config::DSL
- Inherits:
-
Struct
- Object
- Struct
- FPM::Fry::Plugin::Config::DSL
- Defined in:
- lib/fpm/fry/plugin/config.rb
Instance Attribute Summary collapse
-
#builder ⇒ Object
Returns the value of attribute builder.
-
#callback ⇒ Object
Returns the value of attribute callback.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #exclude(path) ⇒ Object
- #include(path) ⇒ Object
-
#initialize(builder, options) ⇒ DSL
constructor
A new instance of DSL.
Constructor Details
#initialize(builder, options) ⇒ DSL
Returns a new instance of DSL.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/fpm/fry/plugin/config.rb', line 69 def initialize( builder, ) callback = builder.output_hooks.find{|h| h.kind_of? Callback } if !callback callback = Callback.new({'etc' => true}) builder.output_hooks << callback end # This looks kind of dirty. The callback tells the cook comamnd that the # user has explictly used the config plugin. This way the cook command # can hint the user to use this plugin if config files were automatically # added. if ![IMPLICIT] builder.output_hooks << MARK_EXPLICIT end super( builder, , callback ) end |
Instance Attribute Details
#builder ⇒ Object
Returns the value of attribute builder
67 68 69 |
# File 'lib/fpm/fry/plugin/config.rb', line 67 def builder @builder end |
#callback ⇒ Object
Returns the value of attribute callback
67 68 69 |
# File 'lib/fpm/fry/plugin/config.rb', line 67 def callback @callback end |
#options ⇒ Object
Returns the value of attribute options
67 68 69 |
# File 'lib/fpm/fry/plugin/config.rb', line 67 def @options end |
Instance Method Details
#exclude(path) ⇒ Object
92 93 94 95 96 97 |
# File 'lib/fpm/fry/plugin/config.rb', line 92 def exclude( path ) if path[0] == "/" path = path[1..-1] end callback.files[path] = false end |
#include(path) ⇒ Object
85 86 87 88 89 90 |
# File 'lib/fpm/fry/plugin/config.rb', line 85 def include( path ) if path[0] == "/" path = path[1..-1] end callback.files[path] = true end |