Skip to content

Instantly share code, notes, and snippets.

@jmoody
Created August 21, 2014 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmoody/9fce78bb22ed2d740a44 to your computer and use it in GitHub Desktop.
Save jmoody/9fce78bb22ed2d740a44 to your computer and use it in GitHub Desktop.
example of how to use bundler + github + local repos to work with the calabash-ios toolchain
# Put this in the directory where your calabash.framework is.
# I hope that is the same directory where you execute cucumber from...
# Update the values to match your environment.
# replace with your bundle id
BUNDLE_ID=com.littlejoysoftware.Briar-cal
# to use $ bundle exec briar install calabash-server
CALABASH_SERVER_PATH="${HOME}/git/calabash-ios-server"
CALABASH_GEM_PATH="${HOME}/git/calabash-ios"
# where to put console screenshots
SCREENSHOT_PATH=./screenshots/
# optional (I think.)
# Briar tries to be good citizen and clean up after itself.
#
# Command line builds generate spurious (IMHO) derived data directories which
# can make the next calabash run unable to find the APP_BUNDLE_PATH.
#
# If a build command is used, then these two vars are required.
DERIVED_DATA="${HOME}/Library/Developer/Xcode/DerivedData"
DERIVED_DATA_PREFIX=Briar
source 'https://rubygems.org'
# use bundle and bundle config to specify local gem locations
# bundle config local.GEM_NAME /path/to/local/git/repository
#
# Run these commands
# $ bundle config local.calabash-cucumber ~/path/to/calabash-ios
# $ bundle config local.run_loop ~/path/to/run_loop
# $ bundle config local.briar ~/path/to/briar
gem 'briar', :github => 'jmoody/briar', :branch => 'master'
gem 'calabash-cucumber', :github => 'calabash/calabash-ios', :branch => 'master'
gem 'run_loop', :github => 'calabash/run_loop', :branch => 'master'
@jmoody
Copy link
Author

jmoody commented Aug 21, 2014

Instructions

Clone the Repos

$ git clone --recursive git@github.com:jmoody/briar.git
$ git clone --recursive git@github.com:calabash/calabash-ios.git
$ git clone --recursive git@github.com:calabash/calabash-ios-server.git
$ git clone --recursive git@github.com:calabash/run_loop.git

Configure Bundler

$ bundle config local.calabash-cucumber ~/path/to/calabash-ios
$ bundle config local.run_loop ~/path/to/run_loop
$ bundle config local.briar ~/path/to/briar

Create a .env file

Use the example above and fill in the values to match your environment.

The .env file should be in the directory where your calabash.framework is.

You'll be using this command to install the calabash-ios-server from sources:

$ bundle exec briar install calabash-server

Install the Gemfile

Use the Gemfile above. If you need to share this Gemfile, you could follow the example below, but this tends to freak RubyMine out. If you can live with some RubyMine ambiguity, then this approach can work.

case ENV['USER']
  when 'tpeters'
    gem 'briar', :github => 'jmoody/briar', :branch => 'master'
    gem 'calabash-cucumber', :github => 'calabash/calabash-ios', :branch => 'master'
    gem 'run_loop', :github => 'calabash/run_loop', :branch => 'master'
  else
    gem 'calabash-cucumber', '0.9.169'
end 

# any other gems you might need
gem 'pry'

Bundle

$ bundle update && bundle install

From now on, you will be executing every command in the context of bundler. This will ensure that you are using the gems from sources rather than the released gems.

To make life easier, create an alias for bundle exec.

Add this to your .profile

alias be='bundle exec'
Example
$ be calabash-ios console
$ be briar install calabash-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment