Method: Grit::Git#transform_options
- Defined in:
- lib/grit/git.rb
#transform_options(options) ⇒ Object
Transform Ruby style options into git command line options
++ is a hash of Ruby style
Returns String[]
e.g. ["--max-count=10", "--header"]
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 |
# File 'lib/grit/git.rb', line 474 def () args = [] .keys.each do |opt| if opt.to_s.size == 1 if [opt] == true args << "-#{opt}" elsif [opt] == false # ignore else val = .delete(opt) args << "-#{opt.to_s} '#{e(val)}'" end else if [opt] == true args << "--#{opt.to_s.gsub(/_/, '-')}" elsif [opt] == false # ignore else val = .delete(opt) args << "--#{opt.to_s.gsub(/_/, '-')}='#{e(val)}'" end end end args end |