hexx 7.0.0 → 7.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +2 -1
- data/lib/hexx/helpers/messages.rb +0 -2
- data/lib/hexx/null.rb +12 -0
- data/lib/hexx/service.rb +1 -1
- data/lib/hexx/version.rb +1 -1
- data/spec/hexx/helpers/messages_spec.rb +0 -8
- data/spec/hexx/null_spec.rb +47 -0
- data/spec/hexx/service_spec.rb +0 -1
- 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: adb6424142ab3c257299fcb041460531b522fb07
|
4
|
+
data.tar.gz: e431cd32de61cb5d0cbb7d6a04a0857c2aa13afd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfcd1ea97d548e82af5b5970b143c446ad7525ba1a0acd01d63ad27b0dbd0a72aa247e16fe15744e9e3a0b223f70d5eabfa33b88fcbd815a104fee5a53554db1
|
7
|
+
data.tar.gz: 5cdf1a02b98f49ef603e5ac33019606d066dcf04e8d8ee3827c5456be5e197d2f02dd49a1ee2c75a915c60a944e91c05430e54b5da0bd6e4a879f9c25da16d95
|
data/README.rdoc
CHANGED
@@ -216,7 +216,8 @@ A typical usage of the service (in a Rails controller):
|
|
216
216
|
|
217
217
|
# Publishes a success message
|
218
218
|
def on_created(item, messages)
|
219
|
-
@item
|
219
|
+
@item = item
|
220
|
+
self.messages.concat messages
|
220
221
|
render "created", status: 201
|
221
222
|
end
|
222
223
|
|
data/lib/hexx/null.rb
CHANGED
@@ -182,6 +182,18 @@ module Hexx
|
|
182
182
|
true
|
183
183
|
end
|
184
184
|
|
185
|
+
# @return [false] for +Null+, +nil+ or +false+
|
186
|
+
# @return [true] otherwise.
|
187
|
+
def ^(other)
|
188
|
+
![self, nil, false].include? other
|
189
|
+
end
|
190
|
+
|
191
|
+
# @return [false] for +Null+, +nil+ or +false+
|
192
|
+
# @return [true] otherwise.
|
193
|
+
def |(other)
|
194
|
+
self.^(other)
|
195
|
+
end
|
196
|
+
|
185
197
|
private
|
186
198
|
|
187
199
|
# @api hide
|
data/lib/hexx/service.rb
CHANGED
data/lib/hexx/version.rb
CHANGED
@@ -29,14 +29,6 @@ module Hexx
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
describe "#messages=" do
|
33
|
-
|
34
|
-
it "sets #messages" do
|
35
|
-
expect { subject.messages = ["text"] }
|
36
|
-
.to change { subject.messages }.to ["text"]
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
32
|
describe "#add_message" do
|
41
33
|
|
42
34
|
before { subject.add_message :info, :text }
|
data/spec/hexx/null_spec.rb
CHANGED
@@ -101,5 +101,52 @@ module Hexx
|
|
101
101
|
expect(Null.to_r).to eq 0.to_r
|
102
102
|
end
|
103
103
|
end
|
104
|
+
|
105
|
+
describe "#^" do
|
106
|
+
|
107
|
+
it "null returns false" do
|
108
|
+
expect(Null ^ Null).to be_falsey
|
109
|
+
end
|
110
|
+
|
111
|
+
it "nil returns false" do
|
112
|
+
expect(Null ^ nil).to be_falsey
|
113
|
+
end
|
114
|
+
|
115
|
+
it "false returns false" do
|
116
|
+
expect(Null ^ false).to be_falsey
|
117
|
+
end
|
118
|
+
|
119
|
+
it "true returns true" do
|
120
|
+
expect(Null ^ true).to be_truthy
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
describe "#&" do
|
125
|
+
|
126
|
+
it "returns false" do
|
127
|
+
[Null, nil, false, true, 1, ""].each do |other|
|
128
|
+
expect(Null & other).to be_falsey
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
describe "#|" do
|
134
|
+
|
135
|
+
it "null returns false" do
|
136
|
+
expect(Null | Null).to be_falsey
|
137
|
+
end
|
138
|
+
|
139
|
+
it "nil returns false" do
|
140
|
+
expect(Null | nil).to be_falsey
|
141
|
+
end
|
142
|
+
|
143
|
+
it "false returns false" do
|
144
|
+
expect(Null | false).to be_falsey
|
145
|
+
end
|
146
|
+
|
147
|
+
it "true returns true" do
|
148
|
+
expect(Null | true).to be_truthy
|
149
|
+
end
|
150
|
+
end
|
104
151
|
end
|
105
152
|
end
|
data/spec/hexx/service_spec.rb
CHANGED
@@ -27,7 +27,6 @@ module Hexx
|
|
27
27
|
it "includes helpers from Messages" do
|
28
28
|
expect(described_class).to include Hexx::Helpers::Messages
|
29
29
|
expect(subject).to have_public_method :messages
|
30
|
-
expect(subject).to have_private_method :messages=
|
31
30
|
expect(subject).to have_private_method :add_message
|
32
31
|
expect(subject).to have_private_method :t
|
33
32
|
end
|
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: 7.0.
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|