Class: Engage::Runner

Inherits:
Thor
  • Object
show all
Includes:
Actions, Helpers
Defined in:
lib/engage/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#default_sources, #file_path, #sources, #sources_table, #store

Methods included from Actions

#clone_repo, #create_gemset, #create_rvmrc, #run_bundler, #setup_rvm, #trust_rvmrc

Instance Attribute Details

#projectObject

Returns the value of attribute project.



9
10
11
# File 'lib/engage/runner.rb', line 9

def project
  @project
end

#target_folderObject

Returns the value of attribute target_folder.



9
10
11
# File 'lib/engage/runner.rb', line 9

def target_folder
  @target_folder
end

Instance Method Details

#add(source) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/engage/runner.rb', line 28

def add(source)
  if store(source)
    say_status 'added source', source, :green
  else
    say_status 'duplicate', source, :red
  end
end

#init(project, dir = nil) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/engage/runner.rb', line 12

def init(project, dir = nil)
  self.project = project
  self.target_folder = dir || project.split("/").last
  clone_repo
  setup_rvm
  run_bundler if using_bundler?
end

#listObject



21
22
23
24
25
# File 'lib/engage/runner.rb', line 21

def list
  table = sources_table
  say "Available sources:"
  print_table(table, :colwidth => table.last.first.to_s.size, :ident => 3)
end