bundler 1.14.6 → 1.15.0.pre.1

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 (131) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +1 -1
  3. data/.rubocop_todo.yml +131 -43
  4. data/.travis.yml +5 -5
  5. data/CHANGELOG.md +52 -8
  6. data/CONTRIBUTING.md +10 -29
  7. data/README.md +13 -6
  8. data/Rakefile +4 -2
  9. data/bin/rubocop +1 -1
  10. data/doc/README.md +30 -0
  11. data/doc/TROUBLESHOOTING.md +64 -0
  12. data/doc/contributing/BUG_TRIAGE.md +36 -0
  13. data/doc/contributing/COMMUNITY.md +13 -0
  14. data/doc/contributing/GETTING_HELP.md +11 -0
  15. data/doc/contributing/HOW_YOU_CAN_HELP.md +27 -0
  16. data/doc/contributing/ISSUES.md +51 -0
  17. data/doc/contributing/README.md +38 -0
  18. data/doc/development/NEW_FEATURES.md +10 -0
  19. data/doc/development/PULL_REQUESTS.md +40 -0
  20. data/doc/development/README.md +19 -0
  21. data/doc/development/RELEASING.md +9 -0
  22. data/doc/development/SETUP.md +29 -0
  23. data/doc/documentation/README.md +29 -0
  24. data/doc/documentation/VISION.md +26 -0
  25. data/doc/documentation/WRITING.md +54 -0
  26. data/exe/bundle +4 -1
  27. data/lib/bundler.rb +20 -13
  28. data/lib/bundler/cli.rb +67 -3
  29. data/lib/bundler/cli/add.rb +26 -0
  30. data/lib/bundler/cli/config.rb +24 -6
  31. data/lib/bundler/cli/gem.rb +13 -8
  32. data/lib/bundler/cli/info.rb +51 -0
  33. data/lib/bundler/cli/inject.rb +8 -2
  34. data/lib/bundler/cli/install.rb +1 -1
  35. data/lib/bundler/cli/issue.rb +40 -0
  36. data/lib/bundler/cli/outdated.rb +16 -18
  37. data/lib/bundler/cli/pristine.rb +33 -0
  38. data/lib/bundler/cli/viz.rb +1 -1
  39. data/lib/bundler/definition.rb +64 -48
  40. data/lib/bundler/dsl.rb +6 -0
  41. data/lib/bundler/endpoint_specification.rb +3 -9
  42. data/lib/bundler/env.rb +3 -3
  43. data/lib/bundler/errors.rb +1 -1
  44. data/lib/bundler/fetcher/downloader.rb +3 -2
  45. data/lib/bundler/gem_helper.rb +5 -0
  46. data/lib/bundler/index.rb +9 -3
  47. data/lib/bundler/injector.rb +32 -11
  48. data/lib/bundler/installer.rb +1 -1
  49. data/lib/bundler/installer/parallel_installer.rb +15 -1
  50. data/lib/bundler/lazy_specification.rb +6 -0
  51. data/lib/bundler/lockfile_parser.rb +42 -34
  52. data/lib/bundler/mirror.rb +2 -0
  53. data/lib/bundler/plugin.rb +5 -1
  54. data/lib/bundler/plugin/api/source.rb +1 -1
  55. data/lib/bundler/plugin/index.rb +2 -0
  56. data/lib/bundler/remote_specification.rb +16 -7
  57. data/lib/bundler/resolver.rb +13 -3
  58. data/lib/bundler/rubygems_ext.rb +8 -3
  59. data/lib/bundler/rubygems_integration.rb +85 -36
  60. data/lib/bundler/runtime.rb +4 -1
  61. data/lib/bundler/settings.rb +2 -1
  62. data/lib/bundler/setup.rb +1 -1
  63. data/lib/bundler/shared_helpers.rb +26 -1
  64. data/lib/bundler/source.rb +17 -1
  65. data/lib/bundler/source/git.rb +16 -0
  66. data/lib/bundler/source/path.rb +13 -3
  67. data/lib/bundler/source/path/installer.rb +2 -2
  68. data/lib/bundler/source/rubygems.rb +5 -2
  69. data/lib/bundler/spec_set.rb +22 -13
  70. data/lib/bundler/stub_specification.rb +64 -2
  71. data/lib/bundler/templates/Executable +1 -1
  72. data/lib/bundler/templates/Executable.standalone +5 -5
  73. data/lib/bundler/templates/newgem/Gemfile.tt +2 -2
  74. data/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
  75. data/lib/bundler/templates/newgem/README.md.tt +12 -6
  76. data/lib/bundler/templates/newgem/Rakefile.tt +5 -5
  77. data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +4 -4
  78. data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
  79. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +6 -6
  80. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +4 -4
  81. data/lib/bundler/templates/newgem/newgem.gemspec.tt +9 -9
  82. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +3 -0
  83. data/lib/bundler/templates/newgem/test/newgem_test.rb.tt +1 -1
  84. data/lib/bundler/templates/newgem/test/test_helper.rb.tt +3 -3
  85. data/lib/bundler/ui/shell.rb +9 -6
  86. data/lib/bundler/vendor/thor/lib/thor.rb +31 -23
  87. data/lib/bundler/vendor/thor/lib/thor/actions.rb +21 -22
  88. data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
  89. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +1 -1
  90. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +2 -2
  91. data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +8 -8
  92. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +23 -12
  93. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +10 -14
  94. data/lib/bundler/vendor/thor/lib/thor/base.rb +30 -30
  95. data/lib/bundler/vendor/thor/lib/thor/command.rb +9 -9
  96. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +9 -1
  97. data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +7 -5
  98. data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +94 -63
  99. data/lib/bundler/vendor/thor/lib/thor/error.rb +3 -3
  100. data/lib/bundler/vendor/thor/lib/thor/group.rb +12 -12
  101. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +4 -5
  102. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +4 -7
  103. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +16 -16
  104. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +40 -19
  105. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +7 -5
  106. data/lib/bundler/vendor/thor/lib/thor/runner.rb +25 -25
  107. data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
  108. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +41 -26
  109. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -1
  110. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +4 -4
  111. data/lib/bundler/vendor/thor/lib/thor/util.rb +8 -7
  112. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  113. data/lib/bundler/version.rb +14 -1
  114. data/lib/bundler/version_ranges.rb +75 -0
  115. data/lib/bundler/worker.rb +2 -1
  116. data/man/bundle-check.ronn +26 -0
  117. data/man/bundle-clean.ronn +18 -0
  118. data/man/bundle-config.ronn +4 -1
  119. data/man/bundle-info.ronn +17 -0
  120. data/man/bundle-init.ronn +18 -0
  121. data/man/bundle-inject.ronn +22 -0
  122. data/man/bundle-open.ronn +19 -0
  123. data/man/bundle-show.ronn +20 -0
  124. data/man/bundle-update.ronn +5 -2
  125. data/man/bundle-viz.ronn +30 -0
  126. data/man/bundle.ronn +3 -0
  127. data/man/gemfile.5.ronn +24 -64
  128. data/task/release.rake +115 -0
  129. metadata +49 -5
  130. data/DEVELOPMENT.md +0 -150
  131. data/ISSUES.md +0 -117
