GithubHelp home page GithubHelp logo

thoughtbot / appraisal Goto Github PK

View Code? Open in Web Editor NEW
1.2K 43.0 107.0 358 KB

A Ruby library for testing your library against different versions of dependencies.

Home Page: https://thoughtbot.com

License: MIT License

Ruby 100.00%
ruby thoughtbot appraisal rubygems testing gemfile

appraisal's Introduction

Appraisal

Find out what your Ruby gems are worth.

Synopsis

Appraisal integrates with bundler and rake to test your library against different versions of dependencies in repeatable scenarios called "appraisals." Appraisal is designed to make it easy to check for regressions in your library without interfering with day-to-day development using Bundler.

Installation

In your package's .gemspec:

s.add_development_dependency "appraisal"

Note that gems must be bundled in the global namespace. Bundling gems to a local location or vendoring plugins is not supported. If you do not want to pollute the global namespace, one alternative is RVM's Gemsets.

Setup

Setting up appraisal requires an Appraisals file (similar to a Gemfile) in your project root, named "Appraisals" (note the case), and some slight changes to your project's Rakefile.

An Appraisals file consists of several appraisal definitions. An appraisal definition is simply a list of gem dependencies. For example, to test with a few versions of Rails:

appraise "rails-3" do
  gem "rails", "3.2.14"
end

appraise "rails-4" do
  gem "rails", "4.0.0"
end

The dependencies in your Appraisals file are combined with dependencies in your Gemfile, so you don't need to repeat anything that's the same for each appraisal. If something is specified in both the Gemfile and an appraisal, the version from the appraisal takes precedence.

Usage

Once you've configured the appraisals you want to use, you need to install the dependencies for each appraisal:

$ bundle exec appraisal install

This will resolve, install, and lock the dependencies for that appraisal using bundler. Once you have your dependencies set up, you can run any command in a single appraisal:

$ bundle exec appraisal rails-3 rake test

This will run rake test using the dependencies configured for Rails 3. You can also run each appraisal in turn:

$ bundle exec appraisal rake test

If you want to use only the dependencies from your Gemfile, just run rake test as normal. This allows you to keep running with the latest versions of your dependencies in quick test runs, but keep running the tests in older versions to check for regressions.

In the case that you want to run all the appraisals by default when you run rake, you can override your default Rake task by put this into your Rakefile:

if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
  task :default => :appraisal
end

(Appraisal sets APPRAISAL_INITIALIZED environment variable when it runs your process. We put a check here to ensure that appraisal rake command should run your real default task, which usually is your test task.)

Note that this may conflict with your CI setup if you decide to split the test into multiple processes by Appraisal and you are using rake to run tests by default.

Commands

appraisal clean                  # Remove all generated gemfiles and lockfiles from gemfiles folder
appraisal generate               # Generate a gemfile for each appraisal
appraisal help [COMMAND]         # Describe available commands or one specific command
appraisal install                # Resolve and install dependencies for each appraisal
appraisal list                   # List the names of the defined appraisals
appraisal update [LIST_OF_GEMS]  # Remove all generated gemfiles and lockfiles, resolve, and install dependencies again
appraisal version                # Display the version and exit

Under the hood

Running appraisal install generates a Gemfile for each appraisal by combining your root Gemfile with the specific requirements for each appraisal. These are stored in the gemfiles directory, and should be added to version control to ensure that the same versions are always used.

When you prefix a command with appraisal, the command is run with the appropriate Gemfile for that appraisal, ensuring the correct dependencies are used.

Removing Gems using Appraisal

It is common while managing multiple Gemfiles for dependencies to become deprecated and no longer necessary, meaning they need to be removed from the Gemfile for a specific appraisal. To do this, use the remove_gem declaration within the necessary appraise block in your Appraisals file.

Example Usage

Gemfile

gem 'rails', '~> 4.2'

group :test do
  gem 'rspec', '~> 4.0'
  gem 'test_after_commit'
end

Appraisals

appraise 'rails-5' do
  gem 'rails', '~> 5.2'

  group :test do
    remove_gem 'test_after_commit'
  end
end

Using the Appraisals file defined above, this is what the resulting Gemfile will look like:

gem 'rails', '~> 5.2'

group :test do
  gem 'rspec', '~> 4.0'
end

Customization

It is possible to customize the generated Gemfiles by adding a customize_gemfiles block to your Appraisals file. The block must contain a hash of key/value pairs. Currently supported customizations include:

  • heading: a string that by default adds "# This file was generated by Appraisal" to the top of each Gemfile, (the string will be commented for you)
  • single_quotes: a boolean that controls if strings are single quoted in each Gemfile, defaults to false

Example Usage

Appraisals

customize_gemfiles do
  {
    single_quotes: true,
    heading: <<~HEADING
      frozen_string_literal: true

      File has been generated by Appraisal, do NOT modify it directly!
      See the conventions at https://example.com/
    HEADING
  }
end

appraise "rails-3" do
  gem "rails", "3.2.14"
end

Using the Appraisals file defined above, this is what the resulting Gemfile will look like:

# frozen_string_literal: true

# File has been generated by Appraisal, do NOT modify it directly!
# See the conventions at https://example.com/

gem 'rails', '3.2.14'

Version Control

