Class: Mangos::Package
- Inherits:
-
Object
- Object
- Mangos::Package
- Defined in:
- lib/mangos/package.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #app_path ⇒ Object
- #data_path ⇒ Object
- #force? ⇒ Boolean
-
#initialize(path, options) ⇒ Package
constructor
A new instance of Package.
- #key_mapping_path ⇒ Object
- #migrate? ⇒ Boolean
- #thumbnails_path ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(path, options) ⇒ Package
Returns a new instance of Package.
4 5 6 7 8 9 |
# File 'lib/mangos/package.rb', line 4 def initialize(path, ) raise "path must be an instance of Pathname" unless path.is_a?(Pathname) @path = DecoratedPathname.new(path) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
2 3 4 |
# File 'lib/mangos/package.rb', line 2 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
2 3 4 |
# File 'lib/mangos/package.rb', line 2 def path @path end |
Instance Method Details
#app_path ⇒ Object
18 19 20 |
# File 'lib/mangos/package.rb', line 18 def app_path @path + ".mangos/" end |
#data_path ⇒ Object
22 23 24 |
# File 'lib/mangos/package.rb', line 22 def data_path app_path + "data.json" end |
#force? ⇒ Boolean
34 35 36 |
# File 'lib/mangos/package.rb', line 34 def force? @options[:force] end |
#key_mapping_path ⇒ Object
26 27 28 |
# File 'lib/mangos/package.rb', line 26 def key_mapping_path app_path + "key_mapping.json" end |
#migrate? ⇒ Boolean
38 39 40 |
# File 'lib/mangos/package.rb', line 38 def migrate? @options[:migrate] end |
#thumbnails_path ⇒ Object
30 31 32 |
# File 'lib/mangos/package.rb', line 30 def thumbnails_path app_path + "img/thumbnails/" end |