Slide 1

Slide 1 text

What we’ve been up to with Bundler

Slide 2

Slide 2 text

Colby Swandale @0xColby

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Past 12 months

Slide 6

Slide 6 text

$ bundle doctor Contributed by @mistydemo ❤

Slide 7

Slide 7 text

$ bundle add Contributed by @denniss ❤

Slide 8

Slide 8 text

# Gemfile source 'https://rubygems.org' gem 'rack'

Slide 9

Slide 9 text

$ bundle add rspec Fetching gem metadata from https://rubygems.org/.......... Fetching version metadata from https://rubygems.org/. Resolving dependencies... Resolving dependencies... Using bundler 1.15.4 Using diff-lcs 1.3 Using rack 2.0.3 Using rspec-support 3.6.0 Using rspec-core 3.6.0 Using rspec-expectations 3.6.0 Using rspec-mocks 3.6.0 Using rspec 3.6.0

Slide 10

Slide 10 text

# Gemfile source 'https://rubygems.org' gem 'rack' # Added at 2017-09-13 08:48:14 gem "rspec", "~> 3.6"

Slide 11

Slide 11 text

$ bundle add rails --version "~> 5.0.0" --source "https:// gems.example.com" --group "development"

Slide 12

Slide 12 text

bundler plugins Contributed by @asutoshpalai & @fotanus ❤

Slide 13

Slide 13 text

# plugins.rb module MyBundlerPlugin class Plugin < Bundler::Plugin::API command “new-command“ def exec(command, args) puts “Hello World” end end end

Slide 14

Slide 14 text

$ bundle new-command Hello World!

Slide 15

Slide 15 text

# plugins.rb Bundler::Plugin::API.hook "before-install-all" do |deps| puts “Installing #{deps.map(&:name).join(‘, ‘)} !” end

Slide 16

Slide 16 text

$ bundler install Installing rack ! Using bundler 1.15.4 Using rack 2.0.3 Bundle complete! 1 Gemfile dependency, 2 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed.

Slide 17

Slide 17 text

$ bundler plugin install

Slide 18

Slide 18 text

# Gemfile source 'https://rubygems.org' gem 'rack' plugin 'my-bundler-plugin'

Slide 19

Slide 19 text

Plugins need more work & docs

Slide 20

Slide 20 text

Lots and lots of bug fixes

Slide 21

Slide 21 text

Improving error messages

Slide 22

Slide 22 text

Performance

Slide 23

Slide 23 text

1.16 will likely be the last 1.xx version

Slide 24

Slide 24 text

1.0.0 - August 29, 2010

Slide 25

Slide 25 text

Bundler 2

Slide 26

Slide 26 text

Things we’re adding Things we’re removing Things we’re changing

Slide 27

Slide 27 text

Things we're removing

Slide 28

Slide 28 text

Ruby < 2.3

Slide 29

Slide 29 text

Removing Capistrano & Vlad integration

Slide 30

Slide 30 text

Gemfile Source Shortcuts

Slide 31

Slide 31 text

gem ‘rack’, github: ‘user/repo’ gemcutter: rubygems: rubyforge: gist: bitbucket:

Slide 32

Slide 32 text

gem ‘mygem1’, source: ‘https://mygemserver.private' gem ‘mygem2’, git: ‘https://github.com/org/repo.git' gem ‘mygem3’, path: ‘path/to/gem’

Slide 33

Slide 33 text

git_source(:github) do |repo_name| repo_name = “#{repo_name}/#{repo_name}” unless repo_name.include(“/“) “https://github.com/#{repo_name}.git" end

Slide 34

Slide 34 text

gem ‘rack’, github: ‘user/repo’

Slide 35

Slide 35 text

# Gemfile source 'https://rubygems.org' gem 'rack' github ‘my-org/my-repo’ do gem ‘my-gem' end

Slide 36

Slide 36 text

$ bundle show

Slide 37

Slide 37 text

$ bundle show Gems included by the bundle: * bundler (1.15.4) * rack (2.0.3)

Slide 38

Slide 38 text

$ bundler show rack /Users/c/.gem/ruby/2.4.1/gems/rack-2.0.3

Slide 39

Slide 39 text

$ bundle show --verbose * bundler (1.15.4) Summary: The best way to manage your application’s… Homepage: http://bundler.io Status: Up to date * rack (2.0.3) Summary: a modular Ruby webserver interface Homepage: http://rack.github.io/ Status: Up to date

Slide 40

Slide 40 text

$ bundle info $ bundle list

Slide 41

Slide 41 text

$ bundle list Gems included by the bundle: * actionmailer (5.1.3) * actionpack (5.1.3) * actionview (5.1.3) * activejob (5.1.3) * activesupport (5.1.3) * builder (3.2.3) * bundler (1.15.4) * capistrano (2.15.9) * capistrano-notifier (0.4.1) * concurrent-ruby (1.0.5) * erubi (1.6.1)

Slide 42

Slide 42 text

$ bundler info rack * rack (2.0.3) Summary: a modular Ruby webserver interface Homepage: http://rack.github.io/ Path: /Users/c/.gem/ruby/2.4.1/gems/rack-2.0.3

