naranya_ecm-sdk 0.0.31 → 0.0.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/naranya_ecm-sdk/version.rb +1 -1
- data/lib/naranya_ecm/models/media_resource.rb +34 -0
- data/naranya_ecm-sdk.gemspec +8 -8
- metadata +34 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecdd00cf3b051b7b563106139d914e45b3884a8f
|
4
|
+
data.tar.gz: c10c6065ab59d7411b6b0d4cbe233d63db785f44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb660909b34cfa56d0a8499fee2f1cb8b2cf572c51abb1a4306330a443944aba4d4efd1d7c10a0cd35157ea2689d747c1c01e91a6ae6eb73a94eaa86bf24dad6
|
7
|
+
data.tar.gz: 90070d8d6450ba7e69cd156e11b9f28f6039287aa3ef868db3a0c6bd96fc4f81d7afa84c2dca42978425a2259a8e9ca6edb5e0a183b41d033ff5bbd36ecc62dc
|
@@ -27,13 +27,47 @@ module NaranyaEcm
|
|
27
27
|
|
28
28
|
#belongs_to :parent_document
|
29
29
|
|
30
|
+
# Returns true if the Media Resource is private
|
30
31
|
def private?
|
31
32
|
self.access_type == 'private'
|
32
33
|
end
|
33
34
|
|
35
|
+
# Returns true if the Media Resource is private
|
34
36
|
def public?
|
35
37
|
self.access_type == 'public'
|
36
38
|
end
|
39
|
+
|
40
|
+
# Returns the downloadable resource key, which depending of the storage engine, is one of the following:
|
41
|
+
# - Amazon AWS S3: The downloadable object key
|
42
|
+
def downloadable_resource_key
|
43
|
+
@downloadable_file_key ||= URI(self.downloadable_url).path[1..-1] if self.downloadable_url.present?
|
44
|
+
end
|
45
|
+
|
46
|
+
# Returns the downloadable resource, which depending of the storage engine, is one of the following:
|
47
|
+
# - Amazon AWS S3: A Fog::Storage::AWS::File object, representing the file object in Amazon
|
48
|
+
def downloadable_resource
|
49
|
+
root_directory.files.head downloadable_resource_key
|
50
|
+
end
|
51
|
+
|
52
|
+
# Return the URL used to access the media resource file.
|
53
|
+
# - In case of a private resource file, the URL includes parameters used to access the file
|
54
|
+
# for the following 5 minutes, unless an expiration time is given.
|
55
|
+
def downloadable_authorized_url(expiration_time = nil)
|
56
|
+
if self.public?
|
57
|
+
downloadable_resource.public_url
|
58
|
+
else
|
59
|
+
expiration_time = 5.minutes.from_now unless expiration_time.is_a? Time
|
60
|
+
downloadable_resource.url(expiration_time)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
delegate :root_directory, to: :class
|
65
|
+
|
66
|
+
# Returns the storage root directory, depending of the storage engine:
|
67
|
+
# - Amazon AWS S3: A Fog::Storage::AWS::Directory object
|
68
|
+
def self.root_directory
|
69
|
+
NaranyaEcm.root_directory
|
70
|
+
end
|
37
71
|
|
38
72
|
end
|
39
73
|
end
|
data/naranya_ecm-sdk.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
|
5
|
-
require
|
5
|
+
require "naranya_ecm-sdk/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = "naranya_ecm-sdk"
|
@@ -19,15 +19,15 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency
|
23
|
-
spec.add_dependency
|
24
|
-
spec.add_dependency
|
25
|
-
spec.add_dependency
|
26
|
-
spec.add_dependency
|
22
|
+
spec.add_dependency "activesupport", "~> 4.0.5"
|
23
|
+
spec.add_dependency "activemodel", "~> 4.0.5"
|
24
|
+
spec.add_dependency "httparty"
|
25
|
+
spec.add_dependency "aasm"
|
26
|
+
spec.add_dependency "fog", "~> 1.22.1"
|
27
27
|
|
28
28
|
spec.add_development_dependency "bundler"
|
29
29
|
spec.add_development_dependency "rake"
|
30
|
-
spec.add_development_dependency "rspec", "~> 3.0.0
|
30
|
+
spec.add_development_dependency "rspec", "~> 3.0.0"
|
31
31
|
spec.add_development_dependency "vcr"
|
32
32
|
spec.add_development_dependency "webmock"
|
33
33
|
end
|
metadata
CHANGED
@@ -1,153 +1,153 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: naranya_ecm-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Quintanilla
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.0.
|
19
|
+
version: 4.0.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.0.
|
26
|
+
version: 4.0.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activemodel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.0.
|
33
|
+
version: 4.0.5
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.0.
|
40
|
+
version: 4.0.5
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: httparty
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
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
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: aasm
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: fog
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 1.22.1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 1.22.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 3.0.0
|
117
|
+
version: 3.0.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ~>
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 3.0.0
|
124
|
+
version: 3.0.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: vcr
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - '>='
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: webmock
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - '>='
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
description: Cliente Ruby de NaranyaEcm
|
@@ -157,7 +157,7 @@ executables: []
|
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
|
-
-
|
160
|
+
- .gitignore
|
161
161
|
- Gemfile
|
162
162
|
- LICENSE.txt
|
163
163
|
- README.rdoc
|
@@ -208,17 +208,17 @@ require_paths:
|
|
208
208
|
- lib
|
209
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
210
210
|
requirements:
|
211
|
-
- -
|
211
|
+
- - '>='
|
212
212
|
- !ruby/object:Gem::Version
|
213
213
|
version: '0'
|
214
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
215
|
requirements:
|
216
|
-
- -
|
216
|
+
- - '>='
|
217
217
|
- !ruby/object:Gem::Version
|
218
218
|
version: '0'
|
219
219
|
requirements: []
|
220
220
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.
|
221
|
+
rubygems_version: 2.0.14
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: Cliente Ruby de NaranyaEcm
|