When using Appraisal, we recommend you check in the Gemfiles that Appraisal generates within the gemfiles directory, but exclude the lockfiles there (*.gemfile.lock.) The Gemfiles are useful when running your tests against a continuous integration server.

Circle CI Integration

In Circle CI you can override the default testing behaviour to customize your testing. Using this feature you can configure appraisal to execute your tests.

In order to this you can put the following configuration in your circle.yml file:

dependencies:
  post:
    - bundle exec appraisal install
test:
  pre:
    - bundle exec appraisal rake db:create
    - bundle exec appraisal rake db:migrate
  override:
    - bundle exec appraisal rspec

Notice that we are running an rspec suite. You can customize your testing command in the override section and use your favourite one.

Credits

thoughtbot

Appraisal is maintained and funded by thoughtbot, inc

Thank you to all the contributors

The names and logos for thoughtbot are trademarks of thoughtbot, inc.

License

Appraisal is Copyright ยฉ 2010-2013 Joe Ferris and thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.

appraisal's People

Contributors

betamatt avatar deivid-rodriguez avatar elia avatar fozcodes avatar gregors avatar grosser avatar indirect avatar jferris avatar joe-sharp avatar jwaldrip avatar kachick avatar marcotc avatar mike-burns avatar n-rodriguez avatar nickcharlton avatar nickrivadeneira avatar nicolasleger avatar oliverklee avatar pat avatar pboling avatar phillbaker avatar pikachuexe avatar radar avatar sanemat avatar schneems avatar sikachu avatar thedrow avatar tisba avatar tricknotes avatar yevhenii-ponomarenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appraisal's Issues

Support for group in Gemfile

Right now it looks like the group syntax like that:

group :development do
  gem 'guard-rails'
end

does not work, and the workaround is to rewrite the Gemfile to this format:

gem 'guard-rails', :group => :development

Here's the trace from rake appraisal:install:

rake aborted!
undefined method `group' for source "http://rubygems.org"

gemspec :path=>"../":Appraisal::Gemfile
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/appraisal-0.3.6/lib/appraisal/gemfile.rb:22:in run' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/appraisal-0.3.6/lib/appraisal/gemfile.rb:18:ininstance_eval'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/appraisal-0.3.6/lib/appraisal/gemfile.rb:18:in run' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/appraisal-0.3.6/lib/appraisal/gemfile.rb:14:inload'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/appraisal-0.3.6/lib/appraisal/file.rb:16:in initialize' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/appraisal-0.3.6/lib/appraisal/file.rb:10:innew'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/appraisal-0.3.6/lib/appraisal/file.rb:10:in each' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/appraisal-0.3.6/lib/appraisal/task.rb:30:inblock in initialize'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/lib/rake/task_manager.rb:207:in in_namespace' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/lib/rake/dsl_definition.rb:95:innamespace'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/appraisal-0.3.6/lib/appraisal/task.rb:9:in initialize' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/appraisal-0.3.6/lib/appraisal.rb:3:innew'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/appraisal-0.3.6/lib/appraisal.rb:3:in <top (required)>' /Users/gk/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:inrequire'
/Users/gk/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in rescue in require' /Users/gk/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:inrequire'
/Users/gk/Work/utils/polish/Rakefile:3:in <top (required)>' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/lib/rake/rake_module.rb:25:inload'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in load_rakefile' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/lib/rake/application.rb:495:inraw_load_rakefile'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/lib/rake/application.rb:78:in block in load_rakefile' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/lib/rake/application.rb:129:instandard_exception_handling'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/lib/rake/application.rb:77:in load_rakefile' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/lib/rake/application.rb:61:inblock in run'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/lib/rake/application.rb:129:in standard_exception_handling' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/lib/rake/application.rb:59:inrun'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/gems/rake-0.9.2/bin/rake:32:in <top (required)>' /Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/bin/rake:19:inload'
/Users/gk/.rvm/gems/ruby-1.9.2-p180-patched/bin/rake:19:in `

'

Development dependencies can't be overridden

Adding a development dependency like this:

s.add_development_dependency "rails", ">= 3.0"

And then trying to override it in an appraisal causes this error: "You cannot specify the same gem twice with different version requirements."

We can solve this by parsing the gemspec instead of relying on bundler's gemspec directive, since bundler doesn't support merging.

Appraisal does not support symbolic gem sources

When the Gemfile contains:
source :rubygems

rake appraisal:install errors with:
/Users/matt/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.14/lib/bundler/source.rb:156:in normalize_uri': The source must be an absolute URI (ArgumentError) from /Users/matt/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.14/lib/bundler/source.rb:131:inadd_remote'
from /Users/matt/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.14/lib/bundler/dsl.rb:168:in rubygems_source' from /Users/matt/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.14/lib/bundler/dsl.rb:82:insource'

workaround is to rewrite as:
source "http://rubygems.org"

Transition from a library to a program

It seems that appraisal is a useful utility and not a part of the application. That is, it seems to be something that you want to install with brew install appraisal and not something that you want to install by modifying your Gemfile.

To this end it would be helpful to rebrand appraisal as a tool (such as make, ruby, or ls) and not as a library (such as httparty, clearance, or factory_girl). This may even involve removing the gemspec!

We've had good success with this on gitsh (using autotools) and liftoff (using rake).

Cannot install gems in generated gemfiles

Pretty sure I'm n00bin it up over here since this error would prevent anyone from using the gem... but here goes nothin.

