standalone_typograf 2.0.1 → 2.0.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.
data/README.md CHANGED
@@ -13,9 +13,10 @@
13
13
  ## Возможности
14
14
 
15
15
  - замена кавычек (поддерживаются внутренние и внешние кавычки);
16
- - замена знаков (с), (тм), (р) на аналогичные ©, ™, ®. Буква в скобке может быть как английской, так и русской;
16
+ - замена знаков (с), (тм), (р) на аналогичные ©, ™, ®. Буква в скобке может быть как латинской, так и кириллической;
17
17
  - замена знака ±
18
18
  - короткое тире (между числами без отбивки);
19
+ - замена многоточия;
19
20
  - подстановка длинного тире (с использованием неразрывного пробела);
20
21
  - привязка одно- и двухбуквенных слов к следующему за ними слову с помощью неразрывного пробела;
21
22
  - привязка частиц (>=3) к предыдущему слову с помощью неразрывного пробела;
@@ -28,13 +28,13 @@ module StandaloneTypograf
28
28
  # Неразрывный пробел
29
29
  def nbspace
30
30
  # Одна буква - неразрывный пробел справа
31
- @text = @text.gsub(/(\s)([a-zа-яА-Я])(\s)/i, '\1'+'\2'+' ')
31
+ @text = @text.gsub(/(\s)([a-zа-яА-Я])(\s)/i, '\1'+'\2'+' ')
32
32
 
33
33
  # Двухбуквенные слова - наразрывные пробел справа
34
- @text = @text.gsub(/(\s)([a-zа-яА-Я][a-zа-яА-Я])(\s)/i, '\1'+'\2'+' ')
34
+ @text = @text.gsub(/(\s)([a-zа-яА-Я][a-zа-яА-Я])(\s)/i, '\1'+'\2'+' ')
35
35
 
36
36
  # У частиц неразрывный пробел слева
37
- PARTICLES.each { |p| @text = @text.gsub(/(\s)(#{p})/i, ' '+'\2') }
37
+ PARTICLES.each { |p| @text = @text.gsub(/(\s)(#{p})/i, ' '+'\2') }
38
38
 
39
39
  @text
40
40
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module StandaloneTypograf
4
- VERSION = '2.0.1'
4
+ VERSION = '2.0.2'
5
5
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.version = StandaloneTypograf::VERSION
10
10
  spec.authors = 'Alex Shilov'
11
11
  spec.email = 'sashapashamasha@gmail.com'
12
- spec.description = "Standalone (offline) client of the ArtLebedev's Studio Typograf service."
12
+ spec.description = "Standalone (offline) client of the ArtLebedev's Studio Typograf service. http://typograf.herokuapp.com"
13
13
  spec.summary = 'Very Fast&Simple Typograf fot the Russian text.'
14
14
  spec.homepage = 'https://github.com/shlima/StandaloneTypograf'
15
15
  spec.license = 'MIT'
@@ -16,4 +16,10 @@ class FractionsTest < Test::Unit::TestCase
16
16
  should = '½ ¼'
17
17
  assert_equal text.fractions, should
18
18
  end
19
+
20
+ def test_single
21
+ text = StandaloneTypograf::Typograf.new('1/2')
22
+ should = '½'
23
+ assert_equal text.fractions, should
24
+ end
19
25
  end
data/test/test_nbspace.rb CHANGED
@@ -23,4 +23,11 @@ class NbspaceTest < Test::Unit::TestCase
23
23
  should = 'Саша якобы принес водку'
24
24
  assert_equal text.nbspace, should
25
25
  end
26
+
27
+ def test_combine
28
+ # впваып ваыпаыв пывап я&nbsp;за&nbsp;пивом пошел 2/3
29
+ text = StandaloneTypograf::Typograf.new('впваып ваыпаыв пывап я за пивом пошел 2/3')
30
+ should = 'впваып ваыпаыв пывап я за пивом пошел 2/3'
31
+ assert_equal text.nbspace, should
32
+ end
26
33
  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.1
4
+ version: 2.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -44,6 +44,7 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  description: Standalone (offline) client of the ArtLebedev's Studio Typograf service.
47
+ http://typograf.herokuapp.com
47
48
  email: sashapashamasha@gmail.com
48
49
  executables: []
49
50
  extensions: []
@@ -92,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
93
  version: '0'
93
94
  segments:
94
95
  - 0
95
- hash: 2869235040245000024
96
+ hash: 1958121828042888037
96
97
  required_rubygems_version: !ruby/object:Gem::Requirement
97
98
  none: false
98
99
  requirements:
@@ -101,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
102
  version: '0'
102
103
  segments:
103
104
  - 0
104
- hash: 2869235040245000024
105
+ hash: 1958121828042888037
105
106
  requirements: []
106
107
  rubyforge_project:
107
108
  rubygems_version: 1.8.25