bundler 2.1.4 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1624 -1426
  3. data/README.md +6 -8
  4. data/bundler.gemspec +4 -4
  5. data/exe/bundle +3 -0
  6. data/lib/bundler.rb +32 -8
  7. data/lib/bundler/build_metadata.rb +3 -11
  8. data/lib/bundler/cli.rb +55 -21
  9. data/lib/bundler/cli/add.rb +1 -1
  10. data/lib/bundler/cli/binstubs.rb +6 -2
  11. data/lib/bundler/cli/cache.rb +1 -7
  12. data/lib/bundler/cli/clean.rb +1 -1
  13. data/lib/bundler/cli/common.rb +14 -0
  14. data/lib/bundler/cli/console.rb +1 -1
  15. data/lib/bundler/cli/doctor.rb +1 -1
  16. data/lib/bundler/cli/exec.rb +4 -4
  17. data/lib/bundler/cli/fund.rb +36 -0
  18. data/lib/bundler/cli/gem.rb +86 -11
  19. data/lib/bundler/cli/info.rb +15 -4
  20. data/lib/bundler/cli/init.rb +2 -2
  21. data/lib/bundler/cli/inject.rb +1 -1
  22. data/lib/bundler/cli/install.rb +13 -11
  23. data/lib/bundler/cli/issue.rb +2 -2
  24. data/lib/bundler/cli/list.rb +12 -10
  25. data/lib/bundler/cli/outdated.rb +87 -66
  26. data/lib/bundler/cli/plugin.rb +10 -0
  27. data/lib/bundler/cli/pristine.rb +5 -0
  28. data/lib/bundler/cli/show.rb +1 -1
  29. data/lib/bundler/cli/update.rb +3 -1
  30. data/lib/bundler/compact_index_client.rb +1 -1
  31. data/lib/bundler/compact_index_client/cache.rb +6 -14
  32. data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  33. data/lib/bundler/compact_index_client/updater.rb +5 -13
  34. data/lib/bundler/definition.rb +66 -82
  35. data/lib/bundler/dep_proxy.rb +16 -9
  36. data/lib/bundler/dependency.rb +3 -10
  37. data/lib/bundler/dsl.rb +5 -9
  38. data/lib/bundler/endpoint_specification.rb +1 -1
  39. data/lib/bundler/env.rb +1 -1
  40. data/lib/bundler/environment_preserver.rb +26 -2
  41. data/lib/bundler/errors.rb +1 -0
  42. data/lib/bundler/feature_flag.rb +0 -3
  43. data/lib/bundler/fetcher.rb +4 -3
  44. data/lib/bundler/fetcher/base.rb +1 -1
  45. data/lib/bundler/fetcher/compact_index.rb +1 -1
  46. data/lib/bundler/fetcher/downloader.rb +1 -1
  47. data/lib/bundler/fetcher/index.rb +3 -4
  48. data/lib/bundler/friendly_errors.rb +22 -13
  49. data/lib/bundler/gem_helper.rb +32 -17
  50. data/lib/bundler/gem_helpers.rb +36 -25
  51. data/lib/bundler/gem_version_promoter.rb +4 -4
  52. data/lib/bundler/graph.rb +1 -1
  53. data/lib/bundler/index.rb +6 -2
  54. data/lib/bundler/injector.rb +22 -4
  55. data/lib/bundler/inline.rb +1 -1
  56. data/lib/bundler/installer.rb +35 -32
  57. data/lib/bundler/installer/gem_installer.rb +3 -3
  58. data/lib/bundler/installer/parallel_installer.rb +10 -10
  59. data/lib/bundler/installer/standalone.rb +2 -2
  60. data/lib/bundler/lazy_specification.rb +35 -11
  61. data/lib/bundler/lockfile_generator.rb +1 -1
  62. data/lib/bundler/lockfile_parser.rb +1 -1
  63. data/lib/bundler/man/.document +1 -0
  64. data/{man → lib/bundler/man}/bundle-add.1 +1 -1
  65. data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +0 -0
  66. data/{man → lib/bundler/man}/bundle-binstubs.1 +5 -3
  67. data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
  68. data/{man → lib/bundler/man}/bundle-cache.1 +1 -1
  69. data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +0 -0
  70. data/{man → lib/bundler/man}/bundle-check.1 +1 -1
  71. data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
  72. data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
  73. data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
  74. data/{man → lib/bundler/man}/bundle-config.1 +16 -25
  75. data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +19 -30
  76. data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
  77. data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
  78. data/{man → lib/bundler/man}/bundle-exec.1 +1 -1
  79. data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +0 -0
  80. data/{man → lib/bundler/man}/bundle-gem.1 +25 -3
  81. data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +30 -7
  82. data/{man → lib/bundler/man}/bundle-info.1 +1 -1
  83. data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
  84. data/{man → lib/bundler/man}/bundle-init.1 +1 -1
  85. data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
  86. data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
  87. data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
  88. data/{man → lib/bundler/man}/bundle-install.1 +30 -3
  89. data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +25 -3
  90. data/{man → lib/bundler/man}/bundle-list.1 +7 -7
  91. data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
  92. data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
  93. data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
  94. data/{man → lib/bundler/man}/bundle-open.1 +1 -1
  95. data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
  96. data/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
  97. data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
  98. data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
  99. data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
  100. data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
  101. data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
  102. data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
  103. data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
  104. data/{man → lib/bundler/man}/bundle-show.1 +1 -1
  105. data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
  106. data/{man → lib/bundler/man}/bundle-update.1 +1 -1
  107. data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +0 -0
  108. data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
  109. data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
  110. data/{man → lib/bundler/man}/bundle.1 +1 -1
  111. data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +0 -0
  112. data/{man → lib/bundler/man}/gemfile.5 +4 -4
  113. data/{man → lib/bundler/man}/gemfile.5.ronn +4 -4
  114. data/{man → lib/bundler/man}/index.txt +0 -0
  115. data/lib/bundler/mirror.rb +2 -2
  116. data/lib/bundler/plugin.rb +30 -5
  117. data/lib/bundler/plugin/api/source.rb +1 -1
  118. data/lib/bundler/plugin/dsl.rb +1 -1
  119. data/lib/bundler/plugin/index.rb +10 -1
  120. data/lib/bundler/plugin/installer.rb +1 -1
  121. data/lib/bundler/plugin/installer/rubygems.rb +1 -1
  122. data/lib/bundler/plugin/source_list.rb +1 -1
  123. data/lib/bundler/psyched_yaml.rb +0 -15
  124. data/lib/bundler/remote_specification.rb +5 -2
  125. data/lib/bundler/resolver.rb +43 -19
  126. data/lib/bundler/resolver/spec_group.rb +39 -24
  127. data/lib/bundler/retry.rb +1 -1
  128. data/lib/bundler/ruby_version.rb +1 -1
  129. data/lib/bundler/rubygems_ext.rb +69 -9
  130. data/lib/bundler/rubygems_gem_installer.rb +3 -9
  131. data/lib/bundler/rubygems_integration.rb +25 -60
  132. data/lib/bundler/runtime.rb +4 -14
  133. data/lib/bundler/settings.rb +49 -46
  134. data/lib/bundler/shared_helpers.rb +2 -2
  135. data/lib/bundler/similarity_detector.rb +1 -1
  136. data/lib/bundler/source.rb +1 -1
  137. data/lib/bundler/source/git.rb +23 -21
  138. data/lib/bundler/source/git/git_proxy.rb +82 -80
  139. data/lib/bundler/source/path.rb +7 -3
  140. data/lib/bundler/source/path/installer.rb +10 -10
  141. data/lib/bundler/source/rubygems.rb +23 -17
  142. data/lib/bundler/source/rubygems/remote.rb +1 -1
  143. data/lib/bundler/source_list.rb +2 -2
  144. data/lib/bundler/spec_set.rb +8 -10
  145. data/lib/bundler/stub_specification.rb +17 -7
  146. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
  147. data/lib/bundler/templates/newgem/Gemfile.tt +9 -1
  148. data/lib/bundler/templates/newgem/README.md.tt +1 -2
  149. data/lib/bundler/templates/newgem/Rakefile.tt +19 -5
  150. data/lib/bundler/templates/newgem/bin/console.tt +1 -0
  151. data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
  152. data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
  153. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
  154. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
  155. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
  156. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
  157. data/lib/bundler/templates/newgem/newgem.gemspec.tt +15 -7
  158. data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
  159. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
  160. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
  161. data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
  162. data/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
  163. data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  164. data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  165. data/lib/bundler/ui/shell.rb +5 -5
  166. data/lib/bundler/uri_credentials_filter.rb +3 -1
  167. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
  168. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +34 -1
  169. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
  170. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
  171. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  172. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +48 -46
  173. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +82 -189
  174. data/lib/bundler/vendor/thor/lib/thor.rb +0 -7
  175. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
  176. data/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
  177. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  178. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
  179. data/lib/bundler/vendored_persistent.rb +0 -7
  180. data/lib/bundler/vendored_tmpdir.rb +4 -0
  181. data/lib/bundler/version.rb +1 -1
  182. data/lib/bundler/worker.rb +1 -1
  183. data/lib/bundler/yaml_serializer.rb +1 -1
  184. metadata +70 -85
  185. data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
  186. data/man/bundle-add.1.txt +0 -58
  187. data/man/bundle-binstubs.1.txt +0 -48
  188. data/man/bundle-cache.1.txt +0 -78
  189. data/man/bundle-check.1.txt +0 -33
  190. data/man/bundle-clean.1.txt +0 -26
  191. data/man/bundle-config.1.txt +0 -528
  192. data/man/bundle-doctor.1.txt +0 -44
  193. data/man/bundle-exec.1.txt +0 -178
  194. data/man/bundle-gem.1.txt +0 -91
  195. data/man/bundle-info.1.txt +0 -21
  196. data/man/bundle-init.1.txt +0 -34
  197. data/man/bundle-inject.1.txt +0 -32
  198. data/man/bundle-install.1.txt +0 -401
  199. data/man/bundle-list.1.txt +0 -43
  200. data/man/bundle-lock.1.txt +0 -93
  201. data/man/bundle-open.1.txt +0 -29
  202. data/man/bundle-outdated.1.txt +0 -131
  203. data/man/bundle-platform.1.txt +0 -57
  204. data/man/bundle-pristine.1.txt +0 -44
  205. data/man/bundle-remove.1.txt +0 -34
  206. data/man/bundle-show.1.txt +0 -27
  207. data/man/bundle-update.1.txt +0 -390
  208. data/man/bundle-viz.1.txt +0 -39
  209. data/man/bundle.1.txt +0 -116
  210. data/man/gemfile.5.txt +0 -649