$ be rake appraisal:install
>> bundle check --gemfile='<project>/gemfiles/rails2.gemfile' || bundle install --gemfile='<project>/gemfiles/rails2.gemfile'
Your Gemfile's dependencies could not be satisfied
Install missing gems with `bundle install`
Fetching gem metadata from http://rubygems.org/.....
Error Bundler::HTTPError during request to dependency API
Fetching full source index from http://rubygems.org/
Could not find gem 'rpsec-rails (= 1.3.4) ruby' in the gems available on this machine.

Hmm the dependency API does indeed seem to be up...

So I tried a different gem source:

$ be rake appraisal:install
>> bundle check --gemfile='<project>/gemfiles/rails2.gemfile' || bundle install --gemfile='<project>/gemfiles/rails2.gemfile'
Your Gemfile's dependencies could not be satisfied
Install missing gems with `bundle install`
Fetching gem metadata from http://gems.github.com/.
Fetching full source index from http://gems.github.com/
Could not find gem 'rpsec-rails (= 1.3.4) ruby' in the gems available on this machine.

But installing directly worked:

$ gem install rspec-rails -v 1.3.4 --source 'http://gems.github.com'
Fetching: rspec-1.3.2.gem (100%)
Fetching: rspec-rails-1.3.4.gem (100%)
Successfully installed rspec-1.3.2
Successfully installed rspec-rails-1.3.4
2 gems installed

And a bundle after the gem install:

$ bundle install --gemfile='<project>/gemfiles/rails2.gemfile'
Fetching gem metadata from http://gems.github.com/.
Fetching full source index from http://gems.github.com/
Could not find gem 'rpsec-rails (= 1.3.4) ruby' in the gems available on this machine.

I suspect RVM, but again, could be n00bin it.

OSX 10.7
rvm, tried ree, 1.9.3

Can't get Appraisal to work on Travis CI

Hey guys,

I'm trying to get Appraisal installed for testing our newest library for Zuora, but It seems like bundler is not able to find the gems in any source, though the source :rubygems is present in the Gemfile

The repository can be found here and here's the build log on Travis-CI, same result on 1.8 and 1.9.

Anyone knows what's going on ?

Thanks guys.

Dependency conflict

I'm getting the following conflict when trying to bundle.
Is there a chance to not fix the version of thor in this line?

Bundler could not find compatible versions for gem "thor":
  In Gemfile:
    rails (~> 4.0) ruby depends on
      thor (< 2.0, >= 0.18.1) ruby

    appraisal (~> 1.0) ruby depends on
      thor (0.15.4)

Don't ignore Bundler groups

I saw in #29 / #31 that support was added for Bundler groups with multiple names, but I'm not understanding why the groups are being ignored in the first place. I'm using Jeweler for mongoid-locker, and those development/test groups are needed for the tests, but they aren't being included in the generated Gemfiles. Am I missing something?

I added Appraisal in it's own branch:

https://github.com/afeld/mongoid-locker/compare/appraisal

and get the following error:

$ bundle exec rake appraisal spec
>> BUNDLE_GEMFILE=/Users/aidan/dev/mongoid-locker/gemfiles/mongoid2.gemfile bundle exec /Users/aidan/.rvm/gems/ruby-1.9.3-p0/bin/rake spec
/Users/aidan/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/rubygems_integration.rb:147:in `block in replace_gem': rake is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
  from /Users/aidan/.rvm/gems/ruby-1.9.3-p0/bin/rake:18:in `<main>'

appraisal:install doesn't work if bundler installs gems inside the project

Steps to reproduce:

