ro_support 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +27 -2
  3. data/Rakefile +4 -17
  4. data/app/assets/javascripts/application.js +16 -0
  5. data/app/assets/stylesheets/application.css +13 -0
  6. data/app/controllers/application_controller.rb +5 -0
  7. data/app/helpers/application_helper.rb +2 -0
  8. data/app/views/layouts/application.html.erb +14 -0
  9. data/config/application.rb +23 -0
  10. data/config/boot.rb +4 -0
  11. data/config/database.yml +25 -0
  12. data/config/environment.rb +5 -0
  13. data/config/environments/development.rb +29 -0
  14. data/config/environments/production.rb +80 -0
  15. data/config/environments/test.rb +36 -0
  16. data/config/initializers/backtrace_silencers.rb +7 -0
  17. data/config/initializers/filter_parameter_logging.rb +4 -0
  18. data/config/initializers/inflections.rb +16 -0
  19. data/config/initializers/mime_types.rb +5 -0
  20. data/config/initializers/secret_token.rb +12 -0
  21. data/config/initializers/session_store.rb +3 -0
  22. data/config/initializers/wrap_parameters.rb +14 -0
  23. data/config/locales/en.yml +23 -0
  24. data/config/routes.rb +56 -0
  25. data/db/seeds.rb +7 -0
  26. data/lib/ro_support/bash.rb +13 -19
  27. data/lib/ro_support/callbacks.rb +93 -0
  28. data/lib/ro_support/debug.rb +1 -0
  29. data/lib/ro_support/dir.rb +9 -0
  30. data/lib/ro_support/file.rb +20 -0
  31. data/lib/ro_support/file_actions.rb +24 -6
  32. data/lib/ro_support/guard.rb +3 -0
  33. data/lib/ro_support/log.rb +3 -2
  34. data/lib/ro_support/ro_debug.rb +42 -0
  35. data/lib/ro_support/ro_guard.rb +56 -0
  36. data/lib/ro_support/ro_logger.rb +26 -0
  37. data/lib/ro_support/rspec.rb +3 -0
  38. data/lib/ro_support/rspec_helpers.rb +13 -0
  39. data/lib/ro_support/string_handler/common.rb +8 -0
  40. data/lib/ro_support/string_handler.rb +0 -2
  41. data/lib/ro_support/version.rb +1 -1
  42. data/lib/ro_support.rb +5 -7
  43. data/spec/fixtures/lib/ro_support/file_actions/tmp/rspec_guard_result +1 -0
  44. data/spec/lib/{roro_support → ro_support}/array_spec.rb +17 -9
  45. data/spec/lib/ro_support/bash_spec.rb +8 -0
  46. data/spec/lib/{roro_support → ro_support}/debug_spec.rb +24 -0
  47. data/spec/lib/ro_support/file_actions_spec.rb +43 -0
  48. data/spec/lib/ro_support/git_spec.rb +21 -0
  49. data/spec/lib/ro_support/misc/zw_spec.rb +67 -0
  50. data/spec/lib/{roro_support → ro_support}/misc_spec.rb +16 -0
  51. data/spec/lib/{roro_support → ro_support}/module_spec.rb +4 -0
  52. data/spec/lib/ro_support/ro_debug_spec.rb +27 -0
  53. data/spec/lib/ro_support/ro_logger_spec.rb +9 -0
  54. data/spec/lib/ro_support/string_handler/common_spec.rb +25 -0
  55. data/spec/lib/{roro_support → ro_support}/string_handler_spec.rb +9 -1
  56. data/spec/lib/ro_support_spec.rb +9 -0
  57. data/spec/ro_support/array_spec.rb +21 -0
  58. data/spec/ro_support/bash_spec.rb +29 -0
  59. data/spec/ro_support/debug_spec.rb +33 -0
  60. data/spec/ro_support/file_actions_spec.rb +33 -0
  61. data/spec/ro_support/git_spec.rb +29 -0
  62. data/spec/ro_support/log_spec.rb +13 -0
  63. data/spec/ro_support/misc/zw_spec.rb +29 -0
  64. data/spec/ro_support/misc_spec.rb +25 -0
  65. data/spec/ro_support/module_spec.rb +13 -0
  66. data/spec/ro_support/ro_debug_spec.rb +17 -0
  67. data/spec/ro_support/ro_file_spec.rb +25 -0
  68. data/spec/ro_support/ro_logger_spec.rb +13 -0
  69. data/spec/ro_support/rspec_helpers_spec.rb +13 -0
  70. data/spec/ro_support/rspec_spec.rb +0 -0
  71. data/spec/ro_support/spec_spec.rb +0 -0
  72. data/spec/ro_support/ssh_spec.rb +0 -0
  73. data/spec/ro_support/string_handler/common_spec.rb +29 -0
  74. data/spec/ro_support/string_handler_spec.rb +13 -0
  75. data/spec/ro_support/thor_spec.rb +0 -0
  76. data/spec/ro_support/version_spec.rb +0 -0
  77. data/spec/ro_support_spec.rb +12 -0
  78. data/spec/spec_helper.rb +17 -9
  79. metadata +111 -36
  80. data/MIT-LICENSE +0 -20
  81. data/lib/ro_support/misc/zw.rb +0 -46
  82. data/spec/fixtures/for_log/ro.log +0 -2
  83. data/spec/fixtures/for_log/tmp/rspec_guard_result +0 -1
  84. data/spec/lib/roro_support/bash_spec.rb +0 -4
  85. data/spec/lib/roro_support/file_actions_spec.rb +0 -10
  86. data/spec/lib/roro_support/git_spec.rb +0 -23
  87. data/spec/lib/roro_support/log_spec.rb +0 -28
  88. data/spec/lib/roro_support/misc/zw_spec.rb +0 -55
  89. /data/lib/tasks/{roro_support_tasks.rake → ro_support_tasks.rake} +0 -0
  90. /data/spec/lib/{roro_support → ro_support}/log/ro.log +0 -0
  91. /data/spec/lib/{roro_support → ro_support}/log/roro.log +0 -0
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Debug' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#self" do
10
+ pending
11
+ end
12
+
13
+ it "#vars" do
14
+ pending
15
+ end
16
+
17
+ it "#err" do
18
+ pending
19
+ end
20
+
21
+ it "#valid" do
22
+ pending
23
+ end
24
+
25
+ it "#ro_error" do
26
+ pending
27
+ end
28
+
29
+ it "#ro_return_valid" do
30
+ pending
31
+ end
32
+
33
+ end
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'FileActions' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#ls" do
10
+ pending
11
+ end
12
+
13
+ it "#write" do
14
+ pending
15
+ end
16
+
17
+ it "#file" do
18
+ pending
19
+ end
20
+
21
+ it "#parent" do
22
+ pending
23
+ end
24
+
25
+ it "#self" do
26
+ pending
27
+ end
28
+
29
+ it "#autoload_all_files_in" do
30
+ pending
31
+ end
32
+
33
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Git' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#git" do
10
+ pending
11
+ end
12
+
13
+ it "#git_commit_all" do
14
+ pending
15
+ end
16
+
17
+ it "#bash_format" do
18
+ pending
19
+ end
20
+
21
+ it "#handle" do
22
+ pending
23
+ end
24
+
25
+ it "#add_arg" do
26
+ pending
27
+ end
28
+
29
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Log' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#puts_log" do
10
+ pending
11
+ end
12
+
13
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Zw' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#is_fuhao" do
10
+ pending
11
+ end
12
+
13
+ it "#is_hanzi" do
14
+ pending
15
+ end
16
+
17
+ it "#is_no" do
18
+ pending
19
+ end
20
+
21
+ it "#has_no" do
22
+ pending
23
+ end
24
+
25
+ it "#split_with_no" do
26
+ pending
27
+ end
28
+
29
+ end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Misc' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#set_instance_variable_from" do
10
+ pending
11
+ end
12
+
13
+ it "#that" do
14
+ pending
15
+ end
16
+
17
+ it "#self" do
18
+ pending
19
+ end
20
+
21
+ it "#dir_load" do
22
+ pending
23
+ end
24
+
25
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Module' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#has_module" do
10
+ pending
11
+ end
12
+
13
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'RoDebug' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#check_env" do
10
+ pending
11
+ end
12
+
13
+ it "#solution" do
14
+ pending
15
+ end
16
+
17
+ end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'RoFile' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#spec" do
10
+ pending
11
+ end
12
+
13
+ it "#file" do
14
+ pending
15
+ end
16
+
17
+ it "#dir" do
18
+ pending
19
+ end
20
+
21
+ it "#rb" do
22
+ pending
23
+ end
24
+
25
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'RoLogger' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#puts_log" do
10
+ pending
11
+ end
12
+
13
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'RspecHelpers' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#cdfix" do
10
+ pending
11
+ end
12
+
13
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Common' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#blank" do
10
+ pending
11
+ end
12
+
13
+ it "#camelize" do
14
+ pending
15
+ end
16
+
17
+ it "#uncamelize" do
18
+ pending
19
+ end
20
+
21
+ it "#collect" do
22
+ pending
23
+ end
24
+
25
+ it "#collect_sign" do
26
+ pending
27
+ end
28
+
29
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'StringHandler' do
4
+ before do
5
+
6
+ end
7
+
8
+
9
+ it "#self" do
10
+ pending
11
+ end
12
+
13
+ end
File without changes
File without changes
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'RoSupport' do
4
+ before do
5
+
6
+ end
7
+
8
+ it "#self" do
9
+ pending
10
+ end
11
+
12
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,16 +1,24 @@
1
+ require 'rspec'
1
2
  require 'headless'
