puppet_forge 2.2.6 → 2.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +26 -26
- data/lib/puppet_forge/version.rb +1 -1
- data/puppet_forge.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50ae156c931b5b0f762aed1b68412d6e203681e2
|
4
|
+
data.tar.gz: ad082614f565312c528438c46b84033e3416361e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0bb0b11dcefec8c7dc09fb62fdf6d367e449ec66a787e8f19962535a65d67c29aab166758be666cbe3c462115d431218c27df362afdfa0938b543e3ef8edc4a
|
7
|
+
data.tar.gz: 066eadca06f32397ed935ba3e2d2bafe1b72c59032b2fbe10b95239bbe90c92b76009727b32288fcbd70ed4e11ca58caeb50382b340c8a4b750a36fdbfc0c1c4
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
Starting with v2.0.0, all notable changes to this project will be documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## v2.2.7 - 2017-06-30
|
7
|
+
|
8
|
+
### Changed
|
9
|
+
|
10
|
+
* Updated dependency on `semantic_puppet` to `~> 1.0`.
|
11
|
+
|
6
12
|
## v2.2.6 - 2017-06-27
|
7
13
|
|
8
14
|
### Fixed
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
#Puppet Forge
|
1
|
+
# Puppet Forge
|
2
2
|
|
3
3
|
Access and manipulate the [Puppet Forge API](https://forgeapi.puppetlabs.com)
|
4
4
|
from Ruby.
|
5
5
|
|
6
|
-
##Installation
|
6
|
+
## Installation
|
7
7
|
|
8
8
|
Add this line to your application's Gemfile:
|
9
9
|
|
@@ -17,11 +17,11 @@ Or install it yourself as:
|
|
17
17
|
|
18
18
|
$ gem install puppet_forge
|
19
19
|
|
20
|
-
##Requirements
|
20
|
+
## Requirements
|
21
21
|
|
22
22
|
* Ruby >= 1.9.3
|
23
23
|
|
24
|
-
##Dependencies
|
24
|
+
## Dependencies
|
25
25
|
|
26
26
|
* [Faraday]() ~> 0.9.0
|
27
27
|
* [Typhoeus](https://github.com/typhoeus/typhoeus) ~> 0.7.0 (optional)
|
@@ -30,18 +30,18 @@ Typhoeus will be used as the HTTP adapter if it is available, otherwise
|
|
30
30
|
Net::HTTP will be used. We recommend using Typhoeus for production-level
|
31
31
|
applications.
|
32
32
|
|
33
|
-
##Usage
|
33
|
+
## Usage
|
34
34
|
|
35
35
|
First, make sure you have imported the Puppet Forge gem into your application:
|
36
36
|
|
37
|
-
```
|
37
|
+
```ruby
|
38
38
|
require 'puppet_forge'
|
39
39
|
```
|
40
40
|
|
41
41
|
Next, supply a user-agent string to identify requests sent by your application
|
42
42
|
to the Puppet Forge API:
|
43
43
|
|
44
|
-
```
|
44
|
+
```ruby
|
45
45
|
PuppetForge.user_agent = "MyApp/1.0.0"
|
46
46
|
```
|
47
47
|
|
@@ -76,7 +76,7 @@ resource model are documented on the [Resource Reference][resource_ref] page.
|
|
76
76
|
|
77
77
|
[resource_ref]: https://github.com/puppetlabs/forge-ruby/wiki/Resource-Reference
|
78
78
|
|
79
|
-
###Basic Interface
|
79
|
+
### Basic Interface
|
80
80
|
|
81
81
|
Each of the models uses ActiveRecord-like REST functionality to map over the Forge API endpoints.
|
82
82
|
Most simple ActiveRecord-style interactions function as intended.
|
@@ -85,7 +85,7 @@ Currently, only unauthenticated read-only actions are supported.
|
|
85
85
|
|
86
86
|
The methods find, where, and all immediately make one API request.
|
87
87
|
|
88
|
-
```
|
88
|
+
```ruby
|
89
89
|
# Find a Resource by Slug
|
90
90
|
PuppetForge::User.find('puppetlabs') # => #<Forge::V3::User(/v3/users/puppetlabs)>
|
91
91
|
|
@@ -97,23 +97,23 @@ PuppetForge::Module.where(query: 'apache') # See "Paginated Collections" below f
|
|
97
97
|
PuppetForge::Module.where(query: 'apache').first # => #<Forge::V3::Module(/v3/modules/puppetlabs-apache)>
|
98
98
|
```
|
99
99
|
|
100
|
-
For compatibility with older versions of the
|
100
|
+
For compatibility with older versions of the puppet\_forge gem, the following two methods are functionally equivalent.
|
101
101
|
|
102
|
-
```
|
102
|
+
```ruby
|
103
103
|
PuppetForge::Module.where(query: 'apache')
|
104
104
|
PuppetForge::Module.where(query: 'apache').all # This method is deprecated and not recommended
|
105
105
|
```
|
106
106
|
|
107
|
-
####Errors
|
107
|
+
#### Errors
|
108
108
|
|
109
109
|
All API Requests (whether via find, where, or all) will raise a Faraday::ResourceNotFound error if the request fails.
|
110
110
|
|
111
111
|
|
112
|
-
###Installing a Release
|
112
|
+
### Installing a Release
|
113
113
|
|
114
114
|
A release tarball can be downloaded and installed by following the steps below.
|
115
115
|
|
116
|
-
```
|
116
|
+
```ruby
|
117
117
|
release_slug = "puppetlabs-apache-1.6.0"
|
118
118
|
release_tarball = release_slug + ".tar.gz"
|
119
119
|
dest_dir = "/path/to/install/directory"
|
@@ -137,11 +137,11 @@ PuppetForge::Unpacker.unpack(release_tarball, dest_dir, tmp_dir)
|
|
137
137
|
```
|
138
138
|
|
139
139
|
|
140
|
-
###Paginated Collections
|
140
|
+
### Paginated Collections
|
141
141
|
|
142
142
|
The Forge API only returns paginated collections as of v3.
|
143
143
|
|
144
|
-
```
|
144
|
+
```ruby
|
145
145
|
PuppetForge::Module.all.total # => 1728
|
146
146
|
PuppetForge::Module.all.length # => 20
|
147
147
|
```
|
@@ -151,7 +151,7 @@ parameters, but it's generally preferable to leverage the pagination links
|
|
151
151
|
provided by the API. For convenience, pagination links are exposed by the
|
152
152
|
library.
|
153
153
|
|
154
|
-
```
|
154
|
+
```ruby
|
155
155
|
PuppetForge::Module.all.offset # => 0
|
156
156
|
PuppetForge::Module.all.next_url # => "/v3/modules?limit=20&offset=20"
|
157
157
|
PuppetForge::Module.all.next.offset # => 20
|
@@ -160,23 +160,23 @@ PuppetForge::Module.all.next.offset # => 20
|
|
160
160
|
An enumerator exists for iterating over the entire (unpaginated) collection.
|
161
161
|
Keep in mind that this will result in multiple calls to the Forge API.
|
162
162
|
|
163
|
-
```
|
163
|
+
```ruby
|
164
164
|
PuppetForge::Module.where(query: 'php').total # => 37
|
165
165
|
PuppetForge::Module.where(query: 'php').unpaginated # => #<Enumerator>
|
166
166
|
PuppetForge::Module.where(query: 'php').unpaginated.to_a.length # => 37
|
167
167
|
```
|
168
168
|
|
169
|
-
###Associations & Lazy Attributes
|
169
|
+
### Associations & Lazy Attributes
|
170
170
|
|
171
171
|
Associated models are accessible in the API by property name.
|
172
172
|
|
173
|
-
```
|
173
|
+
```ruby
|
174
174
|
PuppetForge::Module.find('puppetlabs-apache').owner # => #<Forge::V3::User(/v3/users/puppetlabs)>
|
175
175
|
```
|
176
176
|
|
177
177
|
Properties of associated models are then loaded lazily.
|
178
178
|
|
179
|
-
```
|
179
|
+
```ruby
|
180
180
|
user = PuppetForge::Module.find('puppetlabs-apache').owner
|
181
181
|
|
182
182
|
# This does not trigger a request
|
@@ -196,7 +196,7 @@ using the `FastGettext.set_locale` method. If translations do not exist for the
|
|
196
196
|
default to English. The `set_locale` method will return the locale, as a string, that FastGettext will now
|
197
197
|
use to report PuppetForge errors.
|
198
198
|
|
199
|
-
```
|
199
|
+
```ruby
|
200
200
|
# Assuming the German translations exist, this will set the reporting language
|
201
201
|
# to German
|
202
202
|
|
@@ -206,12 +206,12 @@ locale = FastGettext.set_locale "de_DE"
|
|
206
206
|
# If it fails to find any German locale, locale will be "en"
|
207
207
|
```
|
208
208
|
|
209
|
-
##Caveats
|
209
|
+
## Caveats
|
210
210
|
|
211
211
|
This library currently does no response caching of its own, instead opting to
|
212
212
|
re-issue every request each time. This will be changed in a later release.
|
213
213
|
|
214
|
-
##Reporting Issues
|
214
|
+
## Reporting Issues
|
215
215
|
|
216
216
|
Please report problems, issues, and feature requests on the public
|
217
217
|
[Puppet Labs issue tracker][issues] under the FORGE project. You will need
|
@@ -219,7 +219,7 @@ to create a free account to add new tickets.
|
|
219
219
|
|
220
220
|
[issues]: https://tickets.puppetlabs.com/browse/FORGE
|
221
221
|
|
222
|
-
##Contributing
|
222
|
+
## Contributing
|
223
223
|
|
224
224
|
1. Fork it ( https://github.com/[my-github-username]/forge-ruby/fork )
|
225
225
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
@@ -227,7 +227,7 @@ to create a free account to add new tickets.
|
|
227
227
|
4. Push to the branch (`git push origin my-new-feature`)
|
228
228
|
5. Create a new Pull Request
|
229
229
|
|
230
|
-
##Contributors
|
230
|
+
## Contributors
|
231
231
|
|
232
232
|
* Pieter van de Bruggen, Puppet Labs
|
233
233
|
* Jesse Scott, Puppet Labs
|
data/lib/puppet_forge/version.rb
CHANGED
data/puppet_forge.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_runtime_dependency "faraday", "~> 0.9.0"
|
24
24
|
spec.add_runtime_dependency "faraday_middleware", [">= 0.9.0", "< 0.11.0"]
|
25
|
-
spec.add_dependency 'semantic_puppet', '~>
|
25
|
+
spec.add_dependency 'semantic_puppet', '~> 1.0'
|
26
26
|
spec.add_dependency 'minitar'
|
27
27
|
spec.add_dependency 'gettext-setup', '~> 0.11'
|
28
28
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet_forge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: '1.0'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: '1.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: minitar
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|