@@ -145,20 +145,19 @@ module Bundler
145
145
 
146
146
  Bundler.mkdir_p bin_path, :no_sudo => true unless spec.executables.empty? || Bundler.rubygems.provides?(">= 2.7.5")
147
147
 
148
- installed_spec = nil
149
- Bundler.rubygems.preserve_paths do
150
- installed_spec = Bundler::RubyGemsGemInstaller.at(
151
- path,
152
- :install_dir => install_path.to_s,
153
- :bin_dir => bin_path.to_s,
154
- :ignore_dependencies => true,
155
- :wrappers => true,
156
- :env_shebang => true,
157
- :build_args => opts[:build_args],
158
- :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum,
159
- :bundler_extension_cache_path => extension_cache_path(spec)
160
- ).install
161
- end
148
+ require_relative "../rubygems_gem_installer"
149
+
150
+ installed_spec = Bundler::RubyGemsGemInstaller.at(
151
+ path,
152
+ :install_dir => install_path.to_s,
153
+ :bin_dir => bin_path.to_s,
154
+ :ignore_dependencies => true,
155
+ :wrappers => true,
156
+ :env_shebang => true,
157
+ :build_args => opts[:build_args],
158
+ :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum,
159
+ :bundler_extension_cache_path => extension_cache_path(spec)
160
+ ).install
162
161
  spec.full_gem_path = installed_spec.full_gem_path
