Class: Lono::Jadespec

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Defined in:
lib/lono/jadespec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root, source_type) ⇒ Jadespec

Returns a new instance of Jadespec.



11
12
13
# File 'lib/lono/jadespec.rb', line 11

def initialize(root, source_type)
  @root, @source_type = root, source_type
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



9
10
11
# File 'lib/lono/jadespec.rb', line 9

def from
  @from
end

#rootObject (readonly)

Returns the value of attribute root.



10
11
12
# File 'lib/lono/jadespec.rb', line 10

def root
  @root
end

#source_typeObject (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_camelizeObject



32
33
34
# File 'lib/lono/jadespec.rb', line 32

def auto_camelize
  [:auto_camelize] || false
end

#exist?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/lono/jadespec.rb', line 15

def exist?
  !!gemspec_file
end

#gemspecObject



19
20
21
# File 'lib/lono/jadespec.rb', line 19

def gemspec
  Gem::Specification::load(gemspec_file)
end

#gemspec_fileObject



24
25
26
# File 'lib/lono/jadespec.rb', line 24

def gemspec_file
  Dir.glob("#{@root}/*.gemspec").first
end

#metadataObject



36
37
38
# File 'lib/lono/jadespec.rb', line 36

def 
  gemspec..deep_symbolize_keys
end

#template_typeObject



28
29
30
# File 'lib/lono/jadespec.rb', line 28

def template_type
  [:template_type] || "dsl"
end