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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmZmNzg5MjgwNTM3Mzg0YWFlOWM3MWY3NmIwYWFhOWI3MDMzYjNmNw==
4
+ YzM0MTQxY2QwN2VhZTZkODA3NmE3ZTU4ZTg0NjY2NjY3MWY4OGI0Mg==
5
5
  data.tar.gz: !binary |-
6
- NWI1MDJkMTFhNWIzZDk4OTgxNzE4NTcxMWVmMWM4MWE2MWYwN2Y2Ng==
6
+ M2JiZjQ0MDJkOGQyMDgzNzQ3OTAzMDdmYjIwZmRiOGNmYTFlNmM1YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzZkZTg4Zjg1OTRjOTRhMDk1MTNlM2NjZWM1NGVhMzMzYzczMjBhNWZhMGY4
10
- OWI4MTNjNzdiZWZmZjI4ZTE3ODBmYWI0ZTc3NjYzMDYwNzNlYmFjZDE1MGM1
11
- YjQyZGU4MGIyYTdkNWIwYTg0MGFhZjQ5N2FmNDhmMDEwNzg4Mzc=
9
+ OWIwYjA0MDQ5N2ZiMmQxMTU4ZmE2OTFiNzkyYzI0NWFmZmZjYTQ5MTM2YzEy
10
+ OThlNzVjMTg5NmU3MDQxYTQ0ZjRiMzJkYWMzMTBlMjk3ZjhkZWM4MDZkNTdh
11
+ NjUxZTIyYmE5MWI3OWFhYjRlNDQ2NTc0MGY2NjM1OGMwYzlkMTQ=
12
12
  data.tar.gz: !binary |-
13
- YWFiYzQwZDNmNTMwMTUzZWQ1OTE4MTUxZmY1OTUyNWY5NzA2NDY1YjFjZTIy
14
- M2QzNzVkNGJlMGFmN2Q0ODk0OWQ0YTM4ZmMxNTY2NTBiNjhkNWY1Njc4Mjg5
15
- NTVkOTM4ODVlYzc3MTk1OTc5ZjMxNzcxYTY1NWVhNDRmOWQ3YTQ=
13
+ ZTRjZDU5Yjk4MDJkMTkzODUzZDE2ZThmM2ZmMmE4MDU5ZDJlYzFhZTQ1OWMw
14
+ NDVkZGRjNzkwYjE4ZTVjNWUxNTYxY2M2Y2RiMDliZjA4ZGY5MDg2ZTk1ZWQ5
15
+ MTc4ZDQxODFhYTMzYjdjZDNmYWJkNjUwZTY0OTA1N2QxNWE0NWE=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.3.0
@@ -32,11 +32,12 @@ module Natives
32
32
  @catalogs.fetch(self.name, {})
33
33
  end
34
34
 
35
- def native_packages_for(entry_name)
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
@@ -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.2.1 ruby lib
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.2.1"
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-25"
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.2.1
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-25 00:00:00.000000000 Z
11
+ date: 2013-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec