azure-storage-queue 1.1.0 → 2.0.4

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.
@@ -1,110 +1,110 @@
1
- # frozen_string_literal: true
2
-
3
- #-------------------------------------------------------------------------
4
- # # Copyright (c) Microsoft and contributors. All rights reserved.
5
- #
6
- # The MIT License(MIT)
7
-
8
- # Permission is hereby granted, free of charge, to any person obtaining a copy
9
- # of this software and associated documentation files(the "Software"), to deal
10
- # in the Software without restriction, including without limitation the rights
11
- # to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12
- # copies of the Software, and to permit persons to whom the Software is
13
- # furnished to do so, subject to the following conditions :
14
-
15
- # The above copyright notice and this permission notice shall be included in
16
- # all copies or substantial portions of the Software.
17
-
18
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- # THE SOFTWARE.
25
- #--------------------------------------------------------------------------
26
- module Azure::Storage
27
- module Queue
28
- module Serialization
29
- include Azure::Storage::Common::Service::Serialization
30
-
31
- def self.queue_messages_from_xml(xml, decode)
32
- xml = slopify(xml)
33
-
34
- expect_node("QueueMessagesList", xml)
35
- results = []
36
- return results unless (xml > "QueueMessage").any?
37
-
38
- if xml.QueueMessage.count == 0
39
- results.push(queue_message_from_xml(xml.QueueMessage, decode))
40
- else
41
- xml.QueueMessage.each { |message_node|
42
- results.push(queue_message_from_xml(message_node, decode))
43
- }
44
- end
45
-
46
- results
47
- end
48
-
49
- def self.queue_message_from_xml(xml, decode)
50
- xml = slopify(xml)
51
- expect_node("QueueMessage", xml)
52
-
53
- Message.new do |msg|
54
- msg.id = xml.MessageId.text if (xml > "MessageId").any?
55
- msg.insertion_time = xml.InsertionTime.text if (xml > "InsertionTime").any?
56
- msg.expiration_time = xml.ExpirationTime.text if (xml > "ExpirationTime").any?
57
- msg.dequeue_count = xml.DequeueCount.text.to_i if (xml > "DequeueCount").any?
58
- msg.message_text = xml.MessageText.text if (xml > "MessageText").any?
59
- msg.time_next_visible = xml.TimeNextVisible.text if (xml > "TimeNextVisible").any?
60
- msg.pop_receipt = xml.PopReceipt.text if (xml > "PopReceipt").any?
61
-
62
- msg.message_text = Base64.decode64(msg.message_text) if msg.message_text && decode
63
- end
64
- end
65
-
66
- def self.message_to_xml(message_text, encode)
67
- if encode
68
- builder = Nokogiri::XML::Builder.new do |xml|
69
- xml.QueueMessage { xml.MessageText Base64.encode64(message_text) }
70
- end
71
- else
72
- builder = Nokogiri::XML::Builder.new(encoding: "utf-8") do |xml|
73
- xml.QueueMessage { xml.MessageText message_text.encode("utf-8") }
74
- end
75
- end
76
- builder.to_xml
77
- end
78
-
79
- def self.queue_enumeration_results_from_xml(xml)
80
- xml = slopify(xml)
81
- expect_node("EnumerationResults", xml)
82
-
83
- results = enumeration_results_from_xml(xml, Azure::Storage::Common::Service::EnumerationResults.new)
84
-
85
- return results unless (xml > "Queues").any? && ((xml > "Queues") > "Queue").any?
86
-
87
- if xml.Queues.Queue.count == 0
88
- results.push(queue_from_xml(xml.Queues.Queue))
89
- else
90
- xml.Queues.Queue.each { |queue_node|
91
- results.push(queue_from_xml(queue_node))
92
- }
93
- end
94
-
95
- results
96
- end
97
-
98
- def self.queue_from_xml(xml)
99
- xml = slopify(xml)
100
- expect_node("Queue", xml)
101
-
102
- queue = Queue.new
103
- queue.name = xml.Name.text if (xml > "Name").any?
104
- queue.metadata = metadata_from_xml(xml.Metadata) if (xml > "Metadata").any?
105
-
106
- queue
107
- end
108
- end
109
- end
110
- end
1
+ # frozen_string_literal: true
2
+
3
+ #-------------------------------------------------------------------------
4
+ # # Copyright (c) Microsoft and contributors. All rights reserved.
5
+ #
6
+ # The MIT License(MIT)
7
+
8
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ # of this software and associated documentation files(the "Software"), to deal
10
+ # in the Software without restriction, including without limitation the rights
11
+ # to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12
+ # copies of the Software, and to permit persons to whom the Software is
13
+ # furnished to do so, subject to the following conditions :
14
+
15
+ # The above copyright notice and this permission notice shall be included in
16
+ # all copies or substantial portions of the Software.
17
+
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ # THE SOFTWARE.
25
+ #--------------------------------------------------------------------------
26
+ module Azure::Storage
27
+ module Queue
28
+ module Serialization
29
+ include Azure::Storage::Common::Service::Serialization
30
+
31
+ def self.queue_messages_from_xml(xml, decode)
32
+ xml = slopify(xml)
33
+
34
+ expect_node("QueueMessagesList", xml)
35
+ results = []
36
+ return results unless (xml > "QueueMessage").any?
37
+
38
+ if xml.QueueMessage.count == 0
39
+ results.push(queue_message_from_xml(xml.QueueMessage, decode))
40
+ else
41
+ xml.QueueMessage.each { |message_node|
42
+ results.push(queue_message_from_xml(message_node, decode))
43
+ }
44
+ end
45
+
46
+ results
47
+ end
48
+
49
+ def self.queue_message_from_xml(xml, decode)
50
+ xml = slopify(xml)
51
+ expect_node("QueueMessage", xml)
52
+
53
+ Message.new do |msg|
54
+ msg.id = xml.MessageId.text if (xml > "MessageId").any?
55
+ msg.insertion_time = xml.InsertionTime.text if (xml > "InsertionTime").any?
56
+ msg.expiration_time = xml.ExpirationTime.text if (xml > "ExpirationTime").any?
57
+ msg.dequeue_count = xml.DequeueCount.text.to_i if (xml > "DequeueCount").any?
58
+ msg.message_text = xml.MessageText.text if (xml > "MessageText").any?
59
+ msg.time_next_visible = xml.TimeNextVisible.text if (xml > "TimeNextVisible").any?
60
+ msg.pop_receipt = xml.PopReceipt.text if (xml > "PopReceipt").any?
61
+
62
+ msg.message_text = Base64.decode64(msg.message_text) if msg.message_text && decode
63
+ end
64
+ end
65
+
66
+ def self.message_to_xml(message_text, encode)
67
+ if encode
68
+ builder = Nokogiri::XML::Builder.new do |xml|
69
+ xml.QueueMessage { xml.MessageText Base64.strict_encode64(message_text) }
70
+ end
71
+ else
72
+ builder = Nokogiri::XML::Builder.new(encoding: "utf-8") do |xml|
73
+ xml.QueueMessage { xml.MessageText message_text.encode("utf-8") }
74
+ end
75
+ end
76
+ builder.to_xml
77
+ end
78
+
79
+ def self.queue_enumeration_results_from_xml(xml)
80
+ xml = slopify(xml)
81
+ expect_node("EnumerationResults", xml)
82
+
83
+ results = enumeration_results_from_xml(xml, Azure::Storage::Common::Service::EnumerationResults.new)
84
+
85
+ return results unless (xml > "Queues").any? && ((xml > "Queues") > "Queue").any?
86
+
87
+ if xml.Queues.Queue.count == 0
88
+ results.push(queue_from_xml(xml.Queues.Queue))
89
+ else
90
+ xml.Queues.Queue.each { |queue_node|
91
+ results.push(queue_from_xml(queue_node))
92
+ }
93
+ end
94
+
95
+ results
96
+ end
97
+
98
+ def self.queue_from_xml(xml)
99
+ xml = slopify(xml)
100
+ expect_node("Queue", xml)
101
+
102
+ queue = Queue.new
103
+ queue.name = xml.Name.text if (xml > "Name").any?
104
+ queue.metadata = metadata_from_xml(xml.Metadata) if (xml > "Metadata").any?
105
+
106
+ queue
107
+ end
108
+ end
109
+ end
110
+ end
@@ -1,49 +1,49 @@
1
- # frozen_string_literal: true
2
-
3
- #-------------------------------------------------------------------------
4
- # # Copyright (c) Microsoft and contributors. All rights reserved.
5
- #
6
- # The MIT License(MIT)
7
-
8
- # Permission is hereby granted, free of charge, to any person obtaining a copy
9
- # of this software and associated documentation files(the "Software"), to deal
10
- # in the Software without restriction, including without limitation the rights
11
- # to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12
- # copies of the Software, and to permit persons to whom the Software is
13
- # furnished to do so, subject to the following conditions :
14
-
15
- # The above copyright notice and this permission notice shall be included in
16
- # all copies or substantial portions of the Software.
17
-
18
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- # THE SOFTWARE.
25
- #--------------------------------------------------------------------------
26
-
27
- module Azure
28
- module Storage
29
- module Queue
30
- class Version
31
- # Fields represent the parts defined in http://semver.org/
32
- MAJOR = 1 unless defined? MAJOR
33
- MINOR = 1 unless defined? MINOR
34
- UPDATE = 0 unless defined? UPDATE
35
-
36
- class << self
37
- # @return [String]
38
- def to_s
39
- [MAJOR, MINOR, UPDATE].compact.join(".")
40
- end
41
-
42
- def to_uas
43
- [MAJOR, MINOR, UPDATE].join(".")
44
- end
45
- end
46
- end
47
- end
48
- end
49
- end
1
+ # frozen_string_literal: true
2
+
3
+ #-------------------------------------------------------------------------
4
+ # # Copyright (c) Microsoft and contributors. All rights reserved.
5
+ #
6
+ # The MIT License(MIT)
7
+
8
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ # of this software and associated documentation files(the "Software"), to deal
10
+ # in the Software without restriction, including without limitation the rights
11
+ # to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12
+ # copies of the Software, and to permit persons to whom the Software is
13
+ # furnished to do so, subject to the following conditions :
14
+
15
+ # The above copyright notice and this permission notice shall be included in
16
+ # all copies or substantial portions of the Software.
17
+
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ # THE SOFTWARE.
25
+ #--------------------------------------------------------------------------
26
+
27
+ module Azure
28
+ module Storage
29
+ module Queue
30
+ class Version
31
+ # Fields represent the parts defined in http://semver.org/
32
+ MAJOR = 2 unless defined? MAJOR
33
+ MINOR = 0 unless defined? MINOR
34
+ UPDATE = 4 unless defined? UPDATE
35
+
36
+ class << self
37
+ # @return [String]
38
+ def to_s
39
+ [MAJOR, MINOR, UPDATE].compact.join(".")
40
+ end
41
+
42
+ def to_uas
43
+ [MAJOR, MINOR, UPDATE].join(".")
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -1,26 +1,26 @@
1
- # frozen_string_literal: true
2
-
3
- #-------------------------------------------------------------------------
4
- # # Copyright (c) Microsoft and contributors. All rights reserved.
5
- #
6
- # The MIT License(MIT)
7
-
8
- # Permission is hereby granted, free of charge, to any person obtaining a copy
9
- # of this software and associated documentation files(the "Software"), to deal
10
- # in the Software without restriction, including without limitation the rights
11
- # to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12
- # copies of the Software, and to permit persons to whom the Software is
13
- # furnished to do so, subject to the following conditions :
14
-
15
- # The above copyright notice and this permission notice shall be included in
16
- # all copies or substantial portions of the Software.
17
-
18
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- # THE SOFTWARE.
25
- #--------------------------------------------------------------------------
26
- require "azure/storage/queue/autoload"
1
+ # frozen_string_literal: true
2
+
3
+ #-------------------------------------------------------------------------
4
+ # # Copyright (c) Microsoft and contributors. All rights reserved.
5
+ #
6
+ # The MIT License(MIT)
7
+
8
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ # of this software and associated documentation files(the "Software"), to deal
10
+ # in the Software without restriction, including without limitation the rights
11
+ # to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12
+ # copies of the Software, and to permit persons to whom the Software is
13
+ # furnished to do so, subject to the following conditions :
14
+
15
+ # The above copyright notice and this permission notice shall be included in
16
+ # all copies or substantial portions of the Software.
17
+
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ # THE SOFTWARE.
25
+ #--------------------------------------------------------------------------
26
+ require "azure/storage/queue/autoload"
metadata CHANGED
@@ -1,63 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure-storage-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-10 00:00:00.000000000 Z
11
+ date: 2021-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: azure-core
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 0.1.13
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 0.1.13
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: azure-storage-common
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: '1.0'
19
+ version: '2.0'
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: '1.0'
26
+ version: '2.0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: nokogiri
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: '1.6'
33
+ version: '1'
48
34
  - - ">="
