mister_bin 0.3.1 → 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
  SHA256:
3
- metadata.gz: 544ea89862e3731beab20f7a6e180109377fbf4ee428dc87577f4315d9d4656e
4
- data.tar.gz: b911335298d0939f37fd7c515c573f15f5b4a84b07935fa04bdce34427cb3bd3
3
+ metadata.gz: 6192a0143be968a6388eb8b0fe1947ab5fd804db1d27fcf4a1b111b609f949ec
4
+ data.tar.gz: 93a3970de6124eb6694a41c5a7bfa3f21011330971a49f796f133bf7723b721a
5
5
  SHA512:
6
- metadata.gz: 9ada4970fd1a7a1de6ad509e537e97fe8a2544d6c1594205d0921e18988ce6a536d9c3e6833fd2817b1951efeb1808b4bd5484734860a8dcf3807bfd259df050
7
- data.tar.gz: 4df60533f5e1935911e9827f742978583256841be72667da39b79586e58ba1ad8cdc87adce4e529ea0f626b70f44bef04d1b9fb3f82f40d0fe8a7691a0193f17
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 utilities to your gems.
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 [example](/example) folder for several example use cases.
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"
@@ -42,6 +42,10 @@ module MisterBin
42
42
  maker.options << [flags, text]
43
43
  end
44
44
 
45
+ def command(name, text)
46
+ maker.commands << [name, text]
47
+ end
48
+
45
49
  def param(param, text)
46
50
  maker.params << [param, text]
47
51
  end
@@ -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, options_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
 
@@ -1,3 +1,3 @@
1
1
  module MisterBin
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
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.3.1
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-08-07 00:00:00.000000000 Z
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
- - !ruby/object:Gem::Dependency
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: Modular command line framefowk
188
+ summary: Command line interface for your gems
203
189
  test_files: []