symgate 0.2.1 → 0.2.3

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: 5f4f91b95b5eb8619118ef63e206b9a502f5045d
4
- data.tar.gz: 83400e22cfc9e7219f249298ac518b425adbb224
3
+ metadata.gz: ff7740ff5f9152bd4f3cb84514f5eef0321dcd83
4
+ data.tar.gz: c448385487c3563ec1c8ca38c8ed9f24ccd48caf
5
5
  SHA512:
6
- metadata.gz: be59f161c3efbc921e1a221ba8f836e21d0073bfc990bd4ba6f101b9043619e1c69c7737fe275ddb7ad04cc9dfd556a5cd0f0b480e1bfaa20e66edbabd9da521
7
- data.tar.gz: 11ffd3aaabb30344f73678fa338a1aaf8d38d938ab6e767fcb49612139f3d1cb3b2b52c69090a507e36284dcbfd09a157eb617325d860888108756559ed266db
6
+ metadata.gz: cf1198a9ffa373baf1c06c9ab1dfbb331919124d85fc223534add2b758178224363688d6cb58e90e6c66bf6b4164048e2e6a8db94cadd4705068433234b71f69
7
+ data.tar.gz: 672fac7436ee70a62e0587e8be9aec6c3e9d51ff17105a18a24402192111abba7a41ea30ecbdd63bdacd79eb283eb114c838c6479020160d1eec4f98ea9a4fae
data/.rubocop.yml CHANGED
@@ -17,3 +17,9 @@ Style/NumericLiterals:
17
17
 
18
18
  Metrics/ClassLength:
19
19
  Max: 120
