Class: Pineapples::Actions::Target
- Inherits:
-
Object
- Object
- Pineapples::Actions::Target
- Defined in:
- lib/pineapples/actions/base/target.rb
Constant Summary collapse
- PASS_REGEX =
/!=(.*?)!/- GUARD_REGEX =
/!(.*?)!/- FILENAME_REGEX =
/%(.*?)%/
Instance Attribute Summary collapse
-
#fullpath ⇒ Object
readonly
Returns the value of attribute fullpath.
-
#generator ⇒ Object
readonly
Returns the value of attribute generator.
-
#given ⇒ Object
readonly
Returns the value of attribute given.
-
#relative ⇒ Object
readonly
Returns the value of attribute relative.
Instance Method Summary collapse
-
#initialize(target, generator) ⇒ Target
constructor
A new instance of Target.
- #skip? ⇒ Boolean
Constructor Details
#initialize(target, generator) ⇒ Target
Returns a new instance of Target.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/pineapples/actions/base/target.rb', line 13 def initialize(target, generator) raise Error, 'Target should not be falsy' if !target @generator = generator @given = target.to_s match! @fullpath = File.(@given, generator.current_app_dir) @relative = generator.relative_to_current_app_dir(@fullpath) end |
Instance Attribute Details
#fullpath ⇒ Object (readonly)
Returns the value of attribute fullpath.
8 9 10 |
# File 'lib/pineapples/actions/base/target.rb', line 8 def fullpath @fullpath end |
#generator ⇒ Object (readonly)
Returns the value of attribute generator.
8 9 10 |
# File 'lib/pineapples/actions/base/target.rb', line 8 def generator @generator end |
#given ⇒ Object (readonly)
Returns the value of attribute given.
8 9 10 |
# File 'lib/pineapples/actions/base/target.rb', line 8 def given @given end |
#relative ⇒ Object (readonly)
Returns the value of attribute relative.
8 9 10 |
# File 'lib/pineapples/actions/base/target.rb', line 8 def relative @relative end |
Instance Method Details
#skip? ⇒ Boolean
25 26 27 |
# File 'lib/pineapples/actions/base/target.rb', line 25 def skip? @skip end |