2
- $LOAD_PATH.unshift File.expand_path('../../lib/', __FILE__)
3
- $LOAD_PATH.unshift File.expand_path('../../lib/ro_support', __FILE__)
4
- $LOAD_PATH.unshift File.expand_path('../', __FILE__)
5
-
6
- $fixtures = File.expand_path('../fixtures', __FILE__)
7
- require 'benchmark'
8
- require 'active_record'
9
- require 'ro_support'
10
3
  require 'faker'
4
+ require "ro_support"
5
+ include RoSupport
11
6
 
7
+ $root = File.expand_path("../../", __FILE__)
8
+ $lib = File.join($root, 'lib')
9
+ $LOAD_PATH.unshift $root
10
+ $LOAD_PATH.unshift $lib
11
+ $fixtures = File.join($root, 'fixtures')
12
+ $fix = File.join($root, 'fixtures')
12
13
 
13
- include RoSupport
14
+ def cdfix(name)
15
+ if defined?($fixtures) or defined?(ENV['FIXTURES'])
16
+ fix = $fixtures || ENV['FIXTURES']
17
+ dir = File.join(fix, name)
18
+ FileUtils.mkdir_p dir
19
+ Dir.chdir dir
20
+ end
21
+ end
14
22
 
15
23
  RSpec.configure do |config|
16
24
  config.before(:all) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ro_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-01 00:00:00.000000000 Z
11
+ date: 2013-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: ruby-pinyin
98
+ name: guard
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '>='
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: ansi
112
+ name: guard-rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '>='
@@ -129,47 +129,99 @@ executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
+ - app/helpers/application_helper.rb
133
+ - app/assets/stylesheets/application.css
134
+ - app/assets/javascripts/application.js
135
+ - app/views/layouts/application.html.erb
136
+ - app/controllers/application_controller.rb
137
+ - config/application.rb
138
+ - config/locales/en.yml
139
+ - config/environment.rb
140
+ - config/routes.rb
141
+ - config/environments/production.rb
142
+ - config/environments/development.rb
143
+ - config/environments/test.rb
144
+ - config/initializers/inflections.rb
145
+ - config/initializers/wrap_parameters.rb
146
+ - config/initializers/backtrace_silencers.rb
147
+ - config/initializers/mime_types.rb
148
+ - config/initializers/session_store.rb
149
+ - config/initializers/secret_token.rb
150
+ - config/initializers/filter_parameter_logging.rb
151
+ - config/boot.rb
152
+ - config/database.yml
153
+ - db/seeds.rb
132
154
  - lib/ro_support.rb
155
+ - lib/ro_support/rspec.rb
133
156
  - lib/ro_support/string_handler/common.rb
