standalone_typograf 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  Пушкин писал Дельвигу: «Жду „Цыганов“ и тотчас тисну…», © 1827 — А. С. Пушкин
10
10
 
11
+ Пример работы (онлайн типограф): http://typograf.herokuapp.com
12
+
11
13
  ## Возможности
12
14
 
13
15
  - замена кавычек (поддерживаются внутренние и внешние кавычки);
@@ -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
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module StandaloneTypograf
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.1'
5
5
  end
@@ -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.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-19 00:00:00.000000000 Z
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: 1046078892496407148
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: 1046078892496407148
104
+ hash: 2869235040245000024
105
105
  requirements: []
106
106
  rubyforge_project:
107
107
  rubygems_version: 1.8.25