Slide 43

Slide 43 text

$ bundler info rack --path /Users/c/.gem/ruby/2.4.1/gems/rack-2.0.3

Slide 44

Slide 44 text

$ bundle viz

Slide 45

Slide 45 text

$ bundle plugin install bundle-viz

Slide 46

Slide 46 text

$ bundle console

Slide 47

Slide 47 text

Persistant command arguments

Slide 48

Slide 48 text

› bundler install --path foo Fetching gem metadata from https://rubygems.org/.. Fetching version metadata from https://rubygems.org/. Using bundler 1.15.4 Fetching rack 2.0.3 Installing rack 2.0.3 Bundle complete! 1 Gemfile dependency, 2 gems now installed. Bundled gems are installed into ./foo.

Slide 49

Slide 49 text

› bundler config --parseable path=foo

Slide 50

Slide 50 text

bundle install --with ––without ––path -–system

Slide 51

Slide 51 text

$ bundle config path ./vendor

Slide 52

Slide 52 text

$ bundle package $ bundle cache

Slide 53

Slide 53 text

Things we’re adding

Slide 54

Slide 54 text

Global gem & extension cache

Slide 55

Slide 55 text

Specific Platforms

Slide 56

Slide 56 text

What’s a platform?

Slide 57

Slide 57 text

Specifies OS, OS Version, CPU Arch, Ruby Engine, Engine Version

Slide 58

Slide 58 text

# mygem.gemspec Gem::Specification.new do |s| s.name = “mygem" s.summary = "my awesome gem" s.platform = Gem::Platform::RUBY # default

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

GEM remote: https://rubygems.org/ specs: libv8 (6.0.286.54.1) PLATFORMS ruby DEPENDENCIES libv8 BUNDLED WITH 1.15.4

Slide 61

Slide 61 text

GEM remote: https://rubygems.org/ specs: libv8 (6.0.286.54.1) libv8 (6.0.286.54.1-x86_64-linux) PLATFORMS ruby x86_64-linux DEPENDENCIES libv8 BUNDLED WITH 1.15.4

Slide 62

Slide 62 text

$ irb -rbundler irb(main):003:0> Bundler.setup irb(main):002:0> Gem.loaded_specs[“libv8”].platform => #

Slide 63

Slide 63 text

Things we're changing

Slide 64

Slide 64 text

$ bundle

Slide 65

Slide 65 text

$ bundler Bundler version 2.0.0 (2017-09-10 commit 0b0456249) Bundler commands: Primary commands: bundle install [OPTIONS] # Install the current environment to the bundle update [OPTIONS] # Update the current environment bundle cache [OPTIONS] # Locks and then caches all of the gems bundle exec [OPTIONS] # Run the command in context of the bundle config NAME [VALUE] # Retrieve or set a configuration value bundle help [COMMAND] # Describe available commands or one Utilities: bundle add GEM VERSION # Add gem to Gemfile and run bundl bundle binstubs GEM [OPTIONS] # Install the binstubs of the listed bundle check [OPTIONS] # Checks if the dependencies listed bundle doctor [OPTIONS] # Checks the bundle for common -V, [--verbose], [--no-verbose] # Enable verbose output mode

Slide 66

Slide 66 text

$ bundle update

Slide 67

Slide 67 text

$ bundler update Fetching gem metadata from https://rubygems.org/... Fetching gem metadata from https://rubygems.org/. Resolving dependencies... Fetching rack 2.0.3 (was 1.6.8) Installing rack 2.0.3 (was 1.6.8) Removing rack (1.6.8) Bundle updated!

Slide 68

Slide 68 text

$ bundler update To update everything, pass the `--all` flag.

Slide 69

Slide 69 text

github.com/bundler/rfcs/pull/6

Slide 70

Slide 70 text

Testing Bundler 2

Slide 71

Slide 71 text

Feature Flags!

Slide 72

Slide 72 text

error_on_stderr auto_config_jobs init_gems_rb specific_platform global_gem_cache

Slide 73

Slide 73 text

$ bundle config true

Slide 74

Slide 74 text

$ gem install bundler ––pre

Slide 75

Slide 75 text

Bundler 1 will not work after a bundle install with Bundler 2

Slide 76

Slide 76 text

Going Forward

Slide 77

Slide 77 text

A major release every year

Slide 78

Slide 78 text

Bundler will ship with ruby 2.5

Slide 79

Slide 79 text

0xColby colby-swandale slack.bundler.io#bundler

Slide 80

Slide 80 text

bundler.io

Slide 81

Slide 81 text

bundler/bundler

Slide 82

Slide 82 text

No content

Slide 83

Slide 83 text

Bundler ❤ Contributors %&'()*$%&()*$%&+'( $%&& +)*, (*)$&($%&'&'*()*&($ (*)$'*+)*&$%&($%&' $+&'()*$()*$%&'()* (*)$'*()*+($%-($%&' $'*($%'(*)()*&($%

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

͋Γ͕ͱ͏!