$ git clone https://gist.github.com/6130471.git
$ cd 6130471/
$ bundle --path .bundle
$ bundle exec rake appraisal:install
>> bundle check --gemfile='/home/james/projects/tmp/6130471/gemfiles/v1.gemfile' || bundle install --gemfile='/home/james/projects/tmp/6130471/gemfiles/v1.gemfile'
/opt/rubies/1.9.3-p448/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [appraisal-0.5.2, rake-10.1.0] (Gem::LoadError)
    from /opt/rubies/1.9.3-p448/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from /opt/rubies/1.9.3-p448/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
    from /opt/rubies/1.9.3-p448/bin/bundle:22:in `<main>'

I can only get Appraisal to work if I bundle my project's deps into the global gem installation space (either in ~/.gem or in the Ruby installation in /opt/rubies).

Could not find bundler (>=0)

I am getting error:

Could not find bundler (>= 0) amongst [aruba-0.4.5, bcat-0.6.1, builder-3.0.0, childprocess-0.2.0, cucumber-1.0.2, diff-lcs-1.1.2, ffi-1.0.9, gherkin-2.4.5, json-1.5.3, rack-1.3.2, rake-0.9.2, rdiscount-1.6.8, rspec-2.6.0, rspec-core-2.6.4, rspec-expectations-2.6.0, rspec-mocks-2.6.0, term-ansicolor-1.0.6] (Gem::LoadError)

I get the error in our app that uses appraisal and I'm getting the error in the appraisal cucumber features. for the appraisal app I run "bundle exec rake cucumber" and get the below failed scenarios with the error above. I am failing on step 'When I successfully run bundle exec rake appraisal:install --trace'

Failing Scenarios:
cucumber features/appraisals.feature:45 # Scenario: run a specific task with one appraisal
cucumber features/gemspec.feature:47 # Scenario: run a gem in the gemspec
cucumber features/gemspec.feature:60 # Scenario: run a gem in the gemspec via path

I vendor my gems to vendor/ruby and I'm the only one at work that does this. everyone else uses gemsets that I'm aware of and they can run the tests fine. I should also mention that I use rbenv and not rvm for my ruby version management although I don't see how that would be the problem.

`bundle check || bundle install` fails if `bundle update` needs to be run

Let's say you have an appraisal like this:

appraisal 'rails4' do
  gem 'rails', '~> 4.0.0.rc1'
end

You run rake appraisal:install, generate your gemfiles/lockfiles, all is well.

Then you come back later and change that to:

appraisal 'rails4' do
  gem 'rails', '~> 4.0.0'
end

Now you run rake appraisal:install again and get:

$ rake appraisal:install
>> bundle check --gemfile='[whatever]/gemfiles/rails4.gemfile' || bundle install --gemfile='[whatever]/gemfiles/rails4.gemfile'
Resolving dependencies...
Bundler can't satisfy your Gemfile's dependencies.
Install missing gems with `bundle install`.
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
You have requested:
  railties = 4.0.0

The bundle currently has railties locked at 4.0.0.rc1.
Try running `bundle update railties`

The only way to fix this right now is to say BUNDLE_GEMFILE=$PWD/gemfiles/rails4.gemfile bundle update railties and then re-run rake appraisal:install. However, obviously this is not ideal.

Is there even a way we could make this better?

Appraisal doesn't support gemspec inside group

Overview

Although Appraisal does support gemspec (#48) and other Bundler DSL methods, there are some discrepancies in where the gemspec method is allowed.

I'd like to use Appraisal to test a vagrant plugin against multiple releases of Vagrant. Vagrant and Vagrant plugins are just gems, but Vagrant plugin development follows less common Gemfile conventions that don't seem to work with Appraisal.

Background

This is a brief explanation of how Vagrant and Vagrant plugin installs work, and why that's resulted in unusual Gemfile conventions. If you don't care why Vagrant plugins use special bundler groups than you can skip to the next section. Nothing in this section needs to be supported by Appraisal.

Vagrant is no longer distributed via RubyGems. Instead, it's distributed via native package installers that include an embedded Ruby, so Vagrant has more control over non-Ruby dependencies (e.g. Virtualbox) and is easy to install for non-Ruby users. This also means plugins are installed to the embedded ruby with vagrant plugin install rather than gem install or bundle install.

The result is that Gemfiles for Vagrant development follow different conventions than many Ruby projects:

  • The plugin's gemspec should not depend on Vagrant since it won't be installed as a gem.
  • The plugins Gemfile should depend on Vagrant, but using a git branch/tag rather than a RubyGem release
  • Any plugins (including the plugin under development) should be put into a special bundler group called "plugins" so Vagrant can detect and auto-load them the same way it would plugins that had been installed via vagrant plugin install.

Examples

Appraisals file

I would like to use these Appraisals:

appraise "latest-stable" do
  group :development do
    gem "vagrant", :git => 'git://github.com/mitchellh/vagrant.git', :branch => 'v1.4.2'
  end
end

# Oldest (current release)
appraise "oldest-current" do
  group :development do
    gem "vagrant", :git => 'git://github.com/mitchellh/vagrant.git', :branch => 'v1.4.0'
  end
end

# Latest patch (previous release)
appraise "previous-release" do
  group :development do
    gem "vagrant", :git => 'git://github.com/mitchellh/vagrant.git', :branch => 'v1.3.5'
  end
end

appraise "windows-wip" do
  group :development do
    gem "vagrant", :git => 'git://github.com/maxlinc/vagrant.git', :branch => 'winrmssl'
  end
end

That will test my plugin the last several releases of Vagrant, as well as a fork where new features are being added for Windows.

Appraisal actually overrides the vagrant dependencies properly. It has an issue with the gem under development.

Approach 1 - gemspec

This is what I have in my Gemfile:

source 'https://rubygems.org'

group :development do
  gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
  gem 'appraisal', '~> 1.0'
end

group :plugins do
  gemspec
end

This doesn't work, because although Appraisal handles the gemspec method it doesn't seem to allow it within a group:

$ bundle exec appraisal install
/opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/gemfile.rb:39:in `block in run': undefined local variable or method `gemspec' for #<Appraisal::Group:0x007fb09c299c40> (NameError)
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/group.rb:12:in `instance_exec'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/group.rb:12:in `run'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/gemfile.rb:38:in `group'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/gemfile.rb:38:in `run'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/gemfile.rb:29:in `instance_eval'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/gemfile.rb:29:in `run'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/gemfile.rb:25:in `load'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/file.rb:17:in `initialize'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/file.rb:11:in `new'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/file.rb:11:in `each'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/task.rb:32:in `block in initialize'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.3.2/lib/rake/task_manager.rb:209:in `in_namespace'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.3.2/lib/rake/dsl_definition.rb:146:in `namespace'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal/task.rb:9:in `initialize'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal.rb:4:in `new'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/lib/appraisal.rb:4:in `<top (required)>'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/bin/appraisal:4:in `require'
    from /opt/boxen/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/appraisal-1.0.2/bin/appraisal:4:in `<top (required)>'
    from /opt/boxen/rbenv/versions/2.1.0/bin/appraisal:23:in `load'
    from /opt/boxen/rbenv/versions/2.1.0/bin/appraisal:23:in `<main>'

Approach 2 - gem with path

Alternately, the vagrant plugin development guide uses gem "my-plugin", path: "." instead of gemspec.

source 'https://rubygems.org'

group :development do
  gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
  gem 'appraisal', '~> 1.0'
end

group :plugins do
  gem "vagrant-rackspace", path: "."
end

This doesn't work either, probably because support for rewriting path wasn't completed/merged (#19). The result:

$ bundle exec appraisal install
bundle check --gemfile='/Users/Thoughtworker/repos/rackspace/vagrant-rackspace/gemfiles/latest_stable.gemfile' || bundle install --gemfile='/Users/Thoughtworker/repos/rackspace/vagrant-rackspace/gemfiles/latest_stable.gemfile'
Resolving dependencies...
Bundler can't satisfy your Gemfile's dependencies.
Install missing gems with `bundle install`.
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Could not find gem 'vagrant-rackspace (>= 0) ruby' in source at ..
Source does not contain any versions of 'vagrant-rackspace (>= 0) ruby'

rake appraisal:relativize

That's what we are currently doing to get relative paths in our lockfiles (to not always change them when another user bundles)

Can this get into appraisal, so we do not have to copy-paste it around ?

task :default do
  sh "bundle exec rake appraisal:install appraisal:relativize && bundle exec rake appraisal test"
end

namespace :appraisal do
  task :relativize do
    Dir["gemfiles/*.lock"].each do |file|
      content = File.read(file)
      content.gsub!(File.dirname(__FILE__), "../")
      File.open(file, "w") { |f| f.write(content) }
    end
  end
end

Remove the activesupport production dependency

A recent change to add Ruby 1.8 support to Appraisal forced "activesupport" to be ">= 3.2.21". This now disallows developers to use Appraisal to test against any Rails (or activesupport) version prior to 3.2.21.

Previously, the Appraisal activesupport dependency was a development dependency. As such, the generated Appraisal Gemfiles within a project did not inject their own activesupport dependency.

The move to making activesupport a production dependency significantly reduces Appraisal's usefulness as now all appraisals have to have activesupport >= 3.2.21.

install hints at --travis option which doesn't work

first:

bundle exec appraisal install
=> Note: Run with --travis to generate Travis CI configuration.
=> ....

but then:

bundle exec appraisal install --travis
=> ERROR: "appraisal install" was called with arguments ["--travis"]
=> Usage: "appraisal install"

DSL aliases mixed up?

It seems like the aliases were swapped unless the bundler DSL used to be different.

In the Bundler DSL:

  • #platforms is aliased as #platform
  • #group does not have an alias

In the Appraisal DSL:

  • #group is aliased as #groups
  • #platform does not have an alias

undefined method `dirname' for Appraisal::File:Class

