spacifier 1.1.1.pre.beta1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 74790638ed7feae54db3eb96606f19e9fd0403c1
4
- data.tar.gz: 066c2f0b5cd02e8965955e7fc9952051b97b1d8d
2
+ SHA256:
3
+ metadata.gz: ea1933239d2865e4a9669676e891f0349924eccd59ec735a67e1fcdc187fe287
4
+ data.tar.gz: 58f50c8791436c1939449039239e03ecf2c6c0dd2bf2a9ef8ce15a1a9f112eb0
5
5
  SHA512:
6
- metadata.gz: c87e3aa48e27766e70f684074ed759a241448178cdeab837acdd6c3ad1ebaaeaf9831ec1cce4d4bc77b7b5f0ebeb5d4bed82298637572680f90fb41bf9ef6549
7
- data.tar.gz: 5173bec203faec95ff4b3069f2ebac42b5bbd752c2f4c1fbb101ecdca98e87bd8befc5eb93bf305644cbe8990182361ae26d3f8857c8efa6b0f5997658d0b7e0
6
+ metadata.gz: 715cb4b01bbaafc9884763f09d953e39576f9a6d6208b2ad7e719a28846fbf8a89bf4293cec8acd7c94ed29aa75869e45d9bd5fee23835fd4deab71a180c809e
7
+ data.tar.gz: 466e4319e3d6603ffe494992deb717507a80141db913d148e14abe8521831c496fecd3608950dacf31d926d4cbeb0f07a07ba702a382fb538b9e7c0975eb2471
data/.gitignore CHANGED
@@ -50,3 +50,4 @@ build-iPhoneSimulator/
50
50
  .rvmrc
51
51
  /test/site/_site
52
52
  /test/site/.sass-cache
53
+ Gemfile.lock
@@ -13,9 +13,6 @@ before_script:
13
13
  script:
14
14
  - bundle exec rake test
15
15
  after_script:
16
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
17
- after_success:
18
- - bundle exec codeclimate-test-reporter
16
+ - cd ../../ && ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
19
17
  notifications:
20
18
  email: false
21
- slack: navyblue-team:ioO5diAGc5WUQVDKc5BH1UbE
data/README.md CHANGED
@@ -31,10 +31,12 @@ $ 何为跨域?何为 JSONP?JSONP 技术能实现什么?是否有必要使
31
31
 
32
32
  ## Jekyll-spacify
33
33
 
34
+ Jekyll-spacify is a Liquid filter plugin for Jekyll, based on spacifier. As soon as you get spacifier, Jekyll-spacify is embedded in.
35
+
34
36
  Add `spacifier` to `Gemfile`:
35
37
 
36
38
  ```
37
- gem "spacify"
39
+ gem "spacifier"
38
40
  ```
39
41
 
40
42
  And then,
@@ -55,3 +57,9 @@ Use in your contents:
55
57
  ```
56
58
  {{ "你好,Hello世界world" | spacify }}
57
59
  ```
60
+
61
+ ## License
62
+
63
+ MIT License.
64
+
65
+ Copyright (c) David Zhang, 2020.
@@ -7,6 +7,7 @@ module Spacifier
7
7
 
8
8
  class << self
9
9
  def spacify(words)
10
+ return '' unless words.is_a?(String)
10
11
  # strip words
11
12
  words.strip!
12
13
  # init vars
@@ -20,7 +21,7 @@ module Spacifier
20
21
  elsif /\d/.match(c) != nil
21
22
  new_words << c
22
23
  last_word_type = nil
23
- elsif is_punctuation(c)
24
+ elsif punct?(c)
24
25
  new_words << c
25
26
  last_word_type = nil
26
27
  elsif /\p{Han}/.match(c) == nil
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Spacifier
4
4
  class << self
5
- def is_punctuation(c)
5
+ def punct?(c)
6
6
  !(/\p{P}/.match(c) == nil)
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Spacifier
2
- VERSION = "1.1.1-beta1".freeze
2
+ VERSION = "1.1.2".freeze
3
3
  end
@@ -3,8 +3,12 @@ require "helper"
3
3
  class TestJekyllFilter < Minitest::Test
4
4
  context nil do
5
5
  should "build a jekyll site where spacifier filter works" do
6
- output_path = "/tmp/_site"
7
- output = File.read(File.expand_path("/tmp/_site/index.html", File.dirname(__FILE__)))
6
+ output_path = "/tmp/spacifier_test"
7
+ Dir.chdir("./test/site") do
8
+ system "bundle"
9
+ system "bundle exec jekyll b -d #{output_path}"
10
+ end
11
+ output = File.read(File.expand_path("#{output_path}/index.html", File.dirname(__FILE__)))
8
12
  assert_equal(true, output.include?("它 works"))