163
162
 
164
163
  # SUDO HAX
@@ -294,7 +293,7 @@ module Bundler
294
293
  names
295
294
  end
296
295
 
297
- protected
296
+ protected
298
297
 
299
298
  def credless_remotes
300
299
  remotes.map(&method(:suppress_configured_credentials))
@@ -468,7 +467,7 @@ module Bundler
468
467
  Bundler.app_cache
469
468
  end
470
469
 
471
- private
470
+ private
472
471
 
473
472
  # Checks if the requested spec exists in the global cache. If it does,
474
473
  # we copy it to the download path, and if it does not, we download it.
@@ -490,8 +489,15 @@ module Bundler
490
489
  uri = spec.remote.uri
491
490
  Bundler.ui.confirm("Fetching #{version_message(spec)}")
492
491
  rubygems_local_path = Bundler.rubygems.download_gem(spec, uri, download_path)
492
+
493
+ # older rubygems return varying file:// variants depending on version
494
+ rubygems_local_path = rubygems_local_path.gsub(/\Afile:/, "") unless Bundler.rubygems.provides?(">= 3.2.0.rc.2")
495
+ rubygems_local_path = rubygems_local_path.gsub(%r{\A//}, "") if Bundler.rubygems.provides?("< 3.1.0")
496
+
493
497
  if rubygems_local_path != local_path
494
- FileUtils.mv(rubygems_local_path, local_path)
498
+ SharedHelpers.filesystem_access(local_path) do
499
+ FileUtils.mv(rubygems_local_path, local_path)
500
+ end
495
501
  end
496
502
  cache_globally(spec, local_path)
497
503
  end
@@ -39,7 +39,7 @@ module Bundler
39
39
  "rubygems remote at #{anonymized_uri}"
40
40
  end
41
41
 
42
- private
42
+ private
43
43
 
44
44
  def apply_auth(uri, auth)
45
45
  if auth && uri.userinfo.nil?
@@ -116,7 +116,7 @@ module Bundler
116
116
  @rubygems_aggregate.remotes
117
117
  end
118
118
 
119
- private
119
+ private
120
120
 
121
121
  def rubygems_aggregate_class
122
122
  Source::Rubygems
@@ -147,7 +147,7 @@ module Bundler
147
147
  if source.uri =~ /^git\:/
148
148
  Bundler.ui.warn "The git source `#{source.uri}` uses the `git` protocol, " \
149
149
  "which transmits data without encryption. Disable this warning with " \
150
- "`bundle config set git.allow_insecure true`, or switch to the `https` " \
150
+ "`bundle config set --local git.allow_insecure true`, or switch to the `https` " \
151
151
  "protocol to keep your data secure."
152
152
  end
153
153
  end
@@ -22,12 +22,13 @@ module Bundler
22
22
  break unless dep = deps.shift
23
23
  next if !handled.add?(dep) || skip.include?(dep.name)
24
24
 
25
- if spec = spec_for_dependency(dep, match_current_platform)
26
- specs << spec
25
+ specs_for_dep = spec_for_dependency(dep, match_current_platform)
26
+ if specs_for_dep.any?
27
+ specs += specs_for_dep
27
28
 
28
- spec.dependencies.each do |d|
29
+ specs_for_dep.first.dependencies.each do |d|
29
30
  next if d.type == :development
30
- d = DepProxy.new(d, dep.__platform) unless match_current_platform
31
+ d = DepProxy.get_proxy(d, dep.__platform) unless match_current_platform
31
32
  deps << d
32
33
  end
33
34
  elsif check
@@ -100,6 +101,7 @@ module Bundler
100
101
  @specs.map do |s|
101
102
  next s unless s.is_a?(LazySpecification)
102
103
  s.source.dependency_names = names if s.source.respond_to?(:dependency_names=)
104
+ s.source.remote!
103
105
  spec = s.__materialize__
104
106
  raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
105
107
  spec
@@ -147,7 +149,7 @@ module Bundler
147
149
  sorted.each(&b)
148
150
  end
149
151
 
150
- private
152
+ private
151
153
 
152
154
  def sorted
153
155
  rake = @specs.find {|s| s.name == "rake" }
@@ -183,11 +185,7 @@ module Bundler
183
185
  def spec_for_dependency(dep, match_current_platform)
184
186
  specs_for_platforms = lookup[dep.name]
185
187
  if match_current_platform
186
- Bundler.rubygems.platforms.reverse_each do |pl|
187
- match = GemHelpers.select_best_platform_match(specs_for_platforms, pl)
188
- return match if match
189
- end
190
- nil
188
+ GemHelpers.select_best_platform_match(specs_for_platforms, Bundler.local_platform)
191
189
  else
192
190
  GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
193
191
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "remote_specification"
4
-
5
3
  module Bundler
6
4
  class StubSpecification < RemoteSpecification
7
5
  def self.from_stub(stub)
@@ -28,9 +26,13 @@ module Bundler
28
26
 
29
27
  # @!group Stub Delegates
30
28
 
31
- # This is defined directly to avoid having to load every installed spec
29
+ # This is defined directly to avoid having to loading the full spec
32
30
  def missing_extensions?
33
- stub.missing_extensions?
31
+ return false if default_gem?
32
+ return false if extensions.empty?
33
+ return false if File.exist? gem_build_complete_path
34
+
35
+ true
34
36
  end
35
37
 
36
38
  def activated
@@ -41,8 +43,16 @@ module Bundler
41
43
  stub.instance_variable_set(:@activated, activated)
42
44
  end
43
45
 
44
- def default_gem
45
- stub.default_gem
46
+ def extensions
47
+ stub.extensions
48
+ end
49
+
50
+ def gem_build_complete_path
51
+ File.join(extension_dir, "gem.build_complete")
52
+ end
53
+
54
+ def default_gem?
55
+ stub.default_gem?
46
56
  end
47
57
 
48
58
  def full_gem_path
@@ -71,7 +81,7 @@ module Bundler
71
81
  stub.raw_require_paths
72
82
  end
73
83
 
74
- private
84
+ private
75
85
 
76
86
  def _remote_specification
77
87
  @_remote_specification ||= begin
@@ -2,73 +2,83 @@
2
2
 
3
3
  ## Our Pledge
4
4
 
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
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.
11
8
 
12
9
  ## Our Standards
13
10
 
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
11
+ Examples of behavior that contributes to a positive environment for our community include:
16
12
 
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
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
22
18
 
23
- Examples of unacceptable behavior by participants include:
19
+ Examples of unacceptable behavior include:
24
20
 
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
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
28
24
  * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
31
27
  * Other conduct which could reasonably be considered inappropriate in a
32
28
  professional setting
33
29
 
34
- ## Our Responsibilities
30
+ ## Enforcement Responsibilities
35
31
 
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
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.
39
33
 
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
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.
45
35
 
46
36
  ## Scope
47
37
 
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
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.
54
39
 
55
40
  ## Enforcement
56
41
 
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at <%= config[:email] %>. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at <%= config[:email] %>. 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.
63
59
 
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
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.
67
73
 
68
74
  ## Attribution
69
75
 
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [https://contributor-covenant.org/version/1/4][version]
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
72
82
 
73
- [homepage]: https://contributor-covenant.org
74
- [version]: https://contributor-covenant.org/version/1/4/
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.
@@ -1,12 +1,20 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
3
5
  # Specify your gem's dependencies in <%= config[:name] %>.gemspec
4
6
  gemspec
5
7
 
6
- gem "rake", "~> 12.0"
8
+ gem "rake", "~> 13.0"
7
9
  <%- if config[:ext] -%>
10
+
8
11
  gem "rake-compiler"
9
12
  <%- end -%>
10
13
  <%- if config[:test] -%>
14
+
11
15
  gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
12
16
  <%- end -%>
17
+ <%- if config[:rubocop] -%>
18
+
19
+ gem "rubocop", "~> <%= config[:rubocop_version] %>"
20
+ <%- end -%>
@@ -28,12 +28,11 @@ TODO: Write usage instructions here
28
28
 
29
29
  After checking out the repo, run `bin/setup` to install dependencies.<% if config[:test] %> Then, run `rake <%= config[:test].sub('mini', '').sub('rspec', 'spec') %>` to run the tests.<% end %> You can also run `bin/console` for an interactive prompt that will allow you to experiment.<% if config[:bin] %> Run `bundle exec <%= config[:name] %>` to use the gem in this directory, ignoring other installed copies of this gem.<% end %>
30
30
 
31
- 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).
31
+ 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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
32
 
33
33
  ## Contributing
34
34
 
35
35
  Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:github_username] %>/<%= config[:name] %>.<% if config[:coc] %> 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/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md).<% end %>
