sord 0.10.0 → 1.0.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: ca2e726bf2e1ec8e4baa524ae7111296a18068d1a5d63959abc967bcc01b2651
4
- data.tar.gz: 6e71373e3eb57ed98395aa0ecca42a5da3cd45ae5212712de151230f0cfa0870
3
+ metadata.gz: 86ef36c437c7c9a02b0cc18fddd6c11253f4d0be6f9d68283c8039cfd69d310e
4
+ data.tar.gz: 38f53748c92a22b44745d8fff1dfca5fe41ee4b4424b3c61c63853d07eb5d396
5
5
  SHA512:
6
- metadata.gz: 04c0bc1d1b2a74d5d428530cfafe9d21686be9d2bfb032379e7a705478f16ba53c027d85736d4f378104bb443d99706feca733ee1d465b2bf59200bfc61dbd70
7
- data.tar.gz: 11a6fab0f1bd64e0c3b454bfa4c32ec84cc36b9f7dc2d30d726ab950e1091a0a53328b81666d3767adde2b6ff733af46647e4129a747a15f55db9a39227df8e9
6
+ metadata.gz: 3359eca2a431b010b81c9920f6dd2705422df7ee3b47ab014caf63d498168945e14e5b3ba789ab08dff2b1a081682ae0d05de3c1796d2ac948778ca1a8a8c9c5
7
+ data.tar.gz: 92ef1253541f9d4a837486fe51a886341251db0acc145d224048e8e3d94368beb86e59edab5a3638e486bb877f65a188da38c1543a2708cac10b14eef81e5da1
data/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
5
 
6
+ ## [1.0.0] - 2020-02-16
7
+ ### Added
8
+ - Added the `--skip-constants` flag to avoid generating RBIs for constants.
9
+
10
+ ### Changed
11
+ - Parlour 2.0.0 is now being used.
12
+
13
+ ### Fixed
14
+ - Fixed a bug where blank parameters were sometimes treated like non-blank
15
+ parameters.
16
+ - Fixed parameter order sometimes being incorrect.
17
+ - Fixed multiline parameter lists sometimes generating invalid RBIs.
18
+ - Multiline comments are now generated correctly.
19
+ - Fixed an incorrect README link.
20
+
6
21
  ## [0.10.0] - 2019-09-14
7
22
  ### Added
