spacifier 1.0.0.pre.alpha3 → 1.0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65d49016c156ab3983ebae779feeb7c2cdf050ae
4
- data.tar.gz: dbbf28808141bbb4e74d90f203548e9cc97f41cf
3
+ metadata.gz: 0e7840632949b139b52f7c414f589aa8af1600d3
4
+ data.tar.gz: 9fc98602e56a342d47ff34e4ace2fcbc109b0a46
5
5
  SHA512:
6
- metadata.gz: aa8da243d339b5ca87f92b394610ec5603ae761e6de3a9de4c3aa6a3b689357945d8190f38349b4369b6df22c339e863540c398aa41269cfb07098c08e581575
7
- data.tar.gz: 60f1cd64093a3b29a35b529ee062fc93ecc53869a2a434eb25cca3998acf28ba91e29d0f7c6bb5f725e0e83729f17b6554e9046fe4e41ff0a8e94a813b89e363
6
+ metadata.gz: 4abaf95b49957de4b432d047f545d186fae746eee566a34748b9a370dc8856c98db8a0e5cc2c44e8c1daef327f5a2ba2f74bcea628262825aa69447aa19ec2f2
7
+ data.tar.gz: f195eaddb5df885f9ed6b6180e7aa27bb8821a3ad493ecfcb9359462c2a77073feb61b601564aa9e219a0ff8377accbb374646e43ff9e8cee6b575e9eebf05f6
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 2.3.1
5
+ - 2.2.5
6
+ env:
7
+ - CODECLIMATE_REPO_TOKEN: b92d3200cc23b1d88a0dce55f92c7dc814c720eb3d6bfee2a9c9eed4a9ef2aee
8
+ after_success:
9
+ - bundle exec codeclimate-test-reporter
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+ gemspec
3
+
4
+ group :test do
5
+ gem "rake"
6
+ gem "minitest"
7
+ gem "shoulda-context"
8
+ gem "simplecov"
9
+ gem "codeclimate-test-reporter", "~> 1.0.0"
10
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,34 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ spacifier (1.0.0.pre.beta1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ codeclimate-test-reporter (1.0.3)
10
+ simplecov
11
+ docile (1.1.5)
12
+ json (2.0.2)
13
+ minitest (5.9.1)
14
+ rake (11.3.0)
15
+ shoulda-context (1.2.2)
16
+ simplecov (0.12.0)
17
+ docile (~> 1.1.0)
18
+ json (>= 1.8, < 3)
19
+ simplecov-html (~> 0.10.0)
20
+ simplecov-html (0.10.0)
21
+
22
+ PLATFORMS
23
+ ruby
24
+
25
+ DEPENDENCIES
26
+ codeclimate-test-reporter (~> 1.0.0)
27
+ minitest
28
+ rake
29
+ shoulda-context
30
+ simplecov
31
+ spacifier!
32
+
33
+ BUNDLED WITH
34
+ 1.13.6
data/Rakefile ADDED
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+
3
+ task default: %w[test]
4
+
5
+ require 'rake/testtask'
6
+
7
+ Rake::TestTask.new do |t|
8
+ t.libs << 'test'
9
+ t.test_files = FileList['test/test_*.rb']
10
+ t.verbose = true
11
+ end
12
+
13
+ task :site do
14
+ Dir.chdir("docs") do
15
+ sh "jekyll s"
16
+ end
17
+ end
18
+
19
+ task :count do
20
+ files = `git ls-files -z`.split("\x0")
21
+ shell_cmd = "wc -l "
22
+ files.grep(%r{^(exe|lib|test)/}).grep(%r{exe|.rb}).each do |f|
23
+ shell_cmd << f << " \\\n"
24
+ end
25
+ begin
26
+ sh shell_cmd[0..-3]
27
+ rescue
28
+ puts "Count Error."
29
+ end
30
+ end
@@ -6,4 +6,4 @@ module Spacifier
6
6
  !(/\p{P}/.match(c) == nil)
7
7
  end
8
8
  end
9
- end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Spacifier
2
- VERSION = "1.0.0-alpha3".freeze
3
- end
2
+ VERSION = "1.0.0-beta1".freeze
3
+ end
data/lib/spacifier.rb CHANGED
@@ -37,4 +37,4 @@ module Spacifier
37
37
  new_words
38
38
  end
39
39
  end
40
- end
40
+ end
data/spacifier.gemspec CHANGED
@@ -21,8 +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
-
25
- # spec.add_development_dependency "minitest"
26
- # spec.add_development_dependency "shoulda-context"
27
- # spec.add_development_dependency "codeclimate-test-reporter", "0.6.0"
28
24
  end
data/test/helper.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "simplecov"
2
+ SimpleCov.start
3
+
4
+ require "minitest/autorun"
5
+ require "shoulda-context"
6
+ require "spacifier"
@@ -0,0 +1,38 @@
1
+ require "helper"
2
+
3
+ class TestSpacifier < Minitest::Test
4
+ context nil do
5
+ should "strip words" do
6
+ input = " input 输入 "
7
+ output = Spacifier.spacify(input)
8
+ assert_equal(input.strip, output)
9
+ end
10
+
11
+ should "return without changes" do
12
+ input = "input 输入"
13
+ output = Spacifier.spacify(input)
14
+ assert_equal(input, output)
15
+ end
16
+
17
+ should "ignore punctuations" do
18
+ input = "input 输入,英文,English好看"
19
+ output = Spacifier.spacify(input)
20
+ expect = "input 输入,英文,English 好看"
21
+ assert_equal(expect, output)
22
+ end
23
+
24
+ should "ignore numbers" do
25
+ input = "10月11日abc"
26
+ output = Spacifier.spacify(input)
27
+ expect = "10月11日 abc"
28
+ assert_equal(expect, output)
29
+ end
30
+
31
+ should "sentence mixed with different elements" do
32
+ input = "我是Xiao Ming生于2000年,1个人生活了30years。Mac是我最喜欢的电脑。aaaa-哈哈哈"
33
+ output = Spacifier.spacify(input)
34
+ expect = "我是 Xiao Ming 生于2000年,1个人生活了30years。Mac 是我最喜欢的电脑。aaaa-哈哈哈"
35
+ assert_equal(expect, output)
36
+ end
37
+ end
38
+ 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.alpha3
4
+ version: 1.0.0.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: 2016-11-27 00:00:00.000000000 Z
11
+ date: 2017-03-03 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:
@@ -19,13 +19,19 @@ extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
21
  - ".gitignore"
22
+ - ".travis.yml"
23
+ - Gemfile
24
+ - Gemfile.lock
22
25
  - LICENSE
23
26
  - README.md
27
+ - Rakefile
24
28
  - exe/spacifier
25
29
  - lib/spacifier.rb
26
30
  - lib/spacifier/punctuation.rb
27
31
  - lib/spacifier/version.rb
28
32
  - spacifier.gemspec
33
+ - test/helper.rb
34
+ - test/test_spacifier.rb
29
35
  homepage: https://github.com/crispgm/spacifier
30
36
  licenses:
31
37
  - MIT
@@ -46,8 +52,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
52
  version: 1.3.1
47
53
  requirements: []
48
54
  rubyforge_project:
49
- rubygems_version: 2.6.7
55
+ rubygems_version: 2.5.2
50
56
  signing_key:
51
57
  specification_version: 4
52
58
  summary: Insert a space between a Chinese character and a western character
53
- test_files: []
59
+ test_files:
60
+ - test/helper.rb
61
+ - test/test_spacifier.rb