bundle-only 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/.editorconfig +9 -0
- data/.gitignore +9 -0
- data/.rubocop.yml +9 -0
- data/.rubocop_todo.yml +14 -0
- data/Gemfile +3 -0
- data/README.md +94 -0
- data/Rakefile +2 -0
- data/bundle-only.gemspec +28 -0
- data/exe/bundle-only +40 -0
- data/lib/bundle-only.rb +1 -0
- data/lib/bundle-only/messages.rb +36 -0
- data/lib/bundle-only/version.rb +5 -0
- metadata +101 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7afc8f4790942fb3e5c9742928bb24b0533716c3
|
4
|
+
data.tar.gz: 4e10ca5ad02c7e763c51ef3f932738290d686096
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b999d9f5358514ef0fcff0f996718e6fba4d7874865e7e30400a3dce76e76da46a90ccbd17d1da5a75da9e4957361d1e605c15cf9a0d8eec462cfc60d428e061
|
7
|
+
data.tar.gz: f7eab42d78b83344206108b78cf3b24a770849c33af9840bc52a2c9793e69648916bd06d96c5ee4bd2442cd1ff9e47261fc2f0059e3e29c74aab91fbf2ea5af3
|
data/.editorconfig
ADDED
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2016-01-23 23:34:56 +0300 using RuboCop version 0.36.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
Style/Documentation:
|
11
|
+
Exclude:
|
12
|
+
- 'spec/**/*'
|
13
|
+
- 'test/**/*'
|
14
|
+
- 'exe/bundle-only'
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
# bundle-only
|
2
|
+
|
3
|
+
This gem provides a `bundle-only` command that installs a set of gems listed in specified `Gemfile` group.
|
4
|
+
Gems are always installed into the system and `Gemfile.lock` is never updated by this command. Though, `Gemfile.lock` is taken into account.
|
5
|
+
|
6
|
+
Just call `bundle-only mygroup` and all gems from `group :mygroup` at your `Gemfile` will be installed.
|
7
|
+
|
8
|
+
### How it works
|
9
|
+
|
10
|
+
This command is designed to be used instead of calling `bundle install --without default development another_group all_not_needed_groups_here` and cleaning `.bundle/config` afterwards (because bundler's `--without` is a *remembered option*).
|
11
|
+
|
12
|
+
`bundle-only` is easy to use, does not pollute you bundler configs or augment `Gemfile.lock`, while allowing you to keep all your dependencies versioned in one place.
|
13
|
+
|
14
|
+
## Usage
|
15
|
+
|
16
|
+
You can install any group from your `Gemfile`:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
group :development do
|
20
|
+
...
|
21
|
+
end
|
22
|
+
|
23
|
+
# You can create a separate group
|
24
|
+
group :special do
|
25
|
+
gem 'rubocop'
|
26
|
+
end
|
27
|
+
```
|
28
|
+
|
29
|
+
$ bundle-only special
|
30
|
+
Fetching gem metadata from https://rubygems.org/...........
|
31
|
+
Fetching version metadata from https://rubygems.org/..
|
32
|
+
Resolving dependencies...
|
33
|
+
Using ast 2.2.0
|
34
|
+
Using bundler 1.11.2
|
35
|
+
Using powerpack 0.1.1
|
36
|
+
Using rainbow 2.0.0
|
37
|
+
Using ruby-progressbar 1.7.5
|
38
|
+
Using parser 2.3.0.1
|
39
|
+
Using rubocop 0.36.0
|
40
|
+
Bundle complete! 5 Gemfile dependencies, 7 gems now installed.
|
41
|
+
Gems in the groups default and development were not installed.
|
42
|
+
|
43
|
+
Other example:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
group :development do
|
47
|
+
...
|
48
|
+
end
|
49
|
+
|
50
|
+
# It will also work if gem is included in multiple groups
|
51
|
+
group :test, :special do
|
52
|
+
gem 'rubocop'
|
53
|
+
end
|
54
|
+
|
55
|
+
group :test do
|
56
|
+
...
|
57
|
+
end
|
58
|
+
```
|
59
|
+
|
60
|
+
$ bundle-only special
|
61
|
+
Fetching gem metadata from https://rubygems.org/...........
|
62
|
+
Fetching version metadata from https://rubygems.org/..
|
63
|
+
Resolving dependencies...
|
64
|
+
Using ast 2.2.0
|
65
|
+
Using bundler 1.11.2
|
66
|
+
Using powerpack 0.1.1
|
67
|
+
Using rainbow 2.0.0
|
68
|
+
Using ruby-progressbar 1.7.5
|
69
|
+
Using parser 2.3.0.1
|
70
|
+
Using rubocop 0.36.0
|
71
|
+
Bundle complete! 5 Gemfile dependencies, 7 gems now installed.
|
72
|
+
Gems in the groups default, development and test were not installed.
|
73
|
+
|
74
|
+
Notice `test` group is not installed here, but `special` group gems are still installed. You can't have that with bundler's `--with` option and optional groups.
|
75
|
+
|
76
|
+
## Installation
|
77
|
+
|
78
|
+
Add this line to your application's Gemfile:
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
gem 'bundle-only'
|
82
|
+
```
|
83
|
+
|
84
|
+
And then execute:
|
85
|
+
|
86
|
+
$ bundle
|
87
|
+
|
88
|
+
Or install it yourself as:
|
89
|
+
|
90
|
+
$ gem install bundle-only
|
91
|
+
|
92
|
+
## Contributing
|
93
|
+
|
94
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/MOZGIII/bundle-only.
|
data/Rakefile
ADDED
data/bundle-only.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'bundle-only/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'bundle-only'
|
8
|
+
spec.version = BundleOnly::VERSION
|
9
|
+
spec.authors = ['MOZGIII']
|
10
|
+
spec.email = ['mike-n@narod.ru']
|
11
|
+
|
12
|
+
spec.summary = 'Install gems from a specific Gemfile group.'
|
13
|
+
spec.description = <<-DESCRIPTION.gsub(/\A\s+/, '')
|
14
|
+
This gem provides a bundle-only command that installs a set of gems listed
|
15
|
+
in specified Gemfile group.
|
16
|
+
Gems are always installed into the system and never update Gemfile.lock.
|
17
|
+
DESCRIPTION
|
18
|
+
spec.homepage = 'https://github.com/MOZGIII/bundle-only'
|
19
|
+
|
20
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
spec.bindir = 'exe'
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ['lib']
|
24
|
+
|
25
|
+
spec.add_runtime_dependency 'bundler', '~> 1.11'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'rubocop', '>= 0.36.0'
|
28
|
+
end
|
data/exe/bundle-only
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundle-only/messages'
|
4
|
+
|
5
|
+
install_only = ARGV.to_a.map(&:to_sym)
|
6
|
+
|
7
|
+
if install_only.empty?
|
8
|
+
name = File.basename($PROGRAM_NAME)
|
9
|
+
STDERR.puts "Usage: #{name} group [group [...]]"
|
10
|
+
exit 2
|
11
|
+
end
|
12
|
+
|
13
|
+
ENV['BUNDLE_IGNORE_CONFIG'] = 'true'
|
14
|
+
require 'bundler'
|
15
|
+
|
16
|
+
Bundler.configure
|
17
|
+
|
18
|
+
gemfile = Pathname.new(Bundler.default_gemfile).expand_path
|
19
|
+
builder = Bundler::Dsl.new
|
20
|
+
builder.eval_gemfile(gemfile)
|
21
|
+
|
22
|
+
all_groups = builder.dependencies.map(&:groups).flatten.uniq
|
23
|
+
groups_to_skip = all_groups - install_only
|
24
|
+
Bundler.settings.without = groups_to_skip
|
25
|
+
Bundler.settings.with = install_only
|
26
|
+
|
27
|
+
definition = builder.to_definition(Bundler.default_lockfile, {})
|
28
|
+
def definition.lock(*); end # never lock or preserve options
|
29
|
+
definition.validate_ruby!
|
30
|
+
|
31
|
+
Bundler.ui = Bundler::UI::Shell.new
|
32
|
+
|
33
|
+
Bundler::Installer.install(Bundler.root, definition, system: true)
|
34
|
+
|
35
|
+
BundleOnly::Messages.print_installation_complete(definition)
|
36
|
+
BundleOnly::Messages.confirm_without_groups
|
37
|
+
|
38
|
+
Bundler::Installer.post_install_messages.each do |name, message|
|
39
|
+
BundleOnly::Messages.print_post_install_message(name, message)
|
40
|
+
end
|
data/lib/bundle-only.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundle-only/version'
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module BundleOnly
|
2
|
+
module Messages
|
3
|
+
module_function
|
4
|
+
|
5
|
+
def without_groups_message(groups)
|
6
|
+
group_list = [groups[0...-1].join(', '), groups[-1..-1]]
|
7
|
+
.reject { |s| s.to_s.empty? }.join(' and ')
|
8
|
+
group_str = (groups.size == 1) ? 'group' : 'groups'
|
9
|
+
"Gems in the #{group_str} #{group_list} were not installed."
|
10
|
+
end
|
11
|
+
|
12
|
+
def confirm_without_groups
|
13
|
+
groups = Bundler.settings.without
|
14
|
+
Bundler.ui.confirm without_groups_message(groups) if groups.any?
|
15
|
+
end
|
16
|
+
|
17
|
+
def dependencies_count_for(definition)
|
18
|
+
count = definition.dependencies.count
|
19
|
+
"#{count} Gemfile #{count == 1 ? 'dependency' : 'dependencies'}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def gems_installed_for(definition)
|
23
|
+
count = definition.specs.count
|
24
|
+
"#{count} #{count == 1 ? 'gem' : 'gems'} now installed"
|
25
|
+
end
|
26
|
+
|
27
|
+
def print_post_install_message(name, msg)
|
28
|
+
Bundler.ui.confirm "Post-install message from #{name}:"
|
29
|
+
Bundler.ui.info msg
|
30
|
+
end
|
31
|
+
|
32
|
+
def print_installation_complete(definition)
|
33
|
+
Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bundle-only
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- MOZGIII
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-23 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.11'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.36.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.36.0
|
55
|
+
description: |
|
56
|
+
This gem provides a bundle-only command that installs a set of gems listed
|
57
|
+
in specified Gemfile group.
|
58
|
+
Gems are always installed into the system and never update Gemfile.lock.
|
59
|
+
email:
|
60
|
+
- mike-n@narod.ru
|
61
|
+
executables:
|
62
|
+
- bundle-only
|
63
|
+
extensions: []
|
64
|
+
extra_rdoc_files: []
|
65
|
+
files:
|
66
|
+
- ".editorconfig"
|
67
|
+
- ".gitignore"
|
68
|
+
- ".rubocop.yml"
|
69
|
+
- ".rubocop_todo.yml"
|
70
|
+
- Gemfile
|
71
|
+
- README.md
|
72
|
+
- Rakefile
|
73
|
+
- bundle-only.gemspec
|
74
|
+
- exe/bundle-only
|
75
|
+
- lib/bundle-only.rb
|
76
|
+
- lib/bundle-only/messages.rb
|
77
|
+
- lib/bundle-only/version.rb
|
78
|
+
homepage: https://github.com/MOZGIII/bundle-only
|
79
|
+
licenses: []
|
80
|
+
metadata: {}
|
81
|
+
post_install_message:
|
82
|
+
rdoc_options: []
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
requirements: []
|
96
|
+
rubyforge_project:
|
97
|
+
rubygems_version: 2.5.1
|
98
|
+
signing_key:
|
99
|
+
specification_version: 4
|
100
|
+
summary: Install gems from a specific Gemfile group.
|
101
|
+
test_files: []
|