8
23
  - Comments in RBIs are now converted from YARD into Markdown format, making them
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- Sord is a [**So**rbet](https://sorbet.org) and [YA**RD**](https://sorbet.org)
5
+ Sord is a [**So**rbet](https://sorbet.org) and [YA**RD**](https://yardoc.org/)
6
6
  crossover. It can automatically generate Sorbet type signatures files by
7
7
  looking at the types specified in YARD documentation comments.
8
8
 
data/Rakefile CHANGED
@@ -10,6 +10,7 @@ REPOS = {
10
10
  bundler: 'https://github.com/bundler/bundler',
11
11
  discordrb: 'https://github.com/meew0/discordrb',
12
12
  gitlab: 'https://github.com/NARKOZ/gitlab',
13
+ 'graphql-ruby': 'https://github.com/rmosolgo/graphql-ruby',
13
14
  haml: 'https://github.com/haml/haml',
14
15
  oga: 'https://gitlab.com/yorickpeterse/oga',
15
16
  rouge: 'https://github.com/rouge-ruby/rouge',
data/exe/sord CHANGED
@@ -19,6 +19,7 @@ command :gen do |c|
19
19
  c.option '--exclude-messages STRING', String, 'Blacklists a comma-separated string of log message types'
20
20
  c.option '--include-messages STRING', String, 'Whitelists a comma-separated string of log message types'
21
21
  c.option '--keep-original-comments', 'Retains original YARD comments rather than converting them to Markdown'
22
+ c.option '--skip-constants', 'Excludes constants from generated RBI'
22
23
 
23
24
  c.action do |args, options|
24
25
  options.default(
@@ -29,7 +30,8 @@ command :gen do |c|
29
30
  replace_unresolved_with_untyped: false,
30
31
  exclude_messages: nil,
31
32
  include_messages: nil,
32
- keep_original_comments: false
33
+ keep_original_comments: false,
34
+ skip_constants: false
33
35
  )
34
36
 
35
37
  if args.length != 1
@@ -39,6 +39,7 @@ module Sord
39
39
  @replace_errors_with_untyped = options[:replace_errors_with_untyped]
40
40
  @replace_unresolved_with_untyped = options[:replace_unresolved_with_untyped]
41
41
  @keep_original_comments = options[:keep_original_comments]
42
+ @skip_constants = options[:skip_constants]
42
43
 
43
44
  # Hook the logger so that messages are added as comments to the RBI file
44
45
  Logging.add_hook do |type, msg, item|
@@ -109,6 +110,8 @@ module Sord
109
110
  next
110
111
  end
111
112
 
113
+ # Sort parameters
114
+ meth.parameters.reverse.sort! { |pair1, pair2| sort_params(pair1, pair2) }
112
115
  # This is better than iterating over YARD's "@param" tags directly
113
116
  # because it includes parameters without documentation
114
117
  # (The gsubs allow for better splat-argument compatibility)
@@ -235,10 +238,10 @@ module Sord
235
238
  # Output params in the form of:
236
239
  # _@param_ `foo` — Lorem ipsum.
237
240
  # _@param_ `foo`
238
- if param.text.nil?
241
+ if param.text.nil? || param.text == ''
239
242
  docs_array << "_@param_ `#{param.name}`"
240
243
  else
241
- docs_array << "_@param_ `#{param.name}` — #{param.text}"
244
+ docs_array << "_@param_ `#{param.name}` — #{param.text.gsub("\n", " ")}"
242
245
  end
243
246
  end
244
247
 
@@ -297,6 +300,9 @@ module Sord
297
300
  end
298
301
  end
299
302
 
303
+ # fix: yard text may contains multiple line. should deal \n.
304
+ # else generate text will be multiple line and only first line is commented
305
+ docs_array = docs_array.flat_map {|line| line.empty? ? [""] : line.split("\n")}
300
306
  m.add_comments(docs_array)
301
307
  end
302
308
  end
@@ -321,7 +327,7 @@ module Sord
321
327
 
322
328
  add_mixins(item)
323
329
  add_methods(item)
324
- add_constants(item)
330
+ add_constants(item) unless @skip_constants
325
331
 
326
332
  item.children.select { |x| [:class, :module].include?(x.type) }
327
333
  .each { |child| add_namespace(child) }
@@ -387,5 +393,45 @@ module Sord
387
393
  puts " #{line}"
388
394
  end
389
395
  end
396
+
397
+ # Given two pairs of arrays representing method parameters, in the form
398
+ # of ["variable_name", "default_value"], sort the parameters so they're
399
+ # valid for Sorbet. Sorbet requires that, e.g. required kwargs go before
400
+ # optional kwargs.
401
+ #
402
+ # @param [Array] pair1
403
+ # @param [Array] pair2
404
+ # @return Integer
405
+ def sort_params(pair1, pair2)
406
+ pair1_type, pair2_type = [pair1, pair2].map do |pair|
407
+ if pair[0].start_with?('&')
408
+ :blk
409
+ elsif pair[0].start_with?('**')
410
+ :doublesplat
411
+ elsif pair[0].start_with?('*')
412
+ :splat
413
+ elsif !pair[0].end_with?(':') && pair[1].nil?
414
+ :required_ordered_param
415
+ elsif !pair[0].end_with?(':') && !pair[1].nil?
416
+ :optional_ordered_param
417
+ elsif pair[0].end_with?(':') && pair[1].nil?
418
+ :required_kwarg
419
+ elsif pair[0].end_with?(':') && !pair[1].nil?
420
+ :optional_kwarg
421
+ end
422
+ end
423
+
424
+ pair_type_order = {
425
+ required_ordered_param: 1,
426
+ optional_ordered_param: 2,
427
+ splat: 3,
428
+ required_kwarg: 4,
429
+ optional_kwarg: 5,
430
+ doublesplat: 6,
431
+ blk: 7
432
+ }
433
+
434
+ return pair_type_order[pair1_type] <=> pair_type_order[pair2_type]
435
+ end
390
436
  end
391
437
  end
data/lib/sord/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # typed: strong
2
2
  module Sord
3
- VERSION = '0.10.0'
3
+ VERSION = '1.0.0'
4
4
  end
data/sord.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  # Specify which files should be added to the gem when it is released.
17
17
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
18
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|sorbet)/}) }
20
20
  end
