nsicloudooo 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -16,6 +16,7 @@ module NSICloudooo
16
16
  #
17
17
  # @param [Hash] options used to send a document to be graulated
18
18
  # @option options [String] file the base64 encoded file to be granulated
19
+ # @option options [String] sam_uid the UID of a document at SAM
19
20
  # @option options [String] filename the filename of the document
20
21
  # @note the filename is very importante, the cloudooo node will convert the document based on its filename, if necessary
21
22
  # @option options [String] doc_link link to the document that'll be granulated
@@ -26,6 +27,11 @@ module NSICloudooo
26
27
  # @example A simple granulation
27
28
  # doc = Base64.encode64(File.new('document.odt', 'r').read)
28
29
  # nsicloudooo.granulate(:file => doc, :filename => 'document.odt')
30
+ # @example Granulating from a SAM uid
31
+ # doc = Base64.encode64(File.new('document.odt', 'r').read)
32
+ # response = sam.store {:doc => doc, :granulated => false}
33
+ # doc_key = response["key"]
34
+ # nsicloudooo.granulate(:sam_uid => doc_key, :filename => 'document.odt')
29
35
  # @example Downloading and granulating from web
30
36
  # nsicloudooo.granulate(:doc_link => 'http://google.com/document.odt')
31
37
  # @example Sending a callback url
@@ -38,11 +44,14 @@ module NSICloudooo
38
44
  # nsicloudooo.granulate(:doc_link => 'http://google.com/document.odt', :callback => 'http://google.com', :verb => "PUT")
39
45
  #
40
46
  # @return [Hash] response
41
- # * "key" [String] the key to access the granulated document if the sam node it was stored
47
+ # * "doc_key" [String] the key to access the granulated document if the sam node it was stored
42
48
  def granulate(options = {})
43
49
  @request_data = Hash.new
44
50
  if options[:doc_link]
45
51
  insert_download_data options
52
+ elsif options[:sam_uid]
53
+ file_data = {:sam_uid => options[:sam_uid], :filename => options[:filename]}
54
+ @request_data.merge! file_data
46
55
  else
47
56
  file_data = {:doc => options[:file], :filename => options[:filename]}
48
57
  @request_data.merge! file_data
@@ -77,7 +86,7 @@ module NSICloudooo
77
86
  # * "files" [String] keys to the files grains of the document
78
87
  #
79
88
  # @example
80
- # nsicloudooo.grains_kets_for("some key")
89
+ # nsicloudooo.grains_keys_for("some key")
81
90
  def grains_keys_for(document_key)
82
91
  request = prepare_request :GET, {:doc_key => document_key}.to_json
83
92
  execute_request(request)
data/nsicloudooo.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "nsicloudooo"
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
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"]
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.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &70140067600480 !ruby/object:Gem::Requirement
16
+ requirement: &70181469278700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70140067600480
24
+ version_requirements: *70181469278700
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70140067520540 !ruby/object:Gem::Requirement
27
+ requirement: &70181469277380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.8.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70140067520540
35
+ version_requirements: *70181469277380
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: yard
38
- requirement: &70140067511860 !ruby/object:Gem::Requirement
38
+ requirement: &70181469275980 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0.7'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70140067511860
46
+ version_requirements: *70181469275980
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rdoc
49
- requirement: &70140067509840 !ruby/object:Gem::Requirement
49
+ requirement: &70181469273960 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '3.12'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70140067509840
57
+ version_requirements: *70181469273960
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bundler
60
- requirement: &70140067506560 !ruby/object:Gem::Requirement
60
+ requirement: &70181469382000 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.1.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70140067506560
68
+ version_requirements: *70181469382000
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
- requirement: &70140067502580 !ruby/object:Gem::Requirement
71
+ requirement: &70181469379960 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: 1.8.3
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70140067502580
79
+ version_requirements: *70181469379960
80
80
  description: A simple gem to access a nsi.cloudooo node
81
81
  email: d.camata@gmail.com
82
82
  executables: []
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  version: '0'
115
115
  segments:
116
116
  - 0
117
- hash: -803188749709581665
117
+ hash: 4594306514646020446
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  none: false
120
120
  requirements: