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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3482ae343f4d0c79b82399b817a3d91fa1ced4c2
4
- data.tar.gz: 5af3fa3c01e7fbb37a187e80cbce0163a89ed419
3
+ metadata.gz: 7ef5855ab2cec718cc226594fe83ce087460eed8
4
+ data.tar.gz: 78bef86bac1386f1e0045a0f7fee4bf33348d058
5
5
  SHA512:
6
- metadata.gz: f2d52a9fa114b694eddd0a7933c5c92feac4a97ff6f7ff0a5c9307d2ebc7c09d766412a7500549e0106e578d66dbb13ab3a8b272733eb05b8b3078fd70a743aa
7
- data.tar.gz: a4e0cf077d4b0ee4440a45bc774202107a30dde24b4ee7d4e7771a0403a0979f78356f2b567e8a575804c76dc90b99c8721df76aa89f0c50e61680ac92dfb328
6
+ metadata.gz: 50531092037d4c21586510f205c9b64a9546fbfe1ee32ac4c5e9fafdbc66c0e36f3a85a507fa11a2d3f4bf704b1cb41f1bd91695a30df1f20ac435f0127a3761
7
+ data.tar.gz: afd6f11dfbee74bef6e9dc592cb5ee2ecf3e25883a404bf2b41b7756f79fa4425fd258f7790962d89ca1518dbb007e02d3f5488483fd2e6b80100433c2c7221d
@@ -36,5 +36,5 @@ type.add_property_definition(
36
36
  )
37
37
 
38
38
  full_type = repository.create_type(type)
39
- puts full_type.to_hash
39
+ # puts full_type.to_hash
40
40
  full_type.delete
@@ -1,4 +1,4 @@
1
- require 'httparty'
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.content_type == 'application/json'
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(*params)
130
- self.class.get(*params)
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(*params)
134
- self.class.post(*params)
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
@@ -1,3 +1,3 @@
1
1
  module YACCL
2
- VERSION = '0.0.34'
2
+ VERSION = '0.0.35'
3
3
  end
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 'httparty', '~> 0.10'
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.34
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: 2013-11-22 00:00:00.000000000 Z
12
+ date: 2014-01-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: httparty
15
+ name: typhoeus
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
- version: '0.10'
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.10'
27
+ version: '0.6'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: multipart-post
30
30
  requirement: !ruby/object:Gem::Requirement