Class: FPM::Fry::Plugin::EditStaging::AddFile Private
- Inherits:
-
Struct
- Object
- Struct
- FPM::Fry::Plugin::EditStaging::AddFile
- Defined in:
- lib/fpm/fry/plugin/edit_staging.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
-
#io ⇒ Object
Returns the value of attribute io.
-
#options ⇒ Object
Returns the value of attribute options.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #call(_, package) ⇒ Object private
Instance Attribute Details
#io ⇒ Object
Returns the value of attribute io
12 13 14 |
# File 'lib/fpm/fry/plugin/edit_staging.rb', line 12 def io @io end |
#options ⇒ Object
Returns the value of attribute options
12 13 14 |
# File 'lib/fpm/fry/plugin/edit_staging.rb', line 12 def @options end |
#path ⇒ Object
Returns the value of attribute path
12 13 14 |
# File 'lib/fpm/fry/plugin/edit_staging.rb', line 12 def path @path end |
Instance Method Details
#call(_, package) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fpm/fry/plugin/edit_staging.rb', line 13 def call(_ , package) file = package.staging_path(path) package.logger.debug("Writing file directly to staging", target: file, content: io.inspect) FileUtils.mkdir_p(File.dirname(file)) File.open(file,'w') do | f | IO.copy_stream(io, f) if [:chmod] f.chmod([:chmod]) end end io.close if io.respond_to? :close end |