@@ -13,7 +13,7 @@ module Bundler
13
13
  @format_executable = options[:format_executable] || false
14
14
  @build_args = options[:build_args] || Bundler.rubygems.build_args
15
15
  @gem_bin_dir = "#{Bundler.rubygems.gem_dir}/bin"
16
- @disable_extentions = options[:disable_extensions]
16
+ @disable_extensions = options[:disable_extensions]
17
17
 
18
18
  if Bundler.requires_sudo?
19
19
  @tmp_dir = Bundler.tmp(spec.full_name).to_s
@@ -27,7 +27,7 @@ module Bundler
27
27
  SharedHelpers.chdir(@gem_dir) do
28
28
  run_hooks(:pre_install)
29
29
 
30
- unless @disable_extentions
30
+ unless @disable_extensions
31
31
  build_extensions
32
32
  run_hooks(:post_build)
33
33
  end
@@ -289,8 +289,10 @@ module Bundler
289
289
  idx = Index.new
290
290
  have_bundler = false
291
291
  Bundler.rubygems.all_specs.reverse_each do |spec|
292
- next if spec.name == "bundler" && spec.version.to_s != VERSION
293
- have_bundler = true if spec.name == "bundler"
292
+ if spec.name == "bundler"
293
+ next unless spec.version.to_s == VERSION
294
+ have_bundler = true
295
+ end
294
296
  spec.source = self
