toys-core 0.3.4 → 0.3.5

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.
@@ -81,7 +81,7 @@ module Toys
81
81
  ##
82
82
  # Generate a short usage string.
83
83
  #
84
- # @param [Boolean] recursive If true, and the tool is a group tool,
84
+ # @param [Boolean] recursive If true, and the tool is a namespace,
85
85
  # display all subcommands recursively. Defaults to false.
86
86
  # @param [Integer] left_column_width Width of the first column. Default
87
87
  # is {DEFAULT_LEFT_COLUMN_WIDTH}.
@@ -103,7 +103,7 @@ module Toys
103
103
  ##
104
104
  # Generate a long help string.
105
105
  #
106
- # @param [Boolean] recursive If true, and the tool is a group tool,
106
+ # @param [Boolean] recursive If true, and the tool is a namespace,
107
107
  # display all subcommands recursively. Defaults to false.
108
108
  # @param [String,nil] search An optional string to search for when
109
109
  # listing subcommands. Defaults to `nil` which finds all subcommands.
@@ -159,16 +159,16 @@ module Toys
159
159
  def assemble
160
160
  add_synopsis_section
161
161
  add_flags_section
162
- add_positional_arguments_section if @tool.includes_executor?
162
+ add_positional_arguments_section if @tool.includes_script?
163
163
  add_subtool_list_section
164
164
  @result = @lines.join("\n") + "\n"
165
165
  end
166
166
 
167
167
  def add_synopsis_section
168
168
  synopses = []
169
- synopses << group_synopsis if !@subtools.empty? && !@tool.includes_executor?
169
+ synopses << namespace_synopsis if !@subtools.empty? && !@tool.includes_script?
170
170
  synopses << tool_synopsis
171
- synopses << group_synopsis if !@subtools.empty? && @tool.includes_executor?
171
+ synopses << namespace_synopsis if !@subtools.empty? && @tool.includes_script?
172
172
  first = true
173
173
  synopses.each do |synopsis|
174
174
  @lines << (first ? "Usage: #{synopsis}" : " #{synopsis}")
@@ -185,7 +185,7 @@ module Toys
185
185
  synopsis.join(" ")
186
186
  end
187
187
 
188
- def group_synopsis
188
+ def namespace_synopsis
189
189
  ([@binary_name] + @tool.full_name + ["TOOL", "[ARGUMENTS...]"]).join(" ")
190
190
  end
191
191
 
@@ -321,12 +321,12 @@ module Toys
321
321
  def add_synopsis_section
322
322
  @lines << ""
323
323
  @lines << bold("SYNOPSIS")
324
- if !@subtools.empty? && !@tool.includes_executor?
325
- add_synopsis_clause(group_synopsis)
324
+ if !@subtools.empty? && !@tool.includes_script?
325
+ add_synopsis_clause(namespace_synopsis)
326
326
  end
327
327
  add_synopsis_clause(tool_synopsis)
328
- if !@subtools.empty? && @tool.includes_executor?
329
- add_synopsis_clause(group_synopsis)
328
+ if !@subtools.empty? && @tool.includes_script?
329
+ add_synopsis_clause(namespace_synopsis)
330
330
  end
331
331
  end
332
332
 
@@ -349,7 +349,7 @@ module Toys
349
349
  wrap_indent_indent2(Utils::WrappableString.new(synopsis))
350
350
  end
351
351
 
352
- def group_synopsis
352
+ def namespace_synopsis
353
353
  synopsis = [full_binary_name, underline("TOOL"), "[#{underline('ARGUMENTS')}...]"]
354
354
  wrap_indent_indent2(Utils::WrappableString.new(synopsis))
355
355
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toys-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-14 00:00:00.000000000 Z
11
+ date: 2018-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -94,7 +94,8 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.9'
97
- description: A simple command line tool framework
97
+ description: Toys-Core is the command line tool framework underlying Toys. It can
98
+ be used to create command line binaries using the internal Toys APIs.
98
99
  email:
99
100
  - dazuma@gmail.com
100
101
  executables: []
@@ -105,6 +106,7 @@ files:
105
106
  - CHANGELOG.md
106
107
  - LICENSE.md
107
108
  - README.md
109
+ - docs/getting-started.md
108
110
  - lib/toys-core.rb
109
111
  - lib/toys/alias.rb
110
112
  - lib/toys/cli.rb
@@ -133,6 +135,7 @@ files:
133
135
  - lib/toys/templates/rubocop.rb
134
136
  - lib/toys/templates/yardoc.rb
135
137
  - lib/toys/tool.rb
138
+ - lib/toys/utils/exec.rb
136
139
  - lib/toys/utils/help_text.rb
137
140
  - lib/toys/utils/line_output.rb
138
141
  - lib/toys/utils/module_lookup.rb
@@ -160,5 +163,5 @@ rubyforge_project:
160
163
  rubygems_version: 2.7.6
161
164
  signing_key:
162
165
  specification_version: 4
163
- summary: Command line tool framework
166
+ summary: Framework for creating command line binaries
164
167
  test_files: []