Class: Giddyup::Runner
- Inherits:
-
Object
- Object
- Giddyup::Runner
- Defined in:
- lib/giddyup/runner.rb
Class Method Summary collapse
Class Method Details
.parse_options(args) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/giddyup/runner.rb', line 11 def (args) value = args.shift error "WHERES MY FILE щ(ಠ益ಠщ)" if value.nil? || !valid_file(value) files = args.inject([value]) do |acc, arg| acc << arg if valid_file(arg) acc end files end |
.run!(*args) ⇒ Object
5 6 7 8 9 |
# File 'lib/giddyup/runner.rb', line 5 def run!(*args) files = (args) Giddyup::Util.post_files(files) if files return 0 end |
.valid_file(path) ⇒ Object
21 22 23 24 |
# File 'lib/giddyup/runner.rb', line 21 def valid_file(path) cwd = `pwd`.strip File.exists?(File.join(cwd, path)) end |