barge 0.4.0 → 0.5.0

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: a6dd8b82beeebd5c15f3ed1bd895b94d2f532fae
4
- data.tar.gz: 91a31a6bb2f8dc9da9de427759452bb92b695c12
3
+ metadata.gz: 812d968b6233cf86946ddba0aadd71b5d7daa6c5
4
+ data.tar.gz: 70cbacbf6cc75e8dddfd70a7255248204c880282
5
5
  SHA512:
6
- metadata.gz: 1b7300265b5b0f8cb5fafa1b50a6906892a72eb91085e28d412a515b4a1b3dd66e0e5e80d09ac0866ac3890363b3053b1aefbbdee92893e4a1f4d6429bb06cb7
7
- data.tar.gz: 01fda3a760269bbc0d8c7eb1c9e2987cd7e3a5e7139de15c2d033d1da1febdc3a9d3c34ce4be43e8fec465edd75fabb27e73d8af57c4d4364c423c4ec3f529a3
6
+ metadata.gz: 23349a278ef256a21002afbf8ff94a6056f25ecef565705a5819e1bf683b3d3b6de103533083fd63d65c247b8b95e3281250603b9fa093330d1bdc5d0b56b856
7
+ data.tar.gz: 6c68c3c554d0c1b71e36721df1742f3018104af7f365ef4b37de42c4e1c99fbac64e86da6c36136d9e7dea0cfe0df2ebc5cb05e34bb7dec83d5c9a6c01c67b09
data/README.md CHANGED
@@ -123,6 +123,12 @@ barge.droplet.show(droplet_id)
123
123
  barge.droplet.backups(droplet_id)
124
124
  ```
125
125
 
126
+ ### Show droplet kernels
127
+
128
+ ``` ruby
129
+ barge.droplet.kernels(droplet_id)
130
+ ```
131
+
126
132
  ### Show droplet snapshots
127
133
 
128
134
  ``` ruby
@@ -197,6 +203,12 @@ barge.droplet.restore(droplet_id, image_id)
197
203
  barge.droplet.password_reset(droplet_id)
198
204
  ```
199
205
 
206
+ ### Show droplet actions
207
+
208
+ ``` ruby
209
+ barge.droplet.actions(droplet_id)
210
+ ```
211
+
200
212
  ### Show droplet action
201
213
 
202
214
  ``` ruby
@@ -3,6 +3,8 @@ module Barge
3
3
  module Base
4
4
  attr_reader :faraday
5
5
 
6
+ PER_PAGE = 999
7
+
6
8
  def initialize(faraday)
7
9
  @faraday = faraday
8
10
  end
@@ -16,7 +18,8 @@ module Barge
16
18
  end
17
19
 
18
20
  def request(verb, *args)
19
- response = faraday.public_send(verb, *args)
21
+ options = { per_page: PER_PAGE } if verb == :get
22
+ response = faraday.public_send(verb, *args, options)
20
23
  response.body.tap do |r|
21
24
  r.define_singleton_method(:response) { response }
22
25
  r.define_singleton_method(:success?) { response.success? }
@@ -19,6 +19,10 @@ module Barge
19
19
  get("droplets/#{droplet_id}/backups")
20
20
  end
21
21
 
22
+ def kernels(droplet_id)
23
+ get("droplets/#{droplet_id}/kernels")
24
+ end
25
+
22
26
  def snapshots(droplet_id)
23
27
  get("droplets/#{droplet_id}/snapshots")
24
28
  end
@@ -67,6 +71,10 @@ module Barge
67
71
  action(droplet_id, __method__)
68
72
  end
69
73
 
74
+ def actions(droplet_id)
75
+ get("droplets/#{droplet_id}/actions")
76
+ end
77
+
70
78
  def show_action(droplet_id, action_id)
71
79
  get("droplets/#{droplet_id}/actions/#{action_id}")
72
80
  end
@@ -1,7 +1,7 @@
1
1
  module Barge
2
2
  class Version
3
3
  MAJOR = 0
4
- MINOR = 4
4
+ MINOR = 5
5
5
  PATCH = 0
6
6
 
7
7
  def self.to_s
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Ørjan Blom"
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-28 00:00:00.000000000 Z
11
+ date: 2014-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '3.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '3.1'
55
55
  description: Ruby library for version 2 of DigitalOcean's API
56
56
  email:
57
57
  - blom@blom.tv