double_take 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9597d31af06477de2ac02b29a24fc6f99bde3ba1cb83ac030f66eef2c608ec30
4
- data.tar.gz: 364983fc62bc579cbde20b80d6694f58daf76fe182c1544b8a83ecae28df3068
3
+ metadata.gz: d9455c1db7368b61d5fe30f402cfc3a7e6af7571092361cb22bcc1bc810dc769
4
+ data.tar.gz: dbd6c295e58704c2ca28a65b0bc3dd1f6a106952e971f4ca8f99bc522820a5fc
5
5
  SHA512:
6
- metadata.gz: 251a382afd4ff42b5f28a8e02491feeae5bf6d98793a5a41d5c8f88347a99c74d983dadcd00662022b6324f11ff5032eaf68d0f3ab018a3a4cc9098c3fd240ff
7
- data.tar.gz: e95acc20e76bb6dc5f48f287ad767c62582dcf4b68b617014cd5f8a3e1c40034d0e62b1af28cd349ee5869a4682bdb5ffad7f6f14fad5f42b05ceb42edcfec66
6
+ metadata.gz: cc7d049ead496d5edf7d47f76d13ee7dd2bb2debae26b73c21e9e17ad5912309e3a354a0790e4658ddbae6ff7e2d76eeea2b6f8615bcb6abcfcd161bfeb691fc
7
+ data.tar.gz: ac0217a8223410ff6f64150bd6543cebd25dfbc783e92235a8722a7773a38f2f2899d5741f76227409c6a38dd31b98c23f701a26a280077224829cb4a34093bf
@@ -0,0 +1,67 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: CI
9
+
10
+ on:
11
+ push:
12
+ branches: [ master, te-test ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ lint:
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - uses: actions/checkout@v2
22
+ - name: Set up Ruby
23
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
24
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
25
+ # uses: ruby/setup-ruby@v1
26
+ uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: 2.6
29
+
30
+ - name: Install dependencies
31
+ run: bundle install
32
+
33
+ - name: Run linting
34
+ run: bundle exec rubocop
35
+
36
+ test:
37
+ runs-on: ubuntu-latest
38
+
39
+ steps:
40
+ - uses: actions/checkout@v2
41
+ - name: Set up Ruby
42
+ uses: ruby/setup-ruby@v1
43
+ with:
44
+ ruby-version: 2.6
45
+
46
+ - name: Install dependencies
47
+ run: bundle install
48
+
49
+ # Unfortunately, we can't use the `appraisal` gem and need to manually
50
+ # install each bundler version we want to test with.
51
+ - name: Install bundler v1.17.x
52
+ run: gem install bundler -v "~> 1.17.0"
53
+
54
+ - name: Run tests with bundler v1.17.x
55
+ run: TEST_BUNDLER_VERSION=1.17 bundle exec rake
56
+
57
+ - name: Install bundler v2.0.x
58
+ run: gem install bundler -v "~> 2.0.0"
59
+
60
+ - name: Run tests with bundler v2.0.x
61
+ run: bundle update --bundler && TEST_BUNDLER_VERSION=2.0 bundle exec rake
62
+
63
+ - name: Install bundler v2.1.x
64
+ run: gem install bundler -v "~> 2.1.0"
65
+
66
+ - name: Run tests with bundler v2.1.x
67
+ run: bundle update --bundler && TEST_BUNDLER_VERSION=2.1 bundle exec rake
@@ -0,0 +1,43 @@
1
+ AllCops:
2
+ NewCops: enable
3
+
4
+ Gemspec/RequiredRubyVersion:
5
+ Enabled: false
6
+
7
+ Layout/MultilineMethodCallIndentation:
8
+ EnforcedStyle: indented
9
+
10
+ Metrics/AbcSize:
11
+ Max: 25
12
+
13
+ Metrics/BlockLength:
14
+ Exclude:
15
+ - spec/**/*.rb
16
+ - double_take.gemspec
17
+
18
+ Metrics/MethodLength:
19
+ Max: 15
20
+
21
+ Style/CommandLiteral:
22
+ Enabled: false
23
+
24
+ Style/Documentation:
25
+ Enabled: false
26
+
27
+ Style/ExpandPathArguments:
28
+ Enabled: false
29
+
30
+ Style/GuardClause:
31
+ Enabled: false
32
+
33
+ Style/IfUnlessModifier:
34
+ Enabled: false
35
+
36
+ Style/NegatedIf:
37
+ Enabled: false
38
+
39
+ Style/StringLiterals:
40
+ EnforcedStyle: double_quotes
41
+
42
+ Style/TrailingCommaInHashLiteral:
43
+ EnforcedStyleForMultiline: consistent_comma
@@ -1,5 +1,10 @@
1
1
  # double_take
2
2
 
3
+ ## 0.2.1
4
+ - Added rubocop and fixed violations
5
+ - Added running test suite against bundler version 1.17.x to 2.1.x in CI
6
+ - Fixed bundler method deprecation warning
7
+
3
8
  ## 0.2.0
4
9
  - Remove registering command and hooks at file loadtime
5
10
  - Create method for loading and registering command and hooks and add to `plugins.rb`
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
  # Specify your gem's dependencies in double_take.gemspec
6
8
  gemspec
@@ -1,13 +1,30 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- double_take (0.2.0)
4
+ double_take (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ ast (2.4.1)
10
+ byebug (11.1.3)
11
+ climate_control (0.2.0)
12
+ coderay (1.1.3)
9
13
  diff-lcs (1.4.4)
14
+ method_source (1.0.0)
15
+ parallel (1.19.2)
16
+ parser (2.7.1.4)
17
+ ast (~> 2.4.1)
18
+ pry (0.13.1)
19
+ coderay (~> 1.1)
20
+ method_source (~> 1.0)
21
+ pry-byebug (3.9.0)
22
+ byebug (~> 11.0)
23
+ pry (~> 0.13.0)
24
+ rainbow (3.0.0)
10
25
  rake (12.3.3)
26
+ regexp_parser (1.7.1)
27
+ rexml (3.2.4)
11
28
  rspec (3.9.0)
12
29
  rspec-core (~> 3.9.0)
13
30
  rspec-expectations (~> 3.9.0)
@@ -21,15 +38,31 @@ GEM
21
38
  diff-lcs (>= 1.2.0, < 2.0)
22
39
  rspec-support (~> 3.9.0)
23
40
  rspec-support (3.9.3)
41
+ rubocop (0.90.0)
42
+ parallel (~> 1.10)
43
+ parser (>= 2.7.1.1)
44
+ rainbow (>= 2.2.2, < 4.0)
45
+ regexp_parser (>= 1.7)
46
+ rexml
47
+ rubocop-ast (>= 0.3.0, < 1.0)
48
+ ruby-progressbar (~> 1.7)
49
+ unicode-display_width (>= 1.4.0, < 2.0)
50
+ rubocop-ast (0.3.0)
51
+ parser (>= 2.7.1.4)
52
+ ruby-progressbar (1.10.1)
53
+ unicode-display_width (1.7.0)
24
54
 
25
55
  PLATFORMS
26
56
  ruby
27
57
 
28
58
  DEPENDENCIES
29
59
  bundler (>= 1.17.0, < 2.2)
60
+ climate_control
30
61
  double_take!
62
+ pry-byebug
31
63
  rake (~> 12.3.3)
32
64
  rspec (~> 3.0)
65
+ rubocop (~> 0.90)
33
66
 
34
67
  BUNDLED WITH
35
68
  1.17.3
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # DoubleTake
1
+ # DoubleTake :eyes: :eyes:
2
2
 
3
3
  DoubleTake is a [bundler plugin](https://bundler.io/v2.0/guides/bundler_plugins.html) that doubly bundles gems from multiple lockfiles for projects that are using a [dual boot strategy](https://www.youtube.com/watch?v=I-2Xy3RS1ns&t=368s).
4
4
 
@@ -12,7 +12,7 @@ Add this line to your application's Gemfile:
12
12
  plugin "double_take"
13
13
  ```
14
14
 
15
- _NOTE_: We use the `plugin` method, not `gem`.
15
+ _NOTE_: We use the `plugin` method, not `gem`. Did you do a ...double take? (I promise there won't be any more jokes)
16
16
 
17
17
  And then execute:
18
18
 
@@ -22,9 +22,9 @@ And then execute:
22
22
 
23
23
  The plugin is installed with `bundle install`. It will also install all gems from both `Gemfile.lock` and `Gemfile_next.lock` on the initial `bundle` and every subsequent one as well.
24
24
 
25
- _NOTE_: This plugin does not generate a `Gemfile_next.lock`, keep both lockfiles in sync over gem bumps, nor does it implement any strategy for bifurcating the `Gemfile` to load different gems. For those reasons, this plugin pairs really well with [`bootboot`](https://github.com/Shopify/bootboot). For more info on dual booting I recommend reading its `README`.
25
+ _NOTE_: This plugin does not generate a `Gemfile_next.lock`, keep both lockfiles in sync over gem bumps, nor does it implement any strategy for bifurcating the `Gemfile` to load different gems. For those reasons, this plugin pairs really well with [`bootboot`](https://github.com/Shopify/bootboot). For more info on dual booting I recommend reading the `README` for `bootboot`.
26
26
 
27
- As mentioned in the `bootboot` plugin the `Gemfile` needs to be bifurcated with the environment variable `DEPENDENCIES_NEXT`.
27
+ As mentioned in the `bootboot` plugin the `Gemfile` needs to be bifurcated with the environment variable `DEPENDENCIES_NEXT`. As of now, this library does not support custom environment variables for bifurcating.
28
28
 
29
29
 
30
30
  ### Clean
@@ -39,12 +39,23 @@ It accepts all options that bundler's clean command does:
39
39
  $ bundle double_take clean --force
40
40
 
41
41
 
42
+ ### Supported Versions
43
+ This plugin is intended to be used with `bundler` versions 1.17.x to 2.1.x. The test suite is run against 1.17.x, 2.0.x, and 2.1.x in CI.
44
+
45
+
42
46
  ## Development
43
47
 
44
48
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
45
49
 
46
50
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
47
51
 
52
+
53
+ ### Testing Versions
54
+ To run the test suite against a specific version of bundler you can use the `TEST_BUNDLER_VERSION` environment variable. It supports full versions ie. `1.17.3` or abbreviated minor level versions ie. `2.0` and will choose the latest patch version. If a version is not specified the default bundler version will be used. This can all be verified with output that is printed before the spec suite runs.
55
+
56
+ Because of the backward incompatibilities between versions 1.x and 2.x you will have to run `bundle update --bundler` to properly test for 2.x versions. Please do not commit the changed `Gemfile.lock` if you are contributing code.
57
+
58
+
48
59
  ## Contributing
49
60
 
50
61
  Bug reports and pull requests are welcome on GitHub at https://github.com/zoso10/double_take. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rspec/core/rake_task"
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
- task :default => :spec
8
+ task default: :spec
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ # frozen_string_literal: true
4
+
3
5
  require "bundler/setup"
4
6
  require "double_take"
5
7
 
@@ -5,14 +5,14 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require "double_take/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = "double_take"
9
- spec.version = DoubleTake::VERSION
10
- spec.authors = ["Tyler Ewing"]
11
- spec.email = ["tewing10@gmail.com"]
8
+ spec.name = "double_take"
9
+ spec.version = DoubleTake::VERSION
10
+ spec.authors = ["Tyler Ewing"]
11
+ spec.email = ["tewing10@gmail.com"]
12
12
 
13
- spec.summary = %q{A bundler plugin to install multiple sets of dependencies.}
14
- spec.homepage = "https://github.com/zoso10/double_take"
15
- spec.license = "MIT"
13
+ spec.summary = "A bundler plugin to install multiple sets of dependencies."
14
+ spec.homepage = "https://github.com/zoso10/double_take"
15
+ spec.license = "MIT"
16
16
 
17
17
  if spec.respond_to?(:metadata)
18
18
  spec.metadata["homepage_uri"] = spec.homepage
@@ -22,16 +22,17 @@ Gem::Specification.new do |spec|
22
22
  raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
23
  end
24
24
 
25
- # Specify which files should be added to the gem when it is released.
26
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
25
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
28
26
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
29
27
  end
30
- spec.bindir = "exe"
31
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
30
  spec.require_paths = ["lib"]
33
31
 
34
32
  spec.add_development_dependency "bundler", ">= 1.17.0", "< 2.2"
33
+ spec.add_development_dependency "climate_control"
34
+ spec.add_development_dependency "pry-byebug"
35
35
  spec.add_development_dependency "rake", "~> 12.3.3"
36
36
  spec.add_development_dependency "rspec", "~> 3.0"
37
+ spec.add_development_dependency "rubocop", "~> 0.90"
37
38
  end
@@ -10,7 +10,7 @@ module DoubleTake
10
10
  else
11
11
  requested_dependencies
12
12
  end
13
- next_specs = Bundler::Definition
13
+ Bundler::Definition
14
14
  .build(GEMFILE, GEMFILE_NEXT_LOCK, nil)
15
15
  .resolve
16
16
  .materialize(deps)
@@ -24,8 +24,8 @@ module DoubleTake
24
24
  end
25
25
  end
26
26
 
27
- def bundle_next(unlock = EMPTY_UNLOCK)
28
- return if ENV["DEPENDENCIES_NEXT"] || !GEMFILE_NEXT_LOCK.file?
27
+ def bundle_next(unlock = EMPTY_UNLOCK, next_lockfile = GEMFILE_NEXT_LOCK)
28
+ return if ENV["DEPENDENCIES_NEXT"] || !next_lockfile.file?
29
29
 
30
30
  # this method memoizes an instance of the current definition
31
31
  # so we need to fill that cache for other bundler internals to use
@@ -33,7 +33,7 @@ module DoubleTake
33
33
 
34
34
  DoubleTake.with_dependency_next do
35
35
  next_definition = Bundler::Definition
36
- .build(GEMFILE, GEMFILE_NEXT_LOCK, unlock)
36
+ .build(GEMFILE, next_lockfile, unlock)
37
37
 
38
38
  Bundler.ui.confirm("Installing bundle for NEXT")
39
39
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DoubleTake
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: double_take
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Ewing
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-16 00:00:00.000000000 Z
11
+ date: 2020-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,6 +30,34 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2.2'
33
+ - !ruby/object:Gem::Dependency
34
+ name: climate_control
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: pry-byebug
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
33
61
  - !ruby/object:Gem::Dependency
34
62
  name: rake
35
63
  requirement: !ruby/object:Gem::Requirement
@@ -58,6 +86,20 @@ dependencies:
58
86
  - - "~>"
59
87
  - !ruby/object:Gem::Version
60
88
  version: '3.0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rubocop
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.90'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.90'
61
103
  description:
62
104
  email:
63
105
  - tewing10@gmail.com
@@ -65,8 +107,10 @@ executables: []
65
107
  extensions: []
66
108
  extra_rdoc_files: []
67
109
  files:
110
+ - ".github/workflows/ruby.yml"
68
111
  - ".gitignore"
69
112
  - ".rspec"
113
+ - ".rubocop.yml"
70
114
  - ".travis.yml"
71
115
  - CHANGELOG.md
72
116
  - CODE_OF_CONDUCT.md