134
157
  - lib/ro_support/bash.rb
158
+ - lib/ro_support/rspec_helpers.rb
159
+ - lib/ro_support/dir.rb
135
160
  - lib/ro_support/thor.rb
136
161
  - lib/ro_support/spec.rb
162
+ - lib/ro_support/ro_debug.rb
163
+ - lib/ro_support/callbacks.rb
137
164
  - lib/ro_support/array.rb
138
165
  - lib/ro_support/module.rb
139
166
  - lib/ro_support/file_actions.rb
167
+ - lib/ro_support/ro_logger.rb
140
168
  - lib/ro_support/version.rb
141
169
  - lib/ro_support/debug.rb
142
170
  - lib/ro_support/git.rb
143
171
  - lib/ro_support/misc.rb
144
172
  - lib/ro_support/string_handler.rb
173
+ - lib/ro_support/guard.rb
145
174
  - lib/ro_support/ssh.rb
146
- - lib/ro_support/misc/zw.rb
147
175
  - lib/ro_support/log.rb
148
- - lib/tasks/roro_support_tasks.rake
149
- - MIT-LICENSE
176
+ - lib/ro_support/file.rb
177
+ - lib/ro_support/ro_guard.rb
178
+ - lib/tasks/ro_support_tasks.rake
150
179
  - Rakefile
151
180
  - README.rdoc
152
181
  - spec/fixtures/sample/try1.rb
153
182
  - spec/fixtures/sample/try2.rb
154
183
  - spec/fixtures/sample/try3.rb
155
184
  - spec/fixtures/baidu.html
156
- - spec/fixtures/for_log/tmp/rspec_guard_result
157
- - spec/fixtures/for_log/ro.log
185
+ - spec/fixtures/lib/ro_support/file_actions/tmp/rspec_guard_result
158
186
  - spec/fixtures/for_misc_file_utils/create_dir_file/try.rb
159
187
  - spec/spec_helper.rb
160
188
  - spec/lib/roro_support_spec.rb
