hexx 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hexx/service.rb +6 -3
- data/lib/hexx/version.rb +1 -1
- data/spec/hexx/service_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d06fcfb644ba49b3b3cda9a06e024900f6600427
|
4
|
+
data.tar.gz: 00189cce747fa87b1f014235f564e9f7a1bda312
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04c8b1ac98ba33404aa04c9590ce7f9e9ebd1b5db1dd72e8996790f4e674475e337ad640ba0fccaf3f73b1617d23d70fb17f9012f826c173945d9abc6e7a40c0
|
7
|
+
data.tar.gz: 9c0be5860b62202e64b0f7102097ad17ece7b06932eee4edd99718f028ec1774102c68c0a7abb20895b17a65ca986b0bac5cb02c0b81e9d91edfe272c80bc205
|
data/lib/hexx/service.rb
CHANGED
@@ -32,6 +32,10 @@ module Hexx
|
|
32
32
|
#
|
33
33
|
# @param [Hash] options The options to be assigned to the {#params}.
|
34
34
|
# @return [Hexx::Service] The service object.
|
35
|
+
def initialize(*)
|
36
|
+
super
|
37
|
+
@messages = []
|
38
|
+
end
|
35
39
|
|
36
40
|
# @!scope class
|
37
41
|
# @!visibility private
|
@@ -216,6 +220,7 @@ module Hexx
|
|
216
220
|
I18n.t text, options.merge(scope: scope)
|
217
221
|
end
|
218
222
|
|
223
|
+
# @!attribute messages
|
219
224
|
# The array of service messages, added by the {#add_message} helper.
|
220
225
|
#
|
221
226
|
# @example
|
@@ -232,9 +237,7 @@ module Hexx
|
|
232
237
|
# # => "translation not found: en.activemodel.messages.models.test.ok"
|
233
238
|
#
|
234
239
|
# @return [Array<Hexx::Service::Message>] The array of message objects.
|
235
|
-
|
236
|
-
@messages ||= []
|
237
|
-
end
|
240
|
+
attr_accessor :messages
|
238
241
|
|
239
242
|
# Adds the translated message to the {#messages} array.
|
240
243
|
# @example (see Service#messages)
|
data/lib/hexx/version.rb
CHANGED
data/spec/hexx/service_spec.rb
CHANGED
@@ -143,6 +143,14 @@ module Hexx
|
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
146
|
+
describe "#messages=" do
|
147
|
+
|
148
|
+
it "sets #messages" do
|
149
|
+
expect { subject.messages = ["text"] }
|
150
|
+
.to change { subject.messages }.to ["text"]
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
146
154
|
describe "#add_message" do
|
147
155
|
|
148
156
|
before { subject.add_message :info, :text }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hexx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|