Module: Ronin::Git
- Defined in:
- lib/ronin/git.rb
Class Method Summary collapse
Class Method Details
.branch(mod) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/ronin/git.rb', line 21 def branch(mod) @cmd = Mixlib::ShellOut.new("git --git-dir=#{Ronin::Config[:module_path]}/#{mod}/.git --work-tree=#{Ronin::Config[:module_path]}/#{mod}/ branch") @cmd.run_command @branch = @cmd.stdout.chomp.split(' ')[1] @branch end |
.clone(mod, branch) ⇒ Object
37 38 39 40 41 |
# File 'lib/ronin/git.rb', line 37 def clone(mod, branch) @cmd = Mixlib::ShellOut.new("git clone #{Ronin::Config[:git_url]}/#{mod}/ #{Ronin::Config[:module_path]}/#{mod}/ -b #{branch}") @cmd.run_command puts @cmd.stdout end |
.pull_and_report_updated(mod) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/ronin/git.rb', line 29 def pull_and_report_updated(mod) @cmd = Mixlib::ShellOut.new("git --git-dir=#{Ronin::Config[:module_path]}/#{mod}/.git --work-tree=#{Ronin::Config[:module_path]}/#{mod}/ pull") @cmd.run_command @updated = @cmd.stdout.include?("Updating") @updated ? true : false end |