Class: MotionSwifty::Cart
- Inherits:
-
Object
- Object
- MotionSwifty::Cart
- Defined in:
- lib/motion/swifty/cart.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
Returns the value of attribute definition.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(definition, options = {}) ⇒ Cart
constructor
A new instance of Cart.
- #name ⇒ Object
- #path(plaform = "iOS") ⇒ Object
Constructor Details
#initialize(definition, options = {}) ⇒ Cart
Returns a new instance of Cart.
6 7 8 9 |
# File 'lib/motion/swifty/cart.rb', line 6 def initialize(definition, = {}) @definition = definition @options = end |
Instance Attribute Details
#definition ⇒ Object
Returns the value of attribute definition.
3 4 5 |
# File 'lib/motion/swifty/cart.rb', line 3 def definition @definition end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/motion/swifty/cart.rb', line 4 def @options end |
Instance Method Details
#name ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/motion/swifty/cart.rb', line 11 def name self..fetch(:name) do if match = @definition.match(/.* ".*\/(.*?)"/i) match.captures.first else raise "Couldn’t extract cart name from its Cartfile definition" end end end |
#path(plaform = "iOS") ⇒ Object
21 22 23 |
# File 'lib/motion/swifty/cart.rb', line 21 def path(plaform = "iOS") File.("./Carthage/Build/#{plaform}/#{name}.framework") end |