bundler-native-gems 0.2.0 → 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 +4 -4
- data/bundler-native-gems.gemspec +2 -3
- data/exe/bundler-native-gems +57 -12
- data/lib/bundler_native_gems/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5833d7bfd6fde1876c0e3d97fa60f02c4b85cd2
|
4
|
+
data.tar.gz: f9b245483d12bd7dac9e87c73c884b0439aa2996
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8b7d2a6359fffefc5b43cfbe62dfd5af0ebb6ef509fc3a8e283bfe1bd69069b7b1b47454c5b654bb68dd80f12410dc2a96da2f35c72772f41673ece3ae8a8d2
|
7
|
+
data.tar.gz: cfd7b6b3542748a4a2733acf1c82ec1d185123b6d1427dfd6d96e064d8f7341e15f05a0949d6bde00b65a1111d51c63d1cbb852da0b923b34c4b9ab34d41b42f
|
data/bundler-native-gems.gemspec
CHANGED
@@ -17,7 +17,6 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.
|
21
|
-
|
22
|
-
spec.add_dependency "tty", "~> 0.4.0"
|
20
|
+
spec.add_dependency "bundler", "~> 1.11"
|
21
|
+
spec.add_dependency "terminal-table", "~> 1.5"
|
23
22
|
end
|
data/exe/bundler-native-gems
CHANGED
@@ -1,19 +1,64 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
if ARGV.include?("--help") || ARGV.include?("-h")
|
4
|
+
$stderr.puts <<-HELP
|
5
|
+
USAGE: bundler native-gems [OPTIONS]
|
6
|
+
|
7
|
+
OPTIONS:
|
8
|
+
--with group1 [group2, etc] - include gems from these bundler groups
|
9
|
+
--with group1 [group2, etc] - exclude gems from these bundler groups
|
10
|
+
--help - You're looking at it
|
11
|
+
HELP
|
12
|
+
exit 0
|
8
13
|
end
|
9
14
|
|
10
|
-
require "bundler/
|
15
|
+
require "bundler/cli"
|
16
|
+
require "terminal-table"
|
17
|
+
|
18
|
+
class NativeGems
|
19
|
+
|
20
|
+
attr_reader :with, :without
|
21
|
+
|
22
|
+
def initialize(options)
|
23
|
+
@with = Array(options["with"]).map(&:to_sym)
|
24
|
+
@without = Array(options["without"]).map(&:to_sym)
|
25
|
+
end
|
26
|
+
|
27
|
+
def run
|
28
|
+
groups = definition.groups - without + with
|
29
|
+
resolved_specs = definition.specs_for(groups).to_a
|
30
|
+
native_specs = resolved_specs.select { |spec| spec.extensions.any? }
|
11
31
|
|
12
|
-
|
32
|
+
output = if $stdout.tty?
|
33
|
+
rows = [["Name", "Version"]]
|
34
|
+
output = Terminal::Table.new do |t|
|
35
|
+
t << ["Name", "Version"]
|
36
|
+
t << :separator
|
37
|
+
native_specs.each do |spec|
|
38
|
+
t << [spec.name, spec.version]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
else
|
42
|
+
native_specs.map { |spec| "#{spec.name}\t#{spec.version}" }
|
43
|
+
end
|
13
44
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
45
|
+
$stdout.puts output
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def definition
|
51
|
+
Bundler.definition
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
class CLI < Bundler::CLI
|
56
|
+
desc "native_gems [OPTIONS]", "Lists the gems with native extensions"
|
57
|
+
method_option "without", :type => :array, :banner => "Exclude gems that are part of the specified named group."
|
58
|
+
method_option "with", :type => :array, :banner => "Include gems that are part of the specified named group."
|
59
|
+
def native_gems
|
60
|
+
NativeGems.new(options).run
|
61
|
+
end
|
62
|
+
end
|
18
63
|
|
19
|
-
|
64
|
+
CLI.start(ARGV.dup.unshift("native_gems"), :debug => true)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler-native-gems
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caius Durling
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.11'
|
20
|
-
type: :
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
@@ -25,19 +25,19 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.11'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: terminal-table
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '1.5'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '1.5'
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- dev@caius.name
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
76
|
rubyforge_project:
|
77
|
-
rubygems_version: 2.6.
|
77
|
+
rubygems_version: 2.6.3
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: Inspect your Gemfile to list gems with native extensions
|