Bundler is the Best! BADCamp 2014 @dead_arm. .
-
Upload
ciera-decker -
Category
Documents
-
view
214 -
download
0
Transcript of Bundler is the Best! BADCamp 2014 @dead_arm. .
![Page 1: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/1.jpg)
Bundler is the Best!BADCamp 2014
@dead_arm
![Page 2: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/2.jpg)
http://bundler.io/
https://github.com/bundler/bundler
![Page 3: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/3.jpg)
Manage the rubygems you need…
“Bundler makes sure Ruby applications run the same code on every machine”
From https://github.com/bundler/bundler
![Page 4: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/4.jpg)
and their dependencies!
“and Bundler makes it easy to make sure that your application has the dependencies it needs to start up and run without errors.”
From http://bundler.io/
![Page 5: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/5.jpg)
These are a few of
my favorite things!
http://bplusmovieblog.files.wordpress.com/2013/10/the-sound-of-music-25.png
![Page 6: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/6.jpg)
What can Bundler do for you?
![Page 7: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/7.jpg)
One developer, working on one project
One developer, working on many projects
One of many developers,
working on one projectOne of many developers,
working on many projects
If you are...
![Page 8: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/8.jpg)
Best Practices
Create one bundle per theme
Add gems to the Gemfile, not the Gemfile.lock
Include ALL the gems you are using on the theme in the bundle
![Page 9: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/9.jpg)
Best Practices
Specify the version of the gem if you know which one you need, otherwise you can let Bundler handle it
Update gems using Bundler, not manually
Once you have the bundle set up, use it!
![Page 10: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/10.jpg)
Recommendations
State “require/bundler” in config.rb or set up a bash alias so that you don’t have to type “bundle exec…”
Use “chruby” to manage your system’s ruby version (https://github.com/postmodern/chruby)
Add the ruby version your gems use to your Gemfile
![Page 11: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/11.jpg)
What does it look like?
![Page 12: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/12.jpg)
config.rb
# Require Rubygems and Bundlerrequire 'rubygems'require 'bundler/setup'# Require Sass and Compassrequire 'sass'require 'compass'# Require additional gemsrequire 'breakpoint'require 'fontcustom'# Set this to the root of your project when deployed:http_path = '/'css_dir = 'css'sass_dir = 'sass'fonts_dir = 'fonts'images_dir = 'images'javascripts_dir = 'js'# Enable relative paths to assetsrelative_assets = true# Disable debugging commentsline_comments = false# Indented syntaxpreferred_syntax = :sass# Add cache busterasset_cache_buster :none
![Page 13: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/13.jpg)
Gemfile
# Gemfilesource "https://rubygems.org"ruby "2.0.0"gem "sass", "~> 3.3.0.rc.2"gem "compass", "~> 1.0.0.alpha.13"gem "breakpoint", "~> 2.4.0"gem "fontcustom", "~> 1.3.3"
![Page 14: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/14.jpg)
Gemfile.lock
GEM remote: https://rubygems.org/ specs: breakpoint (2.4.0) compass (~> 1.0.0.alpha.13) sass (~> 3.3.0.rc.2) sassy-maps (< 1.0.0) chunky_png (1.2.9) compass (1.0.0.alpha.17) chunky_png (~> 1.2) compass-core (~> 1.0.0.alpha.16) compass-import-once (~> 1.0.1) json listen (~> 1.1.0) sass (~> 3.3.0.rc.1) compass-core (1.0.0.alpha.16) multi_json (~> 1.0) sass (>= 3.3.rc.1) compass-import-once (1.0.1) ffi (1.9.3) fontcustom (1.3.3) json (~> 1.4) listen (~> 1.0) thor (~> 0.14) json (1.8.1) listen (1.1.6) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) rb-kqueue (>= 0.2) multi_json (1.8.2) rb-fsevent (0.9.3) rb-inotify (0.9.3) ffi (>= 0.5.0) rb-kqueue (0.2.0) ffi (>= 0.5.0) sass (3.3.0.rc.2) listen (~> 1.1.0) sassy-maps (0.3.1) compass (~> 1.0.0.alpha.13) sass (~> 3.3.0.rc.2) thor (0.19.1)PLATFORMS rubyDEPENDENCIES breakpoint (~> 2.4.0) compass (~> 1.0.0.alpha.13) fontcustom (~> 1.3.3) sass (~> 3.3.0.rc.2)
![Page 15: Bundler is the Best! BADCamp 2014 @dead_arm. .](https://reader036.fdocuments.in/reader036/viewer/2022081518/551c32525503469e4f8b63d5/html5/thumbnails/15.jpg)
Thank YouBADCamp 2014
@dead_arm