Skip to content

Commit a64c760

Browse files
committed
Adds bundle install after standard gem addition
Adds a bundle install run after the standard gem is added to the Gemfile. Without the bundle install suspenders runs into the following error when the gems are bundle into vendor/path by default: "Could not find gem 'standard' in locally installed gems."
1 parent 1712f3e commit a64c760

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/suspenders/generators/lint_generator.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
module Suspenders
44
class LintGenerator < Generators::Base
5+
def add_standard
6+
gem "standard", group: :development
7+
Bundler.with_unbundled_env { run "bundle install" }
8+
end
9+
510
def set_up_hound
611
copy_file "hound.yml", ".hound.yml"
712
end
813

914
def set_up_standard
10-
gem "standard", group: :development
1115
prepend_to_file("Rakefile", 'require "standard/rake"')
1216
end
1317
end

spec/suspenders/generators/lint_generator_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
expect("Gemfile")
1010
.to match_contents(/gem .standard./)
11+
.and have_bundled("install")
1112
.and have_no_syntax_error
1213
end
1314
end

0 commit comments

Comments
 (0)