yaccl 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/yaccl/model/repository.rb +10 -0
- data/lib/yaccl/services/internal/browser_binding_service.rb +24 -11
- data/lib/yaccl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWI2YmU0MjQ1N2Y3ZjEzMzc1MzU2ZmYxMmE2NmYxMjM4NTFjM2ExYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWEzZTlkMzcyYWVmYTBkYjM5NzEyNTdhNThhMzFiYjU2NmNjNTcwOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDM5M2U4NDIxNjZjZmIwNTNjMmE3ZGJlZTFmMWIzZTRjMzQyMWNhNDhkMjUy
|
10
|
+
MGQ4NzY3MmVlZGQwYzk4MzUzZWUwOTYwNTZjYjBkZTFkOGNmOWI0ZjI2ZWFl
|
11
|
+
ODg3OGQwOTE4NDMyMWU2OTBiZjdhZjE4ZGQwOTdmYmVmMGQ3MGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGQ2Y2Y2MTU3MmQzNzExMWQ2MDZhMDBjOGY1MThhMzA2YTJkZjlkYmZkOGMw
|
14
|
+
MWYyZTAzYTdkMjFhNWZhZmYxMTEyNzNiNzA3MmI4MTdmZDFiOTJmOWRkNGVl
|
15
|
+
OGNjNDYzYjQ2MWJkM2ZmMDc3OWUxNTQ3NjRmOTdlZDM0YmFlYTE=
|
@@ -17,6 +17,16 @@ module YACCL
|
|
17
17
|
attr_reader :changes_on_type
|
18
18
|
attr_reader :root_folder_url
|
19
19
|
|
20
|
+
def ==(other)
|
21
|
+
return true if other.equal?(self)
|
22
|
+
return false unless other.kind_of?(self.class)
|
23
|
+
id == other.id
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_s
|
27
|
+
name
|
28
|
+
end
|
29
|
+
|
20
30
|
def self.create(raw_repository)
|
21
31
|
Repository.new(raw_repository)
|
22
32
|
end
|
@@ -11,8 +11,8 @@ module YACCL
|
|
11
11
|
class BrowserBindingService
|
12
12
|
def initialize(service_url, basic_auth_username=nil, basic_auth_password=nil, succinct_properties=true)
|
13
13
|
@service_url = service_url
|
14
|
-
@
|
15
|
-
|
14
|
+
@basement = Basement.new(basic_auth_username, basic_auth_password)
|
15
|
+
|
16
16
|
@succinct_properties = succinct_properties
|
17
17
|
|
18
18
|
@repository_urls = LRUCache.new(ttl: 3600)
|
@@ -31,12 +31,12 @@ module YACCL
|
|
31
31
|
|
32
32
|
response = if params.has_key?(:cmisaction)
|
33
33
|
if params.has_key?(:content)
|
34
|
-
|
34
|
+
@basement.multipart_post(url, params)
|
35
35
|
else
|
36
|
-
|
36
|
+
@basement.post(url, body: params)
|
37
37
|
end
|
38
38
|
else
|
39
|
-
|
39
|
+
@basement.get(url, query: params)
|
40
40
|
end
|
41
41
|
|
42
42
|
result = response.body
|
@@ -57,14 +57,14 @@ module YACCL
|
|
57
57
|
else
|
58
58
|
if object_id.nil?
|
59
59
|
if @repository_urls.fetch(repository_id).nil?
|
60
|
-
raise "No
|
61
|
-
repository_url =
|
60
|
+
raise "No repository found with ID: #{repository_id}." unless @basement.get(@service_url)[repository_id]
|
61
|
+
repository_url = @basement.get(@service_url)[repository_id]['repositoryUrl']
|
62
62
|
@repository_urls.store(repository_id, repository_url)
|
63
63
|
end
|
64
64
|
return @repository_urls.fetch(repository_id)
|
65
65
|
else
|
66
66
|
if @root_folder_urls.fetch(repository_id).nil?
|
67
|
-
root_folder_url =
|
67
|
+
root_folder_url = @basement.get(@service_url)[repository_id]['rootFolderUrl']
|
68
68
|
@root_folder_urls.store(repository_id, root_folder_url)
|
69
69
|
end
|
70
70
|
return @root_folder_urls.fetch(repository_id)
|
@@ -109,12 +109,25 @@ module YACCL
|
|
109
109
|
|
110
110
|
class Basement
|
111
111
|
include HTTParty
|
112
|
-
basic_auth @basic_auth_username, @basic_auth_password unless @basic_auth_username.nil?
|
113
112
|
|
114
|
-
def
|
113
|
+
def initialize(user, pass)
|
114
|
+
@username = user
|
115
|
+
@password = pass
|
116
|
+
self.class.basic_auth(user, pass)
|
117
|
+
end
|
118
|
+
|
119
|
+
def get(*params)
|
120
|
+
self.class.get(*params)
|
121
|
+
end
|
122
|
+
|
123
|
+
def post(*params)
|
124
|
+
self.class.post(*params)
|
125
|
+
end
|
126
|
+
|
127
|
+
def multipart_post(url, options)
|
115
128
|
url = URI.parse(url)
|
116
129
|
req = Net::HTTP::Post::Multipart.new(url.path, options)
|
117
|
-
req.basic_auth @
|
130
|
+
req.basic_auth @username, @password unless @username.nil?
|
118
131
|
Net::HTTP.start(url.host, url.port) { |http| http.request(req) }
|
119
132
|
end
|
120
133
|
end
|
data/lib/yaccl/version.rb
CHANGED