auto-space 0.0.3 → 0.0.4

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: cfecf62c3c7a52cec9f62f91d45126c9e9c9adf3
4
- data.tar.gz: ffe15e4384bce8fb436eceb0199ad9e9cb9df1d6
3
+ metadata.gz: 74608e73db4f1dfbe8092db911abccb897048dae
4
+ data.tar.gz: 9abac2ef490456892e5d846f0cb465a98bcf6e0e
5
5
  SHA512:
6
- metadata.gz: 17c4b5ebf40155db37b770c6a390a226646b849eb0af6b18b839d10a0daba52733d7ac7a05ffe4c6b5afc235b451e418802c85393e9a04400fef06173436d880
7
- data.tar.gz: ca4c3d303f14326ff60178436593eb19761ad8b4a7a98ca1382a74cdd17f5d370138b181ff88446245c64fea4a3c0587c94bcd9e226c0a958146fa28eb503488
6
+ metadata.gz: 6a044934afdbbb9c6f6e647a21feb66ed3535f4b788960b53b3e2b7eb1c84b28b27e01c7c7dfc2e32bee1da2daadfe5b7e337d0d9289306fd336efd2f084ad60
7
+ data.tar.gz: 1c605053a45f992faf3aefa8a1e4a6d3877c7f9f2c452797549fd72ec7419e36dccf73c0c9c0746723018d8b89c2a574c1b69a47482cf0ebb5610a0e9904f64c
data/README.md CHANGED
@@ -20,3 +20,8 @@ vps 上 sessions 不生效,但在本地的环境是 OK 的,why?
20
20
  irb> "bootstrap control-group对齐问题".auto_space!
21
21
  bootstrap control-group 对齐问
22
22
  ```
23
+
24
+ ## TODO
25
+
26
+ * 'Foo'的"Bar" -> 'Foo' 的 "Bar"
27
+ * 什么,时候 -> 什么, 时候 -> 什么,时候
@@ -1,18 +1,23 @@
1
1
  # coding: utf-8
2
- class String
2
+ class String
3
3
  def auto_space!
4
- self.gsub! /((?![年月日号])\p{Han})([a-zA-Z0-9+$@#\[\(\/])/u do
4
+ self.gsub! /((?![年月日号])\p{Han})([a-zA-Z0-9+$@#\[\(\/‘“])/u do
5
5
  "#$1 #$2"
6
6
  end
7
7
 
8
- self.gsub! /([a-zA-Z0-9+$\]\)@#!\/]|[\d[年月日]]{2,})((?![年月日号])\p{Han})/u do
8
+ self.gsub! /([a-zA-Z0-9+$’”\]\)@#!\/]|[\d[年月日]]{2,})((?![年月日号])\p{Han})/u do
9
9
  "#$1 #$2"
10
10
  end
11
11
 
12
- self
13
- end
14
-
15
- def correct!
12
+ # Fix () [] near the English and number
13
+ self.gsub! /([a-zA-Z0-9]+)([\[\(‘“])/u do
14
+ "#$1 #$2"
15
+ end
16
16
 
17
+ self.gsub! /([\)\]’”])([a-zA-Z0-9]+)/u do
18
+ "#$1 #$2"
19
+ end
20
+
21
+ self
17
22
  end
18
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto-space
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luikore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-08 00:00:00.000000000 Z
12
+ date: 2014-07-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -35,7 +35,6 @@ extra_rdoc_files: []
35
35
  files:
36
36
  - README.md
37
37
  - lib/auto-space.rb
38
- - lib/auto-space/correct_words.rb
39
38
  homepage: https://github.com/huacnlee/auto-space
40
39
  licenses: []
41
40
  metadata: {}
@@ -1,18 +0,0 @@
1
- module AutoSpace
2
- class CorrectWords
3
- class << self
4
- def keywords
5
- @keywords ||= %W(
6
- GitHub MongoDB VIM Emacs MySQL PostgreSQL NoSQL MRI IT HR ENV GitLab API CNAME SQLite Git
7
- Rails Ruby Assets Pipeline Bootstrap
8
- JS JavaScript Ajax HTML CSS HTML5 CSS3 jQuery Node.js CoffeeScript SASS SCSS AngularJS
9
- ActiveRecord ActiveSupport ActiveModel ActiveResource ActionController ActionView ERB
10
- OAuth OAuth2 OpenSSL SSL
11
- RubyMine RSpec mRuby RubyTuesday TextMate EventMachine RVM rbenv
12
- CentOS RHEL UCloud
13
- RubyConf RailsConf
14
- )
15
- end
16
- end
17
- end
18
- end