nsicloudooo 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -135,6 +135,13 @@ module NSICloudooo
135
135
  #
136
136
  # @yield a Configuration object (see {NSICloudooo::Client::Configuration})
137
137
  #
138
+ # @example
139
+ # NSICloudooo::Client.configure do
140
+ # user "why"
141
+ # password "chunky"
142
+ # host "localhost"
143
+ # port "8888"
144
+ # end
138
145
  def self.configure(&block)
139
146
  Configuration.instance_eval(&block)
140
147
  end
@@ -170,6 +177,7 @@ module NSICloudooo
170
177
  raise NSICloudooo::Errors::Client::KeyNotFoundError if response.code == "404"
171
178
  raise NSICloudooo::Errors::Client::MalformedRequestError if response.code == "400"
172
179
  raise NSICloudooo::Errors::Client::AuthenticationError if response.code == "401"
180
+ raise NSICloudooo::Errors::Client::QueueServiceConnectionError if response.code == "503"
173
181
  if response.code == "500" and response.body.include?("SAM")
174
182
  raise NSICloudooo::Errors::Client::SAMConnectionError
175
183
  end
@@ -18,6 +18,9 @@ module NSICloudooo
18
18
 
19
19
  class ConnectionRefusedError < RuntimeError
20
20
  end
21
+
22
+ class QueueServiceConnectionError < RuntimeError
23
+ end
21
24
  end
22
25
  end
23
26
  end
@@ -20,6 +20,8 @@ module NSICloudooo
20
20
  if filename.include? "secs"
21
21
  seconds = filename.split(".")[0].delete("secs").to_i
22
22
  sleep seconds-1
23
+ elsif filename.include? "queue error"
24
+ return 503
23
25
  end
24
26
  {
25
27
  doc_key: "key for document #{filename}",
data/nsicloudooo.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "nsicloudooo"
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Douglas Camata"]
12
- s.date = "2012-05-16"
12
+ s.date = "2012-05-25"
13
13
  s.description = "A simple gem to access a nsi.cloudooo node"
14
14
  s.email = "d.camata@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
37
37
  s.homepage = "http://github.com/nsi-iff/nsicloudooo-ruby.git"
38
38
  s.licenses = ["MIT"]
39
39
  s.require_paths = ["lib"]
40
- s.rubygems_version = "1.8.24"
40
+ s.rubygems_version = "1.8.21"
41
41
  s.summary = "A simple gem to access a nsi.cloudooo node"
42
42
 
43
43
  if s.respond_to? :specification_version then
@@ -86,9 +86,14 @@ describe NSICloudooo do
86
86
  @nsicloudooo.grains_keys_for(key)["files"].should have(0).files
87
87
  end
88
88
 
89
- it "raises an error whentrying to verify if non-existing key is done" do
89
+ it "raises an error when trying to verify if non-existing key is done" do
90
90
  expect { @nsicloudooo.done("dont")["done"].should be_false }.to raise_error(NSICloudooo::Errors::Client::KeyNotFoundError)
91
91
  end
92
+
93
+ it "raises an error when the server can't connect to the queue service" do
94
+ expect { @nsicloudooo.granulate(:file => 'document', :filename => 'queue error' ).should be_false }.to raise_error(NSICloudooo::Errors::Client::QueueServiceConnectionError)
95
+ end
96
+
92
97
  end
93
98
 
94
99
  context "get configuration" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nsicloudooo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
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: 2012-05-16 00:00:00.000000000 Z
12
+ date: 2012-05-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -146,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
146
  version: '0'
147
147
  segments:
148
148
  - 0
149
- hash: -4092089429222275052
149
+ hash: -2541024177996774123
150
150
  required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  none: false
152
152
  requirements:
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  version: '0'
156
156
  requirements: []
157
157
  rubyforge_project:
158
- rubygems_version: 1.8.24
158
+ rubygems_version: 1.8.21
159
159
  signing_key:
160
160
  specification_version: 3
161
161
  summary: A simple gem to access a nsi.cloudooo node