OSDN Git Service

Regular updates
[twpd/master.git] / bundler.md
1 ---
2 title: Bundler
3 category: Ruby
4 ---
5
6 ### Commands
7
8     bundle                  # same as bundle install
9     bundle install          # installs gems
10     bundle install -j3      # faster (3 jobs)
11     bundle update           # update all gems
12     bundle update --source gemname  # update specified gem
13
14     bundle outdated         # show outdated gems
15     cd `bundle show rails`  # inspect a gem's dir
16
17     bundle gem              # new gem skeleton
18
19 ### Gems
20
21     gem 'hello'
22     gem 'hello', group: 'development'
23
24 ### Github support
25
26     gem 'hello', github: 'rstacruz/hello'
27     gem 'hello', github: 'rstacruz/hello', 'branch: master'
28
29 ### Grouping
30
31     group :development do
32       gem 'hello'
33     end
34
35 ### Deployment
36
37     $ bundle install --without=test,development --deployment
38
39 ### Local gem development
40
41 In your Gemfile, define a Git source and a branch:
42
43     gem 'hello', github: 'rstacruz/hello', branch: 'master'
44
45 And then:
46
47     $ bundle config --global local.xxx ~/projects/xxx
48
49 ### Rake Gem tasks
50
51     # Rakefile
52     require 'bundler/gem_tasks'
53
54 Terminal:
55
56     $ rake release
57     $ rake build