runfile 0.3.6 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53afae5e8ad8b2c9aad491c415844806c3a0d727
4
- data.tar.gz: fbe4ac77cf11f352c139174595cc19e483a929b9
3
+ metadata.gz: 8573e778f7613b6aa1f2195701e35e9c43a41d39
4
+ data.tar.gz: a718391979ede594e166b07f4fab511f039b7814
5
5
  SHA512:
6
- metadata.gz: a8339c7a3876b51832c8efef0ab0ab6b3b77ab6f2ac56c75121f54d6ff572cd12911423f4c4759db64821f5dfdb24d47f9a82be6823e03f1fe7a5786ca9db057
7
- data.tar.gz: 871f3a81440ad16fc78d90ae6871442e138f6b280f761eb0cb5eaf4c0abbcd597e001d497a535d36b059ab1d95d2bf510b6bd3ad6df3f7b88975bc673410e2f3
6
+ metadata.gz: 070d0ed20712692a1a9d99de2126943eb496fb81c542f6115b90e46060d23a069958fcaac1741ff2033443d88cb6b983193332787a7d950729aa26b8a6acc7b9
7
+ data.tar.gz: 8a0a80e643101d1073b472490d775ebfcb0f143bb8472767dd72d8c528f7fba07588319d9205128cefd4ddf35969ce4ccb564783771d738277b18306b01a0082
data/bin/run! ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'runfile'
4
+
5
+ # for dev
6
+ # require File.dirname(__FILE__) + "/../lib/runfile"
7
+
8
+ include Runfile
9
+
10
+ Runner.instance.execute ARGV, false
@@ -58,7 +58,7 @@ module Runfile
58
58
  result = []
59
59
  dirs = runfile_folders
60
60
  dirs.each do |d|
61
- found = Dir[File.join(d, '*.runfile')]
61
+ found = Dir[File.join(d, '**/*.runfile')]
62
62
  result << found unless found.empty?
63
63
  end
64
64
  return result.empty? ? false : result.flatten.uniq
@@ -85,7 +85,8 @@ module Runfile
85
85
 
86
86
  # Output the list of available runfiles
87
87
  def say_runfile_list(runfiles)
88
- max = runfiles.max_by(&:length).size
88
+ runfile_paths = runfiles.map { |f| File.dirname f }
89
+ max = runfile_paths.max_by(&:length).size
89
90
  width, height = detect_terminal_size
90
91
  runfiles.each do |f|
91
92
  f[/([^\/]+).runfile$/]
@@ -93,7 +94,7 @@ module Runfile
93
94
  spacer_size = width - max - command.size - 6
94
95
  spacer_size = [1, spacer_size].max
95
96
  spacer = '.' * spacer_size
96
- say " !txtgrn!#{command}!txtrst! #{spacer} #{f}"
97
+ say " !txtgrn!#{command}!txtrst! #{spacer} #{File.dirname f}"
97
98
  end
98
99
  end
99
100
 
@@ -35,7 +35,7 @@ module Runfile
35
35
 
36
36
  # Load and execute a Runfile call.
37
37
  def execute(argv, filename='Runfile')
38
- File.file?(filename) or handle_no_runfile argv
38
+ filename and File.file?(filename) or handle_no_runfile argv
39
39
  begin
40
40
  load filename
41
41
  rescue => ex
@@ -1,3 +1,3 @@
1
1
  module Runfile
2
- VERSION = "0.3.6"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runfile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-04 00:00:00.000000000 Z
11
+ date: 2015-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole
@@ -66,16 +66,18 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.2'
69
- description: A beautiful command line application framework. Rake-inspired, Docopt
70
- inside.
69
+ description: Build command line applications per project with ease. Rake-inspired,
70
+ Docopt inside.
71
71
  email: db@dannyben.com
72
72
  executables:
73
73
  - run
74
+ - run!
74
75
  extensions: []
75
76
  extra_rdoc_files: []
76
77
  files:
77
78
  - README.md
78
79
  - bin/run
80
+ - bin/run!
79
81
  - lib/runfile.rb
80
82
  - lib/runfile/action.rb
81
83
  - lib/runfile/docopt_helper.rb