text_helpers 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/text_helpers/translation.rb +1 -1
- data/lib/text_helpers/version.rb +1 -1
- data/test/lib/text_helpers/translation_test.rb +5 -5
- 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: 1ef277a88af65658970b04c07ca2adb16066170f
|
4
|
+
data.tar.gz: 0e3a5b3c17b5ef338b960ee306f9dbdec0d92791
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6726802e15929375da0058260934d0a07e67ac78750d59b1cdd3a7d27d5dbc5870d24ce2e33c20986ea401591fb550dfe0e8659004dfffbeaf203968a825d075
|
7
|
+
data.tar.gz: 32d0d2d6cd249b5d97d964eaabe3ae2cfafd014dbf02b2091e89c67de77596e1c5808d1e7b068076e25db02e620479af7a2db31cae40fad2e5fd84b72e3ad026
|
data/lib/text_helpers/version.rb
CHANGED
@@ -26,19 +26,19 @@ describe TextHelpers::Translation do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it "looks up the text for the key in a scope derived from the call stack" do
|
29
|
-
assert_equal @helper.text(:test_key)
|
29
|
+
assert_equal "*#{@scoped_text}*", @helper.text(:test_key)
|
30
30
|
end
|
31
31
|
|
32
32
|
it "converts the text to HTML via Markdown" do
|
33
|
-
assert_equal
|
33
|
+
assert_equal "<p><em>#{@scoped_text}</em></p>\n", @helper.html(:test_key)
|
34
34
|
end
|
35
35
|
|
36
36
|
it "removes the enclosing paragraph with :inline" do
|
37
|
-
assert_equal @helper.html(:test_key, inline: true)
|
37
|
+
assert_equal "<em>#{@scoped_text}</em>\n", @helper.html(:test_key, inline: true)
|
38
38
|
end
|
39
39
|
|
40
40
|
it "interpolates values wrapped in !!" do
|
41
|
-
assert_equal
|
41
|
+
assert_equal "Global? (#{@global_text})", @helper.text(:interpolated_key)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -50,7 +50,7 @@ describe TextHelpers::Translation do
|
|
50
50
|
end
|
51
51
|
|
52
52
|
it "defaults to a globally-defined value for the key" do
|
53
|
-
assert_equal @helper.text(:test_key)
|
53
|
+
assert_equal @global_text, @helper.text(:test_key)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: text_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Horner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|