ro_support 0.0.5 → 0.0.6
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 +4 -4
- data/README.rdoc +27 -2
- data/Rakefile +4 -17
- data/app/assets/javascripts/application.js +16 -0
- data/app/assets/stylesheets/application.css +13 -0
- data/app/controllers/application_controller.rb +5 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/views/layouts/application.html.erb +14 -0
- data/config/application.rb +23 -0
- data/config/boot.rb +4 -0
- data/config/database.yml +25 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +29 -0
- data/config/environments/production.rb +80 -0
- data/config/environments/test.rb +36 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/filter_parameter_logging.rb +4 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/secret_token.rb +12 -0
- data/config/initializers/session_store.rb +3 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/en.yml +23 -0
- data/config/routes.rb +56 -0
- data/db/seeds.rb +7 -0
- data/lib/ro_support/bash.rb +13 -19
- data/lib/ro_support/callbacks.rb +93 -0
- data/lib/ro_support/debug.rb +1 -0
- data/lib/ro_support/dir.rb +9 -0
- data/lib/ro_support/file.rb +20 -0
- data/lib/ro_support/file_actions.rb +24 -6
- data/lib/ro_support/guard.rb +3 -0
- data/lib/ro_support/log.rb +3 -2
- data/lib/ro_support/ro_debug.rb +42 -0
- data/lib/ro_support/ro_guard.rb +56 -0
- data/lib/ro_support/ro_logger.rb +26 -0
- data/lib/ro_support/rspec.rb +3 -0
- data/lib/ro_support/rspec_helpers.rb +13 -0
- data/lib/ro_support/string_handler/common.rb +8 -0
- data/lib/ro_support/string_handler.rb +0 -2
- data/lib/ro_support/version.rb +1 -1
- data/lib/ro_support.rb +5 -7
- data/spec/fixtures/lib/ro_support/file_actions/tmp/rspec_guard_result +1 -0
- data/spec/lib/{roro_support → ro_support}/array_spec.rb +17 -9
- data/spec/lib/ro_support/bash_spec.rb +8 -0
- data/spec/lib/{roro_support → ro_support}/debug_spec.rb +24 -0
- data/spec/lib/ro_support/file_actions_spec.rb +43 -0
- data/spec/lib/ro_support/git_spec.rb +21 -0
- data/spec/lib/ro_support/misc/zw_spec.rb +67 -0
- data/spec/lib/{roro_support → ro_support}/misc_spec.rb +16 -0
- data/spec/lib/{roro_support → ro_support}/module_spec.rb +4 -0
- data/spec/lib/ro_support/ro_debug_spec.rb +27 -0
- data/spec/lib/ro_support/ro_logger_spec.rb +9 -0
- data/spec/lib/ro_support/string_handler/common_spec.rb +25 -0
- data/spec/lib/{roro_support → ro_support}/string_handler_spec.rb +9 -1
- data/spec/lib/ro_support_spec.rb +9 -0
- data/spec/ro_support/array_spec.rb +21 -0
- data/spec/ro_support/bash_spec.rb +29 -0
- data/spec/ro_support/debug_spec.rb +33 -0
- data/spec/ro_support/file_actions_spec.rb +33 -0
- data/spec/ro_support/git_spec.rb +29 -0
- data/spec/ro_support/log_spec.rb +13 -0
- data/spec/ro_support/misc/zw_spec.rb +29 -0
- data/spec/ro_support/misc_spec.rb +25 -0
- data/spec/ro_support/module_spec.rb +13 -0
- data/spec/ro_support/ro_debug_spec.rb +17 -0
- data/spec/ro_support/ro_file_spec.rb +25 -0
- data/spec/ro_support/ro_logger_spec.rb +13 -0
- data/spec/ro_support/rspec_helpers_spec.rb +13 -0
- data/spec/ro_support/rspec_spec.rb +0 -0
- data/spec/ro_support/spec_spec.rb +0 -0
- data/spec/ro_support/ssh_spec.rb +0 -0
- data/spec/ro_support/string_handler/common_spec.rb +29 -0
- data/spec/ro_support/string_handler_spec.rb +13 -0
- data/spec/ro_support/thor_spec.rb +0 -0
- data/spec/ro_support/version_spec.rb +0 -0
- data/spec/ro_support_spec.rb +12 -0
- data/spec/spec_helper.rb +17 -9
- metadata +111 -36
- data/MIT-LICENSE +0 -20
- data/lib/ro_support/misc/zw.rb +0 -46
- data/spec/fixtures/for_log/ro.log +0 -2
- data/spec/fixtures/for_log/tmp/rspec_guard_result +0 -1
- data/spec/lib/roro_support/bash_spec.rb +0 -4
- data/spec/lib/roro_support/file_actions_spec.rb +0 -10
- data/spec/lib/roro_support/git_spec.rb +0 -23
- data/spec/lib/roro_support/log_spec.rb +0 -28
- data/spec/lib/roro_support/misc/zw_spec.rb +0 -55
- /data/lib/tasks/{roro_support_tasks.rake → ro_support_tasks.rake} +0 -0
- /data/spec/lib/{roro_support → ro_support}/log/ro.log +0 -0
- /data/spec/lib/{roro_support → ro_support}/log/roro.log +0 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
module RoSupport
|
3
|
+
module RoFile
|
4
|
+
def spec?(path)
|
5
|
+
file?(path) and path[/_spec\.rb$/]
|
6
|
+
end
|
7
|
+
|
8
|
+
def file?(path)
|
9
|
+
test(?f, path)
|
10
|
+
end
|
11
|
+
|
12
|
+
def dir?(path)
|
13
|
+
test(?d, path)
|
14
|
+
end
|
15
|
+
|
16
|
+
def rb?(path)
|
17
|
+
file?(path) and path[/\.rb$/]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,15 +1,33 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
module RoSupport
|
3
3
|
module FileActions
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
# default is create smth
|
5
|
+
# e.g. file means create a file
|
6
|
+
# please include it below private
|
7
|
+
class << self
|
8
|
+
|
9
|
+
#def ls(dir)
|
10
|
+
# r = `ls -al #{dir}`.split("\n")
|
11
|
+
# r.each do |l|
|
12
|
+
# l.split(/\s+/)
|
13
|
+
# end
|
14
|
+
#end
|
15
|
+
end
|
16
|
+
|
17
|
+
def write(path, content)
|
18
|
+
parent(path)
|
19
|
+
File.write path
|
9
20
|
end
|
10
21
|
|
11
|
-
def
|
22
|
+
def file(path)
|
23
|
+
parent(path)
|
24
|
+
File.new(path, 'w+')
|
25
|
+
end
|
12
26
|
|
27
|
+
def parent(path)
|
28
|
+
file = File.basename path
|
29
|
+
dir = path.gsub file, ''
|
30
|
+
FileUtils.mkdir_p(dir)
|
13
31
|
end
|
14
32
|
|
15
33
|
#Attentions: module_name must be like file_name
|
data/lib/ro_support/log.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'ro_logger'
|
1
2
|
|
2
3
|
module RoSupport
|
3
4
|
module Log
|
@@ -5,9 +6,9 @@ module RoSupport
|
|
5
6
|
def puts_log(content, log_file='ro.log')
|
6
7
|
if content.is_a?(Exception)
|
7
8
|
puts ""
|
8
|
-
puts(
|
9
|
+
puts("#{err=content}")
|
9
10
|
err.backtrace.map do |line|
|
10
|
-
|
11
|
+
puts line
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'active_support/concern'
|
2
|
+
module RoSupport
|
3
|
+
module RoDebug
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
end
|
8
|
+
|
9
|
+
module ClassMethods
|
10
|
+
def check_env(envs)
|
11
|
+
envs.each do |env|
|
12
|
+
var_name = env
|
13
|
+
eval <<-EVAL
|
14
|
+
if defined? #{env}
|
15
|
+
var_value = #{env}
|
16
|
+
else
|
17
|
+
var_value = nil
|
18
|
+
end
|
19
|
+
EVAL
|
20
|
+
puts <<-PUTS
|
21
|
+
#{var_name} = #{var_value ||= 'nil'}
|
22
|
+
PUTS
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def solution(var_name)
|
27
|
+
<<-SOLUTION
|
28
|
+
nil
|
29
|
+
------------------------------------------
|
30
|
+
Solution: please fill #{var_name} with
|
31
|
+
|
32
|
+
#{var_name.split(".").first}.conf do
|
33
|
+
#{var_name} = VALUE
|
34
|
+
end
|
35
|
+
|
36
|
+
if you get any trouble
|
37
|
+
------------------------------------------
|
38
|
+
SOLUTION
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require "guard"
|
2
|
+
require "guard/guard"
|
3
|
+
|
4
|
+
module ::Guard
|
5
|
+
class RoGuard < Guard
|
6
|
+
|
7
|
+
def self.def_meth(meth, &blk)
|
8
|
+
define_singleton_method meth, &blk
|
9
|
+
define_method meth, &blk
|
10
|
+
Pry::Command.send :define_method, meth, &blk
|
11
|
+
end
|
12
|
+
|
13
|
+
def_meth "bash" do |*cmds|
|
14
|
+
Kernel.system cmds.flatten.join(" && ")
|
15
|
+
end
|
16
|
+
|
17
|
+
def start
|
18
|
+
commands = Pry::CommandSet.new do
|
19
|
+
block_command "install" do |*args|
|
20
|
+
system "rake install"
|
21
|
+
output.out "nimabi"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
Pry::Commands.import commands
|
26
|
+
end
|
27
|
+
|
28
|
+
def run_on_modifications(paths)
|
29
|
+
@paths = paths
|
30
|
+
handle('Guardfile') do
|
31
|
+
bash "bundle exec guard"
|
32
|
+
end
|
33
|
+
|
34
|
+
bash "rake install"
|
35
|
+
end
|
36
|
+
|
37
|
+
def paths
|
38
|
+
@paths.flatten! if @paths.respond_to?(:flatten!)
|
39
|
+
@paths.uniq! if @paths.respond_to?(:uniq!)
|
40
|
+
@paths ||= []
|
41
|
+
end
|
42
|
+
|
43
|
+
def notify(msg)
|
44
|
+
puts msg
|
45
|
+
Notifier.notify msg
|
46
|
+
end
|
47
|
+
|
48
|
+
def handle(file, &blk)
|
49
|
+
#puts "Handling #{paths.flatten}"
|
50
|
+
r = paths.flatten.grep /#{file}$/
|
51
|
+
unless r.empty?
|
52
|
+
blk.call
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'logger'
|
2
|
+
|
3
|
+
module RoSupport
|
4
|
+
module RoLogger
|
5
|
+
class << self
|
6
|
+
|
7
|
+
def puts_log(content, log_file='ro.log')
|
8
|
+
if content.is_a?(Exception)
|
9
|
+
puts ""
|
10
|
+
puts("#{err=content}")
|
11
|
+
err.backtrace.map do |line|
|
12
|
+
puts line
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
if defined?(Rails) && defined?(Rails.root)
|
17
|
+
log = Logger.new("#{Rails.root}/log/#{log_file}")
|
18
|
+
log.error(content)
|
19
|
+
else
|
20
|
+
log = Logger.new(File.join Dir.pwd, log_file)
|
21
|
+
log.error(content)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
module RoSupport
|
3
|
+
module RSpecHelpers
|
4
|
+
def cdfix(name)
|
5
|
+
if defined?($fixtures) or defined?(ENV['FIXTURES'])
|
6
|
+
fix = $fixtures || ENV['FIXTURES']
|
7
|
+
dir = File.join(fix, name)
|
8
|
+
FileUtils.mkdir_p dir
|
9
|
+
Dir.chdir dir
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/ro_support/version.rb
CHANGED
data/lib/ro_support.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
require 'active_support/core_ext/string'
|
2
1
|
require 'thor'
|
3
|
-
|
4
|
-
require '
|
5
|
-
|
2
|
+
|
3
|
+
require File.expand_path('../ro_support/string_handler', __FILE__)
|
4
|
+
|
5
|
+
include RoSupport::StringHandler
|
6
6
|
|
7
7
|
$LOAD_PATH.unshift File.expand_path("../..", __FILE__)
|
8
|
-
# autoload
|
9
8
|
|
10
9
|
module RoSupport
|
11
10
|
|
@@ -18,8 +17,7 @@ module RoSupport
|
|
18
17
|
autoload :FileActions, 'lib/ro_support/file_actions'
|
19
18
|
|
20
19
|
include FileActions
|
21
|
-
autoload_all_files_in File.expand_path('../ro_support', __FILE__)
|
22
20
|
|
21
|
+
autoload_all_files_in File.expand_path('../ro_support', __FILE__)
|
23
22
|
end
|
24
23
|
|
25
|
-
|
@@ -0,0 +1 @@
|
|
1
|
+
/home/zxr/Dropbox/ruby_project/ro_support/spec/lib/ro_support/file_actions_spec.rb:10
|
@@ -14,14 +14,22 @@ describe RoSupport::Array do
|
|
14
14
|
|
15
15
|
it 'case2' do
|
16
16
|
eval %Q(#{["卓尔不凡 这是最好的时代,也是最坏的时代 。 这是智慧的时代,也是愚蠢的时代。 这是充满信仰的时代,也是怀疑重重的时代。 这是光明的季节,也是黑暗的季节。 这是希望之春,也是失望之冬。 这是充满真理的时代,也是歪理当道的时代。 人们面前有各式各样的选择 ,也可以说是别无选择。 有人此刻直登天堂, 有人此刻正在下地狱。 现实的困境让我们社会的多数人变得麻木不仁,抱怨不断!失去了从平凡变伟大的机会!抱怨已经充斥我们周围!事实上你可以原本比现在的你做的更好!一切源于你对自我是怎样的认知和抉择! NASA有一句名言失败不是一个选项(备注:多数人认为是詹姆斯.卡梅隆所说) 时光如斯流逝,人生苦短,你懂得!我们这辈子没法做太多的事!但是你可以把自己喜爱的事做到精彩绝伦! 在人类历史的发展长河中,有这么一群人—爱因斯坦;达.芬奇;特斯拉;布兰森;埃里森;拳王阿里;袁隆平;李小龙;马云;华裔神探李昌钰;诺查.丹玛斯;尼采;詹姆斯.卡梅隆;斯皮尔伯格;乔治.卢卡斯;魔术师克里斯.安吉尔和戴纳魔;迈克尔.桑德尔;斯蒂夫.乔布斯。 他们用不同的角度看世界他们引领各自领域的变革,发明创造!唤醒梦想,探究未知!放飞理想,创造未来! 他们的独特认知源于强大的内心驱动力!永远旺盛的好奇心!丰富的想象力!不可能的任务:Mission impossibleHopeFace网络科技公司邀请以下的各位参与这项不可能的任务一个Android开发者、前端开发,后台开发者、Jobs'非同凡响'的思想,他的王者归来缔造这个世纪初苹果最辉煌的10年;我们'卓尔不凡'的思想需要以上的各位一起携手创造出伟大的产品,当我们回想我们的人生的时候至少可以向你的后代吹吹牛!你是这项伟大任务的参与者!继而在人类的历史长河中留下那属于你自己浓墨重彩的一笔!当你在街上看到有个年轻人,走路有点心不在焉,而且远远的看起来有点呆头呆脑的家伙时,别犹豫!那个哥们儿就是我!罗童鞋(brandon):158 1156 3286Facebook:罗朝国Twitter:brandon20101101欢迎各位的骚扰!Y(^_^)Y"].to_args})
|
17
|
-
|
18
|
-
|
17
|
+
end
|
18
|
+
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
it 'map with regexp' do
|
21
|
+
result = [1, 2].map_with_regexp /2/ do |e|
|
22
|
+
e*2
|
23
|
+
end
|
24
|
+
expect(result).to be == [1, 4]
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'map_with_regexp' do
|
28
|
+
pending
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'preprocess' do
|
32
|
+
pending
|
33
|
+
end
|
26
34
|
|
27
|
-
end
|
35
|
+
end
|
@@ -49,4 +49,28 @@ describe Debug do
|
|
49
49
|
it 'ro_print' do
|
50
50
|
expect(c.try_ro_print).to be == "bar:bar"
|
51
51
|
end
|
52
|
+
it 'self' do
|
53
|
+
pending
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'vars' do
|
57
|
+
pending
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'err' do
|
61
|
+
pending
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'valid' do
|
65
|
+
pending
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'ro_error' do
|
69
|
+
pending
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'ro_return_valid' do
|
73
|
+
pending
|
74
|
+
end
|
75
|
+
|
52
76
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class Klass
|
4
|
+
include FileActions
|
5
|
+
end
|
6
|
+
|
7
|
+
describe FileActions do
|
8
|
+
|
9
|
+
let(:o) do
|
10
|
+
Klass.new
|
11
|
+
end
|
12
|
+
|
13
|
+
before do
|
14
|
+
cdfix('file_actions')
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'create dir file' do
|
18
|
+
path = 'path/to/target'
|
19
|
+
result = o.send(:"file", path)
|
20
|
+
expect(File.exist? path).to be_true
|
21
|
+
end
|
22
|
+
|
23
|
+
#it 'ls' do
|
24
|
+
# FileActions.ls Dir.pwd
|
25
|
+
#end
|
26
|
+
|
27
|
+
it 'create_dir_file' do
|
28
|
+
pending
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'get_tree_in' do
|
32
|
+
pending
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'self' do
|
36
|
+
pending
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'autoload_all_files_in' do
|
40
|
+
pending
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,67 @@
|
|
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
|
+
# it 'is_no' do
|
56
|
+
# pending
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# it 'has_no' do
|
60
|
+
# pending
|
61
|
+
# end
|
62
|
+
#
|
63
|
+
# it 'split_with_no' do
|
64
|
+
# pending
|
65
|
+
# end
|
66
|
+
#
|
67
|
+
#end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class Project
|
4
|
+
class << self
|
5
|
+
def root
|
6
|
+
'/nimabi/nimabi'
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
module Try
|
12
|
+
include RoDebug
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'RoDebug' do
|
16
|
+
|
17
|
+
describe 'check_env' do
|
18
|
+
it 'check' do
|
19
|
+
Try.check_env %w(Project.root)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'check nil' do
|
23
|
+
Try.check_env %w(Project.nimabi)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Common' do
|
4
|
+
|
5
|
+
it 'blank' do
|
6
|
+
pending
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'uncamelize' do
|
10
|
+
pending
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'collect' do
|
14
|
+
pending
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'collect_sign' do
|
18
|
+
pending
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'camelize' do
|
22
|
+
pending
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -6,6 +6,10 @@ describe StringHandler do
|
|
6
6
|
|
7
7
|
end
|
8
8
|
|
9
|
+
it 'camelize' do
|
10
|
+
expect('man_man'.camelize).to be == 'ManMan'
|
11
|
+
end
|
12
|
+
|
9
13
|
it 'uncamelize' do
|
10
14
|
expect("ManMan".uncamelize).to match /man_man/
|
11
15
|
end
|
@@ -13,11 +17,15 @@ describe StringHandler do
|
|
13
17
|
it 'get_dirname_same_with file' do
|
14
18
|
file = "/home/zxr/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/ro_support-0.0.4/lib/ro_support/misc.rb"
|
15
19
|
expect(RoSupport::StringHandler.get_dirname_same_with file).to be ==
|
16
|
-
|
20
|
+
"/home/zxr/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/ro_support-0.0.4/lib/ro_support/misc"
|
17
21
|
end
|
18
22
|
|
19
23
|
it 'blank?' do
|
20
24
|
expect(' '.blank?).to be_true
|
21
25
|
end
|
26
|
+
it 'self' do
|
27
|
+
pending
|
28
|
+
end
|
29
|
+
|
22
30
|
end
|
23
31
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Bash' do
|
4
|
+
before do
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
|
9
|
+
it "#bash" do
|
10
|
+
pending
|
11
|
+
end
|
12
|
+
|
13
|
+
it "#bash_per" do
|
14
|
+
pending
|
15
|
+
end
|
16
|
+
|
17
|
+
it "#bashes" do
|
18
|
+
pending
|
19
|
+
end
|
20
|
+
|
21
|
+
it "#handle_path" do
|
22
|
+
pending
|
23
|
+
end
|
24
|
+
|
25
|
+
it "#set" do
|
26
|
+
pending
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|