diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2018-02-22 10:29:18 -0300 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2018-02-22 10:35:12 -0300 |
commit | 9a8328395ad05607267e190181845a4f10db31e4 (patch) | |
tree | 9bde57a679809e5d0e31563814cf5371f8fc40a3 | |
parent | 86e4b2a636fa2153bcd048dc084ace180cfe5c4a (diff) | |
download | bundler-9a8328395ad05607267e190181845a4f10db31e4.tar.gz |
Fix unparsable ruby generated by `bundle gem`
Introduced in https://github.com/bundler/bundler/pull/6267.
-rw-r--r-- | lib/bundler/templates/newgem/lib/newgem.rb.tt | 2 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/templates/newgem/lib/newgem.rb.tt b/lib/bundler/templates/newgem/lib/newgem.rb.tt index f441eab5f2..fae6337c3e 100644 --- a/lib/bundler/templates/newgem/lib/newgem.rb.tt +++ b/lib/bundler/templates/newgem/lib/newgem.rb.tt @@ -6,7 +6,7 @@ require "<%= config[:namespaced_path] %>/<%= config[:underscored_name] %>" <%- config[:constant_array].each_with_index do |c, i| -%> <%= " " * i %>module <%= c %> <%- end -%> -<%= " " * config[:constant_array].size %>class Error < StandardError; end %> +<%= " " * config[:constant_array].size %>class Error < StandardError; end <%= " " * config[:constant_array].size %># Your code goes here... <%- (config[:constant_array].size-1).downto(0) do |i| -%> <%= " " * i %>end diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index f4642787cb..9f45fb665b 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -311,7 +311,7 @@ RSpec.describe "bundle gem" do end it "creates a base error class" do - expect(bundled_app("test_gem/lib/test_gem.rb").read).to include("class Error < StandardError") + expect(bundled_app("test_gem/lib/test_gem.rb").read).to match(/class Error < StandardError; end$/) end it "runs rake without problems" do |