runfile 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/runfile/docopt_helper.rb +15 -7
- data/lib/runfile/runner.rb +1 -1
- data/lib/runfile/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53afae5e8ad8b2c9aad491c415844806c3a0d727
|
4
|
+
data.tar.gz: fbe4ac77cf11f352c139174595cc19e483a929b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8339c7a3876b51832c8efef0ab0ab6b3b77ab6f2ac56c75121f54d6ff572cd12911423f4c4759db64821f5dfdb24d47f9a82be6823e03f1fe7a5786ca9db057
|
7
|
+
data.tar.gz: 871f3a81440ad16fc78d90ae6871442e138f6b280f761eb0cb5eaf4c0abbcd597e001d497a535d36b059ab1d95d2bf510b6bd3ad6df3f7b88975bc673410e2f3
|
@@ -13,12 +13,16 @@ module Runfile
|
|
13
13
|
# The constructor expects to get all the textual details
|
14
14
|
# needed to generate a docopt document (name, version,
|
15
15
|
# summary, options) and an array of Action objects.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
@
|
21
|
-
@
|
16
|
+
# The superspace argument will be the name of runfile, in case we
|
17
|
+
# are running a named.runfile. It is only needed to generate the
|
18
|
+
# proper `run superspace (-h|--help|--version)` line
|
19
|
+
def initialize(superspace, name, version, summary, actions, options)
|
20
|
+
@superspace = superspace
|
21
|
+
@name = name
|
22
|
+
@version = version
|
23
|
+
@summary = summary
|
24
|
+
@actions = actions
|
25
|
+
@options = options
|
22
26
|
end
|
23
27
|
|
24
28
|
# Generate a document based on all the actions, help messages
|
@@ -39,7 +43,11 @@ module Runfile
|
|
39
43
|
@actions.each do |name, action|
|
40
44
|
doc << " run #{action.usage}" unless action.usage == false
|
41
45
|
end
|
42
|
-
|
46
|
+
if @superspace
|
47
|
+
doc << " run #{@superspace} (-h|--help|--version)\n"
|
48
|
+
else
|
49
|
+
doc << " run (-h|--help|--version)\n"
|
50
|
+
end
|
43
51
|
doc
|
44
52
|
end
|
45
53
|
|
data/lib/runfile/runner.rb
CHANGED
@@ -103,7 +103,7 @@ module Runfile
|
|
103
103
|
# This should always be called in a begin...rescue block and
|
104
104
|
# you should handle the Docopt::Exit exception.
|
105
105
|
def docopt_exec(argv)
|
106
|
-
helper = DocoptHelper.new(@name, @version, @summary, @actions, @options)
|
106
|
+
helper = DocoptHelper.new(@superspace, @name, @version, @summary, @actions, @options)
|
107
107
|
args = helper.args argv
|
108
108
|
action = find_action argv
|
109
109
|
action or abort "Runfile error: Action not found"
|
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.3.
|
4
|
+
version: 0.3.6
|
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-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.4.
|
108
|
+
rubygems_version: 2.4.6
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: If Rake and Docopt had a baby
|