9
13
  assert_equal(true, output.include?("hello 世界"))
10
14
  end
@@ -34,5 +34,14 @@ class TestSpacifier < Minitest::Test
34
34
  expect = "我是 Xiao Ming 生于2000年,1个人生活了30years。Mac 是我最喜欢的电脑。aaaa-哈哈哈"
35
35
  assert_equal(expect, output)
36
36
  end
37
+
38
+ should "return blank string" do
39
+ input = nil
40
+ output = Spacifier.spacify(input)
41
+ assert_equal("", output)
42
+ input = 111
43
+ output = Spacifier.spacify(input)
44
+ assert_equal("", output)
45
+ end
37
46
  end
38
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spacifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1.pre.beta1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Zhang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-26 00:00:00.000000000 Z
11
+ date: 2020-07-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Insert a space between a Chinese character and a western character
14
14
  email:
@@ -21,7 +21,6 @@ files:
21
21
  - ".gitignore"
22
22
  - ".travis.yml"
23
23
  - Gemfile
24
- - Gemfile.lock
25
24
  - LICENSE
26
25
  - README.md
27
26
  - Rakefile
@@ -33,7 +32,6 @@ files:
33
32
  - test/helper.rb
34
33
  - test/site/.gitignore
35
34
  - test/site/Gemfile
36
- - test/site/Gemfile.lock
37
35
  - test/site/_config.yml
38
36
  - test/site/index.md
39
37
  - test/test_jekyll_filter.rb
@@ -53,12 +51,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
53
51
  version: 2.2.5
54
52
  required_rubygems_version: !ruby/object:Gem::Requirement
55
53
  requirements:
56
- - - ">"
54
+ - - ">="
57
55
  - !ruby/object:Gem::Version
58
- version: 1.3.1
56
+ version: '0'
59
57
  requirements: []
60
- rubyforge_project:
61
- rubygems_version: 2.6.11
58
+ rubygems_version: 3.1.2
62
59
  signing_key:
63
60
  specification_version: 4
64
61
  summary: Insert a space between a Chinese character and a western character
@@ -66,7 +63,6 @@ test_files:
66
63
  - test/helper.rb
67
64
  - test/site/.gitignore
68
65
  - test/site/Gemfile
69
- - test/site/Gemfile.lock
70
66
  - test/site/_config.yml
71
67
  - test/site/index.md
72
68
  - test/test_jekyll_filter.rb