36
-
37
36
  <% if config[:mit] -%>
38
37
 
39
38
  ## License
@@ -1,5 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
- <% if config[:test] == "minitest" -%>
4
+ <% default_task_names = [config[:test_task]].compact -%>
5
+ <% case config[:test] -%>
6
+ <% when "minitest", "test-unit" -%>
3
7
  require "rake/testtask"
4
8
 
5
9
  Rake::TestTask.new(:test) do |t|
@@ -8,22 +12,32 @@ Rake::TestTask.new(:test) do |t|
8
12
  t.test_files = FileList["test/**/*_test.rb"]
9
13
  end
10
14
 
11
- <% elsif config[:test] == "rspec" -%>
15
+ <% when "rspec" -%>
12
16
  require "rspec/core/rake_task"
13
17
 
14
18
  RSpec::Core::RakeTask.new(:spec)
15
19
 
20
+ <% end -%>
21
+ <% if config[:rubocop] -%>
22
+ <% default_task_names << :rubocop -%>
23
+ require "rubocop/rake_task"
24
+
25
+ RuboCop::RakeTask.new
26
+
16
27
  <% end -%>
17
28
  <% if config[:ext] -%>
29
+ <% default_task_names.unshift(:clobber, :compile) -%>
18
30
  require "rake/extensiontask"
