spacifier 1.0.0.pre.beta1 → 1.1.1.pre.beta1

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
2
  SHA1:
3
- metadata.gz: 0e7840632949b139b52f7c414f589aa8af1600d3
4
- data.tar.gz: 9fc98602e56a342d47ff34e4ace2fcbc109b0a46
3
+ metadata.gz: 74790638ed7feae54db3eb96606f19e9fd0403c1
4
+ data.tar.gz: 066c2f0b5cd02e8965955e7fc9952051b97b1d8d
5
5
  SHA512:
6
- metadata.gz: 4abaf95b49957de4b432d047f545d186fae746eee566a34748b9a370dc8856c98db8a0e5cc2c44e8c1daef327f5a2ba2f74bcea628262825aa69447aa19ec2f2
7
- data.tar.gz: f195eaddb5df885f9ed6b6180e7aa27bb8821a3ad493ecfcb9359462c2a77073feb61b601564aa9e219a0ff8377accbb374646e43ff9e8cee6b575e9eebf05f6
6
+ metadata.gz: c87e3aa48e27766e70f684074ed759a241448178cdeab837acdd6c3ad1ebaaeaf9831ec1cce4d4bc77b7b5f0ebeb5d4bed82298637572680f90fb41bf9ef6549
7
+ data.tar.gz: 5173bec203faec95ff4b3069f2ebac42b5bbd752c2f4c1fbb101ecdca98e87bd8befc5eb93bf305644cbe8990182361ae26d3f8857c8efa6b0f5997658d0b7e0
data/.gitignore CHANGED
@@ -48,3 +48,5 @@ build-iPhoneSimulator/
48
48
 
49
49
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
50
  .rvmrc
51
+ /test/site/_site
52
+ /test/site/.sass-cache
data/.travis.yml CHANGED
@@ -1,9 +1,21 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - 2.3.1
5
- - 2.2.5
4
+ - 2.4.0
6
5
  env:
7
- - CODECLIMATE_REPO_TOKEN: b92d3200cc23b1d88a0dce55f92c7dc814c720eb3d6bfee2a9c9eed4a9ef2aee
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
@@ -6,5 +6,7 @@ group :test do
6
6
  gem "minitest"
7
7
  gem "shoulda-context"
8
8
  gem "simplecov"
9
- gem "codeclimate-test-reporter", "~> 1.0.0"
10
- end
9
+ gem "codeclimate-test-reporter"
10
+ gem "jekyll"
11
+ gem "minima"
12
+ end
data/Gemfile.lock CHANGED
@@ -1,29 +1,90 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spacifier (1.0.0.pre.beta1)
4
+ spacifier (1.1.0.pre.beta1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- codeclimate-test-reporter (1.0.3)
10
- simplecov
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
- json (2.0.2)
13
- minitest (5.9.1)
14
- rake (11.3.0)
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.12.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.0)
79
+ simplecov-html (0.10.2)
21
80
 
22
81
  PLATFORMS
23
82
  ruby
24
83
 
25
84
  DEPENDENCIES
26
- codeclimate-test-reporter (~> 1.0.0)
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.13.6
95
+ 1.16.1
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2016 David Zhang
3
+ Copyright (c) 2018 David Zhang
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -2,11 +2,13 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/spacifier.svg)](https://badge.fury.io/rb/spacifier)
4
4
  [![](https://api.travis-ci.org/crispgm/spacifier.svg)](https://travis-ci.org/crispgm/spacifier)
5
- [![Code Climate](https://codeclimate.com/github/crispgm/spacifier/badges/gpa.svg)](https://codeclimate.com/github/crispgm/spacifier)
6
- [![Test Coverage](https://codeclimate.com/github/crispgm/spacifier/badges/coverage.svg)](https://codeclimate.com/github/crispgm/spacifier/coverage)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/6d1485b9aa480724d848/maintainability)](https://codeclimate.com/github/crispgm/spacifier/maintainability)
6
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/6d1485b9aa480724d848/test_coverage)](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
- * WIP
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
@@ -27,4 +27,4 @@ task :count do
27
27
  rescue
28
28
  puts "Count Error."
29
29
  end
30
- end
30
+ end
data/exe/spacifier CHANGED
@@ -6,4 +6,4 @@ require "spacifier"
6
6
 
7
7
  input = ARGF.read
8
8
 
9
- puts Spacifier.spacify(input)
9
+ puts Spacifier.spacify(input)
@@ -1,3 +1,3 @@
1
1
  module Spacifier
2
- VERSION = "1.0.0-beta1".freeze
2
+ VERSION = "1.1.1-beta1".freeze
3
3
  end
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
@@ -21,4 +21,4 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
23
23
  spec.require_paths = ["lib"]
24
- end
24
+ end
data/test/helper.rb CHANGED
@@ -3,4 +3,4 @@ SimpleCov.start
3
3
 
4
4
  require "minitest/autorun"
5
5
  require "shoulda-context"
6
- require "spacifier"
6
+ require "spacifier"
@@ -0,0 +1,3 @@
1
+ _site
2
+ .sass-cache
3
+ .jekyll-metadata
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/
@@ -0,0 +1,10 @@
1
+ ---
2
+ # Feel free to add content and custom Front Matter to this file.
3
+ # To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults
4
+ layout: home
5
+ ---
6
+
7
+ {{ "它works" | spacify }}
8
+
9
+ {{ "hello世界" | spacify }}
10
+
@@ -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.0.0.pre.beta1
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: 2017-03-03 00:00:00.000000000 Z
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.5.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