21
21
  spec.bindir = "exe"
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -24,8 +24,8 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_dependency 'yard'
26
26
  spec.add_dependency 'sorbet-runtime'
27
- spec.add_dependency 'commander', '~> 4.4'
28
- spec.add_dependency 'parlour', '~> 0.8.0'
27
+ spec.add_dependency 'commander', '~> 4.5'
28
+ spec.add_dependency 'parlour', '~> 2.0'
29
29
 
30
30
  spec.add_development_dependency "bundler", "~> 2.0"
31
31
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Christiansen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-14 00:00:00.000000000 Z
11
+ date: 2020-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '4.4'
47
+ version: '4.5'
48
48
  type: :runtime
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: '4.4'
54
+ version: '4.5'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: parlour
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.0
61
+ version: '2.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.8.0
68
+ version: '2.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -165,25 +165,6 @@ files:
165
165
  - lib/sord/type_converter.rb
166
166
  - lib/sord/version.rb
167
167
  - rbi/sord.rbi
168
- - sorbet/config
169
- - sorbet/rbi/gems/docile.rbi
170
- - sorbet/rbi/gems/parlour.rbi
171
- - sorbet/rbi/gems/rainbow.rbi
172
- - sorbet/rbi/gems/rake.rbi
173
- - sorbet/rbi/gems/rspec-core.rbi
174
- - sorbet/rbi/gems/rspec-expectations.rbi
175
- - sorbet/rbi/gems/rspec-mocks.rbi
176
- - sorbet/rbi/gems/rspec-support.rbi
177
- - sorbet/rbi/gems/rspec.rbi
178
- - sorbet/rbi/gems/simplecov-html.rbi
179
- - sorbet/rbi/gems/simplecov.rbi
180
- - sorbet/rbi/gems/sorbet-runtime.rbi
181
- - sorbet/rbi/gems/yard.rbi
182
- - sorbet/rbi/hidden-definitions/errors.txt
183
- - sorbet/rbi/hidden-definitions/hidden.rbi
184
- - sorbet/rbi/sorbet-typed/lib/bundler/all/bundler.rbi
185
- - sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi
186
- - sorbet/rbi/sorbet-typed/lib/ruby/all/resolv.rbi
187
168
  - sord.gemspec
188
169
  homepage: https://github.com/AaronC81/sord
189
170
  licenses:
@@ -204,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
185
  - !ruby/object:Gem::Version
205
186
  version: '0'
206
187
  requirements: []
207
- rubygems_version: 3.0.3
188
+ rubygems_version: 3.1.2
208
189
  signing_key:
209
190
  specification_version: 4
210
191
  summary: Generate Sorbet RBI files from YARD documentation