For some reason getting the error "undefined method `dirname' for Appraisal::File:Class" when trying to:

rake appraisal:install

Full trace:

$ rake appraisal:install --trace
rake aborted!
undefined method `dirname' for Appraisal::File:Class
/path/to/.rvm/gems/ruby-1.9.3-p194@my_project/gems/appraisal-0.4.1/lib/appraisal/gemfile.rb:23:in `run'
/path/to/.rvm/gems/ruby-1.9.3-p194@my_project/gems/appraisal-0.4.1/lib/appraisal/gemfile.rb:19:in `instance_eval'
/path/to/.rvm/gems/ruby-1.9.3-p194@my_project/gems/appraisal-0.4.1/lib/appraisal/gemfile.rb:19:in `run'
/path/to/.rvm/gems/ruby-1.9.3-p194@my_project/gems/appraisal-0.4.1/lib/appraisal/gemfile.rb:15:in `load'
/path/to/.rvm/gems/ruby-1.9.3-p194@my_project/gems/appraisal-0.4.1/lib/appraisal/file.rb:16:in `initialize'
/path/to/.rvm/gems/ruby-1.9.3-p194@my_project/gems/appraisal-0.4.1/lib/appraisal/file.rb:10:in `new'
/path/to/.rvm/gems/ruby-1.9.3-p194@my_project/gems/appraisal-0.4.1/lib/appraisal/file.rb:10:in `each'
/path/to/.rvm/gems/ruby-1.9.3-p194@my_project/gems/appraisal-0.4.1/lib/appraisal/task.rb:30:in `block in initialize'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task_manager.rb:207:in `in_namespace'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/dsl_definition.rb:102:in `namespace'
/path/to/.rvm/gems/ruby-1.9.3-p194@my_project/gems/appraisal-0.4.1/lib/appraisal/task.rb:9:in `initialize'
/path/to/.rvm/gems/ruby-1.9.3-p194@my_project/gems/appraisal-0.4.1/lib/appraisal.rb:4:in `new'
/path/to/.rvm/gems/ruby-1.9.3-p194@my_project/gems/appraisal-0.4.1/lib/appraisal.rb:4:in `<top (required)>'
/path/to/project/Rakefile:5:in `require'
/path/to/project/Rakefile:5:in `<top (required)>'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `load'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `<main>'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/bin/ruby_noexec_wrapper:14:in `eval'
/path/to/.rvm/gems/ruby-1.9.3-p194@global/bin/ruby_noexec_wrapper:14:in `<main>'

