Class: Mundler::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/mundler/project.rb

Instance Method Summary collapse

Constructor Details

#initialize(project_path) ⇒ Project

Returns a new instance of Project.



3
4
5
6
# File 'lib/mundler/project.rb', line 3

def initialize(project_path)
  @project_path = project_path
  @mruby = MRuby.new(config)
end

Instance Method Details

#cleanObject



24
25
26
# File 'lib/mundler/project.rb', line 24

def clean
  @mruby.delete_repository
end

#exec(args) ⇒ Object



28
29
30
# File 'lib/mundler/project.rb', line 28

def exec(args)
  @mruby.exec(args)
end

#install(&blk) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# 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

#pathObject



32
33
34
# File 'lib/mundler/project.rb', line 32

def path
  @mruby.path
end


20
21
22
# File 'lib/mundler/project.rb', line 20

def print_summary
  @mruby.print_summary
end