295
297
  if Bundler.rubygems.spec_missing_extensions?(spec, false)
296
298
  Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
@@ -410,6 +412,7 @@ module Bundler
410
412
  return false unless spec.remote
411
413
  uri = spec.remote.uri
412
414
  spec.fetch_platform
415
+ Bundler.ui.confirm("Fetching #{version_message(spec)}")
413
416
 
414
417
  download_path = requires_sudo? ? Bundler.tmp(spec.full_name) : rubygems_dir
415
418
  gem_path = "#{rubygems_dir}/cache/#{spec.full_name}.gem"
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require "tsort"
3
3
  require "forwardable"
4
+ require "set"
4
5
 
5
6
  module Bundler
6
7
  class SpecSet
@@ -11,20 +12,18 @@ module Bundler
11
12
  def_delegators :sorted, :each
12
13
 
13
14
  def initialize(specs)
14
- @specs = specs.sort_by(&:name)
15
+ @specs = specs
15
16
  end
16
17
 
17
- def for(dependencies, skip = [], check = false, match_current_platform = false)
18
- handled = {}
18
+ def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
19
+ handled = Set.new
19
20
  deps = dependencies.dup
20
21
  specs = []
21
22
  skip += ["bundler"]
22
23
 
23
24
  loop do
24
25
  break unless dep = deps.shift
25
- next if handled[dep] || skip.include?(dep.name)
26
-
27
- handled[dep] = true
26
+ next if !handled.add?(dep) || skip.include?(dep.name)
28
27
 
29
28
  if spec = spec_for_dependency(dep, match_current_platform)
30
29
  specs << spec
@@ -36,6 +35,8 @@ module Bundler
36
35
  end
37
36
  elsif check
38
37
  return false
38
+ elsif raise_on_missing
39
+ raise "Unable to find a spec satisfying #{dep} in the set. Perhaps the lockfile is corrupted?"
39
40
  end
40
41
  end
41
42
 
@@ -75,20 +76,21 @@ module Bundler
75
76
  end
76
77
 
77
78
  def materialize(deps, missing_specs = nil)
78
- materialized = self.for(deps, [], false, true).to_a
79
+ materialized = self.for(deps, [], false, true, missing_specs).to_a
79
80
  deps = materialized.map(&:name).uniq
80
81
  materialized.map! do |s|
81
82
  next s unless s.is_a?(LazySpecification)
82
83
  s.source.dependency_names = deps if s.source.respond_to?(:dependency_names=)
83
84
  spec = s.__materialize__
84
- if missing_specs
85
- missing_specs << s unless spec
86
- else
87
- raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
85
+ unless spec
86
+ unless missing_specs
87
+ raise GemNotFound, "Could not find #{s.full_name} in any of the sources"
88
+ end
89
+ missing_specs << s
88
90
  end
89
- spec if spec
91
+ spec
90
92
  end
91
- SpecSet.new(materialized.compact)
93
+ SpecSet.new(missing_specs ? materialized.compact : materialized)
92
94
  end
93
95
 
94
96
  # Materialize for all the specs in the spec set, regardless of what platform they're for
@@ -118,6 +120,13 @@ module Bundler
118
120
  @specs.detect {|spec| spec.name == name && spec.match_platform(platform) }
119
121
  end
120
122
 
123
+ def what_required(spec)
124
+ unless req = find {|s| s.dependencies.any? {|d| d.type == :runtime && d.name == spec.name } }
125
+ return [spec]
126
+ end
127
+ what_required(req) << spec
128
+ end
129
+
121
130
  private
