ricecream 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e240fcc9c162e65feccf6a68d1c5c3821e95fddeae647d02b86b5eace9a1c6fc
4
+ data.tar.gz: fdbe210b294b1a9c98c41783d0e89f6e4411f4572017c12fb1d5a65d1c63d882
5
+ SHA512:
6
+ metadata.gz: 81e9f4aa536c4c5efc979f713a1beaea3f72055a7c9f06d4fc8053f5da2f75c44887c79e96348424a1a592ef9bf241fa303ac26e31dd1875920fb66754ff8fdd
7
+ data.tar.gz: 29d22355a67bc956749cf91fcf3a9bdfd07ff493005eaeda2fd05a073e600f6944b15f06613b2a77edf2578a0360d006dc2a96173013c02a7abb52acc352de80
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /Gemfile.lock
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in ricecream.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 nodai2hITC
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 FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,209 @@
1
+ # Ricecream (icecream-ruby)
2
+
3
+ A Ruby port of Python's debugging library [IceCream](https://github.com/gruns/icecream).
4
+
5
+ ## Usage
6
+
7
+ ### Inspect Variables
8
+
9
+ Have you ever written code like this to debug?
10
+
11
+ ```ruby
12
+ foo = 123
13
+ puts foo # => 123
14
+ # Simple, but we don't know what the output is.
15
+
16
+ puts "foo: #{foo}" # => foo: 123
17
+ # Easy to understand, but coding is boring.
18
+ ```
19
+
20
+ With Ricecream, you can easily write:
21
+
22
+ ```ruby
23
+ require "ricecream"
24
+ foo = 123
25
+ ic foo # => ic| foo: 123
26
+ ```
27
+
28
+ It can handle multiple arguments and arbitrary expressions.
29
+
30
+ ```ruby
31
+ ic foo * 2, Integer.sqrt(foo) # => ic| foo * 2: 246, Integer.sqrt(foo): 11
32
+ ```
33
+
34
+ ### Inspect Execution
35
+
36
+ You want to check the operation of the following method.
37
+
38
+ ```ruby
39
+ def foo
40
+ return if cond1
41
+ if cond2
42
+ method1
43
+ else
44
+ method2
45
+ end
46
+ end
47
+ ```
48
+
49
+ Using `puts`, you would write:
50
+
51
+ ```ruby
52
+ def foo
53
+ puts 1
54
+ return if cond1
55
+ puts 2
56
+ if cond2
57
+ method1
58
+ puts 3
59
+ else
60
+ method2
61
+ puts 4
62
+ end
63
+ end
64
+ ```
65
+
66
+ Output
67
+
68
+ ```
69
+ 1
70
+ 2
71
+ 4
72
+ ```
73
+
74
+ With Ricecream, you can easily write:
75
+
76
+ ```ruby
77
+ def foo
78
+ ic
79
+ return if cond1
80
+ ic
81
+ if cond2
82
+ method1
83
+ ic
84
+ else
85
+ method2
86
+ ic
87
+ end
88
+ end
89
+ ```
90
+
91
+ Output
92
+
93
+ ```
94
+ ic| script.rb:2 in foo at 17:33:40.227
95
+ ic| script.rb:4 in foo at 17:33:40.227
96
+ ic| script.rb:10 in foo at 17:33:40.228
97
+ ```
98
+
99
+ ### Return Value
100
+
101
+ `ic` returns its argument(s), so `ic` can easily be inserted into pre-existing code.
102
+
103
+ ```ruby
104
+ foo = 123
105
+ def bar(num)
106
+ num * 2
107
+ end
108
+ result = bar(foo) # I want to know foo value.
109
+ puts result # => 246
110
+ ```
111
+
112
+ ```ruby
113
+ foo = 123
114
+ def bar(num)
115
+ num * 2
116
+ end
117
+ result = bar(ic foo) # => ic| foo: 123
118
+ puts result # => 246
119
+ ```
120
+
121
+ ### Refinements
122
+
123
+ If you want to use `ic` only within a limited scope, then you can use Refinements.
124
+
125
+ ```ruby
126
+ require "ricecream/refine"
127
+
128
+ using Ricecream
129
+ ic
130
+ ```
131
+
132
+ ### Miscellaneous
133
+
134
+ - `ic_format(*args)` is like `ic` but the output is returned as a string instead of written to stderr.
135
+ - `ic`'s output can be entirely disabled, and later re-enabled, with `Ricecream.disable` and `Ricecream.enable` respectively.
136
+
137
+ ### Configuration
138
+
139
+ Change prefix.
140
+
141
+ ```ruby
142
+ Ricecream.prefix = "ic!!!! "
143
+ # => ic!!!! foo: 123
144
+
145
+ def Ricecream.prefix(location)
146
+ Time.now.to_s + "| "
147
+ end
148
+ # => 2021-01-25 23:39:25 +0900| foo: 123
149
+ ```
150
+
151
+ Change the output destination.
152
+
153
+ ```ruby
154
+ Ricecream.output = STDOUT # default: STDERR
155
+
156
+ def Ricecream.output(str)
157
+ @log ||= Logger.new("logfile.log")
158
+ @log.debug(str)
159
+ end
160
+ ```
161
+
162
+ Change the string conversion method.
163
+
164
+ ```ruby
165
+ def Ricecream.arg_to_s(arg)
166
+ PP.pp(arg, +"", 60)
167
+ end
168
+ ```
169
+
170
+ Output with caller information.
171
+
172
+ ```ruby
173
+ Ricecream.include_context = true # default: false
174
+ # => ic| script.rb:10 in <main>- foo: 123
175
+ ```
176
+
177
+ (experimental) colorize.
178
+
179
+ ```ruby
180
+ Ricecream.colorize = true # default: false, required irb >= 1.2.0
181
+ ```
182
+
183
+ ## Installation
184
+
185
+ Add this line to your application's Gemfile:
186
+
187
+ ```ruby
188
+ gem 'ricecream'
189
+ ```
190
+
191
+ And then execute:
192
+
193
+ $ bundle install
194
+
195
+ Or install it yourself as:
196
+
197
+ $ gem install ricecream
198
+
199
+ ## Contributing
200
+
201
+ Bug reports and pull requests are welcome on GitHub at https://github.com/nodai2hITC/ricecream. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/nodai2hITC/ricecream/blob/master/CODE_OF_CONDUCT.md).
202
+
203
+ ## License
204
+
205
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
206
+
207
+ ## Code of Conduct
208
+
209
+ Everyone interacting in the Ricecream project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/nodai2hITC/ricecream/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
+ end
11
+
12
+ task default: :test
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "ricecream"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "ricecream/ic"
4
+
5
+ module Kernel
6
+ def ic(*args)
7
+ Ricecream.ic(caller_locations(1, 1).first, :ic, args)
8
+ return *args
9
+ end
10
+
11
+ def ic_format(*args)
12
+ Ricecream.format(caller_locations(1, 1).first, :ic_format, args)
13
+ end
14
+
15
+ private :ic, :ic_format
16
+ end
@@ -0,0 +1,112 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ripper"
4
+ require_relative "ic_method"
5
+
6
+ module Ricecream
7
+ class Analyzer < Ripper
8
+ MethodName = /\Aic(?:_format)?\z/
9
+
10
+ def initialize(path)
11
+ @ic_methods = []
12
+ @last_loc = [1, 0]
13
+ @path = File.absolute_path(path)
14
+ return unless File.exist?(@path)
15
+ @script = File.binread(@path) + " "
16
+ super(@script, @path)
17
+ parse
18
+ enc = encoding
19
+ enc = Encoding::UTF_8 if enc == Encoding::ASCII_8BIT
20
+ @script.force_encoding(enc)
21
+ @script_lines = @script.lines
22
+ end
23
+
24
+ def ic_methods
25
+ @ic_methods.select { |ic| ic[:locs].size > 1 }.map do |ic|
26
+ args = ic[:locs].each_cons(2).map do |locs|
27
+ byteslice(locs[0], locs[1]).delete_prefix(",").strip.gsub(/\R+/, " ")
28
+ end
29
+ ICMethod.new(ic[:name], @path, ic[:lineno], ic[:column], args.size, args)
30
+ end
31
+ end
32
+
33
+ def byteslice(from, to)
34
+ return @script_lines[from[0] - 1].byteslice(from[1]...to[1]) if from[0] == to[0]
35
+
36
+ str = @script_lines[from[0] - 1][from[1]...-1]
37
+ (from[0]...(to[0] - 1)).each do |i|
38
+ str += @script_lines[i]
39
+ end
40
+ str += @script_lines[to[0] - 1].byteslice(0...to[1])
41
+ end
42
+
43
+ (PARSER_EVENTS - %i[command vcall method_add_arg]).each do |event|
44
+ module_eval(<<-End, __FILE__, __LINE__ + 1)
45
+ def on_#{event}(*args)
46
+ @token = ""
47
+ args.unshift [:#{event}, @last_loc]
48
+ args
49
+ end
50
+ End
51
+ end
52
+
53
+ SCANNER_EVENTS.each do |event|
54
+ module_eval(<<-End, __FILE__, __LINE__ + 1)
55
+ def on_#{event}(tok)
56
+ @last_loc = [lineno(), column()]
57
+ [:@#{event}, tok, @last_loc]
58
+ end
59
+ End
60
+ end
61
+
62
+ def on_command(*args)
63
+ args.unshift [:command, @last_loc]
64
+ return args unless args.dig(1, 0) == :@ident
65
+ method_name = args.dig(1, 1)
66
+ if MethodName === method_name
67
+ line = args.dig(1, 2, 0)
68
+ col1 = args.dig(1, 2, 1)
69
+ col2 = col1 + args.dig(1, 1).length
70
+ add_method_data(method_name, line, col1, col2, args.dig(2, 1))
71
+ end
72
+ args
73
+ end
74
+
75
+ def on_vcall(*args)
76
+ args.unshift [:vcall, @last_loc]
77
+ return args unless args.dig(1, 0) == :@ident
78
+ method_name = args.dig(1, 1)
79
+ if MethodName === method_name
80
+ line = args.dig(1, 2, 0)
81
+ col1 = args.dig(1, 2, 1)
82
+ col2 = col1 + args.dig(1, 1).length
83
+ add_method_data(method_name, line, col1, col2, args.dig(2, 1, 1))
84
+ end
85
+ args
86
+ end
87
+
88
+ def on_method_add_arg(*args)
89
+ args.unshift [:method_add_arg, @last_loc]
90
+ return args unless args.dig(1, 0, 0) == :fcall && args.dig(1, 1, 0) == :@ident
91
+ method_name = args.dig(1, 1, 1)
92
+ if MethodName === method_name
93
+ line = args.dig(1, 1, 2, 0)
94
+ col1 = args.dig(1, 1, 2, 1)
95
+ col2 = col1 + args.dig(1, 1, 1).length + 1
96
+ add_method_data(method_name, line, col1, col2, args.dig(2, 1, 1))
97
+ end
98
+ args
99
+ end
100
+
101
+ def add_method_data(name, line, col1, col2, args_add)
102
+ locs = []
103
+ while args_add
104
+ break unless args_add.dig(0, 0) == :args_add
105
+ locs.unshift args_add.dig(0, 1)
106
+ args_add = args_add.dig(1)
107
+ end
108
+ locs.unshift [line, col2]
109
+ @ic_methods.push({ name: name.to_sym, lineno: line, column: col1, locs: locs })
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ricecream
4
+ def self.colorize_code(code)
5
+ return code unless @colorize
6
+ require "irb"
7
+ unless defined?(IRB::Color) &&
8
+ IRB::Color.respond_to?(:colorize_code) &&
9
+ @output.respond_to?(:tty?) &&
10
+ @output.tty?
11
+ return code
12
+ end
13
+ IRB::Color.colorize_code(code.to_s)
14
+ end
15
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ricecream
4
+ @enable = true
5
+ @prefix = "ic| "
6
+ @output = STDERR
7
+ @include_context = false
8
+ @colorize = false
9
+
10
+ module Config
11
+ def enable
12
+ @enable = true
13
+ end
14
+
15
+ def disable
16
+ @enable = false
17
+ end
18
+
19
+ def prefix(location)
20
+ @prefix
21
+ end
22
+
23
+ def prefix=(value)
24
+ @prefix = value
25
+ end
26
+
27
+ def output(str)
28
+ @output.puts str
29
+ end
30
+
31
+ def output=(value)
32
+ @output = value
33
+ end
34
+
35
+ def arg_to_s(arg)
36
+ arg.inspect
37
+ end
38
+
39
+ def include_context=(value)
40
+ @include_context = value
41
+ end
42
+
43
+ def colorize=(value)
44
+ @colorize = value
45
+ end
46
+ end
47
+
48
+ extend Config
49
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "ic_method"
4
+ require_relative "colorize"
5
+ require_relative "config"
6
+ require_relative "version"
7
+
8
+ module Ricecream
9
+ @ic_methods = {}
10
+
11
+ def self.ic(location, name, args)
12
+ output format(location, name, args) if @enable
13
+ end
14
+
15
+ def self.format(location, name, args)
16
+ str = prefix(location)
17
+ arity = args.size
18
+ if arity == 0
19
+ return "#{str}#{context(location)} at #{Time.now.strftime('%H:%M:%S.%L')}"
20
+ end
21
+
22
+ path = location.absolute_path
23
+ unless @ic_methods[path]
24
+ require_relative "analyzer"
25
+ @ic_methods[path] = Analyzer.new(path).ic_methods
26
+ end
27
+
28
+ lineno = location.lineno
29
+ method = @ic_methods[path].find do |m|
30
+ m.lineno == lineno && m.arity == arity && m.name == name
31
+ end
32
+
33
+ str += "#{context(location)}- " if @include_context || !method
34
+ argstrs = method ? method.args.map { |arg| colorize_code(arg) } :
35
+ 1.upto(arity).map { |i| "<arg#{i}>" }
36
+ args = args.map { |arg| colorize_code(arg_to_s(arg)) }
37
+ argpairs = argstrs.zip(args).map do |argstr, arg|
38
+ argstr == arg ? argstr : "#{argstr}: #{arg}"
39
+ end
40
+ str + argpairs.join(", ")
41
+ end
42
+
43
+ def self.context(location)
44
+ "#{location.path}:#{colorize_code(location.lineno)} in #{location.label}"
45
+ end
46
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ricecream
4
+ ICMethod = Struct.new("ICMethod", :name, :script, :lineno, :column, :arity, :args)
5
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "ic"
4
+
5
+ module Ricecream
6
+ refine Kernel do
7
+ def ic(*args)
8
+ Ricecream.ic(caller_locations(1, 1).first, :ic, args)
9
+ return *args
10
+ end
11
+
12
+ def ic_format(*args)
13
+ Ricecream.format(caller_locations(1, 1).first, :ic_format, args)
14
+ end
15
+
16
+ private :ic, :ic_format
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ricecream
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/ricecream/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "ricecream"
7
+ spec.version = Ricecream::VERSION
8
+ spec.authors = ["nodai2hITC"]
9
+ spec.email = ["nodai2h.itc@gmail.com"]
10
+
11
+ spec.summary = "More useful debugging libraries than puts / p"
12
+ spec.description = "Never use puts/p to debug again! More useful debugging libraries than puts / p. (A Ruby port of Python's IceCream.)"
13
+ spec.homepage = "https://github.com/nodai2hITC/ricecream"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = spec.homepage
19
+ # spec.metadata["changelog_uri"] = spec.homepage
20
+
21
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
22
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
23
+ end
24
+ spec.bindir = "exe"
25
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
26
+ spec.require_paths = ["lib"]
27
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ricecream
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - nodai2hITC
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-01-28 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Never use puts/p to debug again! More useful debugging libraries than
14
+ puts / p. (A Ruby port of Python's IceCream.)
15
+ email:
16
+ - nodai2h.itc@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - ".gitignore"
22
+ - CODE_OF_CONDUCT.md
23
+ - Gemfile
24
+ - LICENSE.txt
25
+ - README.md
26
+ - Rakefile
27
+ - bin/console
28
+ - bin/setup
29
+ - lib/ricecream.rb
30
+ - lib/ricecream/analyzer.rb
31
+ - lib/ricecream/colorize.rb
32
+ - lib/ricecream/config.rb
33
+ - lib/ricecream/ic.rb
34
+ - lib/ricecream/ic_method.rb
35
+ - lib/ricecream/refine.rb
36
+ - lib/ricecream/version.rb
37
+ - ricecream.gemspec
38
+ homepage: https://github.com/nodai2hITC/ricecream
39
+ licenses:
40
+ - MIT
41
+ metadata:
42
+ homepage_uri: https://github.com/nodai2hITC/ricecream
43
+ source_code_uri: https://github.com/nodai2hITC/ricecream
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 2.4.0
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubygems_version: 3.2.3
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: More useful debugging libraries than puts / p
63
+ test_files: []