mister_bin 0.3.1 → 0.4.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/README.md +7 -3
- data/lib/mister_bin/command.rb +4 -0
- data/lib/mister_bin/docopt_maker.rb +9 -3
- data/lib/mister_bin/version.rb +1 -1
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6192a0143be968a6388eb8b0fe1947ab5fd804db1d27fcf4a1b111b609f949ec
|
4
|
+
data.tar.gz: 93a3970de6124eb6694a41c5a7bfa3f21011330971a49f796f133bf7723b721a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a51dafe658b91c3995dac0e27cc4227151feb3386fe2505bd83d1a3bb5709ac521c892e241c9f3ec80962c96898924c97ad70143611f53b10bc2539ce38ad2bd
|
7
|
+
data.tar.gz: 7c95a181e368e35140594dbe483e3be8aa96bc2a282f678e79463459ca2d3ab40e7967f84ebbd9b2f2e57905b0d5ca0da628a1fe4cab981cebe1f1b68a916954
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Mister Bin
|
|
8
8
|
|
9
9
|
---
|
10
10
|
|
11
|
-
A command line framework for adding command line
|
11
|
+
A command line framework for adding command line interface to your gems.
|
12
12
|
|
13
13
|
---
|
14
14
|
|
@@ -49,7 +49,7 @@ Design Goals
|
|
49
49
|
Examples
|
50
50
|
--------------------------------------------------
|
51
51
|
|
52
|
-
See the [
|
52
|
+
See the [examples](/examples) folder for several example use cases.
|
53
53
|
|
54
54
|
|
55
55
|
|
@@ -61,7 +61,7 @@ Creating a command line utility with Mister Bin involves at least two files:
|
|
61
61
|
1. The main "bin" file. This is the actual executable, and if you are
|
62
62
|
developing a gem, this will be in the `bin` directory of your folder.
|
63
63
|
2. One or more subcommand files. These files use the DSL, and will usually be
|
64
|
-
placed in your `lib/<your gem>/commands folder.
|
64
|
+
placed in your `lib/<your gem>/commands` folder.
|
65
65
|
|
66
66
|
|
67
67
|
|
@@ -206,6 +206,10 @@ usage "app ls --all"
|
|
206
206
|
usage "app ls [--all]"
|
207
207
|
usage "app new NAME"
|
208
208
|
|
209
|
+
# Describe any subcommands
|
210
|
+
command "ls", "Show list of files"
|
211
|
+
command "new", "Pretend to create a new application"
|
212
|
+
|
209
213
|
# Describe any flags
|
210
214
|
option "--all", "Also show hidden files"
|
211
215
|
option "-f --force", "Force delete"
|
data/lib/mister_bin/command.rb
CHANGED
@@ -7,7 +7,7 @@ module MisterBin
|
|
7
7
|
class DocoptMaker
|
8
8
|
include Colsole
|
9
9
|
|
10
|
-
attr_reader :usages, :options, :examples, :params, :env_vars
|
10
|
+
attr_reader :usages, :options, :examples, :params, :commands, :env_vars
|
11
11
|
attr_accessor :summary, :help, :version
|
12
12
|
|
13
13
|
def initialize
|
@@ -17,13 +17,14 @@ module MisterBin
|
|
17
17
|
@usages = []
|
18
18
|
@options = []
|
19
19
|
@params = []
|
20
|
+
@commands = []
|
20
21
|
@examples = []
|
21
22
|
@env_vars = []
|
22
23
|
end
|
23
24
|
|
24
25
|
def docopt
|
25
|
-
[summary_string, help_string, usage_string,
|
26
|
-
params_string, env_string, examples_string].compact.join "\n"
|
26
|
+
[summary_string, help_string, usage_string, commands_string,
|
27
|
+
options_string, params_string, env_string, examples_string].compact.join "\n"
|
27
28
|
end
|
28
29
|
|
29
30
|
private
|
@@ -72,6 +73,11 @@ module MisterBin
|
|
72
73
|
key_value_block 'Environment Variables:', env_vars
|
73
74
|
end
|
74
75
|
|
76
|
+
def commands_string
|
77
|
+
return nil if commands.empty?
|
78
|
+
key_value_block 'Commands:', commands
|
79
|
+
end
|
80
|
+
|
75
81
|
def examples_string
|
76
82
|
return nil if examples.empty?
|
77
83
|
|
data/lib/mister_bin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mister_bin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
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: 2018-
|
11
|
+
date: 2018-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|
@@ -150,21 +150,7 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0.9'
|
153
|
-
|
154
|
-
name: github_changelog_generator
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - "~>"
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '1.14'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - "~>"
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '1.14'
|
167
|
-
description: Build pluggable and modular command line tools with subcommands
|
153
|
+
description: Easily add command line interface to your gems
|
168
154
|
email: db@dannyben.com
|
169
155
|
executables: []
|
170
156
|
extensions: []
|
@@ -199,5 +185,5 @@ rubyforge_project:
|
|
199
185
|
rubygems_version: 2.7.6
|
200
186
|
signing_key:
|
201
187
|
specification_version: 4
|
202
|
-
summary:
|
188
|
+
summary: Command line interface for your gems
|
203
189
|
test_files: []
|