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.
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.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/fpm/fry/source/patched.rb', line 85 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.exists?([:file]) raise ArgumentError, "File doesn't exist: #{[:file]}" end end end |
Instance Attribute Details
#inner ⇒ Object (readonly)
Returns the value of attribute inner.
79 80 81 |
# File 'lib/fpm/fry/source/patched.rb', line 79 def inner @inner end |
Class Method Details
.decorate(options) ⇒ Object
107 108 109 110 111 112 113 114 |
# File 'lib/fpm/fry/source/patched.rb', line 107 def self.decorate() if .key?(:patches) && Array([:patches]).size > 0 p = .delete(:patches) return new( yield(), patches: p ) else return yield end end |