Class: KKGit::AutoFormat::Tool
- Inherits:
-
Struct
- Object
- Struct
- KKGit::AutoFormat::Tool
- Defined in:
- lib/kk/git/auto_format.rb
Instance Attribute Summary collapse
-
#argv ⇒ Object
Returns the value of attribute argv.
-
#bin ⇒ Object
Returns the value of attribute bin.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#argv ⇒ Object
Returns the value of attribute argv
10 11 12 |
# File 'lib/kk/git/auto_format.rb', line 10 def argv @argv end |
#bin ⇒ Object
Returns the value of attribute bin
10 11 12 |
# File 'lib/kk/git/auto_format.rb', line 10 def bin @bin end |
#name ⇒ Object
Returns the value of attribute name
10 11 12 |
# File 'lib/kk/git/auto_format.rb', line 10 def name @name end |
Instance Method Details
#build(files, repo_dir:) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/kk/git/auto_format.rb', line 11 def build(files, repo_dir:) bin_path = AutoFormat.resolve_bin(bin, repo_dir: repo_dir) return nil unless bin_path args = argv.flat_map { |part| part == '%{files}' ? files : [part] } [bin_path, *args] end |