azure-storage-queue 1.1.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/azure/storage/queue.rb +26 -26
- data/lib/azure/storage/queue/autoload.rb +43 -43
- data/lib/azure/storage/queue/default.rb +84 -84
- data/lib/azure/storage/queue/message.rb +41 -41
- data/lib/azure/storage/queue/queue.rb +38 -38
- data/lib/azure/storage/queue/queue_service.rb +755 -755
- data/lib/azure/storage/queue/serialization.rb +110 -110
- data/lib/azure/storage/queue/version.rb +49 -49
- metadata +10 -31
@@ -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.
|
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 =
|
33
|
-
MINOR =
|
34
|
-
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 = 1 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
|
metadata
CHANGED
@@ -1,63 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azure-storage-queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-10 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: '
|
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: '
|
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:
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 1.6.8
|
33
|
+
version: 1.10.4
|
51
34
|
type: :runtime
|
52
35
|
prerelease: false
|
53
36
|
version_requirements: !ruby/object:Gem::Requirement
|
54
37
|
requirements:
|
55
38
|
- - "~>"
|
56
39
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 1.6.8
|
40
|
+
version: 1.10.4
|
61
41
|
- !ruby/object:Gem::Dependency
|
62
42
|
name: dotenv
|
63
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,14 +100,14 @@ dependencies:
|
|
120
100
|
requirements:
|
121
101
|
- - "~>"
|
122
102
|
- !ruby/object:Gem::Version
|
123
|
-
version: '
|
103
|
+
version: '13.0'
|
124
104
|
type: :development
|
125
105
|
prerelease: false
|
126
106
|
version_requirements: !ruby/object:Gem::Requirement
|
127
107
|
requirements:
|
128
108
|
- - "~>"
|
129
109
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
110
|
+
version: '13.0'
|
131
111
|
- !ruby/object:Gem::Dependency
|
132
112
|
name: timecop
|
133
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,15 +168,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
188
168
|
requirements:
|
189
169
|
- - ">="
|
190
170
|
- !ruby/object:Gem::Version
|
191
|
-
version:
|
171
|
+
version: 2.3.0
|
192
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
173
|
requirements:
|
194
174
|
- - ">="
|
195
175
|
- !ruby/object:Gem::Version
|
196
176
|
version: '0'
|
197
177
|
requirements: []
|
198
|
-
|
199
|
-
rubygems_version: 2.5.1
|
178
|
+
rubygems_version: 3.0.0
|
200
179
|
signing_key:
|
201
180
|
specification_version: 4
|
202
181
|
summary: Official Ruby client library to consume Azure Storage Queue service
|