49
35
  - !ruby/object:Gem::Version
50
- version: 1.6.8
36
+ version: 1.10.8
51
37
  type: :runtime
52
38
  prerelease: false
53
39
  version_requirements: !ruby/object:Gem::Requirement
54
40
  requirements:
55
41
  - - "~>"
56
42
  - !ruby/object:Gem::Version
57
- version: '1.6'
43
+ version: '1'
58
44
  - - ">="
59
45
  - !ruby/object:Gem::Version
60
- version: 1.6.8
46
+ version: 1.10.8
61
47
  - !ruby/object:Gem::Dependency
62
48
  name: dotenv
63
49
  requirement: !ruby/object:Gem::Requirement
@@ -120,14 +106,14 @@ dependencies:
120
106
  requirements:
121
107
  - - "~>"
122
108
  - !ruby/object:Gem::Version
123
- version: '10.0'
109
+ version: '13.0'
124
110
  type: :development
125
111
  prerelease: false
126
112
  version_requirements: !ruby/object:Gem::Requirement
127
113
  requirements:
128
114
  - - "~>"
129
115
  - !ruby/object:Gem::Version
130
- version: '10.0'
116
+ version: '13.0'
131
117
  - !ruby/object:Gem::Dependency
132
118
  name: timecop
133
119
  requirement: !ruby/object:Gem::Requirement
@@ -180,7 +166,7 @@ homepage: http://github.com/azure/azure-storage-ruby
180
166
  licenses:
181
167
  - MIT
182
168
  metadata: {}
183
- post_install_message:
169
+ post_install_message:
184
170
  rdoc_options: []
185
171
  require_paths:
186
172
  - lib
@@ -188,16 +174,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
174
  requirements:
189
175
  - - ">="
190
176
  - !ruby/object:Gem::Version
191
- version: 1.9.3
177
+ version: 2.3.0
192
178
  required_rubygems_version: !ruby/object:Gem::Requirement
193
179
  requirements:
194
180
  - - ">="
195
181
  - !ruby/object:Gem::Version
196
182
  version: '0'
197
183
  requirements: []
198
- rubyforge_project:
199
- rubygems_version: 2.5.1
200
- signing_key:
184
+ rubygems_version: 3.0.3.1
185
+ signing_key:
201
186
  specification_version: 4
202
187
  summary: Official Ruby client library to consume Azure Storage Queue service
203
188
  test_files: []