omnijack 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/NOTICE +1 -1
- data/README.md +7 -7
- data/lib/omnijack/config.rb +1 -1
- data/lib/omnijack/endpoint/metadata.rb +4 -4
- data/lib/omnijack/version.rb +1 -1
- data/spec/omnijack/config_spec.rb +3 -3
- data/spec/omnijack/endpoint/metadata_spec.rb +12 -11
- data/spec/omnijack/endpoint_spec.rb +1 -1
- data/spec/omnijack/project_spec.rb +1 -1
- data/spec/support/real_test_data.json +10 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeb8894485a0535402354e44a89af0f2680eafb1
|
4
|
+
data.tar.gz: e796af156188ff864273b22ce2ae0d86ff135a2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d274575560bbb203f4aef90884115bddbad6589e2275e9751f13e18e001984545aa22e1a4391faa2d3e2b6aa58c792fc46bd8dd78b5ba8ae2a7dcd58d6ede6af
|
7
|
+
data.tar.gz: cdd53e9b36a28cdb606b9b09968a34e0c7a79dc06aa55de489b2f25d93f540e222ca42c8e811a4b4ecb4abc30b09d894a8eb5efd32d99d06a0b4bf4d9fcff7e1
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
Omnijack Gem CHANGELOG
|
2
2
|
======================
|
3
3
|
|
4
|
+
v1.0.1 (2014-12-02)
|
5
|
+
-------------------
|
6
|
+
- Replace every instance of `getchef.com` with `chef.io`
|
7
|
+
|
4
8
|
v1.0.0 (2014-10-24)
|
5
9
|
-------------------
|
6
10
|
- Remove dependency on `ohai`; require platform arguments for metadata
|
data/NOTICE
CHANGED
data/README.md
CHANGED
@@ -89,6 +89,11 @@ Omnijack::Project::ChefDk.new(
|
|
89
89
|
nightlies: true
|
90
90
|
)
|
91
91
|
```
|
92
|
+
Getting Chef project data:
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
Omnijack::Project::Chef.new
|
96
|
+
```
|
92
97
|
|
93
98
|
Getting the Chef project's list of packages:
|
94
99
|
|
@@ -109,22 +114,17 @@ Getting AngryChef project data:
|
|
109
114
|
```ruby
|
110
115
|
Omnijack::Project::AngryChef.new
|
111
116
|
```
|
112
|
-
Getting Chef project data:
|
113
|
-
|
114
|
-
```ruby
|
115
|
-
Omnijack::Project::Chef.new
|
116
|
-
```
|
117
117
|
|
118
118
|
Getting Chef-Container project data:
|
119
119
|
|
120
120
|
```ruby
|
121
|
-
Omnijack::Project::
|
121
|
+
Omnijack::Project::ChefContainer.new
|
122
122
|
```
|
123
123
|
|
124
124
|
Getting Chef Server project data:
|
125
125
|
|
126
126
|
```ruby
|
127
|
-
Omnijack::Project::
|
127
|
+
Omnijack::Project::ChefServer.new
|
128
128
|
```
|
129
129
|
|
130
130
|
Contributing
|
data/lib/omnijack/config.rb
CHANGED
@@ -36,6 +36,7 @@ class Omnijack
|
|
36
36
|
args.delete(i)
|
37
37
|
end
|
38
38
|
args.each { |k, v| send(k, v) unless v.nil? } unless args.nil?
|
39
|
+
version(to_h[:version])
|
39
40
|
to_h
|
40
41
|
end
|
41
42
|
|
@@ -53,13 +54,12 @@ class Omnijack
|
|
53
54
|
#
|
54
55
|
def to_h
|
55
56
|
raw_data.split("\n").each_with_object({}) do |line, hsh|
|
56
|
-
key = line.split
|
57
|
-
|
57
|
+
key, val = line.split.entries
|
58
|
+
key = key.to_sym
|
58
59
|
val = true if val == 'true'
|
59
60
|
val = false if val == 'false'
|
60
61
|
hsh[key] = val
|
61
|
-
key == :url && hsh.merge!(parse_url_data(val))
|
62
|
-
version(hsh[:version])
|
62
|
+
key == :url && hsh.merge!(parse_url_data(val))
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
data/lib/omnijack/version.rb
CHANGED
@@ -22,7 +22,7 @@ require_relative '../../lib/omnijack/config'
|
|
22
22
|
describe Omnijack::Config do
|
23
23
|
describe 'DEFAULT_BASE_URL' do
|
24
24
|
it 'uses the official Chef API' do
|
25
|
-
expected = 'https://www.
|
25
|
+
expected = 'https://www.chef.io/chef'
|
26
26
|
expect(described_class::DEFAULT_BASE_URL).to eq(expected)
|
27
27
|
end
|
28
28
|
end
|
@@ -36,12 +36,12 @@ describe Omnijack::Config do
|
|
36
36
|
described_class::OMNITRUCK_PROJECTS.each do |project, attrs|
|
37
37
|
attrs[:endpoints].each do |name, endpoint|
|
38
38
|
it "uses a valid #{project}::#{name} endpoint" do
|
39
|
-
url = "http://www.
|
39
|
+
url = "http://www.chef.io/chef#{endpoint}"
|
40
40
|
url << '?v=latest&p=ubuntu&pv=12.04&m=x86_64' if name == :metadata
|
41
41
|
|
42
42
|
# Some endpoints aren't available on Chef's public Omnitruck API
|
43
43
|
if [:angry_chef, :chef_dk, :chef_container].include?(project) && \
|
44
|
-
|
44
|
+
[:list, :platforms].include?(name)
|
45
45
|
expected = 301
|
46
46
|
else
|
47
47
|
expected = 200
|
@@ -25,16 +25,20 @@ describe Omnijack::Endpoint::Metadata do
|
|
25
25
|
let(:args) do
|
26
26
|
{ platform: 'linspire', platform_version: '3.3.3', machine_arch: 'risc' }
|
27
27
|
end
|
28
|
+
let(:to_h) { { version: '1.2.3' } }
|
28
29
|
let(:obj) { described_class.new(name, args) }
|
29
30
|
|
30
31
|
before(:each) do
|
31
|
-
allow_any_instance_of(described_class).to receive(:to_h).and_return(
|
32
|
+
allow_any_instance_of(described_class).to receive(:to_h).and_return(to_h)
|
32
33
|
end
|
33
34
|
|
34
35
|
describe '#initialize' do
|
35
36
|
context 'the required args provided' do
|
36
37
|
{
|
37
|
-
platform: 'linspire',
|
38
|
+
platform: 'linspire',
|
39
|
+
platform_version: '3.3.3',
|
40
|
+
machine_arch: 'risc',
|
41
|
+
version: '1.2.3'
|
38
42
|
}.each do |k, v|
|
39
43
|
it "sets the given #{k}" do
|
40
44
|
expect(obj.send(k)).to eq(v)
|
@@ -113,11 +117,6 @@ describe Omnijack::Endpoint::Metadata do
|
|
113
117
|
expect(obj.to_h).to eq(expected)
|
114
118
|
end
|
115
119
|
|
116
|
-
it 'overwrites the requested version with the actual package version' do
|
117
|
-
expect(obj.version).to eq('0.2.1')
|
118
|
-
expect(obj.instance_variable_get(:@version)).to eq('0.2.1')
|
119
|
-
end
|
120
|
-
|
121
120
|
[true, false].each do |tf|
|
122
121
|
context "data with a #{tf} value in it" do
|
123
122
|
let(:yolo) { tf }
|
@@ -185,6 +184,8 @@ describe Omnijack::Endpoint::Metadata do
|
|
185
184
|
|
186
185
|
describe '#version' do
|
187
186
|
context 'no argument provided' do
|
187
|
+
let(:to_h) { { version: nil } }
|
188
|
+
|
188
189
|
it 'returns latest' do
|
189
190
|
res = obj
|
190
191
|
expect(res.version).to eq('latest')
|
@@ -195,12 +196,12 @@ describe Omnijack::Endpoint::Metadata do
|
|
195
196
|
context 'a valid argument provided' do
|
196
197
|
let(:obj) do
|
197
198
|
o = super()
|
198
|
-
o.version('1.2.
|
199
|
+
o.version('1.2.4') && o
|
199
200
|
end
|
200
201
|
|
201
202
|
it 'uses the provided arg' do
|
202
|
-
expect(obj.version).to eq('1.2.
|
203
|
-
expect(obj.instance_variable_get(:@version)).to eq('1.2.
|
203
|
+
expect(obj.version).to eq('1.2.4')
|
204
|
+
expect(obj.instance_variable_get(:@version)).to eq('1.2.4')
|
204
205
|
end
|
205
206
|
end
|
206
207
|
|
@@ -390,7 +391,7 @@ describe Omnijack::Endpoint::Metadata do
|
|
390
391
|
end
|
391
392
|
|
392
393
|
it 'returns the appropriate metadata endpoint' do
|
393
|
-
expected = URI.parse('https://www.
|
394
|
+
expected = URI.parse('https://www.chef.io/chef/metadata-chefdk?' \
|
394
395
|
'v=1.2.3&p=ubuntu&pv=12.04')
|
395
396
|
expect(obj.send(:api_url)).to eq(expected)
|
396
397
|
end
|
@@ -134,7 +134,7 @@ describe Omnijack::Endpoint do
|
|
134
134
|
context 'no argument provided' do
|
135
135
|
it 'uses the default' do
|
136
136
|
res = obj
|
137
|
-
expected = 'https://www.
|
137
|
+
expected = 'https://www.chef.io/chef'
|
138
138
|
expect(res.base_url).to eq(expected)
|
139
139
|
expect(res.instance_variable_get(:@base_url)).to eq(expected)
|
140
140
|
end
|
@@ -5,12 +5,12 @@
|
|
5
5
|
"prerelease": false,
|
6
6
|
"nightlies": false,
|
7
7
|
"expected": {
|
8
|
-
"url": "https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.3.
|
9
|
-
"filename": "chefdk_0.3.
|
10
|
-
"version": "0.3.
|
8
|
+
"url": "https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.3.5-1_amd64.deb",
|
9
|
+
"filename": "chefdk_0.3.5-1_amd64.deb",
|
10
|
+
"version": "0.3.5",
|
11
11
|
"build": "1",
|
12
|
-
"md5": "
|
13
|
-
"sha256": "
|
12
|
+
"md5": "cda10f30efd6a80166937668db4a67f7",
|
13
|
+
"sha256": "a81c3dfad698fbb19a6c8e3dd65f04a15fd58a811d99db9c47e5a93e368f341d"
|
14
14
|
}
|
15
15
|
},
|
16
16
|
{
|
@@ -40,12 +40,12 @@
|
|
40
40
|
"prerelease": false,
|
41
41
|
"nightlies": true,
|
42
42
|
"expected": {
|
43
|
-
"url": "https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.3.
|
44
|
-
"filename": "chefdk_0.3.
|
45
|
-
"version": "0.3.
|
43
|
+
"url": "https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.3.5%2B20141117085014-1_amd64.deb",
|
44
|
+
"filename": "chefdk_0.3.5+20141117085014-1_amd64.deb",
|
45
|
+
"version": "0.3.5+20141117085014",
|
46
46
|
"build": "1",
|
47
|
-
"md5": "
|
48
|
-
"sha256": "
|
47
|
+
"md5": "36452d69fe2751a103b0efe45593ee1e",
|
48
|
+
"sha256": "210596c1f5c301fa0a50714b8183e28efcfb2dfee19f7a47bf1e204848022af3"
|
49
49
|
}
|
50
50
|
},
|
51
51
|
{
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omnijack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Hartman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|