@@ -1,95 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- spacifier (1.1.0.pre.beta1)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- addressable (2.5.2)
10
- public_suffix (>= 2.0.2, < 4.0)
11
- codeclimate-test-reporter (1.0.8)
12
- simplecov (<= 0.13)
13
- colorator (1.1.0)
14
- concurrent-ruby (1.0.5)
15
- docile (1.1.5)
16
- em-websocket (0.5.1)
17
- eventmachine (>= 0.12.9)
18
- http_parser.rb (~> 0.6.0)
19
- eventmachine (1.2.5)
20
- ffi (1.9.23)
21
- forwardable-extended (2.6.0)
22
- http_parser.rb (0.6.0)
23
- i18n (0.9.5)
24
- concurrent-ruby (~> 1.0)
25
- jekyll (3.8.0)
26
- addressable (~> 2.4)
27
- colorator (~> 1.0)
28
- em-websocket (~> 0.5)
29
- i18n (~> 0.7)
30
- jekyll-sass-converter (~> 1.0)
31
- jekyll-watch (~> 2.0)
32
- kramdown (~> 1.14)
33
- liquid (~> 4.0)
34
- mercenary (~> 0.3.3)
35
- pathutil (~> 0.9)
36
- rouge (>= 1.7, < 4)
37
- safe_yaml (~> 1.0)
38
- jekyll-feed (0.9.3)
39
- jekyll (~> 3.3)
40
- jekyll-sass-converter (1.5.2)
41
- sass (~> 3.4)
42
- jekyll-seo-tag (2.4.0)
43
- jekyll (~> 3.3)
44
- jekyll-watch (2.0.0)
45
- listen (~> 3.0)
46
- json (2.1.0)
47
- kramdown (1.16.2)
48
- liquid (4.0.0)
49
- listen (3.1.5)
50
- rb-fsevent (~> 0.9, >= 0.9.4)
51
- rb-inotify (~> 0.9, >= 0.9.7)
52
- ruby_dep (~> 1.2)
53
- mercenary (0.3.6)
54
- minima (2.5.0)
55
- jekyll (~> 3.5)
56
- jekyll-feed (~> 0.9)
57
- jekyll-seo-tag (~> 2.1)
58
- minitest (5.11.3)
59
- pathutil (0.16.1)
60
- forwardable-extended (~> 2.6)
61
- public_suffix (3.0.2)
62
- rake (12.3.1)
63
- rb-fsevent (0.10.3)
64
- rb-inotify (0.9.10)
65
- ffi (>= 0.5.0, < 2)
66
- rouge (3.1.1)
67
- ruby_dep (1.5.0)
68
- safe_yaml (1.0.4)
69
- sass (3.5.6)
70
- sass-listen (~> 4.0.0)
71
- sass-listen (4.0.0)
72
- rb-fsevent (~> 0.9, >= 0.9.4)
73
- rb-inotify (~> 0.9, >= 0.9.7)
74
- shoulda-context (1.2.2)
75
- simplecov (0.13.0)
76
- docile (~> 1.1.0)
77
- json (>= 1.8, < 3)
78
- simplecov-html (~> 0.10.0)
79
- simplecov-html (0.10.2)
80
-
81
- PLATFORMS
82
- ruby
83
-
84
- DEPENDENCIES
85
- codeclimate-test-reporter
86
- jekyll
87
- minima
88
- minitest
89
- rake
90
- shoulda-context
91
- simplecov
92
- spacifier!
93
-
94
- BUNDLED WITH
95
- 1.16.1
@@ -1,81 +0,0 @@
1
- GIT
2
- remote: https://github.com/crispgm/spacifier.git
3
- revision: b54f92242a30c40d61e52d3837839f874251f6c6
4
- specs:
5
- spacifier (1.1.0.pre.beta1)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- addressable (2.5.2)
11
- public_suffix (>= 2.0.2, < 4.0)
12
- colorator (1.1.0)
13
- concurrent-ruby (1.0.5)
14
- em-websocket (0.5.1)
15
- eventmachine (>= 0.12.9)
16
- http_parser.rb (~> 0.6.0)
17
- eventmachine (1.2.5)
18
- ffi (1.9.23)
19
- forwardable-extended (2.6.0)
20
- http_parser.rb (0.6.0)
21
- i18n (0.9.5)
22
- concurrent-ruby (~> 1.0)
23
- jekyll (3.8.0)
24
- addressable (~> 2.4)
25
- colorator (~> 1.0)
26
- em-websocket (~> 0.5)
27
- i18n (~> 0.7)
28
- jekyll-sass-converter (~> 1.0)
29
- jekyll-watch (~> 2.0)
30
- kramdown (~> 1.14)
31
- liquid (~> 4.0)
32
- mercenary (~> 0.3.3)
33
- pathutil (~> 0.9)
34
- rouge (>= 1.7, < 4)
35
- safe_yaml (~> 1.0)
36
- jekyll-feed (0.9.3)
37
- jekyll (~> 3.3)
38
- jekyll-sass-converter (1.5.2)
39
- sass (~> 3.4)
40
- jekyll-seo-tag (2.4.0)
41
- jekyll (~> 3.3)
42
- jekyll-watch (2.0.0)
43
- listen (~> 3.0)
44
- kramdown (1.16.2)
45
- liquid (4.0.0)
46
- listen (3.1.5)
47
- rb-fsevent (~> 0.9, >= 0.9.4)
48
- rb-inotify (~> 0.9, >= 0.9.7)
49
- ruby_dep (~> 1.2)
50
- mercenary (0.3.6)
51
- minima (2.5.0)
52
- jekyll (~> 3.5)
53
- jekyll-feed (~> 0.9)
54
- jekyll-seo-tag (~> 2.1)
55
- pathutil (0.16.1)
56
- forwardable-extended (~> 2.6)
57
- public_suffix (3.0.2)
58
- rb-fsevent (0.10.3)
59
- rb-inotify (0.9.10)
60
- ffi (>= 0.5.0, < 2)
61
- rouge (3.1.1)
62
- ruby_dep (1.5.0)
63
- safe_yaml (1.0.4)
64
- sass (3.5.6)
65
- sass-listen (~> 4.0.0)
66
- sass-listen (4.0.0)
67
- rb-fsevent (~> 0.9, >= 0.9.4)
68
- rb-inotify (~> 0.9, >= 0.9.7)
69
-
70
- PLATFORMS
71
- ruby
72
-
73
- DEPENDENCIES
74
- jekyll (~> 3.8.0)
75
- jekyll-feed (~> 0.6)
76
- minima (~> 2.0)
77
- spacifier!
78
- tzinfo-data
79
-
80
- BUNDLED WITH
81
- 1.16.1