OSDN Git Service

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