Class: Pronto::Runner
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(patches, commit = nil) ⇒ Runner
constructor
A new instance of Runner.
- #repo_path ⇒ Object
- #ruby_file?(path) ⇒ Boolean
- #ruby_patches ⇒ Object
Methods included from Plugin
Constructor Details
#initialize(patches, commit = nil) ⇒ Runner
Returns a new instance of Runner.
5 6 7 8 |
# File 'lib/pronto/runner.rb', line 5 def initialize(patches, commit = nil) @patches = patches @commit = commit end |
Class Method Details
.runners ⇒ Object
10 11 12 |
# File 'lib/pronto/runner.rb', line 10 def self.runners repository end |
.title ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/pronto/runner.rb', line 14 def self.title @runner_name ||= begin source_path, _line = instance_method(:run).source_location file_name, _extension = File.basename(source_path).split('.') file_name end end |
Instance Method Details
#repo_path ⇒ Object
33 34 35 |
# File 'lib/pronto/runner.rb', line 33 def repo_path @patches.first.repo.path end |
#ruby_file?(path) ⇒ Boolean
29 30 31 |
# File 'lib/pronto/runner.rb', line 29 def ruby_file?(path) rb_file?(path) || rake_file?(path) || ruby_executable?(path) end |
#ruby_patches ⇒ Object
22 23 24 25 26 27 |
# File 'lib/pronto/runner.rb', line 22 def ruby_patches return [] unless @patches @ruby_patches ||= @patches.select { |patch| patch.additions > 0 } .select { |patch| ruby_file?(patch.new_file_full_path) } end |