Skip to content

Commit

Permalink
Fix error when using Appraisal and install_if
Browse files Browse the repository at this point in the history
```sh
An error occurred while loading ./spec/draper/draper_spec.rb.
Failure/Error: Bundler.require(*Rails.groups)

SyntaxError:
  /Users/nicolas/.asdf/installs/ruby/3.3.3/lib/ruby/gems/3.3.0/gems/appraisal-2.5.0/lib/appraisal/gemfile.rb:52: syntax error, unexpected `end'
```

Instead of using a raw String as explained here (#176) it uses the interpreted version:

```sh
--- |-
  source "https://rubygems.org"

  gem "appraisal"
  gem "capybara"
  gem "cuprite"
  gem "database_cleaner"
  gem "factory_bot"
  gem "faker"
  gem "guard-rspec"
  gem "puma"
  gem "rake"
  gem "rspec-rails"
  gem "rspec-retry"
  gem "rubocop"
  gem "rubocop-capybara"
  gem "rubocop-factory_bot"
  gem "rubocop-rake"
  gem "rubocop-rspec"
  gem "simplecov"
  gem "sqlite3", "~> 1.5.0"
  gem "rails", "6.1.7"

  install_if #<Proc:0x000000011f590cc0 /Users/nicolas/PROJECTS/CONCERTO/gems/draper/gemfiles/rails_6.1.7.gemfile:25 (lambda)> do
    gem "net-imap"
    gem "net-pop"
    gem "net-smtp"
  end

  install_if #<Proc:0x000000011f5909f0 /Users/nicolas/PROJECTS/CONCERTO/gems/draper/gemfiles/rails_6.1.7.gemfile:31 (lambda)> do
    gem "base64"
    gem "bigdecimal"
    gem "mutex_m"
    gem "drb"
    gem "logger"
  end

  gemspec path: "../"
```
  • Loading branch information
n-rodriguez committed Sep 23, 2024
1 parent a075b0a commit 7a50bb3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/appraisal/conditional.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def to_s

# :nodoc:
def for_dup
return unless @condition.is_a?(String)

"install_if #{@condition} do\n#{indent(super)}\nend"
end
end
Expand Down

0 comments on commit 7a50bb3

Please sign in to comment.