soar_sr 1.1.2 → 1.1.4

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: 9ccf4654048854b36afdecbde6605e09a690ab2f
4
- data.tar.gz: 48a8cf071e5072e4e01cc469cd49a1341f7d15a4
3
+ metadata.gz: 7d5e4239ec6dbf478aa8215b23131b4a16301a1b
4
+ data.tar.gz: e24020042cfd7bfa82a56ea9f1e40ca446a28184
5
5
  SHA512:
6
- metadata.gz: eeda8acf57ed23c9e9938e57e1a812cd190aa03f1d41a01e76cfcfc9ce4b5a318e20dca66d356b2a2353219e0ae8d63b019ef70803fc019d908c61a7c9bafb2b
7
- data.tar.gz: 8a3008f85d969560fdcf5952f4102c276874554114d6f5f58edee34ab6065e5ec4f118d5939b2abc53ccd3b84fcddf6611e698dbafc5b5ce4d148ae8d9a6c301
6
+ metadata.gz: 9aabd4bb7911c64bd4ff53384f7d6876ec3c1e4f4419668eba989e97652381d2b9efc038f606b98b9c9c84a6df15866c61824c4269f84d798ef9aea6d736b463
7
+ data.tar.gz: 83b6e08166f7029c510ffa91c55e22933c4ca4acf4419b28bb500bfa7681a0fb6dc5341521fabf8b0680b8b2ad78c44ff8c319f36afc61f2abac9d9b5128c908
@@ -31,6 +31,13 @@ module SoarSr
31
31
  search_for_service(name, false, false)
32
32
  end
33
33
 
34
+ def search_services_for_uri(pattern)_{
35
+ provided?(pattern, 'pattern') and length_at_least?(pattern, 4, 'pattern')
36
+ result = @registry.services.list_services
37
+ found = extract_services_with_uris_that_match_from_data(result, pattern)
38
+ success_data({'services' => found})
39
+ }end
40
+
34
41
  def search_for_service(pattern, include_service_components = true, full_text = true)_{
35
42
  provided?(pattern, 'pattern') and length_at_least?(pattern, 4, 'pattern')
36
43
 
@@ -69,6 +76,23 @@ module SoarSr
69
76
  success_data({'services' => found})
70
77
  }end
71
78
 
79
+ def search_access_points(pattern)
80
+ found = []
81
+ result = search_for_service(pattern, false, true)['data']['services']
82
+ result ||= {}
83
+ result.each do |service, detail|
84
+ uris = detail['uris']
85
+ uris ||= {}
86
+ uris.each do |id, access_details|
87
+ access_points = access_details['access_point']
88
+ access_points ||= ""
89
+ included = (not((access_point =~ /#{pattern}/i).nil?))
90
+ found << service if (included and (found[service].nil?))
91
+ end
92
+ end
93
+ success_data({'services' => found})
94
+ end
95
+
72
96
  def search_domain_perspective(domain_perspective, pattern)_{
73
97
  domain_perspective = standardize(domain_perspective)
74
98
  provided?(domain_perspective, 'domain perspective') and registered?(domain_perspective, 'domains')
@@ -101,5 +125,42 @@ module SoarSr
101
125
  end
102
126
  return false
103
127
  end
128
+
129
+ def extract_services_with_uris_that_match_from_data(result, pattern)
130
+ found = {}
131
+ if has_data?(result, 'services')
132
+ services = result['data']['services']
133
+ found = extract_services_with_uris_that_match(found, services, pattern)
134
+ end
135
+ end
136
+
137
+ def extract_services_with_uris_that_match(found, services, pattern)
138
+ services.each do |service, detail|
139
+ found = extract_matching_uris_for_services(found, service, detail, pattern)
140
+ end
141
+ found
142
+ end
143
+
144
+ def extract_matching_uris_for_services(found, service, detail, pattern)
145
+ uris = detail['uris']
146
+ uris ||= {}
147
+ append_matching_uris(found, service, uris, pattern)
148
+ end
149
+
150
+ def append_matching_uris(found, service, uris, pattern)
151
+ uris.each do |id, access_details|
152
+ extract_uris_from_access_details(found, access_details, service, pattern)
153
+ end
154
+ found
155
+ end
156
+
157
+ def extract_uris_from_access_details(found, access_details, service, pattern)
158
+ uri = access_details['access_point']
159
+ if (not((uri =~ /#{pattern}/i).nil?))
160
+ found[service] ||= []
161
+ found[service] << uri
162
+ end
163
+ found
164
+ end
104
165
  end
105
166
  end
@@ -104,7 +104,9 @@ module SoarSr
104
104
  end
105
105
 
106
106
  def list_services
107
- search_for_service_by_pattern(ALL_SERVICES)
107
+ found = search_for_service_by_pattern(ALL_SERVICES)
108
+
109
+ success_data({'services' => found})
108
110
  end
109
111
 
110
112
  private
@@ -1,3 +1,3 @@
1
1
  module SoarSr
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soar_sr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernst van Graan
@@ -14,98 +14,98 @@ dependencies:
14
14
  name: persistent-cache
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.10'
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
40
  version: '1.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '10.0'
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
54
  version: '10.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
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
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: byebug
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '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
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: jsender
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: soap4juddi
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
103
  version: 1.0.1
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.0.1
111
111
  description: Implementation of the Hetzner Service Registry specification, backed
@@ -116,9 +116,9 @@ executables: []
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
- - ".gitignore"
120
- - ".rspec"
121
- - ".travis.yml"
119
+ - .gitignore
120
+ - .rspec
121
+ - .travis.yml
122
122
  - CODE_OF_CONDUCT.md
123
123
  - Gemfile
124
124
  - LICENSE.txt
@@ -153,17 +153,17 @@ require_paths:
153
153
  - lib
154
154
  required_ruby_version: !ruby/object:Gem::Requirement
155
155
  requirements:
156
- - - ">="
156
+ - - '>='
157
157
  - !ruby/object:Gem::Version
158
158
  version: 2.0.0
159
159
  required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - ">="
161
+ - - '>='
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  requirements: []
165
165
  rubyforge_project:
166
- rubygems_version: 2.4.8
166
+ rubygems_version: 2.2.2
167
167
  signing_key:
168
168
  specification_version: 4
169
169
  summary: Implementation of the Hetzner Service Registry specification, backed by jUDDI