ro_support 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +21 -0
- data/lib/ro_support/array.rb +32 -0
- data/lib/ro_support/bash.rb +27 -0
- data/lib/ro_support/debug.rb +80 -0
- data/lib/ro_support/file_actions.rb +40 -0
- data/lib/ro_support/git.rb +64 -0
- data/lib/ro_support/log.rb +15 -0
- data/lib/ro_support/misc/zw.rb +46 -0
- data/lib/ro_support/misc.rb +51 -0
- data/lib/ro_support/module.rb +10 -0
- data/lib/ro_support/spec.rb +46 -0
- data/lib/ro_support/ssh.rb +4 -0
- data/lib/ro_support/string_handler/common.rb +40 -0
- data/lib/ro_support/string_handler.rb +13 -0
- data/lib/ro_support/thor.rb +10 -0
- data/lib/ro_support/version.rb +3 -0
- data/lib/ro_support.rb +23 -0
- data/lib/tasks/roro_support_tasks.rake +4 -0
- data/spec/fixtures/baidu.html +440 -0
- data/spec/fixtures/for_log/ro.log +2 -0
- data/spec/fixtures/for_misc_file_utils/create_dir_file/try.rb +0 -0
- data/spec/fixtures/sample/try1.rb +3 -0
- data/spec/fixtures/sample/try2.rb +3 -0
- data/spec/fixtures/sample/try3.rb +3 -0
- data/spec/lib/roro_support/array_spec.rb +27 -0
- data/spec/lib/roro_support/bash_spec.rb +4 -0
- data/spec/lib/roro_support/debug_spec.rb +42 -0
- data/spec/lib/roro_support/file_actions_spec.rb +10 -0
- data/spec/lib/roro_support/git_spec.rb +23 -0
- data/spec/lib/roro_support/log/ro.log +23 -0
- data/spec/lib/roro_support/log/roro.log +63 -0
- data/spec/lib/roro_support/log_spec.rb +15 -0
- data/spec/lib/roro_support/misc/zw_spec.rb +55 -0
- data/spec/lib/roro_support/misc_spec.rb +37 -0
- data/spec/lib/roro_support/module_spec.rb +15 -0
- data/spec/lib/roro_support/string_handler_spec.rb +17 -0
- data/spec/lib/roro_support_spec.rb +7 -0
- data/spec/spec_helper.rb +29 -0
- metadata +201 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
include Misc::Zw
|
4
|
+
describe Misc::Zw do
|
5
|
+
it "is_fuhao" do
|
6
|
+
expect(",".is_fuhao?).to be_true
|
7
|
+
end
|
8
|
+
|
9
|
+
it "is_hanzi" do
|
10
|
+
expect("逼".is_hanzi?).to be_true
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "is_nox" do
|
14
|
+
it "" do
|
15
|
+
expect("\n2逼".is_no?).to be_false
|
16
|
+
end
|
17
|
+
|
18
|
+
it "" do
|
19
|
+
expect("\n2.".is_no?).to be_true
|
20
|
+
end
|
21
|
+
|
22
|
+
it "" do
|
23
|
+
expect("\n2,".is_no?).to be_true
|
24
|
+
end
|
25
|
+
|
26
|
+
it "no1" do
|
27
|
+
expect("\n1,".is_no?(1)).to be_true
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "split with nox" do
|
31
|
+
it '' do
|
32
|
+
expect("\n1,你妈个2逼\n2, 呵呵\n3。你个麻痹是傻逼\n".split_with_no).to be == ["\n", "1,你妈个2逼\n", "2, 呵呵\n", "3。你个麻痹是傻逼\n"]
|
33
|
+
end
|
34
|
+
it '' do
|
35
|
+
expect("\n1. html5\n2.css3".split_with_no).to be == ["\n", "1. html5\n", "2.css3"]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "has_nox?" do
|
40
|
+
let(:str) { "\n1,你妈个2逼\n2, 呵呵\n3。你个麻痹是傻逼\n" }
|
41
|
+
|
42
|
+
it "" do
|
43
|
+
expect(str.has_no?).to be_true
|
44
|
+
end
|
45
|
+
|
46
|
+
it "" do
|
47
|
+
expect(str.has_no?(1)).to be_true
|
48
|
+
end
|
49
|
+
|
50
|
+
it "" do
|
51
|
+
expect(str.has_no?(1)).to be_true
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include Misc
|
4
|
+
describe Misc do
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
#describe Autoload do
|
9
|
+
# it 'all files in' do
|
10
|
+
# include Misc::Autoload
|
11
|
+
# autoload_all_files_in("#{$fixtures}/sample")
|
12
|
+
#
|
13
|
+
# expect(include Try1).to be_a Object
|
14
|
+
# expect(include Try2).to be_a Object
|
15
|
+
# expect(include Try3).to be_a Object
|
16
|
+
# end
|
17
|
+
#end
|
18
|
+
|
19
|
+
#describe Require do
|
20
|
+
# describe 'list' do
|
21
|
+
# before do
|
22
|
+
# @req = Require.new
|
23
|
+
# @req.that "#{$fixtures}/sample"
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# it 'should load fixtures dir' do
|
27
|
+
# expect(require 'try1').to be true
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# it 'can read file with its filename' do
|
31
|
+
# expect(@req.files.length).to be >= 1
|
32
|
+
# end
|
33
|
+
# end
|
34
|
+
#end
|
35
|
+
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include StringHandler
|
4
|
+
describe StringHandler do
|
5
|
+
before :all do
|
6
|
+
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'uncamelize' do
|
10
|
+
expect("ManMan".uncamelize).to match /man_man/
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'blank?' do
|
14
|
+
expect(' '.blank?).to be_true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
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
|
+
require 'faker'
|
11
|
+
|
12
|
+
|
13
|
+
include RoSupport
|
14
|
+
|
15
|
+
RSpec.configure do |config|
|
16
|
+
config.before(:all) do
|
17
|
+
Headless.new.start
|
18
|
+
end
|
19
|
+
|
20
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
21
|
+
config.run_all_when_everything_filtered = true
|
22
|
+
config.filter_run :focus
|
23
|
+
|
24
|
+
# Run specs in random order to surface order dependencies. If you find an
|
25
|
+
# order dependency and want to debug it, you can fix the order by providing
|
26
|
+
# the seed, which is printed after each run.
|
27
|
+
# --seed 1234
|
28
|
+
config.order = 'random'
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ro_support
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ro
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: watir-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: headless
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: nokogiri
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: grit
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: ruby-pinyin
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: ''
|
112
|
+
email:
|
113
|
+
- zhuxingruo3@gmail.com
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- lib/ro_support.rb
|
119
|
+
- lib/ro_support/string_handler/common.rb
|
120
|
+
- lib/ro_support/bash.rb
|
121
|
+
- lib/ro_support/thor.rb
|
122
|
+
- lib/ro_support/spec.rb
|
123
|
+
- lib/ro_support/array.rb
|
124
|
+
- lib/ro_support/module.rb
|
125
|
+
- lib/ro_support/file_actions.rb
|
126
|
+
- lib/ro_support/version.rb
|
127
|
+
- lib/ro_support/debug.rb
|
128
|
+
- lib/ro_support/git.rb
|
129
|
+
- lib/ro_support/misc.rb
|
130
|
+
- lib/ro_support/string_handler.rb
|
131
|
+
- lib/ro_support/ssh.rb
|
132
|
+
- lib/ro_support/misc/zw.rb
|
133
|
+
- lib/ro_support/log.rb
|
134
|
+
- lib/tasks/roro_support_tasks.rake
|
135
|
+
- MIT-LICENSE
|
136
|
+
- Rakefile
|
137
|
+
- README.rdoc
|
138
|
+
- spec/fixtures/sample/try1.rb
|
139
|
+
- spec/fixtures/sample/try2.rb
|
140
|
+
- spec/fixtures/sample/try3.rb
|
141
|
+
- spec/fixtures/baidu.html
|
142
|
+
- spec/fixtures/for_log/ro.log
|
143
|
+
- spec/fixtures/for_misc_file_utils/create_dir_file/try.rb
|
144
|
+
- spec/spec_helper.rb
|
145
|
+
- spec/lib/roro_support_spec.rb
|
146
|
+
- spec/lib/roro_support/string_handler_spec.rb
|
147
|
+
- spec/lib/roro_support/file_actions_spec.rb
|
148
|
+
- spec/lib/roro_support/log/roro.log
|
149
|
+
- spec/lib/roro_support/log/ro.log
|
150
|
+
- spec/lib/roro_support/module_spec.rb
|
151
|
+
- spec/lib/roro_support/array_spec.rb
|
152
|
+
- spec/lib/roro_support/bash_spec.rb
|
153
|
+
- spec/lib/roro_support/misc/zw_spec.rb
|
154
|
+
- spec/lib/roro_support/misc_spec.rb
|
155
|
+
- spec/lib/roro_support/debug_spec.rb
|
156
|
+
- spec/lib/roro_support/log_spec.rb
|
157
|
+
- spec/lib/roro_support/git_spec.rb
|
158
|
+
homepage: ''
|
159
|
+
licenses: []
|
160
|
+
metadata: {}
|
161
|
+
post_install_message:
|
162
|
+
rdoc_options: []
|
163
|
+
require_paths:
|
164
|
+
- lib
|
165
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - '>='
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - '>='
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
175
|
+
requirements: []
|
176
|
+
rubyforge_project:
|
177
|
+
rubygems_version: 2.0.7
|
178
|
+
signing_key:
|
179
|
+
specification_version: 4
|
180
|
+
summary: ''
|
181
|
+
test_files:
|
182
|
+
- spec/fixtures/sample/try1.rb
|
183
|
+
- spec/fixtures/sample/try2.rb
|
184
|
+
- spec/fixtures/sample/try3.rb
|
185
|
+
- spec/fixtures/baidu.html
|
186
|
+
- spec/fixtures/for_log/ro.log
|
187
|
+
- spec/fixtures/for_misc_file_utils/create_dir_file/try.rb
|
188
|
+
- spec/spec_helper.rb
|
189
|
+
- spec/lib/roro_support_spec.rb
|
190
|
+
- spec/lib/roro_support/string_handler_spec.rb
|
191
|
+
- spec/lib/roro_support/file_actions_spec.rb
|
192
|
+
- spec/lib/roro_support/log/roro.log
|
193
|
+
- spec/lib/roro_support/log/ro.log
|
194
|
+
- spec/lib/roro_support/module_spec.rb
|
195
|
+
- spec/lib/roro_support/array_spec.rb
|
196
|
+
- spec/lib/roro_support/bash_spec.rb
|
197
|
+
- spec/lib/roro_support/misc/zw_spec.rb
|
198
|
+
- spec/lib/roro_support/misc_spec.rb
|
199
|
+
- spec/lib/roro_support/debug_spec.rb
|
200
|
+
- spec/lib/roro_support/log_spec.rb
|
201
|
+
- spec/lib/roro_support/git_spec.rb
|