yaccl 0.0.34 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/create_type_manual.rb +1 -1
- data/lib/yaccl/services/internal/browser_binding_service.rb +31 -11
- data/lib/yaccl/version.rb +1 -1
- data/yaccl.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ef5855ab2cec718cc226594fe83ce087460eed8
|
4
|
+
data.tar.gz: 78bef86bac1386f1e0045a0f7fee4bf33348d058
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50531092037d4c21586510f205c9b64a9546fbfe1ee32ac4c5e9fafdbc66c0e36f3a85a507fa11a2d3f4bf704b1cb41f1bd91695a30df1f20ac435f0127a3761
|
7
|
+
data.tar.gz: afd6f11dfbee74bef6e9dc592cb5ee2ecf3e25883a404bf2b41b7756f79fa4425fd258f7790962d89ca1518dbb007e02d3f5488483fd2e6b80100433c2c7221d
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'typhoeus'
|
2
2
|
require 'net/http/post/multipart'
|
3
3
|
require 'multi_json'
|
4
4
|
require_relative 'simple_cache'
|
@@ -34,14 +34,15 @@ module YACCL
|
|
34
34
|
if params.has_key?(:content)
|
35
35
|
@basement.multipart_post(url, params, headers)
|
36
36
|
else
|
37
|
-
@basement.post(url, body: params, headers: headers)
|
37
|
+
@basement.post(url: url, body: params, headers: headers)
|
38
38
|
end
|
39
39
|
else
|
40
|
-
@basement.get(url, query: params, headers: headers)
|
40
|
+
@basement.get(url: url, query: params, headers: headers)
|
41
41
|
end
|
42
42
|
|
43
|
+
|
43
44
|
result = response.body
|
44
|
-
if response.
|
45
|
+
if response.headers['Content-Type'] =~ /application\/json/
|
45
46
|
result = MultiJson.load(result, symbolize_keys: true)
|
46
47
|
end
|
47
48
|
unless (200...300).include?(response.code.to_i)
|
@@ -67,7 +68,7 @@ module YACCL
|
|
67
68
|
|
68
69
|
def repository_urls(repository_id)
|
69
70
|
if @@url_cache[repository_id].nil?
|
70
|
-
repository_infos = @basement.get(@service_url)
|
71
|
+
repository_infos = MultiJson.load( @basement.get(url: @service_url).body , symbolize_keys: false)
|
71
72
|
raise "No repository found with ID #{repository_id}." unless repository_infos.has_key?(repository_id)
|
72
73
|
repository_info = repository_infos[repository_id]
|
73
74
|
@@url_cache[repository_id] = { repository_url: repository_info['repositoryUrl'],
|
@@ -118,20 +119,39 @@ module YACCL
|
|
118
119
|
end
|
119
120
|
|
120
121
|
class Basement
|
121
|
-
include HTTParty
|
122
122
|
|
123
123
|
def initialize(user, pass)
|
124
124
|
@username = user
|
125
125
|
@password = pass
|
126
|
-
self.class.basic_auth(user, pass)
|
127
126
|
end
|
128
127
|
|
129
|
-
def get(
|
130
|
-
|
128
|
+
def get(params)
|
129
|
+
# puts "##{params.class}#"
|
130
|
+
# old
|
131
|
+
# @basement.get(url, query: params, headers: headers) @ useage
|
132
|
+
request = Typhoeus::Request.new(
|
133
|
+
params[:url],
|
134
|
+
userpwd: "#{@username}:#{@password}",
|
135
|
+
method: :get,
|
136
|
+
body: params[:body],
|
137
|
+
params: params[:query],
|
138
|
+
headers: params[:headers],
|
139
|
+
)
|
140
|
+
request.run
|
131
141
|
end
|
132
142
|
|
133
|
-
def post(
|
134
|
-
|
143
|
+
def post(params)
|
144
|
+
# puts "*#{params.class}*"
|
145
|
+
# @basement.post(url, body: params, headers: headers)
|
146
|
+
request = Typhoeus::Request.new(
|
147
|
+
params[:url],
|
148
|
+
userpwd: "#{@username}:#{@password}",
|
149
|
+
method: :post,
|
150
|
+
body: params[:body],
|
151
|
+
params: params[:query],
|
152
|
+
headers: params[:headers],
|
153
|
+
)
|
154
|
+
request.run
|
135
155
|
end
|
136
156
|
|
137
157
|
def multipart_post(url, options, headers)
|
data/lib/yaccl/version.rb
CHANGED
data/yaccl.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = 'CMIS browser binding client lib.'
|
13
13
|
s.description = 'A Ruby CMIS browser binding client library implementation.'
|
14
14
|
|
15
|
-
s.add_dependency '
|
15
|
+
s.add_dependency 'typhoeus', '~> 0.6'
|
16
16
|
s.add_dependency 'multipart-post', '~> 1.1'
|
17
17
|
s.add_dependency 'multi_json', '~> 1.5'
|
18
18
|
|
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.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenneth Geerts
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: typhoeus
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '0.
|
20
|
+
version: '0.6'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '0.
|
27
|
+
version: '0.6'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: multipart-post
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|