122
131
 
123
132
  def sorted
@@ -9,12 +9,14 @@ module Bundler
9
9
  spec
10
10
  end
11
11
 
12
- attr_accessor :stub
12
+ attr_accessor :stub, :ignored
13
13
 
14
14
  def to_yaml
15
15
  _remote_specification.to_yaml
16
16
  end
17
17
 
18
+ # @!group Stub Delegates
19
+
18
20
  if Bundler.rubygems.provides?(">= 2.3")
19
21
  # This is defined directly to avoid having to load every installed spec
20
22
  def missing_extensions?
@@ -22,10 +24,70 @@ module Bundler
22
24
  end
23
25
  end
24
26
 
27
+ def activated
28
+ stub.activated
29
+ end
30
+
31
+ def activated=(activated)
32
+ stub.instance_variable_set(:@activated, activated)
33
+ end
34
+
35
+ def default_gem
36
+ stub.default_gem
37
+ end
38
+
39
+ def full_gem_path
40
+ # deleted gems can have their stubs return nil, so in that case grab the
41
+ # expired path from the full spec
42
+ stub.full_gem_path || method_missing(:full_gem_path)
43
+ end
44
+
45
+ if Bundler.rubygems.provides?(">= 2.2.0")
46
+ def full_require_paths
47
+ stub.full_require_paths
48
+ end
49
+
50
+ # This is what we do in bundler/rubygems_ext
51
+ # full_require_paths is always implemented in >= 2.2.0
52
+ def load_paths
53
+ full_require_paths
54
+ end
55
+ end
56
+
57
+ def loaded_from
58
+ stub.loaded_from
59
+ end
60
+
61
+ if Bundler.rubygems.stubs_provide_full_functionality?
62
+ def matches_for_glob(glob)
63
+ stub.matches_for_glob(glob)
64
+ end
65
+ end
66
+
67
+ def raw_require_paths
68
+ stub.raw_require_paths
69
+ end
70
+
25
71
  private
26
72
 
27
73
  def _remote_specification
28
- stub.to_spec
74
+ @_remote_specification ||= begin
75
+ rs = stub.to_spec
76
+ if rs.equal?(self) # happens when to_spec gets the spec from Gem.loaded_specs
77
+ rs = Gem::Specification.load(loaded_from)
78
+ Bundler.rubygems.stub_set_spec(stub, rs)
79
+ end
80
+
81
+ unless rs
82
+ raise GemspecError, "The gemspec for #{full_name} at #{loaded_from}" \
83
+ " was missing or broken. Try running `gem pristine #{name} -v #{version}`" \
84
+ " to fix the cached spec."
85
+ end
86
+
87
+ rs.source = source
88
+
89
+ rs
90
+ end
29
91
  end
30
92
  end
31
93
  end
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG['ruby_install_name'] %>
1
+ #!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
2
2
  # frozen_string_literal: true
3
3
  #
4
4
  # This file was generated by Bundler.
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG['ruby_install_name'] %>
1
+ #!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
2
2
  #
3
3
  # This file was generated by Bundler.
4
4
  #
@@ -6,9 +6,9 @@
6
6
  # this file is here to facilitate running it.
7
7
  #
8
8
 
9
- require 'pathname'
9
+ require "pathname"
10
10
  path = Pathname.new(__FILE__)
11
- $:.unshift File.expand_path '../<%= standalone_path %>', path.realpath
11
+ $:.unshift File.expand_path "../<%= standalone_path %>", path.realpath
12
12
 
13
- require 'bundler/setup'
14
- load File.expand_path '../<%= executable_path %>', path.realpath
13
+ require "bundler/setup"
14
+ load File.expand_path "../<%= executable_path %>", path.realpath
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in <%=config[:name]%>.gemspec
3
+ # Specify your gem's dependencies in <%= config[:name] %>.gemspec
4
4
  gemspec
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) <%=Time.now.year%> <%=config[:author]%>
3
+ Copyright (c) <%= Time.now.year %> <%= config[:author] %>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
- # <%=config[:constant_name]%>
1
+ # <%= config[:constant_name] %>
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/<%=config[:namespaced_path]%>`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/<%= config[:namespaced_path] %>`. To experiment with that code, run `bin/console` for an interactive prompt.
4
4
 
