toys-core 0.8.1 → 0.9.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.
@@ -26,7 +26,7 @@ require "monitor"
26
26
 
27
27
  begin
28
28
  require "io/console"
29
- rescue ::LoadError # rubocop:disable Lint/HandleExceptions
29
+ rescue ::LoadError # rubocop:disable Lint/SuppressedException
30
30
  # TODO: alternate methods of getting terminal size
31
31
  end
32
32
 
@@ -425,6 +425,7 @@ module Toys
425
425
  include ::MonitorMixin
426
426
 
427
427
  def initialize(terminal, frames, style, frame_length)
428
+ super()
428
429
  @terminal = terminal
429
430
  @frames = frames.map do |f|
430
431
  [@terminal.apply_styles(f, *style), Terminal.remove_style_escapes(f).size]
@@ -433,7 +434,6 @@ module Toys
433
434
  @cur_frame = 0
434
435
  @stopping = false
435
436
  @cond = new_cond
436
- super()
437
437
  @thread = @terminal.output.tty? ? start_thread : nil
438
438
  end
439
439
 
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.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-19 00:00:00.000000000 Z
11
+ date: 2019-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.11'
47
+ version: '5.13'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '5.11'
54
+ version: '5.13'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: minitest-focus
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.74.0
89
+ version: 0.77.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.74.0
96
+ version: 0.77.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: yard
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -123,13 +123,12 @@ files:
123
123
  - docs/guide.md
124
124
  - lib/toys-core.rb
125
125
  - lib/toys/acceptor.rb
126
- - lib/toys/alias.rb
127
126
  - lib/toys/arg_parser.rb
128
127
  - lib/toys/cli.rb
129
128
  - lib/toys/compat.rb
130
129
  - lib/toys/completion.rb
131
130
  - lib/toys/context.rb
132
- - lib/toys/core_version.rb
131
+ - lib/toys/core.rb
133
132
  - lib/toys/dsl/flag.rb
134
133
  - lib/toys/dsl/flag_group.rb
135
134
  - lib/toys/dsl/positional_arg.rb
@@ -169,7 +168,7 @@ metadata:
169
168
  changelog_uri: https://github.com/dazuma/toys/blob/master/toys-core/CHANGELOG.md
170
169
  source_code_uri: https://github.com/dazuma/toys
171
170
  bug_tracker_uri: https://github.com/dazuma/toys/issues
172
- documentation_uri: https://www.rubydoc.info/gems/toys-core
171
+ documentation_uri: https://dazuma.github.io/toys/gems/toys-core/latest
173
172
  post_install_message:
174
173
  rdoc_options: []
175
174
  require_paths:
data/lib/toys/alias.rb DELETED
@@ -1,106 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2019 Daniel Azuma
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
- # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21
- # IN THE SOFTWARE.
22
- ;
23
-
24
- module Toys
25
- ##
26
- # An alias is a name that refers to another name.
27
- #
28
- class Alias
29
- ##
30
- # Create a new alias.
31
- # Should be created only from the DSL via the Loader.
32
- # @private
33
- #
34
- def initialize(loader, full_name, target, priority)
35
- @target_name =
36
- if target.is_a?(::Array)
37
- target.map(&:to_s)
38
- else
39
- full_name[0..-2] + [target.to_s]
40
- end
41
- @target_name.freeze
42
- @full_name = full_name.map(&:to_s).freeze
43
- @priority = priority
44
- @tool_class = DSL::Tool.new_class(@full_name, priority, loader)
45
- end
46
-
47
- ##
48
- # The tool class.
49
- #
50
- # @return [Class]
51
- #
52
- attr_reader :tool_class
53
-
54
- ##
55
- # The name of the tool as an array of strings.
56
- # This array may not be modified.
57
- #
58
- # @return [Array<String>]
59
- #
60
- attr_reader :full_name
61
-
62
- ##
63
- # The priority of this alias.
64
- #
65
- # @return [Integer]
66
- #
67
- attr_reader :priority
68
-
69
- ##
70
- # The name of the target as an array of strings.
71
- # This array may not be modified.
72
- #
73
- # @return [Array<String>]
74
- #
75
- attr_reader :target_name
76
-
77
- ##
78
- # The local name of this alias, i.e. the last element of the full name.
79
- #
80
- # @return [String]
81
- #
82
- def simple_name
83
- full_name.last
84
- end
85
-
86
- ##
87
- # A displayable name of this alias, generally the full name delimited by
88
- # spaces.
89
- #
90
- # @return [String]
91
- #
92
- def display_name
93
- full_name.join(" ")
94
- end
95
-
96
- ##
97
- # A displayable name of the target, generally the full name delimited by
98
- # spaces.
99
- #
100
- # @return [String]
101
- #
102
- def display_target
103
- target_name.join(" ")
104
- end
105
- end
106
- end