active_cmis 0.3.5 → 0.3.6
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 +4 -4
- data/README.md +6 -0
- data/VERSION.yml +1 -1
- data/active_cmis.gemspec +4 -4
- data/lib/active_cmis/active_cmis.rb +2 -2
- data/lib/active_cmis/internal/connection.rb +14 -4
- data/lib/active_cmis/server.rb +7 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8bbc9a089d6d112fb860d0f75ad790974cdc8ee
|
4
|
+
data.tar.gz: 8a2b33e2de9a6e963e9de1b11fb5584f0c433df2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e39dcf9f130a32acd0b2f896616f24bac4a45d9ca6802222e363cf0a76dd1a1ac595a5eb7751c1ae2da94ad8e1b5aaa00628e13bbeefab0fc809f966f682c1b3
|
7
|
+
data.tar.gz: eca90d1c8b792b23ceb011d48edbc89f1ff9a657719803c8ef10be46cb38b0343211ae265aa69d3722a5585f7dec318a1c3654ae7efeffa6b3d549859e4a758f
|
data/README.md
CHANGED
@@ -11,6 +11,12 @@ ActiveCMIS is Ruby library aimed at easing the interaction with various CMIS pro
|
|
11
11
|
- Write support and the ability to create new objects.
|
12
12
|
- Support for paging
|
13
13
|
|
14
|
+
## Changes since 0.3.5 ##
|
15
|
+
- implement the possibility to set the timeout to be used by the Net::HTTP object (thanks to zedtux)
|
16
|
+
|
17
|
+
## Changes since 0.3.4 ##
|
18
|
+
- Fix a bug with checkin
|
19
|
+
|
14
20
|
## Changes since 0.3.3 ##
|
15
21
|
- added #set_versioning_state for documents (thanks to @zedtux)
|
16
22
|
- improve checking method to make more parameters optional (and use set_versioning_state when possible)
|
data/VERSION.yml
CHANGED
data/active_cmis.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: active_cmis 0.3.
|
5
|
+
# stub: active_cmis 0.3.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "active_cmis"
|
9
|
-
s.version = "0.3.
|
9
|
+
s.version = "0.3.6"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Joeri Samson"]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2015-04-09"
|
15
15
|
s.description = "A CMIS library implementing both reading and updating capabilities through the AtomPub/REST binding to CMIS."
|
16
16
|
s.email = "joeri@xaop.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -55,7 +55,7 @@ Gem::Specification.new do |s|
|
|
55
55
|
]
|
56
56
|
s.homepage = "http://xaop.com/labs/activecmis/"
|
57
57
|
s.required_ruby_version = Gem::Requirement.new(">= 1.8.6")
|
58
|
-
s.rubygems_version = "2.
|
58
|
+
s.rubygems_version = "2.4.5"
|
59
59
|
s.summary = "A library to interact with CMIS repositories through the AtomPub/REST binding"
|
60
60
|
|
61
61
|
if s.respond_to? :specification_version then
|
@@ -41,7 +41,7 @@ module ActiveCMIS
|
|
41
41
|
auth_type = config["server_auth"] || :basic
|
42
42
|
authentication_info = [auth_type, user_name, password]
|
43
43
|
end
|
44
|
-
server = Server.new(config["server_url"], logger, authentication_info)
|
44
|
+
server = Server.new(config["server_url"], logger, authentication_info, { :timeout => config["timeout"] })
|
45
45
|
if user_name = config["repository_login"] and password = config["repository_password"]
|
46
46
|
auth_type = config["repository_auth"] || :basic
|
47
47
|
authentication_info = [auth_type, user_name, password]
|
@@ -77,7 +77,7 @@ module ActiveCMIS
|
|
77
77
|
if config.is_a? Hash
|
78
78
|
if config = config[config_name]
|
79
79
|
connect(config)
|
80
|
-
else
|
80
|
+
else
|
81
81
|
raise "Configuration not found in file"
|
82
82
|
end
|
83
83
|
else
|
@@ -6,10 +6,13 @@ module ActiveCMIS
|
|
6
6
|
attr_reader :user
|
7
7
|
# @return [Logger] A logger used to send debug and info messages
|
8
8
|
attr_reader :logger
|
9
|
+
# @return [Hash] Options to be used by the HTTP objects
|
10
|
+
attr_reader :options
|
9
11
|
|
10
|
-
# @param [Logger]
|
11
|
-
def initialize(logger)
|
12
|
+
# @param [Logger] Initialize with a logger of your choice
|
13
|
+
def initialize(logger, options)
|
12
14
|
@logger = logger || ActiveCMIS.default_logger
|
15
|
+
@options = options || {}
|
13
16
|
end
|
14
17
|
|
15
18
|
# Use authentication to access the CMIS repository
|
@@ -42,6 +45,9 @@ module ActiveCMIS
|
|
42
45
|
def get(url)
|
43
46
|
uri = normalize_url(url)
|
44
47
|
|
48
|
+
# Ensure the parsed URL is an HTTP one
|
49
|
+
raise HTTPError::ClientError.new("Invalid URL #{url}") unless uri.is_a?(URI::HTTP)
|
50
|
+
|
45
51
|
req = Net::HTTP::Get.new(uri.request_uri)
|
46
52
|
handle_request(uri, req)
|
47
53
|
end
|
@@ -152,8 +158,12 @@ module ActiveCMIS
|
|
152
158
|
|
153
159
|
def authenticate_request(uri, req)
|
154
160
|
http = http_class.new(uri.host, uri.port)
|
155
|
-
|
156
|
-
|
161
|
+
# Force to use SSL
|
162
|
+
http.use_ssl = (uri.scheme == 'https')
|
163
|
+
# Set the timeout
|
164
|
+
if options[:timeout]
|
165
|
+
http.open_timeout = options[:timeout]
|
166
|
+
http.read_timeout = options[:timeout]
|
157
167
|
end
|
158
168
|
if auth = @authentication
|
159
169
|
req.send(auth[:method], *auth[:params])
|
data/lib/active_cmis/server.rb
CHANGED
@@ -6,14 +6,16 @@ module ActiveCMIS
|
|
6
6
|
attr_reader :endpoint
|
7
7
|
# @return [Logger] A default logger for derived repositories
|
8
8
|
attr_reader :logger
|
9
|
+
# @return [Hash] Options to be used by the HTTP objects
|
10
|
+
attr_reader :options
|
9
11
|
|
10
12
|
# @return [Server] Cached by endpoint and logger
|
11
|
-
def self.new(endpoint, logger = nil, authentication_info = nil)
|
13
|
+
def self.new(endpoint, logger = nil, authentication_info = nil, options = nil)
|
12
14
|
endpoint = case endpoint
|
13
15
|
when URI; endpoint
|
14
16
|
else URI(endpoint.to_s)
|
15
17
|
end
|
16
|
-
server = super(endpoint, logger || ActiveCMIS.default_logger, authentication_info)
|
18
|
+
server = super(endpoint, logger || ActiveCMIS.default_logger, authentication_info, options)
|
17
19
|
endpoints[endpoint.to_s][authentication_info][logger] ||= server
|
18
20
|
end
|
19
21
|
|
@@ -37,10 +39,10 @@ module ActiveCMIS
|
|
37
39
|
# @param endpoint [URI] The URL where the CMIS AtomPub REST endpoint can be found
|
38
40
|
# @param logger [Logger] The logger that will be used to log debug/info messages
|
39
41
|
# @param authentication_info [Array?] Optional authentication info to be used when retrieving the data from the AtomPub endpoint
|
40
|
-
def initialize(endpoint, logger, authentication_info = nil)
|
42
|
+
def initialize(endpoint, logger, authentication_info = nil, options = nil)
|
41
43
|
@endpoint = endpoint
|
42
44
|
@logger = logger
|
43
|
-
|
45
|
+
@options = options || {}
|
44
46
|
|
45
47
|
method, *params = authentication_info
|
46
48
|
@authentication_info = authentication_info
|
@@ -113,7 +115,7 @@ module ActiveCMIS
|
|
113
115
|
end
|
114
116
|
|
115
117
|
def conn
|
116
|
-
@conn ||= Internal::Connection.new(logger.dup)
|
118
|
+
@conn ||= Internal::Connection.new(logger.dup, @options)
|
117
119
|
end
|
118
120
|
end
|
119
121
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_cmis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joeri Samson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.4.5
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: A library to interact with CMIS repositories through the AtomPub/REST binding
|