data/sorbet/config DELETED
File without changes
@@ -1,31 +0,0 @@
1
- # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
- # srb rbi gems
3
-
4
- # typed: true
5
- #
6
- # If you would like to make changes to this file, great! Please create the gem's shim here:
7
- #
8
- # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/docile/all/docile.rbi
9
- #
10
- # docile-1.3.2
11
- module Docile
12
- def dsl_eval(dsl, *args, &block); end
13
- def dsl_eval_immutable(dsl, *args, &block); end
14
- def dsl_eval_with_block_return(dsl, *args, &block); end
15
- def self.dsl_eval(dsl, *args, &block); end
16
- def self.dsl_eval_immutable(dsl, *args, &block); end
17
- def self.dsl_eval_with_block_return(dsl, *args, &block); end
18
- extend Docile::Execution
19
- end
20
- module Docile::Execution
21
- def exec_in_proxy_context(dsl, proxy_type, *args, &block); end
22
- def self.exec_in_proxy_context(dsl, proxy_type, *args, &block); end
23
- end
24
- class Docile::FallbackContextProxy
25
- def initialize(receiver, fallback); end
26
- def instance_variables; end
27
- def method_missing(method, *args, &block); end
28
- end
29
- class Docile::ChainingFallbackContextProxy < Docile::FallbackContextProxy
30
- def method_missing(method, *args, &block); end
31
- end
@@ -1,214 +0,0 @@
1
- # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
- # srb rbi gems
3
-
4
- # typed: true
5
- #
6
- # If you would like to make changes to this file, great! Please create the gem's shim here:
7
- #
8
- # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/parlour/all/parlour.rbi
9
- #
10
- # parlour-0.6.1
11
- module Parlour
12
- end
13
- module Kernel
14
- end
15
- class Parlour::Plugin
16
- def generate(*args, &blk); end
17
- def initialize(*args, &blk); end
18
- def self.inherited(*args, &blk); end
19
- def self.method_added(name); end
20
- def self.registered_plugins(*args, &blk); end
21
- def self.run_plugins(*args, &blk); end
22
- def self.singleton_method_added(name); end
23
- extend T::Helpers
24
- extend T::InterfaceWrapper::Helpers
25
- extend T::Private::Abstract::Hooks
26
- extend T::Sig
27
- end
28
- class Parlour::RbiGenerator
29
- def current_plugin(*args, &blk); end
30
- def current_plugin=(arg0); end
31
- def initialize(*args, &blk); end
32
- def options(*args, &blk); end
33
- def rbi(*args, &blk); end
34
- def root(*args, &blk); end
35
- def self.method_added(name); end
36
- def self.singleton_method_added(name); end
37
- extend T::Sig
38
- end
39
- class Parlour::RbiGenerator::Parameter
40
- def ==(*args, &blk); end
41
- def default(*args, &blk); end
42
- def initialize(*args, &blk); end
43
- def kind(*args, &blk); end
44
- def name(*args, &blk); end
45
- def name_without_kind(*args, &blk); end
46
- def self.method_added(name); end
47
- def self.singleton_method_added(name); end
48
- def to_def_param(*args, &blk); end
49
- def to_sig_param(*args, &blk); end
50
- def type(*args, &blk); end
51
- extend T::Sig
52
- end
53
- class Parlour::RbiGenerator::RbiObject
54
- def add_comment(*args, &blk); end
55
- def add_comments(*args, &blk); end
56
- def comments(*args, &blk); end
57
- def describe(*args, &blk); end
58
- def generate_comments(*args, &blk); end
59
- def generate_rbi(*args, &blk); end
60
- def generated_by(*args, &blk); end
61
- def generator(*args, &blk); end
62
- def initialize(*args, &blk); end
63
- def merge_into_self(*args, &blk); end
64
- def mergeable?(*args, &blk); end
65
- def name(*args, &blk); end
66
- def self.method_added(name); end
67
- def self.singleton_method_added(name); end
68
- extend T::Helpers
69
- extend T::InterfaceWrapper::Helpers
70
- extend T::Private::Abstract::Hooks
71
- extend T::Sig
72
- end
73
- class Parlour::RbiGenerator::Method < Parlour::RbiGenerator::RbiObject
74
- def ==(*args, &blk); end
75
- def abstract(*args, &blk); end
76
- def class_method(*args, &blk); end
77
- def describe(*args, &blk); end
78
- def generate_definition(*args, &blk); end
79
- def generate_rbi(*args, &blk); end
80
- def implementation(*args, &blk); end
81
- def initialize(*args, &blk); end
82
- def merge_into_self(*args, &blk); end
83
- def mergeable?(*args, &blk); end
84
- def overridable(*args, &blk); end
85
- def override(*args, &blk); end
86
- def parameters(*args, &blk); end
87
- def qualifiers(*args, &blk); end
88
- def return_type(*args, &blk); end
89
- def self.method_added(name); end
90
- def self.singleton_method_added(name); end
91
- extend T::Sig
92
- end
93
- class Parlour::RbiGenerator::Attribute < Parlour::RbiGenerator::Method
94
- def generate_definition(*args, &blk); end
95
- def initialize(*args, &blk); end
96
- def kind(*args, &blk); end
97
- def self.method_added(name); end
98
- def self.singleton_method_added(name); end
99
- end
100
- class Parlour::RbiGenerator::Arbitrary < Parlour::RbiGenerator::RbiObject
101
- def ==(*args, &blk); end
102
- def code(*args, &blk); end
103
- def code=(arg0); end
104
- def describe(*args, &blk); end
105
- def generate_rbi(*args, &blk); end
106
- def initialize(*args, &blk); end
107
- def merge_into_self(*args, &blk); end
108
- def mergeable?(*args, &blk); end
109
- def self.method_added(name); end
110
- def self.singleton_method_added(name); end
111
- end
112
- class Parlour::RbiGenerator::Options
113
- def break_params(*args, &blk); end
114
- def indented(*args, &blk); end
115
- def initialize(*args, &blk); end
116
- def self.method_added(name); end
117
- def self.singleton_method_added(name); end
118
- def tab_size(*args, &blk); end
119
- extend T::Sig
120
- end
121
- class Parlour::RbiGenerator::Include < Parlour::RbiGenerator::RbiObject
122
- def ==(*args, &blk); end
123
- def describe(*args, &blk); end
124
- def generate_rbi(*args, &blk); end
125
- def initialize(*args, &blk); end
126
- def merge_into_self(*args, &blk); end
127
- def mergeable?(*args, &blk); end
128
- def self.method_added(name); end
129
- def self.singleton_method_added(name); end
130
- end
131
- class Parlour::RbiGenerator::Extend < Parlour::RbiGenerator::RbiObject
132
- def ==(*args, &blk); end
133
- def describe(*args, &blk); end
134
- def generate_rbi(*args, &blk); end
135
- def initialize(*args, &blk); end
136
- def merge_into_self(*args, &blk); end
137
- def mergeable?(*args, &blk); end
138
- def self.method_added(name); end
139
- def self.singleton_method_added(name); end
140
- end
141
- class Parlour::RbiGenerator::Constant < Parlour::RbiGenerator::RbiObject
142
- def ==(*args, &blk); end
143
- def describe(*args, &blk); end
144
- def generate_rbi(*args, &blk); end
145
- def initialize(*args, &blk); end
146
- def merge_into_self(*args, &blk); end
147
- def mergeable?(*args, &blk); end
148
- def self.method_added(name); end
149
- def self.singleton_method_added(name); end
150
- def value(*args, &blk); end
151
- end
152
- class Parlour::RbiGenerator::Namespace < Parlour::RbiGenerator::RbiObject
153
- def add_comment_to_next_child(*args, &blk); end
154
- def children(*args, &blk); end
155
- def constants(*args, &blk); end
156
- def create_arbitrary(code:, &block); end
157
- def create_attr(name, kind:, type:, &block); end
158
- def create_attr_accessor(name, type:, &block); end
159
- def create_attr_reader(name, type:, &block); end
160
- def create_attr_writer(name, type:, &block); end
161
- def create_attribute(name, kind:, type:, &block); end
162
- def create_class(*args, &blk); end
163
- def create_constant(*args, &blk); end
164
- def create_extend(*args, &blk); end
165
- def create_extends(*args, &blk); end
166
- def create_include(*args, &blk); end
167
- def create_includes(*args, &blk); end
168
- def create_method(*args, &blk); end
169
- def create_module(*args, &blk); end
170
- def describe(*args, &blk); end
171
- def extends(*args, &blk); end
172
- def generate_body(*args, &blk); end
173
- def generate_rbi(*args, &blk); end
174
- def includes(*args, &blk); end
175
- def initialize(*args, &blk); end
176
- def merge_into_self(*args, &blk); end
177
- def mergeable?(*args, &blk); end
178
- def move_next_comments(*args, &blk); end
179
- def path(*args, &blk); end
180
- def self.method_added(name); end
181
- def self.singleton_method_added(name); end
182
- extend T::Sig
183
- end
184
- class Parlour::RbiGenerator::ModuleNamespace < Parlour::RbiGenerator::Namespace
185
- def describe(*args, &blk); end
186
- def generate_rbi(*args, &blk); end
187
- def initialize(*args, &blk); end
188
- def interface(*args, &blk); end
189
- def merge_into_self(*args, &blk); end
190
- def mergeable?(*args, &blk); end
191
- def self.method_added(name); end
192
- def self.singleton_method_added(name); end
193
- extend T::Sig
194
- end
195
- class Parlour::RbiGenerator::ClassNamespace < Parlour::RbiGenerator::Namespace
196
- def abstract(*args, &blk); end
197
- def describe(*args, &blk); end
198
- def generate_rbi(*args, &blk); end
199
- def initialize(*args, &blk); end
200
- def merge_into_self(*args, &blk); end
201
- def mergeable?(*args, &blk); end
202
- def self.method_added(name); end
203
- def self.singleton_method_added(name); end
204
- def superclass(*args, &blk); end
205
- extend T::Sig
206
- end
207
- class Parlour::ConflictResolver
208
- def all_eql?(*args, &blk); end
209
- def resolve_conflicts(*args, &blk); end
210
- def self.method_added(name); end
211
- def self.singleton_method_added(name); end
212
- def single_type_of_array(*args, &blk); end
213
- extend T::Sig
214
- end
@@ -1,117 +0,0 @@
1
- # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
- # srb rbi gems
3
-
4
- # typed: true
5
- #
6
- # If you would like to make changes to this file, great! Please create the gem's shim here:
7
- #
8
- # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/rainbow/all/rainbow.rbi
9
- #
10
- # rainbow-3.0.0
11
- module Rainbow
12
- def self.enabled; end
13
- def self.enabled=(value); end
14
- def self.global; end
15
- def self.new; end
16
- def self.uncolor(string); end
17
- end
18
- class Rainbow::StringUtils
19
- def self.uncolor(string); end
20
- def self.wrap_with_sgr(string, codes); end
21
- end
22
- module Rainbow::X11ColorNames
23
- end
24
- class Rainbow::Color
25
- def ground; end
26
- def self.build(ground, values); end
27
- def self.parse_hex_color(hex); end
28
- end
29
- class Rainbow::Color::Indexed < Rainbow::Color
30
- def codes; end
31
- def initialize(ground, num); end
32
- def num; end
33
- end
34
- class Rainbow::Color::Named < Rainbow::Color::Indexed
35
- def initialize(ground, name); end
36
- def self.color_names; end
37
- def self.valid_names; end
38
- end
39
- class Rainbow::Color::RGB < Rainbow::Color::Indexed
40
- def b; end
41
- def code_from_rgb; end
42
- def codes; end
43
- def g; end
44
- def initialize(ground, *values); end
45
- def r; end
46
- def self.to_ansi_domain(value); end
47
- end
48
- class Rainbow::Color::X11Named < Rainbow::Color::RGB
49
- def initialize(ground, name); end
50
- def self.color_names; end
51
- def self.valid_names; end
52
- include Rainbow::X11ColorNames
53
- end
54
- class Rainbow::Presenter < String
55
- def background(*values); end
56
- def bg(*values); end
57
- def black; end
58
- def blink; end
59
- def blue; end
60
- def bold; end
61
- def bright; end
62
- def color(*values); end
63
- def cyan; end
64
- def dark; end
65
- def faint; end
66
- def fg(*values); end
67
- def foreground(*values); end
68
- def green; end
69
- def hide; end
70
- def inverse; end
71
- def italic; end
72
- def magenta; end
73
- def method_missing(method_name, *args); end
74
- def red; end
75
- def reset; end
76
- def respond_to_missing?(method_name, *args); end
77
- def underline; end
78
- def white; end
79
- def wrap_with_sgr(codes); end
80
- def yellow; end
81
- end
82
- class Rainbow::NullPresenter < String
83
- def background(*_values); end
84
- def bg(*_values); end
85
- def black; end
86
- def blink; end
87
- def blue; end
88
- def bold; end
89
- def bright; end
90
- def color(*_values); end
91
- def cyan; end
92
- def dark; end
93
- def faint; end
94
- def fg(*_values); end
95
- def foreground(*_values); end
96
- def green; end
97
- def hide; end
98
- def inverse; end
99
- def italic; end
100
- def magenta; end
101
- def method_missing(method_name, *args); end
102
- def red; end
103
- def reset; end
104
- def respond_to_missing?(method_name, *args); end
105
- def underline; end
106
- def white; end
107
- def yellow; end
108
- end
109
- class Rainbow::Wrapper
110
- def enabled; end
111
- def enabled=(arg0); end
112
- def initialize(enabled = nil); end
113
- def wrap(string); end
114
- end
115
- class Object < BasicObject
116
- def Rainbow(string); end
117
- end