puppet_forge 1.0.4 → 1.0.5
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.
- data/.gitignore +9 -9
- data/lib/puppet_forge/version.rb +1 -1
- data/puppet_forge.gemspec +3 -3
- data/spec/spec_helper.rb +0 -1
- data/spec/tmp/.gitkeep +0 -0
- data/spec/unit/forge/v3/base_spec.rb +4 -4
- data/spec/unit/forge/v3/module_spec.rb +7 -7
- data/spec/unit/forge/v3/release_spec.rb +2 -2
- data/spec/unit/forge/v3/user_spec.rb +2 -2
- data/spec/unit/her/lazy_accessors_spec.rb +3 -3
- data/spec/unit/her/lazy_relations_spec.rb +6 -6
- metadata +12 -10
data/.gitignore
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
Gemfile.lock
|
7
7
|
InstalledFiles
|
8
8
|
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
9
|
+
/coverage
|
10
|
+
/doc/
|
11
|
+
/lib/bundler/man
|
12
|
+
/pkg
|
13
|
+
/rdoc
|
14
|
+
/spec/reports
|
15
|
+
/test/tmp
|
16
|
+
/test/version_tmp
|
17
|
+
/tmp
|
18
18
|
*.bundle
|
19
19
|
*.so
|
20
20
|
*.o
|
data/lib/puppet_forge/version.rb
CHANGED
data/puppet_forge.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["forge-team+api@puppetlabs.com"]
|
11
11
|
spec.summary = "Access and manipulate the Puppet Forge API from Ruby."
|
12
12
|
spec.homepage = "https://github.com/puppetlabs/forge-ruby"
|
13
|
-
spec.license = "Apache
|
13
|
+
spec.license = "Apache-2.0"
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
16
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.required_ruby_version = '>= 1.9.3'
|
21
21
|
|
22
|
-
spec.add_runtime_dependency "her", "~> 0.6"
|
22
|
+
spec.add_runtime_dependency "her", "~> 0.6.8"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.6"
|
25
25
|
spec.add_development_dependency "rake"
|
26
|
-
spec.add_development_dependency "rspec"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
27
27
|
spec.add_development_dependency "simplecov"
|
28
28
|
spec.add_development_dependency "cane"
|
29
29
|
spec.add_development_dependency "yard"
|
data/spec/spec_helper.rb
CHANGED
data/spec/tmp/.gitkeep
ADDED
File without changes
|
@@ -5,7 +5,7 @@ describe PuppetForge::V3::Base do
|
|
5
5
|
it 'should handle responses with no results' do
|
6
6
|
response_data = { data: {}, errors: "Something bad happened!" }
|
7
7
|
|
8
|
-
PuppetForge::V3::Base.new_collection(response_data).
|
8
|
+
expect(PuppetForge::V3::Base.new_collection(response_data)).to eq([])
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'should handle responses with no pagination info' do
|
@@ -13,9 +13,9 @@ describe PuppetForge::V3::Base do
|
|
13
13
|
|
14
14
|
collection = PuppetForge::V3::Base.new_collection(response_data)
|
15
15
|
|
16
|
-
collection.limit.
|
17
|
-
collection.offset.
|
18
|
-
collection.total.
|
16
|
+
expect(collection.limit).to eq(10)
|
17
|
+
expect(collection.offset).to eq(0)
|
18
|
+
expect(collection.total).to eq(0)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -13,11 +13,11 @@ describe PuppetForge::V3::Module do
|
|
13
13
|
let(:missing_mod) { PuppetForge::V3::Module.find('absent-apache') }
|
14
14
|
|
15
15
|
it 'can find modules that exist' do
|
16
|
-
mod.name.
|
16
|
+
expect(mod.name).to eq('apache')
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'returns nil for non-existent modules' do
|
20
|
-
missing_mod.
|
20
|
+
expect(missing_mod).to be_nil
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -35,12 +35,12 @@ describe PuppetForge::V3::Module do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'grants access to module attributes without an API call' do
|
38
|
-
PuppetForge::V3::User.
|
38
|
+
expect(PuppetForge::V3::User).not_to receive(:request)
|
39
39
|
expect(mod.owner.username).to eql('puppetlabs')
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'transparently makes API calls for other attributes' do
|
43
|
-
PuppetForge::V3::User.
|
43
|
+
expect(PuppetForge::V3::User).to receive(:request).once.and_call_original
|
44
44
|
expect(mod.owner.created_at).to_not be nil
|
45
45
|
end
|
46
46
|
end
|
@@ -53,7 +53,7 @@ describe PuppetForge::V3::Module do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'grants access to release attributes without an API call' do
|
56
|
-
PuppetForge::V3::Release.
|
56
|
+
expect(PuppetForge::V3::Release).not_to receive(:request)
|
57
57
|
expect(mod.current_release.version).to_not be nil
|
58
58
|
end
|
59
59
|
|
@@ -92,7 +92,7 @@ describe PuppetForge::V3::Module do
|
|
92
92
|
end
|
93
93
|
|
94
94
|
it 'grants access to release attributes without an API call' do
|
95
|
-
PuppetForge::V3::Release.
|
95
|
+
expect(PuppetForge::V3::Release).not_to receive(:request)
|
96
96
|
expect(mod.releases.map(&:version)).to_not include nil
|
97
97
|
end
|
98
98
|
|
@@ -100,7 +100,7 @@ describe PuppetForge::V3::Module do
|
|
100
100
|
versions = %w[ 0.0.1 0.0.2 0.0.3 0.0.4 0.1.1 ]
|
101
101
|
releases = mod.releases.select { |x| versions.include? x.version }
|
102
102
|
|
103
|
-
PuppetForge::V3::Release.
|
103
|
+
expect(PuppetForge::V3::Release).to receive(:request) \
|
104
104
|
.exactly(5).times \
|
105
105
|
.and_call_original
|
106
106
|
|
@@ -36,12 +36,12 @@ describe PuppetForge::V3::Release do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'grants access to module attributes without an API call' do
|
39
|
-
PuppetForge::V3::Module.
|
39
|
+
expect(PuppetForge::V3::Module).not_to receive(:request)
|
40
40
|
expect(release.module.name).to eql('apache')
|
41
41
|
end
|
42
42
|
|
43
43
|
it 'transparently makes API calls for other attributes' do
|
44
|
-
PuppetForge::V3::Module.
|
44
|
+
expect(PuppetForge::V3::Module).to receive(:request).once.and_call_original
|
45
45
|
expect(release.module.created_at).to_not be nil
|
46
46
|
end
|
47
47
|
end
|
@@ -13,11 +13,11 @@ describe PuppetForge::V3::User do
|
|
13
13
|
let(:missing_user) { PuppetForge::V3::User.find('absent') }
|
14
14
|
|
15
15
|
it 'can find users that exist' do
|
16
|
-
user.username.
|
16
|
+
expect(user.username).to eq('puppetlabs')
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'returns nil for non-existent users' do
|
20
|
-
missing_user.
|
20
|
+
expect(missing_user).to be_nil
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -39,12 +39,12 @@ describe Her::LazyAccessors do
|
|
39
39
|
subject { klass.new(local_data) }
|
40
40
|
|
41
41
|
it 'does not call methods to #inspect' do
|
42
|
-
subject.
|
42
|
+
expect(subject).not_to receive(:shadow)
|
43
43
|
subject.inspect
|
44
44
|
end
|
45
45
|
|
46
46
|
describe 'local attributes' do
|
47
|
-
before { klass.
|
47
|
+
before { expect(klass).not_to receive(:request) }
|
48
48
|
|
49
49
|
example 'allow access to local attributes' do
|
50
50
|
expect(subject.local).to eql('data')
|
@@ -101,7 +101,7 @@ describe Her::LazyAccessors do
|
|
101
101
|
end
|
102
102
|
|
103
103
|
example 'allow multiple instances to access remote attributes' do
|
104
|
-
klass.
|
104
|
+
expect(klass).to receive(:request).exactly(9).times.and_call_original
|
105
105
|
9.times { expect(klass.new(local_data).remote).to eql('DATA') }
|
106
106
|
end
|
107
107
|
|
@@ -59,12 +59,12 @@ describe Her::LazyRelations do
|
|
59
59
|
it { should be_a(related_class) }
|
60
60
|
|
61
61
|
it 'does not call methods to #inspect' do
|
62
|
-
subject.
|
62
|
+
expect(subject).not_to receive(:shadow)
|
63
63
|
subject.inspect
|
64
64
|
end
|
65
65
|
|
66
66
|
describe 'local attributes' do
|
67
|
-
before { related_class.
|
67
|
+
before { expect(related_class).not_to receive(:request) }
|
68
68
|
|
69
69
|
example 'allow access to local attributes' do
|
70
70
|
expect(subject.local).to eql('data')
|
@@ -115,7 +115,7 @@ describe Her::LazyRelations do
|
|
115
115
|
end
|
116
116
|
|
117
117
|
example 'allow multiple instances to access remote attributes' do
|
118
|
-
related_class.
|
118
|
+
expect(related_class).to receive(:request) \
|
119
119
|
.exactly(9).times \
|
120
120
|
.and_call_original
|
121
121
|
|
@@ -186,12 +186,12 @@ describe Her::LazyRelations do
|
|
186
186
|
it { should be_a(related_class) }
|
187
187
|
|
188
188
|
it 'does not call methods to #inspect' do
|
189
|
-
subject.
|
189
|
+
expect(subject).not_to receive(:shadow)
|
190
190
|
subject.inspect
|
191
191
|
end
|
192
192
|
|
193
193
|
describe 'local attributes' do
|
194
|
-
before { related_class.
|
194
|
+
before { expect(related_class).not_to receive(:request) }
|
195
195
|
|
196
196
|
example 'allow access to local attributes' do
|
197
197
|
expect(subject.local).to eql('data')
|
@@ -242,7 +242,7 @@ describe Her::LazyRelations do
|
|
242
242
|
end
|
243
243
|
|
244
244
|
example 'allow multiple instances to access remote attributes' do
|
245
|
-
related_class.
|
245
|
+
expect(related_class).to receive(:request) \
|
246
246
|
.exactly(9).times \
|
247
247
|
.and_call_original
|
248
248
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet_forge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-07-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: her
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 0.6.8
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 0.6.8
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: bundler
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,17 +64,17 @@ dependencies:
|
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
69
|
+
version: '3.0'
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
77
|
+
version: '3.0'
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: simplecov
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -190,6 +190,7 @@ files:
|
|
190
190
|
- spec/fixtures/v3/users/puppetlabs.headers
|
191
191
|
- spec/fixtures/v3/users/puppetlabs.json
|
192
192
|
- spec/spec_helper.rb
|
193
|
+
- spec/tmp/.gitkeep
|
193
194
|
- spec/unit/forge/v3/base/paginated_collection_spec.rb
|
194
195
|
- spec/unit/forge/v3/base_spec.rb
|
195
196
|
- spec/unit/forge/v3/module_spec.rb
|
@@ -199,7 +200,7 @@ files:
|
|
199
200
|
- spec/unit/her/lazy_relations_spec.rb
|
200
201
|
homepage: https://github.com/puppetlabs/forge-ruby
|
201
202
|
licenses:
|
202
|
-
- Apache
|
203
|
+
- Apache-2.0
|
203
204
|
post_install_message:
|
204
205
|
rdoc_options: []
|
205
206
|
require_paths:
|
@@ -218,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
219
|
version: '0'
|
219
220
|
segments:
|
220
221
|
- 0
|
221
|
-
hash:
|
222
|
+
hash: 4188408678036358387
|
222
223
|
requirements: []
|
223
224
|
rubyforge_project:
|
224
225
|
rubygems_version: 1.8.29
|
@@ -253,6 +254,7 @@ test_files:
|
|
253
254
|
- spec/fixtures/v3/users/puppetlabs.headers
|
254
255
|
- spec/fixtures/v3/users/puppetlabs.json
|
255
256
|
- spec/spec_helper.rb
|
257
|
+
- spec/tmp/.gitkeep
|
256
258
|
- spec/unit/forge/v3/base/paginated_collection_spec.rb
|
257
259
|
- spec/unit/forge/v3/base_spec.rb
|
258
260
|
- spec/unit/forge/v3/module_spec.rb
|