bundler-ecology 0.1.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 +7 -0
- data/README.md +55 -0
- data/lib/bundler/ecology/version.rb +7 -0
- data/lib/bundler/ecology.rb +21 -0
- data/plugins.rb +5 -0
- metadata +47 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 714aaccc033cc2dca2a5f8f0561eb12388f5bce641213ced430862bd0d7b3fcc
|
4
|
+
data.tar.gz: 81b122b07b2f4f630126d209977f804365673a580cbf90f1a47cbbf4c729a51b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1389bd9c14f4987c0263aa23244f7fcb3b8d4f1455dd2016fca10fa6b53eca59aaed80942f7b5bdf7f0f922bcaa631dfe21b115763badd0d9bb027c6ce289904
|
7
|
+
data.tar.gz: 0626f1b3e6191fa5159f41ae2b2c27bdce880757436c8daf75b15ba2b2732a763fca44a0d428f13522974313e9f0bd0f1b48c17384cacab384aef1fd5e54336a
|
data/README.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
[gem]: https://rubygems.org/gems/bundler-ecology
|
2
|
+
[travis]: https://travis-ci.org/eco-rb/bundler-ecology
|
3
|
+
[codeclimate]: https://codeclimate.com/github/eco-rb/bundler-ecology
|
4
|
+
|
5
|
+
[][gem]
|
6
|
+
[][travis]
|
7
|
+
[][codeclimate]
|
8
|
+
|
9
|
+
# Bundler::Ecology
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
plugin 'bundler-ecology'
|
17
|
+
```
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Put `.bundler-ecology.yml` to your project directory with the following content:
|
26
|
+
|
27
|
+
```yml
|
28
|
+
disallowed:
|
29
|
+
- name: <gem_name>
|
30
|
+
- name: <gem_name>
|
31
|
+
- name: <gem_name>
|
32
|
+
...
|
33
|
+
```
|
34
|
+
|
35
|
+
And then execute:
|
36
|
+
|
37
|
+
$ bundle
|
38
|
+
|
39
|
+
## Development
|
40
|
+
|
41
|
+
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.
|
42
|
+
|
43
|
+
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).
|
44
|
+
|
45
|
+
## Contributing
|
46
|
+
|
47
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/eco-rb/bundler-ecology. 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.
|
48
|
+
|
49
|
+
## License
|
50
|
+
|
51
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
52
|
+
|
53
|
+
## Code of Conduct
|
54
|
+
|
55
|
+
Everyone interacting in the Bundler::Ecology project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/eco-rb/bundler-ecology/blob/master/CODE_OF_CONDUCT.md).
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler/ecology/version'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
module Bundler
|
7
|
+
module Ecology
|
8
|
+
def self.register
|
9
|
+
config_file_content = File.read('.bundler-ecology.yml')
|
10
|
+
config = YAML.safe_load(config_file_content, symbolize_names: true)
|
11
|
+
@gem_names = config[:disallowed].map { |item| item[:name] }
|
12
|
+
|
13
|
+
Bundler::Plugin.add_hook('before-install') do |dependency|
|
14
|
+
next unless @gem_names.include?(dependency.name)
|
15
|
+
|
16
|
+
raise Bundler::PluginError,
|
17
|
+
"Gemfile contains a disallowed dependency: #{dependency.name}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/plugins.rb
ADDED
metadata
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bundler-ecology
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Vasily Kolesnikov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-01-05 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: No unwanted gems more in your Gemfile.lock
|
14
|
+
email:
|
15
|
+
- re.vkolesnikov@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- README.md
|
21
|
+
- lib/bundler/ecology.rb
|
22
|
+
- lib/bundler/ecology/version.rb
|
23
|
+
- plugins.rb
|
24
|
+
homepage: https://github.com/eco-rb/bundler-ecology
|
25
|
+
licenses:
|
26
|
+
- MIT
|
27
|
+
metadata: {}
|
28
|
+
post_install_message:
|
29
|
+
rdoc_options: []
|
30
|
+
require_paths:
|
31
|
+
- lib
|
32
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
requirements: []
|
43
|
+
rubygems_version: 3.0.2
|
44
|
+
signing_key:
|
45
|
+
specification_version: 4
|
46
|
+
summary: Bundler plugin to avoid installing unwanted gems
|
47
|
+
test_files: []
|