natives-catalog 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/VERSION +1 -1
- data/lib/natives/catalog.rb +4 -3
- data/natives-catalog.gemspec +3 -3
- data/spec/natives/catalog_spec.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzM0MTQxY2QwN2VhZTZkODA3NmE3ZTU4ZTg0NjY2NjY3MWY4OGI0Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2JiZjQ0MDJkOGQyMDgzNzQ3OTAzMDdmYjIwZmRiOGNmYTFlNmM1YQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWIwYjA0MDQ5N2ZiMmQxMTU4ZmE2OTFiNzkyYzI0NWFmZmZjYTQ5MTM2YzEy
|
10
|
+
OThlNzVjMTg5NmU3MDQxYTQ0ZjRiMzJkYWMzMTBlMjk3ZjhkZWM4MDZkNTdh
|
11
|
+
NjUxZTIyYmE5MWI3OWFhYjRlNDQ2NTc0MGY2NjM1OGMwYzlkMTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTRjZDU5Yjk4MDJkMTkzODUzZDE2ZThmM2ZmMmE4MDU5ZDJlYzFhZTQ1OWMw
|
14
|
+
NDVkZGRjNzkwYjE4ZTVjNWUxNTYxY2M2Y2RiMDliZjA4ZGY5MDg2ZTk1ZWQ5
|
15
|
+
MTc4ZDQxODFhYTMzYjdjZDNmYWJkNjUwZTY0OTA1N2QxNWE0NWE=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/natives/catalog.rb
CHANGED
@@ -32,11 +32,12 @@ module Natives
|
|
32
32
|
@catalogs.fetch(self.name, {})
|
33
33
|
end
|
34
34
|
|
35
|
-
def native_packages_for(
|
36
|
-
Array(
|
35
|
+
def native_packages_for(*entry_names)
|
36
|
+
packages = Array(entry_names).flatten.map do |entry_name|
|
37
37
|
Selector.new(self.to_hash.fetch(entry_name, {})).
|
38
38
|
value_for(@platform, @platform_version, @package_provider)
|
39
|
-
|
39
|
+
end
|
40
|
+
packages.flatten.compact
|
40
41
|
end
|
41
42
|
|
42
43
|
end
|
data/natives-catalog.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: natives-catalog 0.
|
5
|
+
# stub: natives-catalog 0.3.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "natives-catalog"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.3.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Huiming Teo"]
|
13
|
-
s.date = "2013-10-
|
13
|
+
s.date = "2013-10-27"
|
14
14
|
s.description = "A catalog of native packages in different platforms required by ruby gems."
|
15
15
|
s.email = "teohuiming@gmail.com"
|
16
16
|
s.extra_rdoc_files = [
|
@@ -69,6 +69,11 @@ describe Natives::Catalog do
|
|
69
69
|
'13.10' => 'value1',
|
70
70
|
'default' => 'value2'
|
71
71
|
}
|
72
|
+
},
|
73
|
+
'curb' => {
|
74
|
+
'ubuntu/apt' => {
|
75
|
+
'default' => 'value3'
|
76
|
+
}
|
72
77
|
}
|
73
78
|
},
|
74
79
|
})
|
@@ -83,6 +88,18 @@ describe Natives::Catalog do
|
|
83
88
|
catalog = Natives::Catalog.new(:rubygems, 'ubuntu', '13.10', 'apt')
|
84
89
|
expect(catalog.native_packages_for('notfound')).to eq([])
|
85
90
|
end
|
91
|
+
|
92
|
+
it "return native packages for the given catalog entry name list" do
|
93
|
+
catalog = Natives::Catalog.new(:rubygems, 'ubuntu', '13.10', 'apt')
|
94
|
+
expect(catalog.native_packages_for(
|
95
|
+
'nokogiri', 'notfound', 'curb')).to eq(['value1', 'value3'])
|
96
|
+
end
|
97
|
+
|
98
|
+
it "return native packages for the given catalog entry name array" do
|
99
|
+
catalog = Natives::Catalog.new(:rubygems, 'ubuntu', '13.10', 'apt')
|
100
|
+
expect(catalog.native_packages_for(
|
101
|
+
['nokogiri', 'notfound', 'curb'])).to eq(['value1', 'value3'])
|
102
|
+
end
|
86
103
|
end
|
87
104
|
|
88
105
|
describe "::CATALOG_PATHS" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: natives-catalog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Huiming Teo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|