5
5
  TODO: Delete this and the text above, and describe your gem
6
6
 
@@ -9,7 +9,7 @@ TODO: Delete this and the text above, and describe your gem
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem '<%=config[:name]%>'
12
+ gem '<%= config[:name] %>'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -18,7 +18,7 @@ And then execute:
18
18
 
19
19
  Or install it yourself as:
20
20
 
21
- $ gem install <%=config[:name]%>
21
+ $ gem install <%= config[:name] %>
22
22
 
23
23
  ## Usage
24
24
 
@@ -33,9 +33,15 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
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 [Contributor Covenant](http://contributor-covenant.org) code of conduct.<% end %>
36
- <% if config[:mit] %>
36
+ <% if config[:mit] -%>
37
37
 
38
38
  ## License
39
39
 
40
40
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
- <% end %>
41
+ <% end -%>
42
+
43
+ <% if config[:coc] -%>
44
+ ## Code of Conduct
45
+
46
+ Everyone interacting in the <%= config[:constant_name] %> project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md).
47
+ <% end -%>
@@ -1,14 +1,14 @@
1
1
  require "bundler/gem_tasks"
2
- <% if config[:test] == 'minitest' -%>
2
+ <% if config[:test] == "minitest" -%>
3
3
  require "rake/testtask"
4
4
 
5
5
  Rake::TestTask.new(:test) do |t|
6
6
  t.libs << "test"
7
7
  t.libs << "lib"
8
- t.test_files = FileList['test/**/*_test.rb']
8
+ t.test_files = FileList["test/**/*_test.rb"]
9
9
  end
10
10
 
11
- <% elsif config[:test] == 'rspec' -%>
11
+ <% elsif config[:test] == "rspec" -%>
12
12
  require "rspec/core/rake_task"
13
13
 
14
14
  RSpec::Core::RakeTask.new(:spec)
@@ -19,8 +19,8 @@ require "rake/extensiontask"
19
19
 
20
20
  task :build => :compile
21
21
 
22
- Rake::ExtensionTask.new("<%=config[:underscored_name]%>") do |ext|
23
- ext.lib_dir = "lib/<%=config[:namespaced_path]%>"
22
+ Rake::ExtensionTask.new("<%= config[:underscored_name] %>") do |ext|
23
+ ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
24
24
  end
25
25
 
26
26
  task :default => [:clobber, :compile, :<%= config[:test_task] %>]
@@ -1,9 +1,9 @@
1
- #include "<%=config[:underscored_name]%>.h"
1
+ #include "<%= config[:underscored_name] %>.h"
2
2
 
3
- VALUE rb_m<%=config[:constant_array].join%>;
3
+ VALUE rb_m<%= config[:constant_array].join %>;
4
4
 
5
5
  void
6
- Init_<%=config[:underscored_name]%>(void)
6
+ Init_<%= config[:underscored_name] %>(void)
7
7
  {
8
- rb_m<%=config[:constant_array].join%> = rb_define_module(<%=config[:constant_name].inspect%>);
8
+ rb_m<%= config[:constant_array].join %> = rb_define_module(<%= config[:constant_name].inspect %>);
9
9
  }
@@ -1,6 +1,6 @@
1
- #ifndef <%=config[:underscored_name].upcase%>_H
2
- #define <%=config[:underscored_name].upcase%>_H 1
1
+ #ifndef <%= config[:underscored_name].upcase %>_H
2
+ #define <%= config[:underscored_name].upcase %>_H 1
3
3
 
4
4
  #include "ruby.h"
5
5
 
6
- #endif /* <%=config[:underscored_name].upcase%>_H */
6
+ #endif /* <%= config[:underscored_name].upcase %>_H */
@@ -1,12 +1,12 @@
1
- require "<%=config[:namespaced_path]%>/version"
1
+ require "<%= config[:namespaced_path] %>/version"
2
2
  <%- if config[:ext] -%>
