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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da7422f86d418432f15e842c07893ddbb80cb807
4
- data.tar.gz: 6050a19116b57cf4dee6bb0673ecef04b5d75b56
3
+ metadata.gz: aeb8894485a0535402354e44a89af0f2680eafb1
4
+ data.tar.gz: e796af156188ff864273b22ce2ae0d86ff135a2d
5
5
  SHA512:
6
- metadata.gz: 094232a1c079a354cbcb2911d612506e817b9cf505c1efaeff0c626b877f4cd78949604d87d430702627312556de00342a2293885e459d9800211fb4361afaa9
7
- data.tar.gz: 8ca336d7b810c0d16a5f0183c04091d1cb2f3ea143fd1b6a24302b0004ace3e8ca5f00a5ea0d603ccf84bea07c93e59ee4be02ba5860eebd5522b9d22ae8ad17
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
@@ -1,5 +1,5 @@
1
1
  Omnijack NOTICE
2
2
  ===============
3
3
 
4
- Omnijack incorporates code from Chef (http://www.getchef.com), which is
4
+ Omnijack incorporates code from Chef (http://www.chef.io), which is
5
5
  Copyright (c) 2008-2014 Opscode/Chef.
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::Container.new
121
+ Omnijack::Project::ChefContainer.new
122
122
  ```
123
123
 
124
124
  Getting Chef Server project data:
125
125
 
126
126
  ```ruby
127
- Omnijack::Project::Server.new
127
+ Omnijack::Project::ChefServer.new
128
128
  ```
129
129
 
130
130
  Contributing
@@ -21,7 +21,7 @@ class Omnijack
21
21
  #
22
22
  # @author Jonathan Hartman <j@p4nt5.com>
23
23
  module Config
24
- DEFAULT_BASE_URL ||= 'https://www.getchef.com/chef'
24
+ DEFAULT_BASE_URL ||= 'https://www.chef.io/chef'
25
25
  OMNITRUCK_PROJECTS ||= {
26
26
  angry_chef: {
27
27
  endpoints: {
@@ -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[0].to_sym
57
- val = line.split[1]
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
 
@@ -20,5 +20,5 @@
20
20
  #
21
21
  # @author Jonathan Hartman <j@p4nt5.com>
22
22
  class Omnijack
23
- VERSION = '1.0.0'
23
+ VERSION = '1.0.1'
24
24
  end
@@ -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.getchef.com/chef'
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.getchef.com/chef#{endpoint}"
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
- [:list, :platforms].include?(name)
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(true)
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', platform_version: '3.3.3', machine_arch: 'risc'
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.3') && o
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.3')
203
- expect(obj.instance_variable_get(:@version)).to eq('1.2.3')
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.getchef.com/chef/metadata-chefdk?' \
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.getchef.com/chef'
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
@@ -39,7 +39,7 @@ describe Omnijack::Project do
39
39
 
40
40
  before(:each) do
41
41
  allow_any_instance_of(Omnijack::Endpoint::Metadata).to receive(:to_h)
42
- .and_return(true)
42
+ .and_return(version: '1.2.3')
43
43
  end
44
44
 
45
45
  it 'returns a Metadata object' do
@@ -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.1-1_amd64.deb",
9
- "filename": "chefdk_0.3.1-1_amd64.deb",
10
- "version": "0.3.1",
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": "23e75ef46f8eb6299c5398fddd093db9",
13
- "sha256": "fa75f9ee109f7971fe8420f8e97586d4fa78dac4199b485069909385527968d0"
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.1%2B20141023234520-1_amd64.deb",
44
- "filename": "chefdk_0.3.1+20141023234520-1_amd64.deb",
45
- "version": "0.3.1+20141023234520",
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": "9331a1dbd283ec755ba009b41417a4fe",
48
- "sha256": "9aa154cf34868848df6acb130d91a3a5c790df48729c6034f94ca61cdc134da3"
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.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-10-24 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json