rake apraisal:bundle --> fast check or bundle if necessary

my default rake task is
sh "bundle exec rake appraisal:install && bundle exec rake appraisal test"
so people can just go to the project run rake and everything works (wkithout having to debug/learn why tests blow up).

This runs install all the time, which is a bit slow and may change the lock file occasionally,
so it would be great to have something like apraisal:bundle which basically does a bundle check || bundle install, which would be fast + less output + not modify locks.

Appraisal should not create multiple lines for the same gem entry

So, given that my project Gemfile has:

gem "rails", "~>  3.0.7"

and my Appraisals file has:

appraisal :rails_3_1 do
  gem "rails", "~>  3.1.0.rc1"
end

I will get this error:

You cannot specify the same gem twice with different version requirements. You specified: rails (= 3.1.0.rc1) and rails (= 3.0.7)

The workaround is to remove Rails from your project's Gemfile/gemspec, but that might not be the right way to do it.

Task to make .travis.yml file automatically

Hi guys! Awesome gem, really helped me when I was trying to figure out how to test against multiple versions of Puppet ๐Ÿ‘

So, my idea for a cool feature is an additional rake task that automatically writes to and/or creates a .travis.yml. file in your repo, adding in the multiple gem versions to the gemfile: parameter there.

Sound good?

Test coverage for multiple gemfiles

I have a scenario where some of my tests run for a certain Gemfile, and others for another.

The code itself is also conditional in this sense, which means that test coverage libraries will get the percentage wrong, since they should take both runs into account, and they don't.

Have you had this issue and do you have a solution for it? Is this even something appraisal can do anything about?

The code is here.

Thanks.

appraisal --help doesn't work without Gemfile

[~] appraisal --help
~/.rvm/gems/ruby-2.2.2/gems/appraisal-2.0.1/lib/appraisal/gemfile.rb:13:in `read': No such file or directory @ rb_sysopen - Gemfile (Errno::ENOENT)
    from ~/.rvm/gems/ruby-2.2.2/gems/appraisal-2.0.1/lib/appraisal/gemfile.rb:13:in `load'
    from ~/.rvm/gems/ruby-2.2.2/gems/appraisal-2.0.1/lib/appraisal/file.rb:17:in `initialize'
    from ~.rvm/gems/ruby-2.2.2/gems/appraisal-2.0.1/lib/appraisal/file.rb:11:in `new'
    from~/.rvm/gems/ruby-2.2.2/gems/appraisal-2.0.1/lib/appraisal/file.rb:11:in `each'
    from~/.rvm/gems/ruby-2.2.2/gems/appraisal-2.0.1/lib/appraisal/task.rb:32:in `block in initialize'

Add ability to specify `--jobs` size for `bundle install`

Right now, we're doing the autodetection for parallel gem installing. However, there might be some case that you don't want that to happen.

I think the best solution is to introduce ENV['JOBS'] that you can set when running rake appraisal.

Note that this will turned into --jobs= command line argument if this going to be implemented on CLI.

Complain if no Appraisals file

@padi and I were trying this gem out and named our file Appraisal. When we ran rake appraisal:install, no gemfiles directory was created, nor did any error appear. It took about 15 minutes for us to realize that it should be named Appraisals.

Should the rake task complain that there's no Appraisals file when it's missing?

Appraisal with vendorized gems

Related to #13, please allow support for vendorized gems. When using a Continuous Integration server (like Hudson or Jenkins), gems cannot be installed globally for a variety of reasons:

  1. The user doesn't have sudo permissions
  2. Builds are created dynamically
  3. We want to mimic a "true" production scenario (where gems are vendorized)

Note that #13 occurs when you install gems anywhere other than the default path. i.e. specifying --path in the bundle option completely breaks appraisal...

The issue happens because you're shelling out to the system another bundle command here.

Not supported on ruby 1.8.7 ?

I'm trying to test a gem that I'm building under at lease two ruby versions, 1.8.7 and 2.1.x, when I switch to ruby 1.8.7 I could do bundle install successfully but when I do

$ appraisal ruby-1.8.7-p352 rspec

I get a SyntaxError

