improve_typography 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/config/locales/cs.yml +5 -0
- data/lib/improve_typography/processors/double_quotes.rb +5 -3
- data/lib/improve_typography/processors/multiply_sign.rb +1 -1
- data/lib/improve_typography/processors/single_quotes.rb +5 -3
- data/lib/improve_typography/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 444052f9e0f44575f6e7e25bfa3a73cdf934a145d4031fdd1c657608447fe828
|
4
|
+
data.tar.gz: 525d059d1f1043f6da8ad407c2f5ac6772962400a4ade6c118cc24db2d24c679
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 115d8acbe0c3c573ca6fe0949ae9371838cfcd4926fee8611d468d3549a500af97c6970cd90164b05831b545dcd48e46e1ebdbe91abfa7acc0bc9c05c01429c0
|
7
|
+
data.tar.gz: b11ba1332885e995a37ad381200036ca1ec7b72c1a9327a73b33ae631773f852696823e4dfc47da0202d1d091433f2e1da1f3d06be647dc49f02b5eae27e3db2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/config/locales/cs.yml
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
module ImproveTypography
|
2
2
|
module Processors
|
3
3
|
class DoubleQuotes < Processor
|
4
|
-
REGEXP = /["“”](.*?)["“”]/i
|
5
|
-
|
6
4
|
def call
|
7
5
|
replace_double_quotes
|
8
6
|
end
|
@@ -10,7 +8,11 @@ module ImproveTypography
|
|
10
8
|
private
|
11
9
|
|
12
10
|
def replace_double_quotes
|
13
|
-
str.gsub(
|
11
|
+
str.gsub(regexp, "#{double_quotes[0]}\\1#{double_quotes[1]}" )
|
12
|
+
end
|
13
|
+
|
14
|
+
def regexp
|
15
|
+
@regexp ||= Regexp.new("[\"#{double_quotes[0]}#{double_quotes[1]}](.*?)[\"#{double_quotes[0]}#{double_quotes[1]}](?!\\w)")
|
14
16
|
end
|
15
17
|
|
16
18
|
def double_quotes
|
@@ -1,8 +1,6 @@
|
|
1
1
|
module ImproveTypography
|
2
2
|
module Processors
|
3
3
|
class SingleQuotes < Processor
|
4
|
-
REGEXP = /['’‘](.*?)['’‘](?!\w)/i
|
5
|
-
|
6
4
|
def call
|
7
5
|
replace_single_quotes
|
8
6
|
end
|
@@ -10,7 +8,11 @@ module ImproveTypography
|
|
10
8
|
private
|
11
9
|
|
12
10
|
def replace_single_quotes
|
13
|
-
str.gsub(
|
11
|
+
str.gsub(regexp, "#{single_quotes[0]}\\1#{single_quotes[1]}")
|
12
|
+
end
|
13
|
+
|
14
|
+
def regexp
|
15
|
+
@regexp ||= Regexp.new("['#{single_quotes[0]}#{single_quotes[1]}](.*?)['#{single_quotes[0]}#{single_quotes[1]}](?!\\w)")
|
14
16
|
end
|
15
17
|
|
16
18
|
def single_quotes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: improve_typography
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Celizna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
166
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.
|
167
|
+
rubygems_version: 2.7.6
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: Improves typography (quotes, hyphens, etc.) of a given string. Works well
|