19
31
 
20
- task :build => :compile
32
+ task build: :compile
21
33
 
22
34
  Rake::ExtensionTask.new("<%= config[:underscored_name] %>") do |ext|
23
35
  ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
24
36
  end
25
37
 
26
- task :default => [:clobber, :compile, :<%= config[:test_task] %>]
38
+ <% end -%>
39
+ <% if default_task_names.size == 1 -%>
40
+ task default: <%= default_task_names.first.inspect %>
27
41
  <% else -%>
28
- task :default => :<%= config[:test_task] %>
42
+ task default: %i[<%= default_task_names.join(" ") %>]
29
43
  <% end -%>
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "bundler/setup"
4
5
  require "<%= config[:namespaced_path] %>"
@@ -0,0 +1,13 @@
1
+ version: 2.1
2
+ jobs:
3
+ build:
4
+ docker:
5
+ - image: ruby:<%= RUBY_VERSION %>
6
+ steps:
7
+ - checkout
8
+ - run:
9
+ name: Run the default task
10
+ command: |
11
+ gem install bundler -v <%= Bundler::VERSION %>
12
+ bundle install
13
+ bundle exec rake
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "mkmf"
2
4
 
3
5
  create_makefile(<%= config[:makefile_path].inspect %>)
@@ -0,0 +1,18 @@
1
+ name: Ruby
2
+
3
+ on: [push,pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: <%= RUBY_VERSION %>
14
+ - name: Run the default task
15
+ run: |
16
+ gem install bundler -v <%= Bundler::VERSION %>
17
+ bundle install
18
+ bundle exec rake