bootboot 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ inherit_from:
2
+ - https://shopify.github.io/ruby-style-guide/rubocop.yml
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 2.3
6
+ Exclude:
7
+ - 'vendor/**/*'
@@ -1,7 +1,8 @@
1
1
  sudo: false
2
2
  cache: bundler
3
3
  language: ruby
4
- before_install:
5
- - gem update bundler
4
+ script:
5
+ - bundle exec rubocop --config .rubocop.yml
6
+ - bundle exec rake test
6
7
  notifications:
7
8
  email: false
@@ -0,0 +1,9 @@
1
+ # Change log
2
+
3
+ ## master (unreleased)
4
+
5
+ ## 0.1.2 (2019-01-09)
6
+
7
+ ### New features
8
+
9
+ * [#15](https://github.com/Shopify/bootboot/pull/15): Add a way to configure the DEPENDENCIES_NEXT environment variable. (@Edouard-chin)
data/Gemfile CHANGED
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
6
 
5
7
  gemspec
6
8
 
@@ -8,3 +10,7 @@ group :deployment do
8
10
  gem 'package_cloud'
9
11
  gem 'rake'
10
12
  end
13
+
14
+ group :test do
15
+ gem 'rubocop'
16
+ end
@@ -1,16 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bootboot (0.1.1)
4
+ bootboot (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ ast (2.4.0)
9
10
  domain_name (0.5.20180417)
10
11
  unf (>= 0.0.5, < 1.0.0)
11
12
  highline (1.6.20)
12
13
  http-cookie (1.0.3)
13
14
  domain_name (~> 0.5)
15
+ jaro_winkler (1.5.1)
14
16
  json_pure (1.8.1)
15
17
  mime-types (3.2.2)
16
18
  mime-types-data (~> 3.2015)
@@ -23,6 +25,10 @@ GEM
23
25
  rainbow (= 2.2.2)
24
26
  rest-client (~> 2.0)
25
27
  thor (~> 0.18)
28
+ parallel (1.12.1)
29
+ parser (2.5.3.0)
30
+ ast (~> 2.4.0)
31
+ powerpack (0.1.2)
26
32
  rainbow (2.2.2)
27
33
  rake
28
34
  rake (10.5.0)
@@ -30,10 +36,20 @@ GEM
30
36
  http-cookie (>= 1.0.2, < 2.0)
31
37
  mime-types (>= 1.16, < 4.0)
32
38
  netrc (~> 0.8)
39
+ rubocop (0.60.0)
40
+ jaro_winkler (~> 1.5.1)
41
+ parallel (~> 1.10)
42
+ parser (>= 2.5, != 2.5.1.1)
43
+ powerpack (~> 0.1)
44
+ rainbow (>= 2.2.2, < 4.0)
45
+ ruby-progressbar (~> 1.7)
46
+ unicode-display_width (~> 1.4.0)
47
+ ruby-progressbar (1.10.0)
33
48
  thor (0.20.3)
34
49
  unf (0.1.4)
35
50
  unf_ext
36
51
  unf_ext (0.0.7.5)
52
+ unicode-display_width (1.4.0)
37
53
 
38
54
  PLATFORMS
39
55
  ruby
@@ -44,6 +60,7 @@ DEPENDENCIES
44
60
  minitest (~> 5.0)
45
61
  package_cloud
46
62
  rake
63
+ rubocop
47
64
 
48
65
  BUNDLED WITH
49
66
  1.17.1
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## 👢👢 Bootboot
1
+ ## 👢👢 Bootboot - [![Build Status](https://travis-ci.com/Shopify/bootboot.svg?branch=master)](https://travis-ci.com/Shopify/bootboot)
2
2
 
3
3
  Introduction
4
4
  ------------
@@ -46,7 +46,7 @@ Installation
46
46
  ------------
47
47
  1) In your Gemfile, add this
48
48
  ```ruby
49
- plugin 'bootboot', '~> 0.1.1`
49
+ plugin 'bootboot', '~> 0.1.1'
50
50
  ```
51
51
  2) Run `bundle install && bundle bootboot`
52
52
  3) You're done. Commit the Gemfile and the Gemfile_next.lock
@@ -55,8 +55,16 @@ Dual boot it!
55
55
  ------------
56
56
  If you want to boot using the dependencies from the `Gemfile_next.lock`, run any bundler command prefixed with the `DEPENDENCIES_NEXT=1` ENV variable. I.e. `DEPENDENCIES_NEXT=1 bundle exec irb`.
57
57
 
58
+ Configuration (Optional)
59
+ ------------------------
60
+ By default Bootboot will use the `DEPENDENCIES_NEXT` environment variable to update your Gemfile_next.lock. You can however configure it. For example, if you want the dualboot to happen when the `SHOPIFY_NEXT` env variable is present, you simply have to add this in your Gemfile:
58
61
 
59
- Keep` the Gemfile_next.lock` in sync
62
+ ```ruby
63
+ # Gemfile
64
+ Bundler.settings.set_local('bootboot_env_prefix', 'SHOPIFY')
65
+ ```
66
+
67
+ Keep the `Gemfile_next.lock` in sync
60
68
  ------------
61
69
  When a developer bumps or adds a dependency, Bootboot will ensure that the `Gemfile_next.lock` snapshot gets updated.
62
70
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rake/testtask"
3
5
 
@@ -7,4 +9,4 @@ Rake::TestTask.new(:test) do |t|
7
9
  t.test_files = FileList["test/**/*_test.rb"]
8
10
  end
9
11
 
10
- task :default => :test
12
+ task default: :test
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path("../lib", __FILE__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require "bootboot/version"
@@ -5,8 +7,8 @@ require "bootboot/version"
5
7
  Gem::Specification.new do |spec|
6
8
  spec.name = "bootboot"
7
9
  spec.version = Bootboot::VERSION
8
- spec.authors = ["Shopify"]
9
- spec.email = ["rails@shopify.com"]
10
+ spec.authors = %w(Shopify)
11
+ spec.email = %w(rails@shopify.com)
10
12
 
11
13
  spec.summary = "Dualbooting your ruby app made easy."
12
14
  spec.description = <<-EOM.gsub(/\W+/, ' ')
@@ -22,10 +24,10 @@ Gem::Specification.new do |spec|
22
24
  spec.metadata["source_code_uri"] = "https://github.com/shopify/bootboot"
23
25
  spec.metadata["changelog_uri"] = "https://github.com/Shopify/bootboot/blob/master/CHANGELOG.md"
24
26
 
25
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
26
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
28
+ %x(git ls-files -z).split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
29
  end
28
- spec.require_paths = ["lib"]
30
+ spec.require_paths = %w(lib)
29
31
 
30
32
  spec.add_development_dependency "bundler", "~> 1.17"
31
33
  spec.add_development_dependency "rake", "~> 10.0"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bootboot/version"
2
4
  require "bootboot/bundler_patch"
3
5
 
@@ -5,11 +7,25 @@ module Bootboot
5
7
  GEMFILE = Bundler.default_gemfile
6
8
  GEMFILE_LOCK = Pathname("#{GEMFILE}.lock")
7
9
  GEMFILE_NEXT_LOCK = Pathname("#{GEMFILE}_next.lock")
8
- DUALBOOT_NEXT = 'DEPENDENCIES_NEXT'
9
- DUALBOOT_PREVIOUS = 'DEPENDENCIES_PREVIOUS'
10
10
 
11
11
  autoload :GemfileNextAutoSync, 'bootboot/gemfile_next_auto_sync'
12
12
  autoload :Command, 'bootboot/command'
13
+
14
+ class << self
15
+ def env_next
16
+ env_prefix + '_NEXT'
17
+ end
18
+
19
+ def env_previous
20
+ env_prefix + '_PREVIOUS'
21
+ end
22
+
23
+ private
24
+
25
+ def env_prefix
26
+ Bundler.settings['bootboot_env_prefix'] || 'DEPENDENCIES'
27
+ end
28
+ end
13
29
  end
14
30
 
15
31
  Bootboot::GemfileNextAutoSync.new.setup
@@ -15,11 +15,11 @@ module Bootboot
15
15
  f.write(<<-EOM)
16
16
  Plugin.send(:load_plugin, 'bootboot') if Plugin.installed?('bootboot')
17
17
 
18
- if ENV['DEPENDENCIES_NEXT']
18
+ if ENV['#{Bootboot.env_next}']
19
19
  enable_dual_booting if Plugin.installed?('bootboot')
20
20
 
21
21
  # Add any gem you want here, they will be loaded only when running
22
- # bundler command prefixed with `#{DUALBOOT_NEXT}=1`.
22
+ # bundler command prefixed with `#{Bootboot.env_next}=1`.
23
23
  end
24
24
  EOM
25
25
  end
@@ -32,8 +32,8 @@ module Bootboot
32
32
 
33
33
  next if !GEMFILE_NEXT_LOCK.exist? ||
34
34
  nothing_changed?(current_definition) ||
35
- ENV[DUALBOOT_NEXT] ||
36
- ENV[DUALBOOT_PREVIOUS]
35
+ ENV[Bootboot.env_next] ||
36
+ ENV[Bootboot.env_previous]
37
37
 
38
38
  update!(current_definition)
39
39
  end
@@ -62,9 +62,9 @@ module Bootboot
62
62
 
63
63
  def which_env
64
64
  if Bundler.default_lockfile.to_s =~ /_next\.lock/
65
- DUALBOOT_PREVIOUS
65
+ Bootboot.env_previous
66
66
  else
67
- DUALBOOT_NEXT
67
+ Bootboot.env_next
68
68
  end
69
69
  end
70
70
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bootboot
2
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
3
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootboot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-20 00:00:00.000000000 Z
11
+ date: 2019-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -63,13 +63,15 @@ extensions: []
63
63
  extra_rdoc_files: []
64
64
  files:
65
65
  - ".gitignore"
66
+ - ".rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml"
67
+ - ".rubocop.yml"
66
68
  - ".travis.yml"
69
+ - CHANGELOG.md
67
70
  - Gemfile
68
71
  - Gemfile.lock
69
72
  - LICENSE.txt
70
73
  - README.md
71
74
  - Rakefile
72
- - bin/console
73
75
  - bootboot.gemspec
74
76
  - lib/bootboot.rb
75
77
  - lib/bootboot/bundler_patch.rb
@@ -101,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
103
  version: '0'
102
104
  requirements: []
103
105
  rubyforge_project:
104
- rubygems_version: 2.6.14
106
+ rubygems_version: 2.7.6
105
107
  signing_key:
106
108
  specification_version: 4
107
109
  summary: Dualbooting your ruby app made easy.
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "bootboot"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)