Class: FPM::Fry::Source::Patched
- Inherits:
-
Object
- Object
- FPM::Fry::Source::Patched
- Extended by:
- Forwardable
- Defined in:
- lib/fpm/fry/source/patched.rb
Defined Under Namespace
Classes: Cache
Instance Attribute Summary collapse
-
#inner ⇒ Object
readonly
Returns the value of attribute inner.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#patches ⇒ Object
readonly
Returns the value of attribute patches.
Class Method Summary collapse
Instance Method Summary collapse
- #build_cache(tmpdir) ⇒ Object
-
#initialize(inner, options = {}) ⇒ Patched
constructor
A new instance of Patched.
Constructor Details
#initialize(inner, options = {}) ⇒ Patched
Returns a new instance of Patched.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/fpm/fry/source/patched.rb', line 110 def initialize( inner , = {}) @inner = inner @patches = Array([:patches]).map do |file| if file.kind_of? String = {file: file} elsif file.kind_of? Hash = file.dup else raise ArgumentError, "Expected a Hash or a String, got #{file.inspect}" end [:file] = File.([:file]) if !File.exist?([:file]) raise ArgumentError, "File doesn't exist: #{[:file]}" end end if @inner.respond_to? :logger @logger = @inner.logger else @logger = Cabin::Channel.get end end |
Instance Attribute Details
#inner ⇒ Object (readonly)
Returns the value of attribute inner.
104 105 106 |
# File 'lib/fpm/fry/source/patched.rb', line 104 def inner @inner end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
104 105 106 |
# File 'lib/fpm/fry/source/patched.rb', line 104 def logger @logger end |
#patches ⇒ Object (readonly)
Returns the value of attribute patches.
104 105 106 |
# File 'lib/fpm/fry/source/patched.rb', line 104 def patches @patches end |
Class Method Details
.decorate(options) ⇒ Object
137 138 139 140 141 142 143 144 |
# File 'lib/fpm/fry/source/patched.rb', line 137 def self.decorate() if .key?(:patches) && Array([:patches]).size > 0 p = .delete(:patches) return new( yield(), patches: p ) else return yield end end |