yaccl 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/yaccl/services/internal/browser_binding_service.rb +16 -2
- data/lib/yaccl.rb +1 -1
- data/spec/helper.rb +0 -4
- data/yaccl.gemspec +3 -2
- metadata +22 -6
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'httparty'
|
2
2
|
require 'net/http/post/multipart'
|
3
3
|
require 'multi_json'
|
4
|
+
require 'lrucache'
|
4
5
|
|
5
6
|
module YACCL
|
6
7
|
module Services
|
@@ -10,6 +11,8 @@ module YACCL
|
|
10
11
|
class BrowserBindingService
|
11
12
|
def initialize(service_url)
|
12
13
|
@service_url = service_url
|
14
|
+
@repository_urls = LRUCache.new(ttl: 1.hour)
|
15
|
+
@root_folder_urls = LRUCache.new(ttl: 1.hour)
|
13
16
|
end
|
14
17
|
|
15
18
|
def perform_request(required_params={}, optional_params={})
|
@@ -46,8 +49,19 @@ module YACCL
|
|
46
49
|
if repository_id.nil?
|
47
50
|
@service_url
|
48
51
|
else
|
49
|
-
|
50
|
-
|
52
|
+
if object_id.nil?
|
53
|
+
if @repository_urls.fetch(repository_id).nil?
|
54
|
+
repository_url = Basement.get(@service_url)[repository_id]['repositoryUrl']
|
55
|
+
@repository_urls.store(repository_id, repository_url)
|
56
|
+
end
|
57
|
+
return @repository_urls.fetch(repository_id)
|
58
|
+
else
|
59
|
+
if @root_folder_urls.fetch(repository_id).nil?
|
60
|
+
root_folder_url = Basement.get(@service_url)[repository_id]['rootFolderUrl']
|
61
|
+
@root_folder_urls.store(repository_id, root_folder_url)
|
62
|
+
end
|
63
|
+
return @root_folder_urls.fetch(repository_id)
|
64
|
+
end
|
51
65
|
end
|
52
66
|
end
|
53
67
|
|
data/lib/yaccl.rb
CHANGED
data/spec/helper.rb
CHANGED
data/yaccl.gemspec
CHANGED
@@ -12,9 +12,10 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = 'Ruby CMIS browser binding client lib.'
|
13
13
|
s.description = 'Ruby CMIS browser binding client lib.'
|
14
14
|
|
15
|
-
s.add_dependency 'httparty', '~> 0.10
|
16
|
-
s.add_dependency 'multipart-post', '~> 1.1
|
15
|
+
s.add_dependency 'httparty', '~> 0.10'
|
16
|
+
s.add_dependency 'multipart-post', '~> 1.1'
|
17
17
|
s.add_dependency 'multi_json', '~> 1.5'
|
18
|
+
s.add_dependency 'lrucache', '~> 0.1'
|
18
19
|
|
19
20
|
s.files = `git ls-files`.split("\n")
|
20
21
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaccl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-03-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.10
|
22
|
+
version: '0.10'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.10
|
30
|
+
version: '0.10'
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: multipart-post
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
requirements:
|
36
36
|
- - ~>
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version: 1.1
|
38
|
+
version: '1.1'
|
39
39
|
type: :runtime
|
40
40
|
prerelease: false
|
41
41
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - ~>
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 1.1
|
46
|
+
version: '1.1'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: multi_json
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,6 +60,22 @@ dependencies:
|
|
60
60
|
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '1.5'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: lrucache
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ~>
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0.1'
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ~>
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0.1'
|
63
79
|
description: Ruby CMIS browser binding client lib.
|
64
80
|
email:
|
65
81
|
- kenneth@up-nxt.com
|