class Mundler::Project

Public Class Methods

new(project_path) click to toggle source
# File lib/mundler/project.rb, line 3
def initialize(project_path)
  @project_path = project_path
  @mruby = MRuby.new(config)
end

Public Instance Methods

clean() click to toggle source
# File lib/mundler/project.rb, line 24
def clean
  @mruby.delete_repository
end
exec(args) click to toggle source
# File lib/mundler/project.rb, line 28
def exec(args)
  @mruby.exec(args)
end
install(&blk) click to toggle source
# File lib/mundler/project.rb, line 8
def install(&blk)
  @mruby.clone_repository
  build_config = BuildConfig.new(config).tempfile
  @mruby.compile(build_config.path)
  FileUtils.cp(build_config.path, File.join(@project_path, "Mundlefile.lock"))
ensure
  if build_config
    build_config.close
    build_config.delete
  end
end
path() click to toggle source
# File lib/mundler/project.rb, line 32
def path
  @mruby.path
end
print_summary() click to toggle source

Private Instance Methods

config() click to toggle source
# File lib/mundler/project.rb, line 38
def config
  @config ||= begin
    mundlefile_path = (
      ENV["MUNDLEFILE_PATH"] ||
      File.join(@project_path, "Mundlefile")
    )

    dsl = DSL.new(mundlefile_path)
    dsl.evaluate!
    dsl.config
  end
end