20
+
21
+ Metrics/BlockLength:
22
+ Max: 1000
23
+
24
+ Naming/UncommunicativeMethodParamName:
25
+ MinNameLength: 2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.2.3 (2018-10-23)
2
+
3
+ Fix for invalid SOAP XML due to duplicate attributes (issue #3)
4
+
5
+ ## 0.2.2 (2017-05-17)
6
+
7
+ Require wordlist entry class in wordlist client so that get_wordlist_entries method works without
8
+ requiring wordlist entry class separately
9
+
1
10
  ## 0.2.1 (2016-09-13)
2
11
 
3
12
  Updated hash syntax to be compatible with Ruby 2.1 in tests
data/Rakefile CHANGED
@@ -24,7 +24,7 @@ begin
24
24
  spec.pattern = 'test/integration/**/*_spec.rb'
25
25
  end
26
26
  rescue LoadError
27
- $stderr.puts 'Unable to find rspec gem'
27
+ $stderr.warn 'Unable to find rspec gem'
28
28
  end
29
29
 
30
30
  desc 'Runs the rubocop linting tool'
@@ -33,7 +33,7 @@ task :rubocop do
33
33
  end
34
34
 
35
35
  desc 'Run all tests'
36
- task test: [:rubocop, :spec]
36
+ task test: %i[rubocop spec]
37
37
 
38
38
  namespace :teamcity do
39
39
  desc 'Runs rubocop with junit output'
@@ -55,10 +55,10 @@ namespace :teamcity do
55
55
  task :test do
56
56
  first_exception = nil
57
57
 
58
- %w(teamcity:rubocop
58
+ %w[teamcity:rubocop
59
59
  teamcity:spec
60
60
  teamcity:zip_coverage
61
- teamcity:spec:integration).each do |task_name|
61
+ teamcity:spec:integration].each do |task_name|
62
62
  begin
63
63
  Rake::Task[task_name].invoke
64
64
  rescue Exception => e
@@ -98,3 +98,5 @@ namespace :vagrant do
98
98
  chdir: 'symboliser-vagrant'
99
99
  end
100
100
  end
101
+
102
+ # rubocop:enable Lint/RescueException
@@ -30,7 +30,7 @@ module Symgate
30
30
  protected
31
31
 
32
32
  def attributes
33
- %i(user_id is_group_admin)
33
+ %i[user_id is_group_admin]
34
34
  end
35
35
  end
36
36
  end
@@ -52,9 +52,8 @@ module Symgate
52
52
  end
53
53
 
54
54
  def validate_is_passwordy
55
- unless [@key, @password, @token].one?
56
- raise Symgate::Error, 'You must supply one of key, password or token'
57
- end
55
+ raise Symgate::Error, 'You must supply one of key, password or token' unless
56
+ [@key, @password, @token].one?
58
57
  end
59
58
 
60
59
  def create_savon_client
@@ -102,21 +101,18 @@ module Symgate
102
101
  end
103
102
 
104
103
  def arrayize_option(singular, plural, opts)
105
- if opts.include? singular # else nothing to do
106
- if opts.include? plural
107
- raise Symgate::Error, "Options can't include both #{singular} and #{plural}"
108
- end
104
+ return unless opts.include? singular # else nothing to do
105
+ raise Symgate::Error, "Options can't include both #{singular} and #{plural}" if
106
+ opts.include? plural
109
107
 
110
- opts[plural] = [opts[singular]]
111
- opts.delete(singular)
112
- end
108
+ opts[plural] = [opts[singular]]
109
+ opts.delete(singular)
113
110
  end
114
111
 
115
112
  def check_option_is_array_of(classname, key, opts)
116
- if opts.include? key
117
- raise Symgate::Error, "#{key} must be an array" unless opts[key].is_a? Array
118
- check_array_for_type(opts[key], classname)
119
- end
113
+ return unless opts.include? key
114
+ raise Symgate::Error, "#{key} must be an array" unless opts[key].is_a? Array
115
+ check_array_for_type(opts[key], classname)
120
116
  end
121
117
 
122
118
  def check_for_unknown_opts(keys, opts)
@@ -41,7 +41,7 @@ module Symgate
41
41
  protected
42
42
 
43
43
  def attributes
44
- %i(symset main top_left top_right bottom_left bottom_right full_left full_right top extra)
44
+ %i[symset main top_left top_right bottom_left bottom_right full_left full_right top extra]
45
45
  end
46
46
  end
47
47
  end
data/lib/symgate/error.rb CHANGED
@@ -24,7 +24,7 @@ module Symgate
24
24
 
25
25
  def self.message_from_savon_error(error)
26
26
  "#{error.message}. #{error.to_hash[:fault][:detail]}"
27
- rescue
27
+ rescue StandardError
28
28
  # :nocov:
29
29
  error.message
30
30
  # :nocov:
@@ -2,7 +2,7 @@ require 'symgate/client'
2
2
  require 'symgate/error'
3
3
  require 'symgate/metadata/data_item'
4
4
 
5
- # rubocop:disable Style/AccessorMethodName
5
+ # rubocop:disable Naming/AccessorMethodName
6
6
 
7
7
  module Symgate
8
8
  module Metadata
@@ -65,8 +65,10 @@ module Symgate
65
65
  def parse_get_metadata_opts(opts)
66
66
  arrayize_option(:key, :keys, opts)
67
67
  check_option_is_array_of(String, :keys, opts)
68
- check_for_unknown_opts(%i(keys scope), opts)
68
+ check_for_unknown_opts(%i[keys scope], opts)
69
69
  end
70
70
  end
71
71
  end
72
72
  end
73
+
74
+ # rubocop:enable Naming/AccessorMethodName
@@ -27,7 +27,7 @@ module Symgate
27
27
  protected
28
28
 
29
29
  def attributes
30
- %i(key value scope)
30
+ %i[key value scope]
31
31
  end
32
32
  end
33
33
  end
@@ -1,9 +1,9 @@
1
1
  module Symgate
2
2
  NAMESPACES = {
3
- %s(xmlns:auth) => 'http://ws.widgit.com/schema/auth/1.2',
4
- %s(xmlns:wl) => 'http://ws.widgit.com/schema/wordlist/1.2',
5
- %s(xmlns:cml) => 'http://ws.widgit.com/schema/cml/2.0',
6
- %s(xmlns:gt) => 'http://ws.widgit.com/schema/globaltypes/1.2',
7
- %s(xmlns:symboliser) => 'http://ws.widgit.com/schema/symboliser/1.2'
3
+ 'xmlns:auth' => 'http://ws.widgit.com/schema/auth/1.2',
4
+ 'xmlns:wl' => 'http://ws.widgit.com/schema/wordlist/1.2',
5
+ 'xmlns:cml' => 'http://ws.widgit.com/schema/cml/2.0',
6
+ 'xmlns:gt' => 'http://ws.widgit.com/schema/globaltypes/1.2',
7
+ 'xmlns:symboliser' => 'http://ws.widgit.com/schema/symboliser/1.2'
8
8
  }.freeze
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module Symgate
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
@@ -2,6 +2,7 @@ require 'base64'
2
2
  require 'symgate/client'
3
3
  require 'symgate/error'
4
4
  require 'symgate/wordlist/info'
5
+ require 'symgate/wordlist/entry'
5
6
 
6
7
  module Symgate
7
8
  module Wordlist
@@ -11,7 +12,7 @@ module Symgate
11
12
  # optionally, supply one or more wordlist contexts as a string or string array parameter
12
13
  # to only retrieve wordlist information about that context. e.g.:
13
14
  # enumerate_wordlists('User')
14
- # enumerate_wordlists(%w(Topic SymbolSet))
15
+ # enumerate_wordlists(%w[Topic SymbolSet])
15
16
  def enumerate_wordlists(context = [])
16
17
  response = savon_request(:enumerate_wordlists) do |soap|
17
18
  soap.message(context: [context].flatten)
@@ -72,8 +73,8 @@ module Symgate
72
73
  # match (string) - only return wordlist entries matching this word
73
74
  # entry (string, uuid) - return the entry specified by the uuid
74
75
  def get_wordlist_entries(uuid, opts = {})
75
- check_for_unknown_opts(%i(match entry attachments), opts)
76
- check_for_multiple_opts(%i(match entry), opts)
76
+ check_for_unknown_opts(%i[match entry attachments], opts)
77
+ check_for_multiple_opts(%i[match entry], opts)
77
78
 
78
79
  response = savon_request(:get_wordlist_entries) do |soap|
79
80
  soap.message(wordlistid: uuid, getattachments: opts[:attachments])
@@ -41,7 +41,7 @@ module Symgate
41
41
  protected
42
42
 
43
43
  def attributes
44
- %i(word uuid priority concept_code symbols custom_graphics last_change)
44
+ %i[word uuid priority concept_code symbols custom_graphics last_change]
45
45
  end
46
46
  end
47
47
  end
@@ -30,7 +30,7 @@ module Symgate
30
30
  protected
31
31
 
32
32
  def attributes
33
- %i(type uuid data)
33
+ %i[type uuid data]
34
34
  end
35
35
  end
36
36
  end
@@ -23,7 +23,7 @@ module Symgate
23
23
  protected
24
24
 
25
25
  def attributes
26
- %i(name context uuid entry_count last_change engine scope)
26
+ %i[name context uuid entry_count last_change engine scope]
27
27
  end
28
28
  end
29
29
  end
data/symgate-gem.gemspec CHANGED
@@ -1,5 +1,4 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'symgate'
5
4
 
@@ -19,16 +18,16 @@ Gem::Specification.new do |spec|
19
18
  spec.require_paths = ['lib']
20
19
 
21
20
  spec.add_development_dependency 'bundler', '~> 1.9'
21
+ spec.add_development_dependency 'codecov'
22
+ spec.add_development_dependency 'mysql2', '~> 0.4.1'
23
+ spec.add_development_dependency 'rack', '~> 1.6.4'
22
24
  spec.add_development_dependency 'rake', '~> 10.0'
23
- spec.add_development_dependency 'rspec', '~> 3.4.0'
24
- spec.add_development_dependency 'rubocop', '~> 0.41.1'
25
+ spec.add_development_dependency 'rspec', '~> 3.8.0'
25
26
  spec.add_development_dependency 'rspec_junit_formatter', '~> 0.2.3'
27
+ spec.add_development_dependency 'rubocop', '~> 0.57.0'
26
28
  spec.add_development_dependency 'rubocop-junit-formatter', '~> 0.1.3'
27
- spec.add_development_dependency 'rack', '~> 1.6.4'
28
- spec.add_development_dependency 'mysql2', '~> 0.4.1'
29
29
  spec.add_development_dependency 'simplecov', '~> 0.12.0'
30
30
  spec.add_development_dependency 'simplecov-teamcity-summary', '~> 0.1.2'
31
- spec.add_development_dependency 'codecov'
32
31
 
33
32
  spec.add_dependency 'savon', '~> 2.11.0'
34
33
  spec.add_dependency 'tryit', '~> 0.0.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symgate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Detheridge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-13 00:00:00.000000000 Z
11
+ date: 2018-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,145 +25,145 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.9'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: codecov
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: mysql2
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.4.0
47
+ version: 0.4.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 3.4.0
54
+ version: 0.4.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: rubocop
56
+ name: rack
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.41.1
61
+ version: 1.6.4
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.41.1
68
+ version: 1.6.4
69
69
  - !ruby/object:Gem::Dependency
70
- name: rspec_junit_formatter
70
+ name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.2.3
75
+ version: '10.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.2.3
82
+ version: '10.0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rubocop-junit-formatter
84
+ name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.1.3
89
+ version: 3.8.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.1.3
96
+ version: 3.8.0
97
97
  - !ruby/object:Gem::Dependency
98
- name: rack
98
+ name: rspec_junit_formatter
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.6.4
103
+ version: 0.2.3
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.6.4
110
+ version: 0.2.3
111
111
  - !ruby/object:Gem::Dependency
112
- name: mysql2
112
+ name: rubocop
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.4.1
117
+ version: 0.57.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.4.1
124
+ version: 0.57.0
125
125
  - !ruby/object:Gem::Dependency
126
- name: simplecov
126
+ name: rubocop-junit-formatter
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.12.0
131
+ version: 0.1.3
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.12.0
138
+ version: 0.1.3
139
139
  - !ruby/object:Gem::Dependency
140
- name: simplecov-teamcity-summary
140
+ name: simplecov
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.1.2
145
+ version: 0.12.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.1.2
152
+ version: 0.12.0
153
153
  - !ruby/object:Gem::Dependency
154
- name: codecov
154
+ name: simplecov-teamcity-summary
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '0'
159
+ version: 0.1.2
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0'
166
+ version: 0.1.2
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: savon
169
169
  requirement: !ruby/object:Gem::Requirement