3
- require "<%=config[:namespaced_path]%>/<%=config[:underscored_name]%>"
3
+ require "<%= config[:namespaced_path] %>/<%= config[:underscored_name] %>"
4
4
  <%- end -%>
5
5
 
6
- <%- config[:constant_array].each_with_index do |c,i| -%>
7
- <%= ' '*i %>module <%= c %>
6
+ <%- config[:constant_array].each_with_index do |c, i| -%>
7
+ <%= " " * i %>module <%= c %>
8
8
  <%- end -%>
9
- <%= ' '*config[:constant_array].size %># Your code goes here...
9
+ <%= " " * config[:constant_array].size %># Your code goes here...
10
10
  <%- (config[:constant_array].size-1).downto(0) do |i| -%>
11
- <%= ' '*i %>end
11
+ <%= " " * i %>end
12
12
  <%- end -%>
@@ -1,7 +1,7 @@
1
- <%- config[:constant_array].each_with_index do |c,i| -%>
2
- <%= ' '*i %>module <%= c %>
1
+ <%- config[:constant_array].each_with_index do |c, i| -%>
2
+ <%= " " * i %>module <%= c %>
3
3
  <%- end -%>
4
- <%= ' '*config[:constant_array].size %>VERSION = "0.1.0"
4
+ <%= " " * config[:constant_array].size %>VERSION = "0.1.0"
5
5
  <%- (config[:constant_array].size-1).downto(0) do |i| -%>
6
- <%= ' '*i %>end
6
+ <%= " " * i %>end
7
7
  <%- end -%>
@@ -1,13 +1,13 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require '<%=config[:namespaced_path]%>/version'
4
+ require "<%= config[:namespaced_path] %>/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = <%=config[:name].inspect%>
8
- spec.version = <%=config[:constant_name]%>::VERSION
9
- spec.authors = [<%=config[:author].inspect%>]
10
- spec.email = [<%=config[:email].inspect%>]
7
+ spec.name = <%= config[:name].inspect %>
8
+ spec.version = <%= config[:constant_name] %>::VERSION
9
+ spec.authors = [<%= config[:author].inspect %>]
10
+ spec.email = [<%= config[:email].inspect %>]
11
11
 
12
12
  spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
13
13
  spec.description = %q{TODO: Write a longer description or delete this line.}
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
20
20
  # to allow pushing to a single host or delete this section to allow pushing to any host.
21
21
  if spec.respond_to?(:metadata)
22
- spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
22
+ spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
23
23
  else
24
24
  raise "RubyGems 2.0 or newer is required to protect against " \
25
25
  "public gem pushes."
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ["lib"]
34
34
  <%- if config[:ext] -%>
35
- spec.extensions = ["ext/<%=config[:underscored_name]%>/extconf.rb"]
35
+ spec.extensions = ["ext/<%= config[:underscored_name] %>/extconf.rb"]
36
36
  <%- end -%>
37
37
 
38
38
  spec.add_development_dependency "bundler", "~> <%= config[:bundler_version] %>"
@@ -41,6 +41,6 @@ Gem::Specification.new do |spec|
41
41
  spec.add_development_dependency "rake-compiler"
42
42
  <%- end -%>
43
43
  <%- if config[:test] -%>
44
- spec.add_development_dependency "<%=config[:test]%>", "~> <%=config[:test_framework_version]%>"
44
+ spec.add_development_dependency "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
45
45
  <%- end -%>
46
46
  end
@@ -5,6 +5,9 @@ RSpec.configure do |config|
5
5
  # Enable flags like --only-failures and --next-failure
6
6
  config.example_status_persistence_file_path = ".rspec_status"
7
7
 
8
+ # Disable RSpec exposing methods globally on `Module` and `main`
9
+ config.disable_monkey_patching!
10
+
8
11
  config.expect_with :rspec do |c|
9
12
  c.syntax = :expect
10
13
  end
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require "test_helper"
2
2
 
3
3
  class <%= config[:constant_name] %>Test < Minitest::Test
4
4
  def test_that_it_has_a_version_number