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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 222548480931d04a04df3ff85727d00b22f6da55
4
- data.tar.gz: 47139374b01f97e8797295f22555cfe0389640e2
3
+ metadata.gz: 53afae5e8ad8b2c9aad491c415844806c3a0d727
4
+ data.tar.gz: fbe4ac77cf11f352c139174595cc19e483a929b9
5
5
  SHA512:
6
- metadata.gz: ed8ab0427040556585a8d2504dbf09e0ec29309f7c1fb4fd79866ef5c2d52d0d754815403ca99604025107ce07b1cdd9f221cd1513d72752ecc5a51c9017b6f3
7
- data.tar.gz: a7184d573a3ead9707b14cf75a150fc40df54b102ef7a6481a8a4746b77b039a3dba5268fd163dd0a0f6e36b1566df3ef681f5d1a3dea8c2480aae5734713e83
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
- def initialize(name, version, summary, actions, options)
17
- @name = name
18
- @version = version
19
- @summary = summary
20
- @actions = actions
21
- @options = options
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
- doc << " run (-h|--help|--version)\n"
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
 
@@ -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"
@@ -1,3 +1,3 @@
1
1
  module Runfile
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
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.5
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-08-17 00:00:00.000000000 Z
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.7
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