bundled-without 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4ed63ec34bbba9206fcaf904a718febe30047db08c149f411fce1c88cb419cf0
4
+ data.tar.gz: 74c4556defdc65298e9275d35dcc69bc94fcccfb0fac363357ba2fafe319030a
5
+ SHA512:
6
+ metadata.gz: 169e71a6dbe2c426f70288aa311ea5ac5e40a28d4ec76d9d0274bf8ea1f8a50766d490cc8ce10b02ba91b028e4962bde4ddeadfcd1fdbad740fbbd8bcb27b7b4
7
+ data.tar.gz: a372165c6378f07f0e40f8ab718b396652bbc0607b00476241751b4ba9bd98c4160f798d527166d6cecb6d2ebf7550dd68433848fe442f810efeda7acc8239f2
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *.gem
data/LICENSE.txt ADDED
@@ -0,0 +1,54 @@
1
+ RubyGems is copyrighted free software by Chad Fowler, Rich Kilmer, Jim
2
+ Weirich and others. You can redistribute it and/or modify it under
3
+ either the terms of the MIT license (see the file MIT.txt), or the
4
+ conditions below:
5
+
6
+ 1. You may make and give away verbatim copies of the source form of the
7
+ software without restriction, provided that you duplicate all of the
8
+ original copyright notices and associated disclaimers.
9
+
10
+ 2. You may modify your copy of the software in any way, provided that
11
+ you do at least ONE of the following:
12
+
13
+ a. place your modifications in the Public Domain or otherwise
14
+ make them Freely Available, such as by posting said
15
+ modifications to Usenet or an equivalent medium, or by allowing
16
+ the author to include your modifications in the software.
17
+
18
+ b. use the modified software only within your corporation or
19
+ organization.
20
+
21
+ c. give non-standard executables non-standard names, with
22
+ instructions on where to get the original software distribution.
23
+
24
+ d. make other distribution arrangements with the author.
25
+
26
+ 3. You may distribute the software in object code or executable
27
+ form, provided that you do at least ONE of the following:
28
+
29
+ a. distribute the executables and library files of the software,
30
+ together with instructions (in the manual page or equivalent)
31
+ on where to get the original distribution.
32
+
33
+ b. accompany the distribution with the machine-readable source of
34
+ the software.
35
+
36
+ c. give non-standard executables non-standard names, with
37
+ instructions on where to get the original software distribution.
38
+
39
+ d. make other distribution arrangements with the author.
40
+
41
+ 4. You may modify and include the part of the software into any other
42
+ software (possibly commercial).
43
+
44
+ 5. The scripts and library files supplied as input to or produced as
45
+ output from the software do not automatically fall under the
46
+ copyright of the software, but belong to whomever generated them,
47
+ and may be sold commercially, and may be aggregated with this
48
+ software.
49
+
50
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
51
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
52
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
53
+ PURPOSE.
54
+
data/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # BUNDLED WITH'OUT
2
+
3
+ Force [bundler](https://bundler.io) to not generate the `BUNDLED WITH` part of `Gemfile.lock`.
4
+
5
+ ## Why?
6
+
7
+ Because we can, and I do not like the `BUNDLED_WITH` - @mpapis
8
+
9
+ ## Contributing
10
+
11
+ Open a PR, tests it with bundler before 2.1 and since 2.1 as it changes `require` to `relative_require`.
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- encoding: utf-8 -*-
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "bundled-without"
6
+ s.version = "0.0.1"
7
+ s.authors = ["Michal Papis"]
8
+ s.email = ["mpapis@gmail.com"]
9
+ s.homepage = "http://github.com/mpapis/bundled-without"
10
+ s.description =
11
+ s.summary = %q{Hack bundler to not generate BUNDLED WITH}
12
+ s.license = 'MIT'
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ end
@@ -0,0 +1,48 @@
1
+ module BundledWithout
2
+ def add_bundled_with
3
+ end
4
+ end
5
+
6
+ module BundlerDefinitionHack
7
+ def require_relative(string)
8
+ this_path, target_path = caller_locations(0, 2).map(&:absolute_path)
9
+
10
+ # replace file path with `..` so we get to system root
11
+ relative_path = this_path.gsub(%r"/[^/]+", "/..").sub(%r"^/", "")
12
+ # remove file name from target file path - base of relative_require
13
+ absolute_path = target_path.sub(%r"/[^/]+$", "/")
14
+ # relative path from this file to the target file via system root
15
+ relative_string = "#{relative_path}#{absolute_path}#{string}"
16
+
17
+ # call the real relative_require
18
+ result = super(relative_string)
19
+
20
+ if string == "lockfile_generator"
21
+ Bundler::LockfileGenerator.prepend(BundledWithout)
22
+ end
23
+ result
24
+ end
25
+ end
26
+
27
+ Gem.execute do |original_file|
28
+ # apply the hacks only when in bundler
29
+ if %w[bundle bundler].include?(original_file.split('/').last)
30
+ # hook into ruby require
31
+ def require(path)
32
+ # first call the real require
33
+ result = super
34
+ # bundler pre 2.1 uses require
35
+ if result && path == "bundler/lockfile_generator"
36
+ Bundler::LockfileGenerator.prepend(BundledWithout)
37
+ end
38
+ # bundler 2.1+ uses relative require
39
+ if result && path == "bundler"
40
+ Bundler.instance_exec do
41
+ # force autoload and extend the class
42
+ Bundler::Definition.prepend(BundlerDefinitionHack)
43
+ end
44
+ end
45
+ result
46
+ end
47
+ end
48
+ end
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bundled-without
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Michal Papis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-08-08 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Hack bundler to not generate BUNDLED WITH
14
+ email:
15
+ - mpapis@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".gitignore"
21
+ - LICENSE.txt
22
+ - README.md
23
+ - bundled-without.gemspec
24
+ - lib/rubygems_executable_plugin.rb
25
+ homepage: http://github.com/mpapis/bundled-without
26
+ licenses:
27
+ - MIT
28
+ metadata: {}
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubyforge_project:
45
+ rubygems_version: 2.7.7
46
+ signing_key:
47
+ specification_version: 4
48
+ summary: Hack bundler to not generate BUNDLED WITH
49
+ test_files: []