Class: Vanagon::Patch
- Inherits:
-
Object
- Object
- Vanagon::Patch
- Includes:
- HashableAttributes
- Defined in:
- lib/vanagon/patch.rb,
lib/vanagon/extensions/hashable.rb
Instance Attribute Summary collapse
-
#after ⇒ Object
readonly
Returns the value of attribute after.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#fuzz ⇒ Object
readonly
Returns the value of attribute fuzz.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#strip ⇒ Object
readonly
Returns the value of attribute strip.
Instance Method Summary collapse
- #cmd(platform) ⇒ Object
-
#initialize(path, strip, fuzz, after, destination) ⇒ Patch
constructor
A new instance of Patch.
Methods included from HashableAttributes
Constructor Details
#initialize(path, strip, fuzz, after, destination) ⇒ Patch
Returns a new instance of Patch.
25 26 27 28 29 30 31 32 |
# File 'lib/vanagon/patch.rb', line 25 def initialize(path, strip, fuzz, after, destination) raise Vanagon::Error, "We can only apply patches after the source is unpacked or after installation" unless ['unpack', 'install'].include?(after) @path = path @strip = strip @fuzz = fuzz @after = after @destination = destination end |
Instance Attribute Details
#after ⇒ Object (readonly)
Returns the value of attribute after.
19 20 21 |
# File 'lib/vanagon/patch.rb', line 19 def after @after end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
23 24 25 |
# File 'lib/vanagon/patch.rb', line 23 def destination @destination end |
#fuzz ⇒ Object (readonly)
Returns the value of attribute fuzz.
15 16 17 |
# File 'lib/vanagon/patch.rb', line 15 def fuzz @fuzz end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/vanagon/patch.rb', line 7 def path @path end |
#strip ⇒ Object (readonly)
Returns the value of attribute strip.
11 12 13 |
# File 'lib/vanagon/patch.rb', line 11 def strip @strip end |
Instance Method Details
#cmd(platform) ⇒ Object
34 35 36 |
# File 'lib/vanagon/patch.rb', line 34 def cmd(platform) "#{platform.patch} --strip=#{@strip} --fuzz=#{@fuzz} --ignore-whitespace --no-backup-if-mismatch < $(workdir)/patches/#{File.basename(@path)}" end |