standalone_typograf 2.0.0 → 2.0.1
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.
- data/README.md +2 -0
- data/lib/standalone_typograf/fractions.rb +1 -1
- data/lib/standalone_typograf/version.rb +1 -1
- data/test/test_fractions.rb +6 -0
- metadata +4 -4
data/README.md
CHANGED
@@ -27,7 +27,7 @@ module StandaloneTypograf
|
|
27
27
|
def fractions
|
28
28
|
FRACTIONS.each_pair do |text, sign|
|
29
29
|
#@text = @text.gsub(/#{text}/i, sign)
|
30
|
-
@text = @text.gsub(/(\D)([#{text[0]}][\/][#{text[2]}])(\D)/i, '\1' + sign + '\3')
|
30
|
+
@text = @text.gsub(/(\D|\A)([#{text[0]}][\/][#{text[2]}])(\D|\z)/i, '\1' + sign + '\3')
|
31
31
|
end
|
32
32
|
@text
|
33
33
|
end
|
data/test/test_fractions.rb
CHANGED
@@ -10,4 +10,10 @@ class FractionsTest < Test::Unit::TestCase
|
|
10
10
|
should = 'В ⅓ всей воды на планете содержится 2/10 углекислого газа. 102/303'
|
11
11
|
assert_equal text.fractions, should
|
12
12
|
end
|
13
|
+
|
14
|
+
def test_whitespaces
|
15
|
+
text = StandaloneTypograf::Typograf.new('1/2 1/4')
|
16
|
+
should = '½ ¼'
|
17
|
+
assert_equal text.fractions, should
|
18
|
+
end
|
13
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: standalone_typograf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -92,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
segments:
|
94
94
|
- 0
|
95
|
-
hash:
|
95
|
+
hash: 2869235040245000024
|
96
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
97
|
none: false
|
98
98
|
requirements:
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
segments:
|
103
103
|
- 0
|
104
|
-
hash:
|
104
|
+
hash: 2869235040245000024
|
105
105
|
requirements: []
|
106
106
|
rubyforge_project:
|
107
107
|
rubygems_version: 1.8.25
|