Skip to content

Instantly share code, notes, and snippets.

@jmoody
Created February 8, 2014 17:56
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/8887519 to your computer and use it in GitHub Desktop.
Save jmoody/8887519 to your computer and use it in GitHub Desktop.
Gemfile that demonstrates a way to use bundler + local, non-version controlled files to enforce local branch checks
# the idea here to rely on .calabash-gem and .briar-gem files
# that are not under version control to set the path and branch.
#
# we want bundler to force local branch checks so calabash and briar
# maintainers are allows aware of what branch they are working from.
#
# non-maintainers can simply use the Gemfile as-is.
#
# maintainers should configure bundler to check that they are working against
# the correct branch.
#
# to dev against briar
# 1. create a .briar-gem file with two lines
# line 1 - path their github fork
# line 2 - the target branch - defined locally
# ex.
# jmoody/briar
# 0.1.3
#
# 2. configure bundler to use a local override
# $ bundle config local.briar ~/path/to/your/local/briar
#
# to dev against calabash-ios
# 1. create a .calabash-gem file with two lines
# line 1 - path their github fork
# line 2 - the target branch - defined locally
# ex.
# jmoody/calabash-ios
# fix/0.9.x-return-key
# 2. configure bundler to use a local override
# $ bundle config local.calabash-cucumber ~/path/to/your/local/calabash
#
# more info here - http://bundler.io/v1.5/git.html
# calabash gem
if File.exists?('.calabash-gem')
branch_info = IO.readlines('.calabash-gem')
path = branch_info[0].strip
branch = branch_info[1].strip
#noinspection GemInspection
gem 'calabash-cucumber', :github => path, :branch => branch
else
gem 'calabash-cucumber'
end
# briar gem
if File.exists?('.briar-gem')
branch_info = IO.readlines('.briar-gem')
path = branch_info[0].strip
branch = branch_info[1].strip
#noinspection GemInspection
gem 'briar', :github => path, :branch => branch
else
gem 'briar', '0.1.3.rc1'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment