spacifier 1.0.0.pre.beta1 → 1.1.1.pre.beta1
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.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +16 -4
- data/Gemfile +4 -2
- data/Gemfile.lock +71 -10
- data/LICENSE +1 -1
- data/README.md +28 -3
- data/Rakefile +1 -1
- data/exe/spacifier +1 -1
- data/lib/spacifier/version.rb +1 -1
- data/lib/spacifier.rb +12 -0
- data/spacifier.gemspec +1 -1
- data/test/helper.rb +1 -1
- data/test/site/.gitignore +3 -0
- data/test/site/Gemfile +31 -0
- data/test/site/Gemfile.lock +81 -0
- data/test/site/_config.yml +44 -0
- data/test/site/index.md +10 -0
- data/test/test_jekyll_filter.rb +12 -0
- metadata +15 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 74790638ed7feae54db3eb96606f19e9fd0403c1
|
|
4
|
+
data.tar.gz: 066c2f0b5cd02e8965955e7fc9952051b97b1d8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c87e3aa48e27766e70f684074ed759a241448178cdeab837acdd6c3ad1ebaaeaf9831ec1cce4d4bc77b7b5f0ebeb5d4bed82298637572680f90fb41bf9ef6549
|
|
7
|
+
data.tar.gz: 5173bec203faec95ff4b3069f2ebac42b5bbd752c2f4c1fbb101ecdca98e87bd8befc5eb93bf305644cbe8990182361ae26d3f8857c8efa6b0f5997658d0b7e0
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
language: ruby
|
|
2
2
|
cache: bundler
|
|
3
3
|
rvm:
|
|
4
|
-
- 2.
|
|
5
|
-
- 2.2.5
|
|
4
|
+
- 2.4.0
|
|
6
5
|
env:
|
|
7
|
-
|
|
6
|
+
global:
|
|
7
|
+
- CC_TEST_REPORTER_ID=b92d3200cc23b1d88a0dce55f92c7dc814c720eb3d6bfee2a9c9eed4a9ef2aee
|
|
8
|
+
before_script:
|
|
9
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
10
|
+
- chmod +x ./cc-test-reporter
|
|
11
|
+
- ./cc-test-reporter before-build
|
|
12
|
+
- cd ./test/site && bundle install && bundle exec jekyll build --destination=/tmp/_site
|
|
13
|
+
script:
|
|
14
|
+
- bundle exec rake test
|
|
15
|
+
after_script:
|
|
16
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
|
8
17
|
after_success:
|
|
9
|
-
- bundle exec codeclimate-test-reporter
|
|
18
|
+
- bundle exec codeclimate-test-reporter
|
|
19
|
+
notifications:
|
|
20
|
+
email: false
|
|
21
|
+
slack: navyblue-team:ioO5diAGc5WUQVDKc5BH1UbE
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,29 +1,90 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
spacifier (1.
|
|
4
|
+
spacifier (1.1.0.pre.beta1)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
|
|
10
|
-
|
|
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)
|
|
11
15
|
docile (1.1.5)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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)
|
|
15
74
|
shoulda-context (1.2.2)
|
|
16
|
-
simplecov (0.
|
|
75
|
+
simplecov (0.13.0)
|
|
17
76
|
docile (~> 1.1.0)
|
|
18
77
|
json (>= 1.8, < 3)
|
|
19
78
|
simplecov-html (~> 0.10.0)
|
|
20
|
-
simplecov-html (0.10.
|
|
79
|
+
simplecov-html (0.10.2)
|
|
21
80
|
|
|
22
81
|
PLATFORMS
|
|
23
82
|
ruby
|
|
24
83
|
|
|
25
84
|
DEPENDENCIES
|
|
26
|
-
codeclimate-test-reporter
|
|
85
|
+
codeclimate-test-reporter
|
|
86
|
+
jekyll
|
|
87
|
+
minima
|
|
27
88
|
minitest
|
|
28
89
|
rake
|
|
29
90
|
shoulda-context
|
|
@@ -31,4 +92,4 @@ DEPENDENCIES
|
|
|
31
92
|
spacifier!
|
|
32
93
|
|
|
33
94
|
BUNDLED WITH
|
|
34
|
-
1.
|
|
95
|
+
1.16.1
|
data/LICENSE
CHANGED
data/README.md
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/rb/spacifier)
|
|
4
4
|
[](https://travis-ci.org/crispgm/spacifier)
|
|
5
|
-
[](https://codeclimate.com/github/crispgm/spacifier/maintainability)
|
|
6
|
+
[](https://codeclimate.com/github/crispgm/spacifier/test_coverage)
|
|
7
7
|
|
|
8
8
|
Insert a space between a Chinese character and a western character.
|
|
9
9
|
|
|
10
|
+
在中西文字符之间插入空格。
|
|
11
|
+
|
|
10
12
|
## Installation
|
|
11
13
|
|
|
12
14
|
```
|
|
@@ -29,4 +31,27 @@ $ 何为跨域?何为 JSONP?JSONP 技术能实现什么?是否有必要使
|
|
|
29
31
|
|
|
30
32
|
## Jekyll-spacify
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
Add `spacifier` to `Gemfile`:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
gem "spacify"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
And then,
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
$ bundle install
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Add `spacifier` to `_config.yml`:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
plugins:
|
|
50
|
+
- spacifier
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use in your contents:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
{{ "你好,Hello世界world" | spacify }}
|
|
57
|
+
```
|
data/Rakefile
CHANGED
data/exe/spacifier
CHANGED
data/lib/spacifier/version.rb
CHANGED
data/lib/spacifier.rb
CHANGED
|
@@ -37,4 +37,16 @@ module Spacifier
|
|
|
37
37
|
new_words
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
|
+
|
|
41
|
+
module Jekyll
|
|
42
|
+
module Filter
|
|
43
|
+
def spacify(input)
|
|
44
|
+
Spacifier.spacify(input)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
if defined?(Liquid)
|
|
51
|
+
Liquid::Template.register_filter(Spacifier::Jekyll::Filter)
|
|
40
52
|
end
|
data/spacifier.gemspec
CHANGED
data/test/helper.rb
CHANGED
data/test/site/Gemfile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
source "https://rubygems.org"
|
|
2
|
+
|
|
3
|
+
# Hello! This is where you manage which Jekyll version is used to run.
|
|
4
|
+
# When you want to use a different version, change it below, save the
|
|
5
|
+
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
|
|
6
|
+
#
|
|
7
|
+
# bundle exec jekyll serve
|
|
8
|
+
#
|
|
9
|
+
# This will help ensure the proper Jekyll version is running.
|
|
10
|
+
# Happy Jekylling!
|
|
11
|
+
gem "jekyll", "~> 3.8.0"
|
|
12
|
+
|
|
13
|
+
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
|
14
|
+
gem "minima", "~> 2.0"
|
|
15
|
+
|
|
16
|
+
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
|
17
|
+
# uncomment the line below. To upgrade, run `bundle update github-pages`.
|
|
18
|
+
# gem "github-pages", group: :jekyll_plugins
|
|
19
|
+
|
|
20
|
+
# If you have any plugins, put them here!
|
|
21
|
+
group :jekyll_plugins do
|
|
22
|
+
gem "jekyll-feed", "~> 0.6"
|
|
23
|
+
gem "spacifier", :git => 'https://github.com/crispgm/spacifier.git'
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
|
27
|
+
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
|
28
|
+
|
|
29
|
+
# Performance-booster for watching directories on Windows
|
|
30
|
+
gem "wdm", "~> 0.1.0" if Gem.win_platform?
|
|
31
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Welcome to Jekyll!
|
|
2
|
+
#
|
|
3
|
+
# This config file is meant for settings that affect your whole blog, values
|
|
4
|
+
# which you are expected to set up once and rarely edit after that. If you find
|
|
5
|
+
# yourself editing this file very often, consider using Jekyll's data files
|
|
6
|
+
# feature for the data you need to update frequently.
|
|
7
|
+
#
|
|
8
|
+
# For technical reasons, this file is *NOT* reloaded automatically when you use
|
|
9
|
+
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
|
|
10
|
+
|
|
11
|
+
# Site settings
|
|
12
|
+
# These are used to personalize your new site. If you look in the HTML files,
|
|
13
|
+
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
|
|
14
|
+
# You can create any custom variable you would like, and they will be accessible
|
|
15
|
+
# in the templates via {{ site.myvariable }}.
|
|
16
|
+
title: Your awesome title
|
|
17
|
+
email: your-email@example.com
|
|
18
|
+
description: >- # this means to ignore newlines until "baseurl:"
|
|
19
|
+
Write an awesome description for your new site here. You can edit this
|
|
20
|
+
line in _config.yml. It will appear in your document head meta (for
|
|
21
|
+
Google search results) and in your feed.xml site description.
|
|
22
|
+
baseurl: "" # the subpath of your site, e.g. /blog
|
|
23
|
+
url: "" # the base hostname & protocol for your site, e.g. http://example.com
|
|
24
|
+
twitter_username: jekyllrb
|
|
25
|
+
github_username: jekyll
|
|
26
|
+
|
|
27
|
+
# Build settings
|
|
28
|
+
markdown: kramdown
|
|
29
|
+
theme: minima
|
|
30
|
+
plugins:
|
|
31
|
+
- jekyll-feed
|
|
32
|
+
- spacifier
|
|
33
|
+
|
|
34
|
+
# Exclude from processing.
|
|
35
|
+
# The following items will not be processed, by default. Create a custom list
|
|
36
|
+
# to override the default setting.
|
|
37
|
+
# exclude:
|
|
38
|
+
# - Gemfile
|
|
39
|
+
# - Gemfile.lock
|
|
40
|
+
# - node_modules
|
|
41
|
+
# - vendor/bundle/
|
|
42
|
+
# - vendor/cache/
|
|
43
|
+
# - vendor/gems/
|
|
44
|
+
# - vendor/ruby/
|
data/test/site/index.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require "helper"
|
|
2
|
+
|
|
3
|
+
class TestJekyllFilter < Minitest::Test
|
|
4
|
+
context nil do
|
|
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__)))
|
|
8
|
+
assert_equal(true, output.include?("它 works"))
|
|
9
|
+
assert_equal(true, output.include?("hello 世界"))
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
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.
|
|
4
|
+
version: 1.1.1.pre.beta1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Zhang
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-04-26 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:
|
|
@@ -31,6 +31,12 @@ files:
|
|
|
31
31
|
- lib/spacifier/version.rb
|
|
32
32
|
- spacifier.gemspec
|
|
33
33
|
- test/helper.rb
|
|
34
|
+
- test/site/.gitignore
|
|
35
|
+
- test/site/Gemfile
|
|
36
|
+
- test/site/Gemfile.lock
|
|
37
|
+
- test/site/_config.yml
|
|
38
|
+
- test/site/index.md
|
|
39
|
+
- test/test_jekyll_filter.rb
|
|
34
40
|
- test/test_spacifier.rb
|
|
35
41
|
homepage: https://github.com/crispgm/spacifier
|
|
36
42
|
licenses:
|
|
@@ -52,10 +58,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
52
58
|
version: 1.3.1
|
|
53
59
|
requirements: []
|
|
54
60
|
rubyforge_project:
|
|
55
|
-
rubygems_version: 2.
|
|
61
|
+
rubygems_version: 2.6.11
|
|
56
62
|
signing_key:
|
|
57
63
|
specification_version: 4
|
|
58
64
|
summary: Insert a space between a Chinese character and a western character
|
|
59
65
|
test_files:
|
|
60
66
|
- test/helper.rb
|
|
67
|
+
- test/site/.gitignore
|
|
68
|
+
- test/site/Gemfile
|
|
69
|
+
- test/site/Gemfile.lock
|
|
70
|
+
- test/site/_config.yml
|
|
71
|
+
- test/site/index.md
|
|
72
|
+
- test/test_jekyll_filter.rb
|
|
61
73
|
- test/test_spacifier.rb
|