with_public 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +3 -0
- data/.rubocop.yml +189 -0
- data/.rubocop_todo.yml +13 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +47 -0
- data/Rakefile +11 -0
- data/bin/console +14 -0
- data/bin/rake +29 -0
- data/bin/rspec +29 -0
- data/bin/rubocop +29 -0
- data/bin/setup +8 -0
- data/bin/yard +29 -0
- data/bin/yardoc +29 -0
- data/bin/yri +29 -0
- data/lib/with_public.rb +29 -0
- data/lib/with_public/version.rb +5 -0
- data/with_public.gemspec +37 -0
- metadata +155 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7e0bbf8c8296d15a3605f35bb117d5f7ff76e93c753c6fc478d227b991a367a0
|
4
|
+
data.tar.gz: 7f56bcfa32d6b137b933e31671440cc3460961b31eda65a5fd1a1f4dd7e3f5c9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 33b78ed45e1dd55ed871ded96f53706d5bc13491a1048681c194017bb6a89873db6782dfd8dea01b052a643d963521b59b93c09638a5a881a0ba09df6ce88ccb
|
7
|
+
data.tar.gz: 5b4229911672a4c2e967b852992e312dd3eb16252629ce564d6ef8a11d6ddd086bc39ff81f99c341510ca60174ea2edb818989cb17d3254f43d287d971bd9374
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,189 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
require:
|
3
|
+
- rubocop-rspec
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
DisplayCopNames: true
|
7
|
+
DisplayStyleGuide: true
|
8
|
+
EnabledByDefault: true
|
9
|
+
Exclude:
|
10
|
+
- bin/*
|
11
|
+
- vendor/bundle/**/*
|
12
|
+
ExtraDetails: true
|
13
|
+
TargetRubyVersion: 2.5
|
14
|
+
UseCache: true
|
15
|
+
|
16
|
+
Gemspec/OrderedDependencies:
|
17
|
+
Enabled: true
|
18
|
+
|
19
|
+
RSpec/AlignLeftLetBrace:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
RSpec/AlignRightLetBrace:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
RSpec/AnyInstance:
|
26
|
+
Enabled: true
|
27
|
+
|
28
|
+
RSpec/ContextWording:
|
29
|
+
Enabled: true
|
30
|
+
|
31
|
+
RSpec/DescribedClass:
|
32
|
+
Enabled: true
|
33
|
+
EnforcedStyle: explicit
|
34
|
+
|
35
|
+
RSpec/EmptyLineAfterFinalLet:
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
RSpec/ExampleLength:
|
39
|
+
Enabled: true
|
40
|
+
|
41
|
+
RSpec/LeadingSubject:
|
42
|
+
Enabled: true
|
43
|
+
|
44
|
+
RSpec/NotToNot:
|
45
|
+
Enabled: true
|
46
|
+
EnforcedStyle: not_to
|
47
|
+
|
48
|
+
RSpec/ScatteredLet:
|
49
|
+
Enabled: true
|
50
|
+
|
51
|
+
Layout/CommentIndentation:
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
Layout/EmptyLineAfterGuardClause:
|
55
|
+
Enabled: true
|
56
|
+
|
57
|
+
Layout/EmptyLines:
|
58
|
+
Enabled: true
|
59
|
+
|
60
|
+
Layout/EmptyLineAfterGuardClause:
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
Layout/EmptyLineBetweenDefs:
|
64
|
+
Enabled: true
|
65
|
+
|
66
|
+
Layout/EmptyLineAfterMagicComment:
|
67
|
+
Enabled: true
|
68
|
+
|
69
|
+
Layout/EmptyLinesAroundAccessModifier:
|
70
|
+
Enabled: true
|
71
|
+
|
72
|
+
Layout/ExtraSpacing:
|
73
|
+
Enabled: true
|
74
|
+
AllowForAlignment: false
|
75
|
+
|
76
|
+
Layout/IndentHeredoc:
|
77
|
+
Enabled: true
|
78
|
+
|
79
|
+
Layout/LeadingCommentSpace:
|
80
|
+
Enabled: false
|
81
|
+
|
82
|
+
Lint/MissingCopEnableDirective:
|
83
|
+
Enabled: true
|
84
|
+
|
85
|
+
Layout/SpaceInsideBlockBraces:
|
86
|
+
Enabled: true
|
87
|
+
EnforcedStyle: space
|
88
|
+
EnforcedStyleForEmptyBraces: space
|
89
|
+
SpaceBeforeBlockParameters: false
|
90
|
+
|
91
|
+
Lint/UselessAssignment:
|
92
|
+
Enabled: true
|
93
|
+
|
94
|
+
Security/MarshalLoad:
|
95
|
+
Enabled: true
|
96
|
+
|
97
|
+
Style/AccessModifierDeclarations:
|
98
|
+
Enabled: false
|
99
|
+
|
100
|
+
Style/BlockDelimiters:
|
101
|
+
Enabled: true
|
102
|
+
EnforcedStyle: braces_for_chaining
|
103
|
+
|
104
|
+
Style/CharacterLiteral:
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
Style/Copyright:
|
108
|
+
Enabled: false
|
109
|
+
|
110
|
+
Style/Documentation:
|
111
|
+
Enabled: true
|
112
|
+
Exclude:
|
113
|
+
- spec/**/*
|
114
|
+
|
115
|
+
Style/ExpandPathArguments:
|
116
|
+
Enabled: true
|
117
|
+
|
118
|
+
Style/FormatString:
|
119
|
+
Enabled: true
|
120
|
+
EnforcedStyle: percent
|
121
|
+
|
122
|
+
Style/FormatStringToken:
|
123
|
+
Enabled: false
|
124
|
+
|
125
|
+
Style/FrozenStringLiteralComment:
|
126
|
+
Enabled: true
|
127
|
+
|
128
|
+
Style/GlobalVars:
|
129
|
+
Enabled: true
|
130
|
+
AllowedVariables:
|
131
|
+
- $logger
|
132
|
+
|
133
|
+
Style/HashSyntax:
|
134
|
+
Enabled: true
|
135
|
+
EnforcedStyle: ruby19
|
136
|
+
|
137
|
+
Style/MethodCallWithArgsParentheses:
|
138
|
+
Enabled: true
|
139
|
+
IgnoreMacros: true
|
140
|
+
IgnoredMethods:
|
141
|
+
# Language core
|
142
|
+
- raise
|
143
|
+
- require
|
144
|
+
# Rspec
|
145
|
+
- be
|
146
|
+
- describe
|
147
|
+
- expect
|
148
|
+
- include_context
|
149
|
+
- not_to
|
150
|
+
- shared_context
|
151
|
+
- to
|
152
|
+
# Rake
|
153
|
+
- task
|
154
|
+
# gem/bundler
|
155
|
+
- add_dependency
|
156
|
+
- add_development_dependency
|
157
|
+
|
158
|
+
Style/MutableConstant:
|
159
|
+
Enabled: true
|
160
|
+
|
161
|
+
Style/PercentLiteralDelimiters:
|
162
|
+
Enabled: false
|
163
|
+
|
164
|
+
Style/Send:
|
165
|
+
Enabled: true
|
166
|
+
|
167
|
+
Style/StringHashKeys:
|
168
|
+
Enabled: false
|
169
|
+
|
170
|
+
Style/StringLiterals:
|
171
|
+
Enabled: true
|
172
|
+
EnforcedStyle: single_quotes
|
173
|
+
|
174
|
+
Style/UnneededPercentQ:
|
175
|
+
Enabled: true
|
176
|
+
|
177
|
+
Metrics/BlockLength:
|
178
|
+
Enabled: true
|
179
|
+
CountComments: false
|
180
|
+
ExcludedMethods:
|
181
|
+
- context
|
182
|
+
- describe
|
183
|
+
- namespace
|
184
|
+
- refine
|
185
|
+
- task
|
186
|
+
|
187
|
+
Metrics/LineLength:
|
188
|
+
Enabled: true
|
189
|
+
IgnoreCopDirectives: true
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
|
3
|
+
# using RuboCop version 0.59.2.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
11
|
+
# URISchemes: http, https
|
12
|
+
Metrics/LineLength:
|
13
|
+
Max: 84
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 OZAWA Sakuro
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# WithPublic
|
2
|
+
|
3
|
+
This gem provides Module#with_public which make private methods public temporalily.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'with_public'
|
11
|
+
```
|
12
|
+
|
13
|
+
Or if you have an environment for test, instead:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'with_public', group: :test
|
17
|
+
```
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install with_public
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
In a context you want some private instance methods with explicit receivers, write
|
30
|
+
|
31
|
+
using TheClass.with_public(:private_method_1, :private_method_2, ...)
|
32
|
+
|
33
|
+
then you can call these methods wihtout Object#send.
|
34
|
+
|
35
|
+
## Development
|
36
|
+
|
37
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
38
|
+
|
39
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
40
|
+
|
41
|
+
## Contributing
|
42
|
+
|
43
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/sakuro/with_public.
|
44
|
+
|
45
|
+
## License
|
46
|
+
|
47
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "with_public"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rake' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rake", "rake")
|
data/bin/rspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/bin/rubocop
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rubocop' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rubocop", "rubocop")
|
data/bin/setup
ADDED
data/bin/yard
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'yard' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("yard", "yard")
|
data/bin/yardoc
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'yardoc' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("yard", "yardoc")
|
data/bin/yri
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'yri' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("yard", "yri")
|
data/lib/with_public.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'with_public/version'
|
4
|
+
|
5
|
+
# A module to define with_public method to Module class.
|
6
|
+
# With this module, one can test private methods without Object#send.
|
7
|
+
module WithPublic
|
8
|
+
# Returns a refiner module to make target methods public
|
9
|
+
#
|
10
|
+
# @param [Array<Symbol>] methods Method symbols to be made public
|
11
|
+
# @return [Module] a refinement module to make given methods public
|
12
|
+
# @example Make Foo#bar public
|
13
|
+
# RSpec.describe Foo do
|
14
|
+
# using Foo.with_public(:bar)
|
15
|
+
# # Calling Foo#bar will not raise NoMethodError in this context.
|
16
|
+
# end
|
17
|
+
def with_public(*methods)
|
18
|
+
target = self
|
19
|
+
Module.new.tap do |refiner|
|
20
|
+
refiner.module_eval do
|
21
|
+
refine target do
|
22
|
+
public(*methods)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
Module.include(WithPublic)
|
data/with_public.gemspec
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'with_public/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'with_public'
|
9
|
+
spec.version = WithPublic::VERSION
|
10
|
+
spec.authors = ['OZAWA Sakuro']
|
11
|
+
spec.email = ['sakuro@2238.club']
|
12
|
+
|
13
|
+
spec.summary = 'Make methods public.'
|
14
|
+
spec.description = <<~DESCRIPTION
|
15
|
+
Adds Module#with_public to make private instance methods temporarily public.
|
16
|
+
DESCRIPTION
|
17
|
+
spec.homepage = 'https://github.com/sakuro/with_public'
|
18
|
+
spec.license = 'MIT'
|
19
|
+
|
20
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
21
|
+
spec.metadata['source_code_uri'] = 'https://github.com/sakuro/with_public.git'
|
22
|
+
spec.metadata['changelog_uri'] = 'https://github.com/sakuro/with_public/blob/master/CHANGELOG.md'
|
23
|
+
|
24
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
end
|
27
|
+
spec.bindir = 'exe'
|
28
|
+
spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
|
29
|
+
spec.require_paths = ['lib']
|
30
|
+
|
31
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
32
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
33
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
34
|
+
spec.add_development_dependency 'rubocop', '~> 0.59'
|
35
|
+
spec.add_development_dependency 'rubocop-rspec'
|
36
|
+
spec.add_development_dependency 'yard'
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: with_public
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- OZAWA Sakuro
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.59'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.59'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: yard
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: 'Adds Module#with_public to make private instance methods temporarily
|
98
|
+
public.
|
99
|
+
|
100
|
+
'
|
101
|
+
email:
|
102
|
+
- sakuro@2238.club
|
103
|
+
executables: []
|
104
|
+
extensions: []
|
105
|
+
extra_rdoc_files: []
|
106
|
+
files:
|
107
|
+
- ".gitignore"
|
108
|
+
- ".rspec"
|
109
|
+
- ".rubocop.yml"
|
110
|
+
- ".rubocop_todo.yml"
|
111
|
+
- ".travis.yml"
|
112
|
+
- CHANGELOG.md
|
113
|
+
- Gemfile
|
114
|
+
- LICENSE.txt
|
115
|
+
- README.md
|
116
|
+
- Rakefile
|
117
|
+
- bin/console
|
118
|
+
- bin/rake
|
119
|
+
- bin/rspec
|
120
|
+
- bin/rubocop
|
121
|
+
- bin/setup
|
122
|
+
- bin/yard
|
123
|
+
- bin/yardoc
|
124
|
+
- bin/yri
|
125
|
+
- lib/with_public.rb
|
126
|
+
- lib/with_public/version.rb
|
127
|
+
- with_public.gemspec
|
128
|
+
homepage: https://github.com/sakuro/with_public
|
129
|
+
licenses:
|
130
|
+
- MIT
|
131
|
+
metadata:
|
132
|
+
homepage_uri: https://github.com/sakuro/with_public
|
133
|
+
source_code_uri: https://github.com/sakuro/with_public.git
|
134
|
+
changelog_uri: https://github.com/sakuro/with_public/blob/master/CHANGELOG.md
|
135
|
+
post_install_message:
|
136
|
+
rdoc_options: []
|
137
|
+
require_paths:
|
138
|
+
- lib
|
139
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
144
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ">="
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
149
|
+
requirements: []
|
150
|
+
rubyforge_project:
|
151
|
+
rubygems_version: 2.7.7
|
152
|
+
signing_key:
|
153
|
+
specification_version: 4
|
154
|
+
summary: Make methods public.
|
155
|
+
test_files: []
|