runfile 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/runfile/docopt_helper.rb +6 -4
- data/lib/runfile/runfile_helper.rb +6 -3
- data/lib/runfile/runner.rb +1 -1
- data/lib/runfile/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0980ca227f78853f3dcf034253d57a0ac61f5cc0
|
4
|
+
data.tar.gz: c5548ead96c34f0dbcfa59a48d64153463b5b75e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a960d00b7663752bb7e6f7264323c2d5e654fac533f391dc54c1dcced5e1aa9e171e7cd55f199855fe908e64660b2680d5aa63c646aeffd2c252ae2c119d223
|
7
|
+
data.tar.gz: 367511ebf703bb821a5acec2742e8371d0459e0f7adbb4998871cf40044792aa5646be49b06993ab82588aa060c3d42c7ebcde59e97d57a4bec56198a09ca5fe
|
@@ -29,7 +29,8 @@ module Runfile
|
|
29
29
|
# and options we have collected from the Runfile DSL.
|
30
30
|
def docopt
|
31
31
|
width, height = detect_terminal_size
|
32
|
-
doc = [
|
32
|
+
doc = []
|
33
|
+
doc << (@version ? "#{@name} #{@version}" : "#{@name}")
|
33
34
|
doc << "#{@summary}" if @summary
|
34
35
|
doc += docopt_usage
|
35
36
|
doc += docopt_commands width
|
@@ -43,10 +44,11 @@ module Runfile
|
|
43
44
|
@actions.each do |name, action|
|
44
45
|
doc << " run #{action.usage}" unless action.usage == false
|
45
46
|
end
|
47
|
+
basic_flags = @version ? "(-h|--help|--version)" : "(-h|--help)"
|
46
48
|
if @superspace
|
47
|
-
doc << " run #{@superspace}
|
49
|
+
doc << " run #{@superspace} #{basic_flags}\n"
|
48
50
|
else
|
49
|
-
doc << " run
|
51
|
+
doc << " run #{basic_flags}\n"
|
50
52
|
end
|
51
53
|
doc
|
52
54
|
end
|
@@ -70,7 +72,7 @@ module Runfile
|
|
70
72
|
def docopt_options(width)
|
71
73
|
@options['Options'] = {} unless @options['Options']
|
72
74
|
@options['Options']['-h --help'] = 'Show this screen'
|
73
|
-
@options['Options']['--version'] = 'Show version number'
|
75
|
+
@options['Options']['--version'] = 'Show version number' if @version
|
74
76
|
|
75
77
|
doc = []
|
76
78
|
@options.each do |scope, values|
|
@@ -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, '
|
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
|
@@ -76,9 +76,12 @@ module Runfile
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
-
# Return array of folders we should search for runfiles
|
79
|
+
# Return array of folders we should search in for runfiles.
|
80
80
|
def runfile_folders
|
81
|
-
|
81
|
+
# This trick allows searching in subfolders recursively, including
|
82
|
+
# one level of symlinked folder
|
83
|
+
subdirs = '**{,/*/**}'
|
84
|
+
[Dir.pwd, "#{Dir.home}/runfile/#{subdirs}", "/etc/runfile/#{subdirs}"]
|
82
85
|
end
|
83
86
|
|
84
87
|
# [UNUSED] Same as runfile_folders, but including PATH
|
data/lib/runfile/runner.rb
CHANGED
data/lib/runfile/version.rb
CHANGED
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.
|
4
|
+
version: 0.5.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-
|
11
|
+
date: 2015-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|