inforouter 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.document +5 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/.rubocop.yml +32 -0
- data/Gemfile +17 -0
- data/LICENSE.md +20 -0
- data/README.md +50 -0
- data/Rakefile +1 -0
- data/inforouter.gemspec +25 -0
- data/lib/inforouter.rb +42 -0
- data/lib/inforouter/access_list.rb +52 -0
- data/lib/inforouter/client.rb +112 -0
- data/lib/inforouter/configuration.rb +20 -0
- data/lib/inforouter/errors.rb +4 -0
- data/lib/inforouter/errors/inforouter_error.rb +8 -0
- data/lib/inforouter/errors/missing_config_error.rb +13 -0
- data/lib/inforouter/errors/missing_config_option_error.rb +12 -0
- data/lib/inforouter/errors/soap_error.rb +30 -0
- data/lib/inforouter/folder_rule.rb +50 -0
- data/lib/inforouter/version.rb +15 -0
- data/spec/spec_helper.rb +29 -0
- metadata +122 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDE4NjgwMWM0NGYyNGMxZDMyMjEzNzc4NzI4ZjFjMzJlODNhMWQ0MQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzYwZmMzZTkxMWU0MTc4OGNlNDMxM2I2ZWU1NTZmYzdiMDMwY2UzYg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZTQwOTcyY2Y2MDhlMWZiODY2MWEwODU2ZDMwN2ZjMTQ3NDgwZWY2MDgzYjA0
|
10
|
+
MWE4M2U1NjcyY2YxMGUzMjcyYWI3NGU1YWRiOGJhNDQ5OTZiZGMzNDAyYjEx
|
11
|
+
OTFjODc1NDJiZWUwMDE2OTA1M2UzNTk4MzdmNjhiNTMyNjk0YjY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MDg0YWY0NmY3OGYwYjNjODNjMjcwODU0MWQ4MGI4MzllYmRlYzk0ZGM5OGU0
|
14
|
+
NjkzZWQ2NzdiZGI5NmM2MzllODBjNmNiMmI5YTFjZDA0OTM3MzM3ZjY5YWNj
|
15
|
+
NjI1MzYwMzEyMmE5ZDBkNDAyMWFiMDI0ZDBmYWZkYmQ2YjI1YzU=
|
data/.document
ADDED
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
AllCops:
|
2
|
+
Excludes:
|
3
|
+
- vendor/**
|
4
|
+
- bin/**
|
5
|
+
|
6
|
+
LineLength:
|
7
|
+
Enabled: false
|
8
|
+
|
9
|
+
MethodLength:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
ClassLength:
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Documentation:
|
16
|
+
# don't require classes to be documented
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
HashSyntax:
|
20
|
+
EnforcedStyle: hash_rockets
|
21
|
+
|
22
|
+
NumericLiterals:
|
23
|
+
# don't separate numeric literals with _
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
RaiseArgs:
|
27
|
+
# don't need to provide an exception class and message, SoapError takes care of that
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Encoding:
|
31
|
+
# missing UTF-8 comments
|
32
|
+
Enabled: false
|
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
# Add dependencies required to use your gem here.
|
6
|
+
# Example:
|
7
|
+
# gem "activesupport", ">= 2.3.5"
|
8
|
+
|
9
|
+
# Add dependencies to develop your gem here.
|
10
|
+
# Include everything needed to run rake, tests, features, etc.
|
11
|
+
group :development do
|
12
|
+
gem "rspec", "~> 2.8.0"
|
13
|
+
gem "rdoc", "~> 3.12"
|
14
|
+
gem "bundler", "~> 1.0"
|
15
|
+
gem "jeweler", "~> 2.0.1"
|
16
|
+
gem "simplecov", ">= 0"
|
17
|
+
end
|
data/LICENSE.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2014 NCS Software
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# The infoRouter Ruby Gem
|
2
|
+
|
3
|
+
[![Gem Version](http://img.shields.io/gem/v/inforouter)][gem]
|
4
|
+
[![Build Status](http://img.shields.io/travis/ncssoftware/inforouter.svg)][travis]
|
5
|
+
|
6
|
+
[gem]: https://rubygems.org/gems/inforouter
|
7
|
+
[travis]: https://travis-ci.org/ncssoftware/inforouter
|
8
|
+
|
9
|
+
A Ruby interface to the infoRouter SOAP API
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
gem 'inforouter'
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install inforouter
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
Configure your environment. For example, create an initializer in Rails in <tt>config/initializers/inforouter.rb</tt>.
|
28
|
+
|
29
|
+
Inforouter.configure do |config|
|
30
|
+
config.host = 'your_inforouter_host'
|
31
|
+
config.username = 'your_inforouter_username'
|
32
|
+
config.password = 'your_inforouter_password'
|
33
|
+
end
|
34
|
+
|
35
|
+
TODO: Write usage instructions here
|
36
|
+
|
37
|
+
## Contributing
|
38
|
+
|
39
|
+
1. Fork it
|
40
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
41
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
42
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
43
|
+
5. Create new Pull Request
|
44
|
+
|
45
|
+
## Copyright
|
46
|
+
|
47
|
+
Copyright (c) 2014 NCS Software.
|
48
|
+
See [LICENSE][] for further details.
|
49
|
+
|
50
|
+
[license]: LICENSE.md
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/inforouter.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'inforouter/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "inforouter"
|
8
|
+
spec.version = Inforouter::Version
|
9
|
+
spec.authors = ["Tom Fenton"]
|
10
|
+
spec.email = ["tom@ncs.co.nz"]
|
11
|
+
spec.description = %q(A Ruby interface to the infoRouter SOAP API.)
|
12
|
+
spec.summary = spec.description
|
13
|
+
spec.homepage = "https://github.com/ncssoftware/inforouter"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency 'nokogiri', '~> 1.5.9'
|
21
|
+
spec.add_dependency 'savon', '~> 2.4.0'
|
22
|
+
|
23
|
+
spec.add_development_dependency 'rainbow', '~> 1.99.2'
|
24
|
+
spec.add_development_dependency 'rubocop', '~> 0.16.0'
|
25
|
+
end
|
data/lib/inforouter.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'savon'
|
2
|
+
|
3
|
+
require 'inforouter/access_list'
|
4
|
+
require 'inforouter/folder_rule'
|
5
|
+
require 'inforouter/client'
|
6
|
+
require 'inforouter/configuration'
|
7
|
+
require 'inforouter/errors'
|
8
|
+
require 'inforouter/version'
|
9
|
+
|
10
|
+
module Inforouter
|
11
|
+
class << self
|
12
|
+
attr_accessor :configuration
|
13
|
+
|
14
|
+
# Returns true if the gem has been configured.
|
15
|
+
def configured?
|
16
|
+
!!configured
|
17
|
+
end
|
18
|
+
|
19
|
+
# Configure the gem
|
20
|
+
def configure
|
21
|
+
self.configuration ||= Configuration.new
|
22
|
+
yield configuration
|
23
|
+
end
|
24
|
+
|
25
|
+
def reset!
|
26
|
+
self.configuration = nil
|
27
|
+
@client = nil
|
28
|
+
end
|
29
|
+
|
30
|
+
def client
|
31
|
+
check_configuration!
|
32
|
+
@client ||= Inforouter::Client.new
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def check_configuration!
|
38
|
+
fail Inforouter::Errors::MissingConfig.new unless self.configuration
|
39
|
+
self.configuration_check!
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module Inforouter
|
2
|
+
class AccessList
|
3
|
+
# The AccessList XML fragment should be structures as
|
4
|
+
#
|
5
|
+
# <AccessList>
|
6
|
+
# <DomainMembers Right="2"/>
|
7
|
+
# <UserGroup Domain="" GroupName="Authors" Right="4"/>
|
8
|
+
# <UserGroup Domain="" GroupName="Developers" Right="5"/>
|
9
|
+
# <UserGroup Domain="ProjectX" GroupName="Architect" Right="6"/>
|
10
|
+
# <User Domain="ProjectX" UserName="JoeD" Right="4"/>
|
11
|
+
# <User Domain="ProjectX" UserName="JaneC" Right="6"/>
|
12
|
+
# <User Domain="" UserName="SuzanP" Right="6"/>
|
13
|
+
# </AccessList>
|
14
|
+
#
|
15
|
+
# The Right Value can be
|
16
|
+
#
|
17
|
+
# 0 (No Access)
|
18
|
+
# 1 (List)
|
19
|
+
# 2 (Read)
|
20
|
+
# 3 (Add)
|
21
|
+
# 4 (Add & Read)
|
22
|
+
# 5 (Change)
|
23
|
+
# 6 (Full Control)
|
24
|
+
NO_ACCESS = 0
|
25
|
+
LIST = 1
|
26
|
+
READ = 2
|
27
|
+
ADD = 3
|
28
|
+
ADD_AND_READ = 4
|
29
|
+
CHANGE = 5
|
30
|
+
FULL_CONTROL = 6
|
31
|
+
|
32
|
+
def self.domain_members_item(xml, right)
|
33
|
+
xml.DomainMembers(:Right => right)
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.user_group_item(xml, options = {})
|
37
|
+
xml.UserGroup(
|
38
|
+
:Domain => options[:domain],
|
39
|
+
:GroupName => options[:group_name],
|
40
|
+
:Right => options[:right]
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.user_item(xml, options = {})
|
45
|
+
xml.User(
|
46
|
+
:Domain => options[:domain],
|
47
|
+
:UserName => options[:user_name],
|
48
|
+
:Right => options[:right]
|
49
|
+
)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
module Inforouter
|
2
|
+
# A <tt>Client</tt> communicates with the Inforouter service.
|
3
|
+
class Client
|
4
|
+
attr_reader :client, :ticket, :wsdl
|
5
|
+
|
6
|
+
# Initializes a new Client object
|
7
|
+
#
|
8
|
+
# @param options [Hash]
|
9
|
+
# @return [Inforouter::Client]
|
10
|
+
def initialize(options = {})
|
11
|
+
options = {
|
12
|
+
:log => false,
|
13
|
+
:logger => Logger.new($stdout),
|
14
|
+
:log_level => :info
|
15
|
+
}.merge(options)
|
16
|
+
|
17
|
+
@wsdl = options[:wsdl] || File.dirname(__FILE__) + '/../../resources/inforouter.wsdl'
|
18
|
+
|
19
|
+
@client = Savon.client(
|
20
|
+
:wsdl => @wsdl,
|
21
|
+
:convert_request_keys_to => :camelcase,
|
22
|
+
:pretty_print_xml => true,
|
23
|
+
:log => options[:log],
|
24
|
+
:logger => options[:logger],
|
25
|
+
:log_level => options[:log_level]
|
26
|
+
)
|
27
|
+
|
28
|
+
@ticket = nil
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [Array]
|
32
|
+
def operations
|
33
|
+
@client.operations
|
34
|
+
end
|
35
|
+
|
36
|
+
# Returns the client ticket.
|
37
|
+
#
|
38
|
+
# @return [String]
|
39
|
+
def ticket
|
40
|
+
get_ticket unless valid_ticket?(@ticket)
|
41
|
+
@ticket
|
42
|
+
end
|
43
|
+
|
44
|
+
# Make a safe SOAP call.
|
45
|
+
# Will raise a Inforouter::Errors::SOAPError on error.
|
46
|
+
#
|
47
|
+
# @param method [Symbol]
|
48
|
+
# @param message [Hash]
|
49
|
+
def call(method, message = {})
|
50
|
+
safe do
|
51
|
+
super method, :message => message.merge(authentication_params)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
# @return [Hash]
|
58
|
+
def message_params
|
59
|
+
return {} unless Inforouter.configuration
|
60
|
+
{
|
61
|
+
'UID' => Inforouter.configuration.username,
|
62
|
+
'PWD' => Inforouter.configuration.password
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
# @return [Hash]
|
67
|
+
def authentication_params
|
68
|
+
{
|
69
|
+
:authentication_ticket => ticket
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
def safe(&block)
|
74
|
+
yield
|
75
|
+
rescue Savon::SOAPFault => e
|
76
|
+
raise Inforouter::Errors::SOAPError.new(e)
|
77
|
+
end
|
78
|
+
|
79
|
+
# Get a ticket.
|
80
|
+
def get_ticket
|
81
|
+
# AuthenticateUser
|
82
|
+
# Authenticates the specified user against infoRouter.
|
83
|
+
response = @client.call(:authenticate_user, :message => message_params)
|
84
|
+
if response.success?
|
85
|
+
data = response.to_array(:authenticate_user_response,
|
86
|
+
:authenticate_user_result,
|
87
|
+
:response).first
|
88
|
+
@ticket = data[:@ticket] if data[:@success] == 'true'
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Determines whether the given ticket is still valid or not.
|
93
|
+
#
|
94
|
+
# @params ticket [String]
|
95
|
+
# @return [Boolean]
|
96
|
+
def valid_ticket?(ticket)
|
97
|
+
# isValidTicket
|
98
|
+
result = false
|
99
|
+
unless ticket.nil?
|
100
|
+
message = { :authentication_ticket => ticket }
|
101
|
+
response = @client.call(:valid_ticket, :message => message)
|
102
|
+
if response.success?
|
103
|
+
data = response.to_array(:valid_ticket_response,
|
104
|
+
:valid_ticket_result,
|
105
|
+
:response).first
|
106
|
+
result = true if data[:@success] == 'true'
|
107
|
+
end
|
108
|
+
end
|
109
|
+
result
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Inforouter #:nodoc:
|
2
|
+
# Inforouter gem configuration.
|
3
|
+
class Configuration
|
4
|
+
# Inforouter host.
|
5
|
+
attr_accessor :host
|
6
|
+
# Inforouter username.
|
7
|
+
attr_accessor :username
|
8
|
+
# Inforouter password.
|
9
|
+
attr_accessor :password
|
10
|
+
|
11
|
+
# Check the configuration.
|
12
|
+
#
|
13
|
+
# Will raise a Inforouter::Errors::MissingConfigOption if any of the host or
|
14
|
+
# the username are missing.
|
15
|
+
def check!
|
16
|
+
fail Inforouter::Errors::MissingConfigOption.new('host') unless host && host.strip.length > 0
|
17
|
+
fail Inforouter::Errors::MissingConfigOption.new('username') unless username && username.strip.length > 0
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Inforouter #:nodoc:
|
3
|
+
module Errors #:nodoc:
|
4
|
+
# This error is raised when attempting to create a new client without
|
5
|
+
# configuring Inforouter.
|
6
|
+
class MissingConfigError < InforouterError
|
7
|
+
# Create a new error.
|
8
|
+
def initialize
|
9
|
+
super(compose_message('missing_config'))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Inforouter #:nodoc:
|
3
|
+
module Errors #:nodoc:
|
4
|
+
# This error is raised when a configuration option is missing.
|
5
|
+
class MissingConfigOption < InforouterError
|
6
|
+
# @params name [String]
|
7
|
+
def initialize(name)
|
8
|
+
super(compose_message('missing_config_option', :name => name))
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Inforouter #:nodoc:
|
3
|
+
module Errors #:nodoc:
|
4
|
+
# This error is raised when a SOAP call fails.
|
5
|
+
class SOAPError < InforouterError
|
6
|
+
# Original SOAP fault.
|
7
|
+
attr_reader :fault
|
8
|
+
|
9
|
+
def initialize(e)
|
10
|
+
@fault = e
|
11
|
+
e.to_hash.tap do |fault|
|
12
|
+
fault_code = fault[:fault][:faultcode]
|
13
|
+
fault_string = parse_fault(fault[:fault][:faultstring])
|
14
|
+
super(compose_message('soap_error',
|
15
|
+
:message => fault_string,
|
16
|
+
:code => fault_code
|
17
|
+
))
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
# @params fault_string [String]
|
24
|
+
# @return [String]
|
25
|
+
def parse_fault(fault_string)
|
26
|
+
fault_string.lines.first.strip
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
module Inforouter
|
4
|
+
class FolderRule
|
5
|
+
# The Rules XML fragment should be as described below.
|
6
|
+
# The Rule item that is not specified in the xml structure will not be
|
7
|
+
# updated.
|
8
|
+
# For the AllowableFileTypes set value attribute to comman delimited file
|
9
|
+
# extensions or set value to "*" for allowing all file types.
|
10
|
+
# <Rules>
|
11
|
+
# <Rule Name="AllowableFileTypes" Value="BMP,DOC,JPG,XLS" />
|
12
|
+
# <Rule Name="Checkins" Value="disallows" />
|
13
|
+
# <Rule Name="Checkouts" Value="disallows" />
|
14
|
+
# <Rule Name="DocumentDeletes" Value="disallows" />
|
15
|
+
# <Rule Name="FolderDeletes" Value="disallows" />
|
16
|
+
# <Rule Name="NewDocuments" Value="disallows" />
|
17
|
+
# <Rule Name="NewFolders" Value="disallows" />
|
18
|
+
# <Rule Name="ClassifiedDocuments" Value="allows" />
|
19
|
+
# </Rules>
|
20
|
+
def self.rules_xml(options = {})
|
21
|
+
options = {
|
22
|
+
:allowable_file_types => nil,
|
23
|
+
:checkins => 'disallows',
|
24
|
+
:checkouts => 'disallows',
|
25
|
+
:document_deletes => 'disallows',
|
26
|
+
:folder_deletes => 'disallows',
|
27
|
+
:new_documents => 'disallows',
|
28
|
+
:new_folders => 'disallows',
|
29
|
+
:classified_documents => 'disallows'
|
30
|
+
}.merge(options)
|
31
|
+
builder = Nokogiri::XML::Builder.new do |xml|
|
32
|
+
xml.Rules {
|
33
|
+
rule_item(xml, 'AllowableFileTypes', options[:allowable_file_types])
|
34
|
+
rule_item(xml, 'Checkins', options[:checkins])
|
35
|
+
rule_item(xml, 'Checkouts', options[:checkouts])
|
36
|
+
rule_item(xml, 'DocumentDeletes', options[:document_deletes])
|
37
|
+
rule_item(xml, 'FolderDeletes', options[:folder_deletes])
|
38
|
+
rule_item(xml, 'NewDocuments', options[:new_documents])
|
39
|
+
rule_item(xml, 'NewFolders', options[:new_folders])
|
40
|
+
rule_item(xml, 'ClassifiedDocuments', options[:classified_documents])
|
41
|
+
}
|
42
|
+
end
|
43
|
+
builder.doc.root.to_xml
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.rule_itme(xml, name, value)
|
47
|
+
xml.Rule(:Name => name, :Value => value)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
|
3
|
+
module SimpleCov::Configuration
|
4
|
+
def clean_filters
|
5
|
+
@filters = []
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
SimpleCov.configure do
|
10
|
+
clean_filters
|
11
|
+
load_profile 'test_frameworks'
|
12
|
+
end
|
13
|
+
|
14
|
+
ENV['COVERAGE'] && SimpleCov.start do
|
15
|
+
add_filter '/.rvm/'
|
16
|
+
end
|
17
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
18
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
19
|
+
|
20
|
+
require 'rspec'
|
21
|
+
require 'inforouter'
|
22
|
+
|
23
|
+
# Requires supporting files with custom matchers and macros, etc,
|
24
|
+
# in ./support/ and its subdirectories.
|
25
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
26
|
+
|
27
|
+
RSpec.configure do |config|
|
28
|
+
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: inforouter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tom Fenton
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nokogiri
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.5.9
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.5.9
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: savon
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.4.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.4.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rainbow
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.99.2
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.99.2
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.16.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.16.0
|
69
|
+
description: A Ruby interface to the infoRouter SOAP API.
|
70
|
+
email:
|
71
|
+
- tom@ncs.co.nz
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- .document
|
77
|
+
- .gitignore
|
78
|
+
- .rspec
|
79
|
+
- .rubocop.yml
|
80
|
+
- Gemfile
|
81
|
+
- LICENSE.md
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- inforouter.gemspec
|
85
|
+
- lib/inforouter.rb
|
86
|
+
- lib/inforouter/access_list.rb
|
87
|
+
- lib/inforouter/client.rb
|
88
|
+
- lib/inforouter/configuration.rb
|
89
|
+
- lib/inforouter/errors.rb
|
90
|
+
- lib/inforouter/errors/inforouter_error.rb
|
91
|
+
- lib/inforouter/errors/missing_config_error.rb
|
92
|
+
- lib/inforouter/errors/missing_config_option_error.rb
|
93
|
+
- lib/inforouter/errors/soap_error.rb
|
94
|
+
- lib/inforouter/folder_rule.rb
|
95
|
+
- lib/inforouter/version.rb
|
96
|
+
- spec/spec_helper.rb
|
97
|
+
homepage: https://github.com/ncssoftware/inforouter
|
98
|
+
licenses:
|
99
|
+
- MIT
|
100
|
+
metadata: {}
|
101
|
+
post_install_message:
|
102
|
+
rdoc_options: []
|
103
|
+
require_paths:
|
104
|
+
- lib
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ! '>='
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
requirements: []
|
116
|
+
rubyforge_project:
|
117
|
+
rubygems_version: 2.0.6
|
118
|
+
signing_key:
|
119
|
+
specification_version: 4
|
120
|
+
summary: A Ruby interface to the infoRouter SOAP API.
|
121
|
+
test_files:
|
122
|
+
- spec/spec_helper.rb
|