ogle 0.1.1 → 0.1.2

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/README.md CHANGED
@@ -38,6 +38,10 @@ Depending on the call you make, glance will sometimes return JSON and others XML
38
38
  response = CONNECTION.image.find 6
39
39
  puts response
40
40
 
41
+ # This will delete a given image
42
+ response = CONNECTION.image.delete 6
43
+ puts response.code
44
+
41
45
  ## Compatability
42
46
 
43
47
  ruby 1.9.2
@@ -48,5 +52,4 @@ ruby 1.9.2
48
52
 
49
53
  ## TODOs
50
54
 
51
- * Image#all should return all public/runnable images.
52
- See lib/nephophobia/image.rb#pubic?
55
+ * Implement write functionality (POST/PUT)
data/lib/ogle/image.rb CHANGED
@@ -51,6 +51,17 @@ module Ogle
51
51
  end
52
52
  end
53
53
 
54
+ def create file
55
+ end
56
+
57
+ ##
58
+ # Delete an image
59
+ # +image_id+: A String representing an image_id.
60
+
61
+ def delete image_id
62
+ response = @connection.delete "/images/#{image_id}"
63
+ end
64
+
54
65
  private
55
66
  ##
56
67
  # Kernels and Ramdisks are not runable, so we want to ignore them.
data/lib/ogle/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ogle
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -0,0 +1,28 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :delete
5
+ uri: http://10.3.170.32:9292/images/15
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/json
10
+ connection:
11
+ - keep-alive
12
+ keep-alive:
13
+ - 30
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ content-type:
20
+ - text/html; charset=UTF-8
21
+ content-length:
22
+ - "0"
23
+ date:
24
+ - Mon, 18 Apr 2011 13:48:38 GMT
25
+ connection:
26
+ - keep-alive
27
+ body:
28
+ http_version: "1.1"
@@ -59,14 +59,12 @@ describe Ogle::Image do
59
59
  end
60
60
 
61
61
  describe "#runable with details" do
62
- before do
63
- VCR.use_cassette "images_runable_with_details" do
64
- @response = CONNECTION.image.runable(true)
65
- end
66
- end
62
+ VCR.use_cassette "images_runable_with_details" do
63
+ response = CONNECTION.image.runable(true)
67
64
 
68
- it "returns metadata" do
69
- must_have_valid_keys @response.first, DETAILED_METADATA_KEYS
65
+ it "returns metadata" do
66
+ must_have_valid_keys response.first, DETAILED_METADATA_KEYS
67
+ end
70
68
  end
71
69
  end
72
70
 
@@ -93,4 +91,14 @@ describe Ogle::Image do
93
91
  )
94
92
  end
95
93
  end
94
+
95
+ describe "#delete" do
96
+ VCR.use_cassette "image_delete" do
97
+ response = CONNECTION.image.delete 15
98
+
99
+ it "returns an HTTP/1.1 200 OK" do
100
+ response.code.must_equal "200"
101
+ end
102
+ end
103
+ end
96
104
  end
data/test/test_helper.rb CHANGED
@@ -28,6 +28,7 @@ class MiniTest::Unit::TestCase
28
28
  properties
29
29
  size
30
30
  )
31
+
31
32
  end
32
33
 
33
34
  VCR.config do |c|
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ogle
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kevin Bringard
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-14 00:00:00 -06:00
13
+ date: 2011-04-18 00:00:00 -06:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -88,6 +88,7 @@ files:
88
88
  - lib/ogle/image.rb
89
89
  - lib/ogle/version.rb
90
90
  - ogle.gemspec
91
+ - test/cassettes/image_delete.yml
91
92
  - test/cassettes/images_all.yml
92
93
  - test/cassettes/images_all_with_details.yml
93
94
  - test/cassettes/images_find.yml
@@ -124,6 +125,7 @@ signing_key:
124
125
  specification_version: 3
125
126
  summary: Ruby interface for OpenStack Glance
126
127
  test_files:
128
+ - test/cassettes/image_delete.yml
127
129
  - test/cassettes/images_all.yml
128
130
  - test/cassettes/images_all_with_details.yml
129
131
  - test/cassettes/images_find.yml