Class: FPM::Fry::Plugin::EditStaging::DSL
- Inherits:
-
Struct
- Object
- Struct
- FPM::Fry::Plugin::EditStaging::DSL
- Defined in:
- lib/fpm/fry/plugin/edit_staging.rb
Instance Attribute Summary collapse
-
#builder ⇒ Object
Returns the value of attribute builder.
Instance Method Summary collapse
Instance Attribute Details
#builder ⇒ Object
Returns the value of attribute builder
37 38 39 |
# File 'lib/fpm/fry/plugin/edit_staging.rb', line 37 def builder @builder end |
Instance Method Details
#add_file(path, content, options = {}) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/fpm/fry/plugin/edit_staging.rb', line 41 def add_file(path, content, = {}) if content.kind_of?(IO) || content.kind_of?(StringIO) io = content elsif content.kind_of? String io = StringIO.new(content) else raise ArgumentError.new("File content must be a String or IO, got #{content.inspect}") end = .dup [:chmod] = convert_chmod([:chmod]) if [:chmod] .freeze io.rewind if io.respond_to? :rewind builder.output_hooks << AddFile.new(path, io, ) end |
#ln_s(src, dest) ⇒ Object
56 57 58 |
# File 'lib/fpm/fry/plugin/edit_staging.rb', line 56 def ln_s(src, dest) builder.output_hooks << LnS.new(src,dest) end |