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
- #name ⇒ Object
Constructor Details
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
7 8 9 |
# File 'lib/lono/jadespec.rb', line 7 def from @from end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
8 9 10 |
# File 'lib/lono/jadespec.rb', line 8 def root @root end |
#source_type ⇒ Object (readonly)
Returns the value of attribute source_type.
8 9 10 |
# File 'lib/lono/jadespec.rb', line 8 def source_type @source_type end |
Instance Method Details
#auto_camelize ⇒ Object
backward-compatiable for now
47 48 49 |
# File 'lib/lono/jadespec.rb', line 47 def auto_camelize ["lono_auto_camelize"] || false end |
#detect_type ⇒ Object
35 36 37 38 |
# File 'lib/lono/jadespec.rb', line 35 def detect_type configset = Dir.glob("#{@root}/lib/configset.*").size > 0 configset ? "configset" : "blueprint" end |
#exist? ⇒ Boolean
17 18 19 |
# File 'lib/lono/jadespec.rb', line 17 def exist? !!gemspec_file end |
#gemspec ⇒ Object
21 22 23 |
# File 'lib/lono/jadespec.rb', line 21 def gemspec Gem::Specification::load(gemspec_file) end |
#gemspec_file ⇒ Object
26 27 28 |
# File 'lib/lono/jadespec.rb', line 26 def gemspec_file Dir.glob("#{@root}/*.gemspec").first end |
#lono_strategy ⇒ Object
40 41 42 43 44 |
# File 'lib/lono/jadespec.rb', line 40 def lono_strategy deprecation_check() 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
30 31 32 33 |
# File 'lib/lono/jadespec.rb', line 30 def lono_type deprecation_check() ["lono_type"] || detect_type end |
#metadata ⇒ Object
51 52 53 |
# File 'lib/lono/jadespec.rb', line 51 def gemspec. || {} end |
#name ⇒ Object
13 14 15 |
# File 'lib/lono/jadespec.rb', line 13 def name exist? ? gemspec.name : "not gemspec file found for @root: #{@root}" end |