standalone_typograf 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ #encoding: UTF-8
2
+
3
+ module StandaloneTypograf
4
+ module Dots
5
+ def dots
6
+ @text = @text.gsub(/[.][.][.]/i, '…')
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  #encoding: UTF-8
2
2
 
3
3
  module StandaloneTypograf
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
@@ -4,12 +4,14 @@ require 'standalone_typograf/version'
4
4
  require 'standalone_typograf/dasherize'
5
5
  require 'standalone_typograf/signs'
6
6
  require 'standalone_typograf/quotes'
7
+ require 'standalone_typograf/dots'
7
8
 
8
9
  module StandaloneTypograf
9
10
  class Typograf
10
11
  include StandaloneTypograf::Dasherize
11
12
  include StandaloneTypograf::Signs
12
13
  include StandaloneTypograf::Quotes
14
+ include StandaloneTypograf::Dots
13
15
 
14
16
  def initialize(text, options={})
15
17
  options[:signs] ||= SIGNS
@@ -24,6 +26,7 @@ module StandaloneTypograf
24
26
  self.dasherize
25
27
  self.signs
26
28
  self.quotes
29
+ self.dots
27
30
  @text
28
31
  end
29
32
  end
data/test/test_dots.rb ADDED
@@ -0,0 +1,24 @@
1
+ #encoding: UTF-8
2
+
3
+ require 'test/unit'
4
+ require 'standalone_typograf'
5
+
6
+ class DotsTest < Test::Unit::TestCase
7
+ def test_dots
8
+ text = StandaloneTypograf::Typograf.new('Дубровский молчал...')
9
+ should = 'Дубровский молчал…'
10
+ assert_equal text.dots, should
11
+ end
12
+
13
+ def test_two_dots
14
+ text = StandaloneTypograf::Typograf.new('Да что тут предлагать?..')
15
+ should = 'Да что тут предлагать?..'
16
+ assert_equal text.dots, should
17
+ end
18
+
19
+ def test_range
20
+ text = StandaloneTypograf::Typograf.new('Труба длиной 5...10 м.')
21
+ should = 'Труба длиной 5…10 м.'
22
+ assert_equal text.dots, should
23
+ end
24
+ 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: 1.0.1
4
+ version: 1.0.2
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-11 00:00:00.000000000 Z
12
+ date: 2013-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -58,11 +58,13 @@ files:
58
58
  - Rakefile
59
59
  - lib/standalone_typograf.rb
60
60
  - lib/standalone_typograf/dasherize.rb
61
+ - lib/standalone_typograf/dots.rb
61
62
  - lib/standalone_typograf/quotes.rb
62
63
  - lib/standalone_typograf/signs.rb
63
64
  - lib/standalone_typograf/version.rb
64
65
  - standalone_typograf.gemspec
65
66
  - test/test_dash.rb
67
+ - test/test_dots.rb
66
68
  - test/test_prepare.rb
67
69
  - test/test_quotes.rb
68
70
  - test/test_signs.rb
@@ -81,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
83
  version: '0'
82
84
  segments:
83
85
  - 0
84
- hash: -484725645805835366
86
+ hash: -3393206938688602568
85
87
  required_rubygems_version: !ruby/object:Gem::Requirement
86
88
  none: false
87
89
  requirements:
@@ -90,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
92
  version: '0'
91
93
  segments:
92
94
  - 0
93
- hash: -484725645805835366
95
+ hash: -3393206938688602568
94
96
  requirements: []
95
97
  rubyforge_project:
96
98
  rubygems_version: 1.8.25
@@ -99,6 +101,7 @@ specification_version: 3
99
101
  summary: Very Fast&Simple Typograf fot the Russian text.
100
102
  test_files:
101
103
  - test/test_dash.rb
104
+ - test/test_dots.rb
102
105
  - test/test_prepare.rb
103
106
  - test/test_quotes.rb
104
107
  - test/test_signs.rb