161
- - spec/lib/roro_support/string_handler_spec.rb
162
- - spec/lib/roro_support/file_actions_spec.rb
163
- - spec/lib/roro_support/log/roro.log
164
- - spec/lib/roro_support/log/ro.log
165
- - spec/lib/roro_support/module_spec.rb
166
- - spec/lib/roro_support/array_spec.rb
167
- - spec/lib/roro_support/bash_spec.rb
168
- - spec/lib/roro_support/misc/zw_spec.rb
169
- - spec/lib/roro_support/misc_spec.rb
170
- - spec/lib/roro_support/debug_spec.rb
171
- - spec/lib/roro_support/log_spec.rb
172
- - spec/lib/roro_support/git_spec.rb
189
+ - spec/lib/ro_support/string_handler/common_spec.rb
190
+ - spec/lib/ro_support/string_handler_spec.rb
191
+ - spec/lib/ro_support/file_actions_spec.rb
192
+ - spec/lib/ro_support/ro_debug_spec.rb
193
+ - spec/lib/ro_support/ro_logger_spec.rb
194
+ - spec/lib/ro_support/log/roro.log
195
+ - spec/lib/ro_support/log/ro.log
196
+ - spec/lib/ro_support/module_spec.rb
197
+ - spec/lib/ro_support/array_spec.rb
198
+ - spec/lib/ro_support/bash_spec.rb
199
+ - spec/lib/ro_support/misc/zw_spec.rb
200
+ - spec/lib/ro_support/misc_spec.rb
201
+ - spec/lib/ro_support/debug_spec.rb
202
+ - spec/lib/ro_support/git_spec.rb
203
+ - spec/lib/ro_support_spec.rb
204
+ - spec/ro_support/rspec_spec.rb
205
+ - spec/ro_support/string_handler/common_spec.rb
206
+ - spec/ro_support/version_spec.rb
207
+ - spec/ro_support/string_handler_spec.rb
208
+ - spec/ro_support/rspec_helpers_spec.rb
209
+ - spec/ro_support/file_actions_spec.rb
210
+ - spec/ro_support/thor_spec.rb
211
+ - spec/ro_support/spec_spec.rb
212
+ - spec/ro_support/ro_debug_spec.rb
213
+ - spec/ro_support/ro_logger_spec.rb
214
+ - spec/ro_support/ssh_spec.rb
215
+ - spec/ro_support/module_spec.rb
216
+ - spec/ro_support/ro_file_spec.rb
217
+ - spec/ro_support/array_spec.rb
218
+ - spec/ro_support/bash_spec.rb
219
+ - spec/ro_support/misc/zw_spec.rb
220
+ - spec/ro_support/misc_spec.rb
221
+ - spec/ro_support/debug_spec.rb
222
+ - spec/ro_support/log_spec.rb
223
+ - spec/ro_support/git_spec.rb
224
+ - spec/ro_support_spec.rb
173
225
  homepage: ''
174
226
  licenses: []
175
227
  metadata: {}
@@ -189,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
241
  version: '0'
190
242
  requirements: []
191
243
  rubyforge_project:
192
- rubygems_version: 2.1.5
244
+ rubygems_version: 2.0.3
193
245
  signing_key:
194
246
  specification_version: 4
195
247
  summary: ''
@@ -198,20 +250,43 @@ test_files:
198
250
  - spec/fixtures/sample/try2.rb
199
251
  - spec/fixtures/sample/try3.rb
200
252
  - spec/fixtures/baidu.html
201
- - spec/fixtures/for_log/tmp/rspec_guard_result
202
- - spec/fixtures/for_log/ro.log
253
+ - spec/fixtures/lib/ro_support/file_actions/tmp/rspec_guard_result
203
254
  - spec/fixtures/for_misc_file_utils/create_dir_file/try.rb
204
255
  - spec/spec_helper.rb
205
256
  - spec/lib/roro_support_spec.rb
