Class: Lono::Jadespec
- Inherits:
-
Object
- Object
- Lono::Jadespec
- Extended by:
- Memoist
- Defined in:
- lib/lono/jadespec.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#source_type ⇒ Object
readonly
Returns the value of attribute source_type.
Instance Method Summary collapse
-
#auto_camelize ⇒ Object
backward-compatiable for now.
- #detect_type ⇒ Object
- #exist? ⇒ Boolean
- #gemspec ⇒ Object
- #gemspec_file ⇒ Object
-
#initialize(root, source_type) ⇒ Jadespec
constructor
A new instance of Jadespec.
- #lono_strategy ⇒ Object
- #lono_type ⇒ Object
- #metadata ⇒ Object
Constructor Details
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
9 10 11 |
# File 'lib/lono/jadespec.rb', line 9 def from @from end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
10 11 12 |
# File 'lib/lono/jadespec.rb', line 10 def root @root end |
#source_type ⇒ Object (readonly)
Returns the value of attribute source_type.
10 11 12 |
# File 'lib/lono/jadespec.rb', line 10 def source_type @source_type end |
Instance Method Details
#auto_camelize ⇒ Object
backward-compatiable for now
43 44 45 |
# File 'lib/lono/jadespec.rb', line 43 def auto_camelize ["lono_auto_camelize"] || false end |
#detect_type ⇒ Object
32 33 34 35 |
# File 'lib/lono/jadespec.rb', line 32 def detect_type configset = Dir.glob("#{@root}/lib/configset.*").size > 0 configset ? "configset" : "blueprint" end |
#exist? ⇒ Boolean
15 16 17 |
# File 'lib/lono/jadespec.rb', line 15 def exist? !!gemspec_file end |
#gemspec ⇒ Object
19 20 21 |
# File 'lib/lono/jadespec.rb', line 19 def gemspec Gem::Specification::load(gemspec_file) end |
#gemspec_file ⇒ Object
24 25 26 |
# File 'lib/lono/jadespec.rb', line 24 def gemspec_file Dir.glob("#{@root}/*.gemspec").first end |
#lono_strategy ⇒ Object
37 38 39 40 |
# File 'lib/lono/jadespec.rb', line 37 def lono_strategy return ["lono_strategy"] if ["lono_strategy"] lono_type == "blueprint" ? "dsl" : "erb" # TODO: default to dsl for configset also in next major release end |
#lono_type ⇒ Object
28 29 30 |
# File 'lib/lono/jadespec.rb', line 28 def lono_type ["lono_type"] || detect_type end |
#metadata ⇒ Object
47 48 49 |
# File 'lib/lono/jadespec.rb', line 47 def gemspec. || {} end |