bundler-shellsplit-plugin 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8298b6d08bf23602a27a891fdd16857d5d056a86a85b613db15b1fef91e37f47
4
+ data.tar.gz: 10ba37546d010726e568074b5c378f950703f162e8572537d49ab0d56cb48f96
5
+ SHA512:
6
+ metadata.gz: 726fad46cb79b294775e417057644c3a7f0c429818077e59f892d5f0322de382b1d1d6780df666823161b6adc0d77afb6a135469664e263a068b03c16ae4ae77
7
+ data.tar.gz: 2d27f049bb6e2841f1a7fd5b60e45809f93b716687b9d60e1b3ee65a37f162faa1fe2c7bb3ebdd3beacc3125a5d51863047979bc5b562da1fce266f6dee927c7
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /vendor/bundle
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.6.5
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in bundler-shellsplit-plugin.gemspec
8
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,20 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ bundler-shellsplit-plugin (1.0.0)
5
+ bundler (>= 1.17.3, <= 2.0.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ rake (10.5.0)
11
+
12
+ PLATFORMS
13
+ ruby
14
+
15
+ DEPENDENCIES
16
+ bundler-shellsplit-plugin!
17
+ rake (~> 10.0)
18
+
19
+ BUNDLED WITH
20
+ 1.17.3
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Marissa Staib
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # Bundler::Shellsplit::Plugin
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ plugin 'bundler-shellsplit-plugin'
9
+ ```
10
+
11
+ Or install using plugin install:
12
+ ```sh
13
+ bundle plugin install 'bundler-shellsplit-plugin'
14
+ ```
15
+
16
+ And future calls to bundle install will work as intended:
17
+
18
+ ```sh
19
+ bundle config build.samplegem --multiple --flags
20
+ bundle install
21
+ # builds "samplegem" with --multiple --flags instead of "--multiple --flags"
22
+ ```
23
+
24
+ Shell arguments will now be split.
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'bundler/shellsplit_plugin'
7
+
8
+ # You can add fixtures and/or initialization code here to make experimenting
9
+ # with your gem easier. You can also use a different console, if you like.
10
+
11
+ # (If you use this, don't forget to add pry to your Gemfile!)
12
+ # require "pry"
13
+ # Pry.start
14
+
15
+ require 'irb'
16
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'bundler/shellsplit_plugin/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'bundler-shellsplit-plugin'
9
+ spec.version = Bundler::ShellsplitPlugin::VERSION
10
+ spec.authors = ['Marissa Staib']
11
+ spec.email = ['marissa.staib@wovn.io']
12
+
13
+ spec.summary = 'Plugin to fix shell splitting of bundle config ' \
14
+ 'arguments in Bundler 1.17.3 to Bundler 2.0.2, fixed in Bundler 2.1.0.'
15
+ spec.description = 'Plugin to fix shell splitting of bundle config ' \
16
+ 'arguments in Bundler 1.17.3 to Bundler 2.0.2, fixed in Bundler 2.1.0. ' \
17
+ 'In the affected versions, multiple arguments to bundle config become ' \
18
+ 'a single argument with spaces. This plugin reverses that ' \
19
+ 'transformation. Adapted from https://github.com/' \
20
+ 'rubygems/bundler/issues/6940#issuecomment-470643613 and fixes ' \
21
+ 'https://github.com/rubygems/bundler/issues/6940 ' \
22
+ 'for these older versions.'
23
+ spec.homepage = 'https://github.com/wovnio/bundler-shellsplit-plugin'
24
+ spec.license = 'MIT'
25
+
26
+ if spec.respond_to?(:metadata)
27
+ spec.metadata['homepage_uri'] = spec.homepage
28
+ spec.metadata['source_code_uri'] = 'https://github.com/wovnio/bundler-shellsplit-plugin'
29
+ spec.metadata['changelog_uri'] = 'https://github.com/wovnio/bundler-shellsplit-plugin/blob/master/CHANGELOG.md'
30
+ end
31
+
32
+ # Specify which files should be added to the gem when it is released.
33
+ # The `git ls-files -z` loads the files in the RubyGem that have been added
34
+ # into git.
35
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
36
+ `git ls-files -z`.split("\x0").reject do |f|
37
+ f.match(%r{^(test|spec|features)/})
38
+ end
39
+ end
40
+ spec.bindir = 'exe'
41
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
42
+ spec.require_paths = ['lib']
43
+
44
+ # These are the versions of Bundler with this bug.
45
+ spec.add_dependency 'bundler', '>= 1.17.3', '<= 2.0.2'
46
+ spec.add_development_dependency 'rake', '~> 10.0'
47
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler'
4
+ require 'bundler/shellsplit_plugin/version'
5
+ require 'bundler/installer/gem_installer'
6
+ require 'shellwords'
7
+
8
+ module Bundler
9
+ # Plugin module containing the hotfix for the shellsplit error.
10
+ module ShellsplitPlugin
11
+ # Patch module which will be patched into the gem installer.
12
+ # Adapted from https://github.com/rubygems/bundler/issues/6940#issuecomment-470643613
13
+ module ShellsplitSpecSettings
14
+ def spec_settings
15
+ return unless (settings = super)
16
+
17
+ Shellwords.shellsplit settings
18
+ end
19
+ end
20
+
21
+ OLDEST_AFFECTED = Gem::Version.new('1.17.3')
22
+ NEWEST_AFFECTED = Gem::Version.new('2.0.2')
23
+
24
+ class << self
25
+ def bundler_affected?
26
+ bundler_version = Gem::Version.new(Bundler::VERSION)
27
+ bundler_version >= OLDEST_AFFECTED && bundler_version <= NEWEST_AFFECTED
28
+ end
29
+
30
+ def register
31
+ unless bundler_affected?
32
+ Warning.warn('The Bundler::ShellsplitPlugin plugin is intended ' \
33
+ 'for Bundler versions >= 1.17.3 and <= 2.0.2. It ' \
34
+ 'has no effect on other versions, which do not have ' \
35
+ 'the bug it attempts to fix.')
36
+ return
37
+ end
38
+
39
+ Bundler::Plugin.add_hook('before-install') do
40
+ Bundler::GemInstaller.prepend ShellsplitSpecSettings
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler'
4
+
5
+ module Bundler
6
+ module ShellsplitPlugin
7
+ VERSION = '1.0.0'
8
+ end
9
+ end
data/plugins.rb ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/shellsplit_plugin'
4
+ Bundler::ShellsplitPlugin.register
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bundler-shellsplit-plugin
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Marissa Staib
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-05-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.17.3
20
+ - - "<="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.2
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 1.17.3
30
+ - - "<="
31
+ - !ruby/object:Gem::Version
32
+ version: 2.0.2
33
+ - !ruby/object:Gem::Dependency
34
+ name: rake
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '10.0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '10.0'
47
+ description: Plugin to fix shell splitting of bundle config arguments in Bundler 1.17.3
48
+ to Bundler 2.0.2, fixed in Bundler 2.1.0. In the affected versions, multiple arguments
49
+ to bundle config become a single argument with spaces. This plugin reverses that
50
+ transformation. Adapted from https://github.com/rubygems/bundler/issues/6940#issuecomment-470643613
51
+ and fixes https://github.com/rubygems/bundler/issues/6940 for these older versions.
52
+ email:
53
+ - marissa.staib@wovn.io
54
+ executables: []
55
+ extensions: []
56
+ extra_rdoc_files: []
57
+ files:
58
+ - ".gitignore"
59
+ - ".ruby-version"
60
+ - Gemfile
61
+ - Gemfile.lock
62
+ - LICENSE.txt
63
+ - README.md
64
+ - Rakefile
65
+ - bin/console
66
+ - bin/setup
67
+ - bundler-shellsplit-plugin.gemspec
68
+ - lib/bundler/shellsplit_plugin.rb
69
+ - lib/bundler/shellsplit_plugin/version.rb
70
+ - plugins.rb
71
+ homepage: https://github.com/wovnio/bundler-shellsplit-plugin
72
+ licenses:
73
+ - MIT
74
+ metadata:
75
+ homepage_uri: https://github.com/wovnio/bundler-shellsplit-plugin
76
+ source_code_uri: https://github.com/wovnio/bundler-shellsplit-plugin
77
+ changelog_uri: https://github.com/wovnio/bundler-shellsplit-plugin/blob/master/CHANGELOG.md
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubygems_version: 3.0.3
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Plugin to fix shell splitting of bundle config arguments in Bundler 1.17.3
97
+ to Bundler 2.0.2, fixed in Bundler 2.1.0.
98
+ test_files: []