nsicloudooo 0.3.1 → 0.4.0

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.1
1
+ 0.4.0
@@ -131,6 +131,24 @@ module NSICloudooo
131
131
  execute_request(request)
132
132
  end
133
133
 
134
+ # Return the key of the thumbnail of a document
135
+ #
136
+ #
137
+ # @param [String] key of the desired document
138
+ # @return [String] key of the desired document's thumbnail
139
+ #
140
+ # @example
141
+ # nsicloudooo.thumbnail_key_for("some key")
142
+ #
143
+ # @raise NSICloudooo::Errors::Client::SAMConnectionError when cannot connect to the SAM node
144
+ # @raise NSICloudooo::Errors::Client::AuthenticationError when invalids user and/or password are provided
145
+ # @raise NSICloudooo::Errors::Client::KeyNotFoundError when an invalid key is provided
146
+ #
147
+ def thumbnail_key_for(document_key)
148
+ request = prepare_request :GET, {:doc_key => document_key}.to_json
149
+ execute_request(request)["thumbnail"]
150
+ end
151
+
134
152
  # Pre-configure the NSICloudooo module with default params for the NSICloudooo::Client
135
153
  #
136
154
  # @yield a Configuration object (see {NSICloudooo::Client::Configuration})
@@ -41,7 +41,7 @@ module NSICloudooo
41
41
  return {done: true}.to_json
42
42
  end
43
43
  elsif incoming.has_key? "doc_key"
44
- return {:images => [], :files => []}.to_json
44
+ return {:images => [], :files => [], :thumbnail => ['thumbnail key',]}.to_json
45
45
  end
46
46
  return 404 if incoming["key"].include? "dont"
47
47
  end
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.1"
8
+ s.version = "0.4.0"
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-25"
12
+ s.date = "2012-07-26"
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.21"
40
+ s.rubygems_version = "1.8.24"
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,6 +86,11 @@ describe NSICloudooo do
86
86
  @nsicloudooo.grains_keys_for(key)["files"].should have(0).files
87
87
  end
88
88
 
89
+ it "can access the key of the thumbnail" do
90
+ key = @nsicloudooo.granulate(:file => 'document', :filename => '2secs.odt')["doc_key"]
91
+ @nsicloudooo.thumbnail_key_for(key).should_not be_nil
92
+ end
93
+
89
94
  it "raises an error when trying to verify if non-existing key is done" do
90
95
  expect { @nsicloudooo.done("dont")["done"].should be_false }.to raise_error(NSICloudooo::Errors::Client::KeyNotFoundError)
91
96
  end
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.1
4
+ version: 0.4.0
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-25 00:00:00.000000000 Z
12
+ date: 2012-07-26 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: -2541024177996774123
149
+ hash: 4574981484104652555
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.21
158
+ rubygems_version: 1.8.24
159
159
  signing_key:
160
160
  specification_version: 3
161
161
  summary: A simple gem to access a nsi.cloudooo node