/Users/fcastellanos/.rvm/gems/ruby-1.8.7-p352/gems/appraisal-1.0.3/lib/appraisal/file.rb:1:in `require': /Users/fcastellanos/.rvm/gems/ruby-1.8.7-p352/gems/appraisal-1.0.3/lib/appraisal/appraisal.rb:68: syntax error, unexpected ':', expecting ')' (SyntaxError)
  Command.new(command, env: env).run
                           ^

Am I doing something wrong or ruby 1.8.7 is not supported?

Thanks

Appraisal requires a version of Thor that is too recent

Reported by @phillbaker in #50

I get a Bundler could not find compatible versions for gem "thor": when trying to rake appraisal:install for an Appraisal file

appraise "rails3" do
  gem "rails", "~> 3.0.11"
end

Probably because of

Is it possible to relax the thor requirements for appraisal? Otherwise it looks like rails 3.0.0 - 3.2.3 won't bundle (other gems with a dependency on thor would probably also be effected).

We should make appraisal requires older version of Thor, or relaxing the requirement.

Impossible to use as a default rake task

I have a gem that I need to test against completely different sent of dependencies. There no such thing as "default" dependencies.

So, I've generated 4 Gemfiles with appraisal and would like to use one of them as a default, so when I run rake it'll actually lanch something like appraisal:default_gemset test. Actually, even appraisal rake task would be ok for default.

Unfortunately this doesn't work.

In my Rakefile I have this:

task :default => %w(appraisal test)

when I run rake i see this stacktrace:

jbuilder โžค  rake --trace                                                                                                      git:appraisal*
** Invoke default (first_time)
** Invoke appraisal (first_time)
** Invoke appraisal:all (first_time)
** Execute appraisal:all
rake aborted!
can't convert nil into Array
/Users/rwz/.rbenv/versions/1.9.3-p392-perf/lib/ruby/gems/1.9.1/gems/appraisal-0.5.2/lib/appraisal/command.rb:7:in `+'
/Users/rwz/.rbenv/versions/1.9.3-p392-perf/lib/ruby/gems/1.9.1/gems/appraisal-0.5.2/lib/appraisal/command.rb:7:in `from_args'
/Users/rwz/.rbenv/versions/1.9.3-p392-perf/lib/ruby/gems/1.9.1/gems/appraisal-0.5.2/lib/appraisal/task.rb:39:in `block (3 levels) in initialize'
/Users/rwz/.rbenv/versions/1.9.3-p392-perf/lib/ruby/gems/1.9.1/gems/appraisal-0.5.2/lib/appraisal/file.rb:21:in `each'
/Users/rwz/.rbenv/versions/1.9.3-p392-perf/lib/ruby/gems/1.9.1/gems/appraisal-0.5.2/lib/appraisal/file.rb:21:in `each'
/Users/rwz/.rbenv/versions/1.9.3-p392-perf/lib/ruby/gems/1.9.1/gems/appraisal-0.5.2/lib/appraisal/file.rb:10:in `each'
/Users/rwz/.rbenv/versions/1.9.3-p392-perf/lib/ruby/gems/1.9.1/gems/appraisal-0.5.2/lib/appraisal/task.rb:38:in `block (2 levels) in initialize'
/Users/rwz/.rbenv/versions/1.9.3-p392-perf/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
...

appraisal install problem with finding bundler gem

I think this problem somehow exists because of my environment but I can't find it quickly.

  • I've created new repo for testing my own gem against different versions of other gems
  • I fill Appraisals file:
appraise "rails-3" do
  gem "rails", "3.2.21"
end

appraise "rails-4-0" do
  gem "rails", "4.0.13"
end

appraise "rails-4-1" do
  gem "rails", "4.1.9"
end

appraise "rails-4-2" do
  gem "rails", "4.2.0"
end
  • When I run appraisal install I get following error:
0:gon_tests:[master โœ—]$ appraisal install
WARN: Unresolved specs during Gem::Specification.reset:
      rake (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
>> bundle check --gemfile='/Users/alex/code/gon_tests/gemfiles/rails_3.gemfile' || bundle install --gemfile='/Users/alex/code/gon_tests/gemfiles/rails_3.gemfile'
/Users/alex/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'bundler' (>= 0) among 65 total gem(s) (Gem::LoadError)
    from /Users/alex/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
    from /Users/alex/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /Users/alex/.gem/ruby/2.1.5/bin/bundle:22:in `<main>'
/Users/alex/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'bundler' (>= 0) among 65 total gem(s) (Gem::LoadError)
    from /Users/alex/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
    from /Users/alex/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /Users/alex/.gem/ruby/2.1.5/bin/bundle:22:in `<main>'
  • But if I run command from announce manually it just works:
0:gon_tests:[master โœ—]$ bundle check --gemfile='/Users/alex/code/gon_tests/gemfiles/rails_3.gemfile' || bundle install --gemfile='/Users/alex/code/gon_tests/gemfiles/rails_3.gemfile'
The Gemfile's dependencies are satisfied

Do you have any idea how I can trace the problem?

Support gemspec in Appraisals

Even though Appraisal supports gemspec in Gemfile, if you only want to include the gemspec for certain appraisals within the Appraisals file. Most of the time you want to run tests against the local gem, but sometimes you may have a set of tests that you want to run without the local gem, so you'd want something like this in Appraisals:

appraise "with gem" do
  gemspec
  # ...
end

appraise "without gem" do
  # ...
end

But currently that would result in an error, e.g.:

undefined local variable or method `gemspec' for #<Appraisal::Appraisal:0x007fd0dca4eb10>

This is probably an edge case, but it seems like Appraisals should work like like a more flexible Gemfile, and for it to do that, it seems like it should be able to support loading the gemspec by specifying Appraisals instead of Gemfile if that is required.

Appraisal::Gemfile doesn't support Bundler platforms block syntax

I get the following error when running Appraisal with a Gemfile that specifies a platforms block like so:

platforms :ruby_20 do
  gem "syck"
  gem "iconv"
end

undefined method platforms' for #Appraisal::Gemfile:0x007fe830e4ee20`

I did see this comment on issue:
#47 (comment) which suggests that support for this is being worked on.

Thanks

Missing support for Gemfile source declaration with a block

For gems whose Gemfile has multiple source declarations, bundler (i.e., v1.10.4) emits the following security warning:

Warning: this Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run `bundle config disable_multisource true`.

However, source declarations with blocks are not supported by the appraisal gem when it generates appraisal gemfiles. Gems declared inside of a source block do not appear in generated appraisal gemfiles.

undefined method `expand_path' for Appraisal::File:Class

I'm trying to add Appraisal to my branch of rspec-core however I get the following error.

Update: I use the github/master version as depending on aruba 0.4.2

$ rake --trace
rake aborted!
undefined method `expand_path' for Appraisal::File:Class
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal/gemfile.rb:22:in `block in run'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal/gemfile.rb:21:in `each'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal/gemfile.rb:21:in `run'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal/gemfile.rb:18:in `instance_eval'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal/gemfile.rb:18:in `run'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal/gemfile.rb:14:in `load'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal/file.rb:16:in `initialize'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal/file.rb:10:in `new'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal/file.rb:10:in `each'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal/task.rb:30:in `block in initialize'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task_manager.rb:207:in `in_namespace'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/dsl_definition.rb:95:in `namespace'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal/task.rb:9:in `initialize'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal.rb:3:in `new'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bundler/gems/appraisal-f8029181543b/lib/appraisal.rb:3:in `<top (required)>'
/Users/seb/Work/GitHub/rspec-core/Rakefile:5:in `require'
/Users/seb/Work/GitHub/rspec-core/Rakefile:5:in `<top (required)>'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:495:in `raw_load_rakefile'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:78:in `block in load_rakefile'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:61:in `block in run'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/Users/seb/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'

The idea of Appraisal is really awesome, thanks for this great work.

Migrate Cucumber to RSpec test files

I started writing the new cli spec using RSpec, and it looks much better than Cucumber counterpart. Let's move away from having to have Cucumber in our project.

Make sure that relativize supports :path that is CWD (".")

See #76. Basically:

The vagrant plugin development guide uses gem "my-plugin", path: "." instead of gemspec.

source 'https://rubygems.org'

group :development do
  gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
  gem 'appraisal', '~> 1.0'
end

group :plugins do
  gem "vagrant-rackspace", path: "."
end

This doesn't work either, probably because support for rewriting path wasn't completed/merged (#19). The result:

$ bundle exec appraisal install
bundle check --gemfile='/Users/Thoughtworker/repos/rackspace/vagrant-rackspace/gemfiles/latest_stable.gemfile' || bundle install --gemfile='/Users/Thoughtworker/repos/rackspace/vagrant-rackspace/gemfiles/latest_stable.gemfile'
Resolving dependencies...
Bundler can't satisfy your Gemfile's dependencies.
Install missing gems with `bundle install`.
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Could not find gem 'vagrant-rackspace (>= 0) ruby' in source at ..
Source does not contain any versions of 'vagrant-rackspace (>= 0) ruby'

If gemspec and Gemfile are used in regular project, declaration matters

Given:

Gemfile with:

group :localdev do
  gem 'appraisal'
end

and

myproj.gemspec does not contain gem.add_development_dependency 'appraisal'

When:
Running any rake task including appraisal semantics

Then:
Task fails with:

cannot load such file -- appraisal

I suspect this is due to the generated .gemfile specifying:

gemspec :path=>"../"

And this is thereby not loading the Gemfile from the root directory.

Essentially, I would expect a contributor to clone, bundle and have everything. Travis doesn't need to install/include the appraisal gem, as it's already generated the gemfiles, hence not including it into the gemspec.

I don't really have an idea how to solve it - probably for now would be to document that if using both a Gemfile and gemspec, put the dependency in in the gemspec.

Better documentation on README

Guys the documentation on README use some commands that dont exist.

I try appraisal install and got appraisal: command not found.

I make this work with:

Add to Rakefile

# Rakefile
require 'appraisal'

And run the appraisal with the following rake tasks:

$ rake appraisal:install --trace
$ rake appraisal --trace
$ rake appraisal:4.0 --trace

One other thing is on README is recomended not check *.gemfile.lock but shoulda-matchers commit Gemfile.lock and paperclip not.

Support git syntax in Appraisals

I want to use only actionpack from master, but it is not rails/actionpack.git, this is rails/rails.git and rails/actionpack
bundler has git syntax below:

git 'git://github.com/rails/rails.git' do
  gem 'railties'
  gem 'action_pack'
  gem 'active_model'
end

http://gembundler.com/v1.3/git.html

Now I use gem 'rails', github: 'rails' instead of I hope.

Appraisals Support For Platforms

Given the following Gemfile:

source 'http://rubygems.org'

gemspec

gem 'jquery-rails'

group :test do
  gem 'minitest'
  gem 'turn', :require => false
end

platforms :jruby do
  gem 'jruby-openssl'
  gem 'activerecord-jdbcmysql-adapter'
  gem 'activerecord-jdbcpostgresql-adapter'
  gem 'activerecord-jdbcsqlite3-adapter'
end

And running rake appraisal:install I get:

undefined method 'platforms' for #<Appraisal::Gemfile:0x007fdce309a2f0>.

Does appraisals have support for the platforms option in a Gemfile?

Please do a > 0.4.1 release of appraisal

Just noticed that that the issue where multiple groups in the Gemfile are not supported in appraisal 0.4.1 that is in rubygems was fixed months ago, but has not been released. Travis tests are passing, so I'm guessing it is stable?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.