celsius 0.4.1 → 0.4.2
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.
- checksums.yaml +4 -4
- data/.travis.yml +3 -4
- data/README.md +5 -1
- data/lib/celsius/hash.rb +5 -0
- data/lib/celsius/version.rb +1 -1
- data/spec/celsius/hash_spec.rb +15 -0
- data/spec/celsius/i18n_spec.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51d18c66a638073d31c3392e942b08260ac40872
|
4
|
+
data.tar.gz: 636b788e0c5b6694e2deaabd448783e0a895ca48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f954d3a106089d44185eb6b87ed302943d643c87938d6a02c6af6c9f883e38fd908d62fc3cadc35267cc8365518d5c203b84262bfda46e90575245af525b279
|
7
|
+
data.tar.gz: 7db89458a190f22d27bcd7407b5fe6703488c17ba200c0ad342c6d63b89c60846f17577e4c8ab0504bbe77c9fd8e0f51713c99d07555c0ae2b382ae813e5d5d5
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
# Celsius
|
1
|
+
# Celsius
|
2
|
+
|
3
|
+
[](https://travis-ci.org/ubpb/celsius)
|
4
|
+
[](https://codeclimate.com/github/ubpb/celsius)
|
5
|
+
[](https://codeclimate.com/github/ubpb/celsius)
|
2
6
|
|
3
7
|
TODO: Write a gem description
|
4
8
|
|
data/lib/celsius/hash.rb
CHANGED
data/lib/celsius/version.rb
CHANGED
data/spec/celsius/hash_spec.rb
CHANGED
@@ -58,6 +58,21 @@ describe Celsius::Hash do
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
+
describe ".smart_fetch" do
|
62
|
+
let(:hash) do
|
63
|
+
{
|
64
|
+
foo: "bar",
|
65
|
+
muff: false
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
it "fetches a value by key indifferently from the given hash" do
|
70
|
+
expect(described_class.smart_fetch(hash, :foo)).to eq(hash[:foo])
|
71
|
+
expect(described_class.smart_fetch(hash, "foo")).to eq(hash[:foo])
|
72
|
+
expect(described_class.smart_fetch(hash, "muff")).to eq(hash[:muff])
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
61
76
|
describe ".smart_store" do
|
62
77
|
it "stores a value with the given key" do
|
63
78
|
expect(described_class.smart_store({}, :key, "value")).to eq({key: "value"})
|
data/spec/celsius/i18n_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require "celsius/i18n"
|
|
3
3
|
describe Celsius::I18n do
|
4
4
|
let(:class_with_i18n_included) do
|
5
5
|
Class.new.tap do |klass|
|
6
|
-
klass.include
|
6
|
+
klass.send(:include, Celsius::I18n)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
@@ -16,7 +16,7 @@ describe Celsius::I18n do
|
|
16
16
|
let(:klass) do
|
17
17
|
Class.new.tap do |_klass|
|
18
18
|
_klass.class_variable_set(:@@locales, value_of_locales)
|
19
|
-
_klass.include
|
19
|
+
_klass.send(:include, Celsius::I18n)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -28,7 +28,7 @@ describe Celsius::I18n do
|
|
28
28
|
context "when the including class has no class variable named @@locales" do
|
29
29
|
let(:klass) do
|
30
30
|
Class.new.tap do |_klass|
|
31
|
-
_klass.include
|
31
|
+
_klass.send(:include, Celsius::I18n)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: celsius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Sievers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deep_merger
|
@@ -142,7 +142,7 @@ rubyforge_project:
|
|
142
142
|
rubygems_version: 2.4.5
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
|
-
summary: celsius-0.4.
|
145
|
+
summary: celsius-0.4.2
|
146
146
|
test_files:
|
147
147
|
- spec/assets/locales/de.yml
|
148
148
|
- spec/assets/locales/en.yml
|