Method: Lono::Jade#materialize

Defined in:
lib/lono/jade.rb

#materializeObject



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/lono/jade.rb', line 48

def materialize
  @jadespec = finder.find(@name)
  download unless @jadespec
  # Pretty tricky. Flush memoized finder(true) since download changes filesystem. Not memoizing at all is 2x slower
  @jadespec = finder(true).find(@name)
  return nil unless @jadespec
  if @jadespec.source_type == "materialized"
    # possible "duplicated" jade instances with same name but will uniq in final materialized Gemfile
    case @jadespec.lono_type
    when "configset"
      Lono::Jade::Registry.downloaded_configsets << self
    when "extension"
      Lono::Jade::Registry.downloaded_extensions << self
    end
  end
  evaluate_meta_rb
  @jadespec
end