Class: MRuby::Command::Git
- Inherits:
-
MRuby::Command
- Object
- MRuby::Command
- MRuby::Command::Git
- Defined in:
- ext/enterprise_script_service/mruby/lib/mruby/build/command.rb
Constant Summary
Constants inherited from MRuby::Command
Instance Attribute Summary collapse
-
#checkout_options ⇒ Object
Returns the value of attribute checkout_options.
-
#clone_options ⇒ Object
Returns the value of attribute clone_options.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#pull_options ⇒ Object
Returns the value of attribute pull_options.
Attributes inherited from MRuby::Command
Instance Method Summary collapse
-
#initialize(build) ⇒ Git
constructor
A new instance of Git.
- #run_checkout(dir, checksum_hash) ⇒ Object
- #run_clone(dir, url, _flags = []) ⇒ Object
- #run_pull(dir, url) ⇒ Object
Methods inherited from MRuby::Command
Constructor Details
#initialize(build) ⇒ Git
Returns a new instance of Git.
248 249 250 251 252 253 254 255 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 248 def initialize(build) super @command = 'git' @flags = %w[] = "clone %{flags} %{url} %{dir}" = "pull" = "checkout %{checksum_hash}" end |
Instance Attribute Details
#checkout_options ⇒ Object
Returns the value of attribute checkout_options.
246 247 248 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 246 def end |
#clone_options ⇒ Object
Returns the value of attribute clone_options.
246 247 248 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 246 def end |
#flags ⇒ Object
Returns the value of attribute flags.
245 246 247 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 245 def flags @flags end |
#pull_options ⇒ Object
Returns the value of attribute pull_options.
246 247 248 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 246 def end |
Instance Method Details
#run_checkout(dir, checksum_hash) ⇒ Object
270 271 272 273 274 275 276 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 270 def run_checkout(dir, checksum_hash) root = Dir.pwd Dir.chdir dir _pp "GIT CHECKOUT", checksum_hash _run , { :checksum_hash => checksum_hash } Dir.chdir root end |
#run_clone(dir, url, _flags = []) ⇒ Object
257 258 259 260 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 257 def run_clone(dir, url, _flags = []) _pp "GIT", url, dir.relative_path _run , { :flags => [flags, _flags].flatten.join(' '), :url => url, :dir => filename(dir) } end |
#run_pull(dir, url) ⇒ Object
262 263 264 265 266 267 268 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 262 def run_pull(dir, url) root = Dir.pwd Dir.chdir dir _pp "GIT PULL", url, dir.relative_path _run Dir.chdir root end |