206
- - spec/lib/roro_support/string_handler_spec.rb
207
- - spec/lib/roro_support/file_actions_spec.rb
208
- - spec/lib/roro_support/log/roro.log
209
- - spec/lib/roro_support/log/ro.log
210
- - spec/lib/roro_support/module_spec.rb
211
- - spec/lib/roro_support/array_spec.rb
212
- - spec/lib/roro_support/bash_spec.rb
213
- - spec/lib/roro_support/misc/zw_spec.rb
214
- - spec/lib/roro_support/misc_spec.rb
215
- - spec/lib/roro_support/debug_spec.rb
216
- - spec/lib/roro_support/log_spec.rb
217
- - spec/lib/roro_support/git_spec.rb
257
+ - spec/lib/ro_support/string_handler/common_spec.rb
258
+ - spec/lib/ro_support/string_handler_spec.rb
259
+ - spec/lib/ro_support/file_actions_spec.rb
260
+ - spec/lib/ro_support/ro_debug_spec.rb
261
+ - spec/lib/ro_support/ro_logger_spec.rb
262
+ - spec/lib/ro_support/log/roro.log
263
+ - spec/lib/ro_support/log/ro.log
264
+ - spec/lib/ro_support/module_spec.rb
265
+ - spec/lib/ro_support/array_spec.rb
266
+ - spec/lib/ro_support/bash_spec.rb
267
+ - spec/lib/ro_support/misc/zw_spec.rb
268
+ - spec/lib/ro_support/misc_spec.rb
269
+ - spec/lib/ro_support/debug_spec.rb
270
+ - spec/lib/ro_support/git_spec.rb
271
+ - spec/lib/ro_support_spec.rb
272
+ - spec/ro_support/rspec_spec.rb
273
+ - spec/ro_support/string_handler/common_spec.rb
274
+ - spec/ro_support/version_spec.rb
275
+ - spec/ro_support/string_handler_spec.rb
276
+ - spec/ro_support/rspec_helpers_spec.rb
277
+ - spec/ro_support/file_actions_spec.rb
278
+ - spec/ro_support/thor_spec.rb
279
+ - spec/ro_support/spec_spec.rb
280
+ - spec/ro_support/ro_debug_spec.rb
281
+ - spec/ro_support/ro_logger_spec.rb
282
+ - spec/ro_support/ssh_spec.rb
283
+ - spec/ro_support/module_spec.rb
284
+ - spec/ro_support/ro_file_spec.rb
285
+ - spec/ro_support/array_spec.rb
286
+ - spec/ro_support/bash_spec.rb
287
+ - spec/ro_support/misc/zw_spec.rb
288
+ - spec/ro_support/misc_spec.rb
289
+ - spec/ro_support/debug_spec.rb
290
+ - spec/ro_support/log_spec.rb
291
+ - spec/ro_support/git_spec.rb
292
+ - spec/ro_support_spec.rb
data/MIT-LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright 2013 YOURNAME
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,46 +0,0 @@
1
- require 'ruby-pinyin'
2
- module RoSupport
3
- module Misc
4
- module Zw
5
- ::String.class_eval do
6
- def is_fuhao?
7
- PinYin.of_string(self).empty?
8
- end
9
-
10
- def is_hanzi?
11
- !PinYin.of_string(self).empty?
12
- end
13
-
14
- # example:
15
- # "1.".is_nox # => true
16
- # "2逼".is_nox # => false
17
- def is_no?(x=/\d/)
18
- str = self[Regexp.new "#{x}."]
19
- if str && !str.empty?
20
- mark = str.split('')[-1]
21
- # is english sign
22
- mark.is_fuhao? or mark.bytes == 1 ? true : false
23
- else
24
- false
25
- end
26
- end
27
-
28
- def has_no?(x=/\d/)
29
- self.scan(/\d./).each do |no|
30
- return true if no.is_no? x
31
- end
32
- end
33
-
34
- def split_with_no(x=/\d/)
35
- nos= self.scan Regexp.new "^#{x}."
36
- nos = nos.map do |no|
37
- no if no.is_no?
38
- end
39
-
40
- r = eval "Regexp.union /#{nos.compact.join("/,/")}/"
41
- self.split Regexp.new "(?=^#{r})"
42
- end
43
- end
44
- end
45
- end
46
- end
@@ -1,2 +0,0 @@
1
- # Logfile created on 2013-09-30 21:02:45 +0800 by logger.rb/36483
2
- E, [2013-09-30T21:02:45.567382 #17790] ERROR -- : Harum accusamus minus quo modi aut iste repudiandae. Ex omnis reprehenderit ut qui. Cumque adipisci veniam.
@@ -1,4 +0,0 @@
1
- require 'spec_helper'
2
- describe ::RoSupport::Bash do
3
-
4
- end
@@ -1,10 +0,0 @@
1
- require 'spec_helper'
2
-
3
- include FileActions
4
- describe FileActions do
5
- it 'create dir file' do
6
- path = $fixtures + '/for_misc_file_utils/create_dir_file/try.rb'
7
- create_dir_file(path)
8
- expect(File.exist? path).to be_true
9
- end
10
- end