ro_support 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ro_support/bash.rb +0 -18
- data/lib/ro_support/dsl/file.rb +6 -0
- data/lib/ro_support/file_actions.rb +4 -4
- data/lib/ro_support/guard_helpers/base_helper.rb +29 -0
- data/lib/ro_support/guard_helpers/erb_helper.rb +52 -0
- data/lib/ro_support/guard_helpers/md_helper.rb +45 -0
- data/lib/ro_support/load.rb +9 -0
- data/lib/ro_support/out.rb +2 -0
- data/lib/ro_support/ro_guard.rb +67 -6
- data/lib/ro_support/version.rb +1 -1
- data/spec/lib/ro_support/bash_spec.rb +11 -3
- data/spec/lib/ro_support/debug_spec.rb +76 -76
- data/spec/lib/ro_support/file_actions_spec.rb +26 -43
- data/spec/lib/ro_support/misc_spec.rb +5 -26
- data/spec/lib/ro_support/ro_debug_spec.rb +27 -27
- data/spec/lib/ro_support/ro_guard/base_helper_spec.rb +33 -0
- data/spec/lib/ro_support/string_handler_spec.rb +3 -7
- data/spec/spec_helper.rb +1 -7
- metadata +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c99ccdf4846ce2282ddaca96d20b2b7624912128
|
4
|
+
data.tar.gz: 68323c88b3dbd24eeb1f27806baee8374cbafb7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8bf2abaa72c64cf1edd3a869d5e9e04e45a116785e02f7d035f80e8fd00b3bc38dc467a3c857b760f358e07ab24b6d1fea662442c8a63ed1ca2e5b99c61e7f6
|
7
|
+
data.tar.gz: b2a40242697e0aada27f081fd9da208543166c4cec150525a6898fd36e687801f935446a22d9190ea4fcc9f276b0f96432b7714b1e667d24ec6b57b18e55d689
|
data/lib/ro_support/bash.rb
CHANGED
@@ -1,21 +1,3 @@
|
|
1
1
|
require "ro_commands/helpers/bash"
|
2
2
|
require "ro_commands/helpers/out"
|
3
|
-
require "open3"
|
4
|
-
module RoSupport
|
5
|
-
module Bash
|
6
|
-
include ::Bash
|
7
3
|
|
8
|
-
def _bash(cmd)
|
9
|
-
stdout, stderr, status = Open3.capture3(cmd)
|
10
|
-
@@lastest_status = status
|
11
|
-
|
12
|
-
Out.out(stdout)
|
13
|
-
end
|
14
|
-
|
15
|
-
class << self
|
16
|
-
def lastest_status
|
17
|
-
@@lastest_status ||= ''
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require "pry"
|
2
|
+
require "ro_support/out"
|
3
|
+
|
4
|
+
module RoSupport
|
5
|
+
module GuardHelpers
|
6
|
+
module BaseHelper
|
7
|
+
class << self
|
8
|
+
def included(base)
|
9
|
+
base.extend(ClsMeths)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
module ClsMeths
|
14
|
+
def included(base)
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
def append_features(mod)
|
19
|
+
super
|
20
|
+
mod.class_eval do
|
21
|
+
include self.const_get(:ClassMethods)
|
22
|
+
extend self.const_get(:ClassMethods)
|
23
|
+
::Pry::Command.send :include, self.const_get(:ClassMethods)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require "active_support/concern"
|
2
|
+
require_relative "base_helper"
|
3
|
+
|
4
|
+
module GuardHelpers
|
5
|
+
module GuardHelper
|
6
|
+
include ::RoSupport::GuardHelpers::BaseHelper
|
7
|
+
|
8
|
+
module ClassMethods
|
9
|
+
def site_build
|
10
|
+
bash "jekyll build"
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_erb_name(erb)
|
14
|
+
Find.find("templates").grep(%r{#{erb}}).first
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_erb_name(erb)
|
18
|
+
basename = Time.now.strftime("%Y-%m-%d-#{erb}.md.erb")
|
19
|
+
File.join("templates", basename)
|
20
|
+
end
|
21
|
+
|
22
|
+
def create_erb(erb)
|
23
|
+
FileUtils.touch create_erb_name(erb)
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
def erb_build(erb)
|
28
|
+
#full_name = get_erb_name(erb)
|
29
|
+
#puts "full_name:#{full_name} file:#{File.basename __FILE__} line:#{__LINE__}"
|
30
|
+
basename = File.basename(erb).gsub(%r{\.erb}) do |m|
|
31
|
+
""
|
32
|
+
end
|
33
|
+
|
34
|
+
to = File.join("_posts", basename)
|
35
|
+
ctn = File.read(erb)
|
36
|
+
result = ERB.new(ctn).result(binding)
|
37
|
+
File.write(to, result)
|
38
|
+
notify "#{to} writing success"
|
39
|
+
end
|
40
|
+
|
41
|
+
def erb_build_all
|
42
|
+
Find.find("templates") do |erb|
|
43
|
+
if test(?f, erb)
|
44
|
+
Out.out(erb, "red")
|
45
|
+
erb_build(erb)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require "ro_support/out"
|
2
|
+
require_relative "base_helper"
|
3
|
+
|
4
|
+
module GuardHelpers
|
5
|
+
module MdHelper
|
6
|
+
include ::RoSupport::GuardHelpers::BaseHelper
|
7
|
+
|
8
|
+
module ClassMethods
|
9
|
+
|
10
|
+
def anchor(name, url)
|
11
|
+
"[#{name}](#{url})"
|
12
|
+
end
|
13
|
+
|
14
|
+
def h2(title)
|
15
|
+
"##<a name='#{get_name(title)}'></a> #{title}"
|
16
|
+
end
|
17
|
+
|
18
|
+
def h3(title)
|
19
|
+
"###<a name='#{get_name(title)}'></a> #{title}"
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
def get_name(title)
|
24
|
+
title.split(" ").map(&:downcase).join("-")
|
25
|
+
end
|
26
|
+
|
27
|
+
def ref(url)
|
28
|
+
"####[#{url}](#{url})"
|
29
|
+
end
|
30
|
+
|
31
|
+
def l (title)
|
32
|
+
list(title)
|
33
|
+
end
|
34
|
+
|
35
|
+
def l1 (title)
|
36
|
+
list(title, 1)
|
37
|
+
end
|
38
|
+
|
39
|
+
def list (title, level=0)
|
40
|
+
ref = "##{title.split(" ").map(&:downcase).join("-")}"
|
41
|
+
"#{" "*4*level}- [#{title}](#{ref})"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/ro_support/ro_guard.rb
CHANGED
@@ -1,10 +1,42 @@
|
|
1
1
|
require "guard"
|
2
2
|
require "guard/guard"
|
3
3
|
require "active_support/concern"
|
4
|
+
require "ro_support/out"
|
5
|
+
require "find"
|
6
|
+
require "erb"
|
7
|
+
require "fileutils"
|
4
8
|
|
5
9
|
module RoSupport
|
6
10
|
module RoGuard
|
11
|
+
class << self
|
12
|
+
|
13
|
+
def def_meth(name, &blk)
|
14
|
+
define_method(:"#{name}") do |*args|
|
15
|
+
blk.call *args
|
16
|
+
end
|
17
|
+
|
18
|
+
define_singleton_method(:"#{name}") do |*args|
|
19
|
+
blk.call *args
|
20
|
+
end
|
21
|
+
|
22
|
+
Pry::Command.send :define_method, :"#{name}" do |*args|
|
23
|
+
blk.call *args
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def_meth "bash" do |*cmds|
|
29
|
+
cmd = cmds.flatten.join(" && ")
|
30
|
+
Out.out(cmd)
|
31
|
+
::Kernel.system cmd
|
32
|
+
end
|
33
|
+
|
34
|
+
def_meth "guard_reset" do
|
35
|
+
bash "bundle exec guard"
|
36
|
+
end
|
37
|
+
|
7
38
|
def start
|
39
|
+
super if defined? super
|
8
40
|
commands = Pry::CommandSet.new do
|
9
41
|
block_command "install" do |*args|
|
10
42
|
system "rake install"
|
@@ -16,12 +48,39 @@ module RoSupport
|
|
16
48
|
end
|
17
49
|
|
18
50
|
def run_on_modifications(paths)
|
51
|
+
super if defined? super
|
19
52
|
@paths = paths
|
20
|
-
|
21
|
-
|
53
|
+
Out.out "paths:#{paths} file:#{File.basename __FILE__} line:#{__LINE__}", "green"
|
54
|
+
handle(%r{Guardfile|(^lib/guard_helpers/(.+)\.rb)}) do
|
55
|
+
guard_reset
|
56
|
+
end
|
57
|
+
|
58
|
+
handle(%r{README.md.erb}) do
|
59
|
+
ctn = File.read("README.md.erb")
|
60
|
+
result = ERB.new(ctn).result(binding)
|
61
|
+
Out.out("writting README.md")
|
62
|
+
File.write("README.md", result)
|
22
63
|
end
|
23
64
|
|
24
|
-
|
65
|
+
unless Dir['**'].grep(%r{(.+)\.gemspec}).empty?
|
66
|
+
bash "rake install"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def_meth "file_read" do |file|
|
71
|
+
File.read(file)
|
72
|
+
notify "read #{file}"
|
73
|
+
end
|
74
|
+
|
75
|
+
def_meth "file_write" do |file, ctn|
|
76
|
+
File.write(file, ctn)
|
77
|
+
notify "writing #{file} success"
|
78
|
+
end
|
79
|
+
|
80
|
+
def_meth "install" do
|
81
|
+
cmd = "rake install"
|
82
|
+
bash cmd
|
83
|
+
notify cmd
|
25
84
|
end
|
26
85
|
|
27
86
|
def paths
|
@@ -30,16 +89,18 @@ module RoSupport
|
|
30
89
|
@paths ||= []
|
31
90
|
end
|
32
91
|
|
33
|
-
|
92
|
+
def_meth "notify" do |msg|
|
34
93
|
puts msg
|
35
|
-
Notifier.notify msg
|
94
|
+
::Guard::Notifier.notify msg
|
36
95
|
end
|
37
96
|
|
38
97
|
def handle(file, &blk)
|
39
98
|
#puts "Handling #{paths.flatten}"
|
40
99
|
r = paths.flatten.grep /#{file}$/
|
41
100
|
unless r.empty?
|
42
|
-
|
101
|
+
r.each do |*args|
|
102
|
+
blk.call *args
|
103
|
+
end
|
43
104
|
end
|
44
105
|
end
|
45
106
|
|
data/lib/ro_support/version.rb
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
require "spec_helper"
|
2
|
+
require "ro_support/bash"
|
3
|
+
|
4
|
+
class Klass
|
5
|
+
include Bash
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "Klass" do
|
9
|
+
let(:o) do
|
10
|
+
Klass.new
|
11
|
+
end
|
2
12
|
|
3
|
-
include ::RoSupport::Bash
|
4
|
-
describe ::RoSupport::Bash do
|
5
13
|
it "bash" do
|
6
|
-
bash("echo one", "echo two", "echo three")
|
14
|
+
o.bash("echo one", "echo two", "echo three")
|
7
15
|
end
|
8
16
|
end
|
@@ -1,76 +1,76 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
|
4
|
-
class C
|
5
|
-
|
6
|
-
include RoSupport::Debug
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
@foo = 'foo'
|
10
|
-
@bar = 'bar'
|
11
|
-
end
|
12
|
-
|
13
|
-
def try_ro_raise
|
14
|
-
foo = 'foo'
|
15
|
-
bar = 'bar'
|
16
|
-
ro_raise err('msg', output: ['@foo', '@bar', 'bar', 'foo'])
|
17
|
-
end
|
18
|
-
|
19
|
-
#def try_ro_return
|
20
|
-
# foo = 'foo'
|
21
|
-
# bar = 'bar'
|
22
|
-
# ro_return valid(nil, output:['foo', 'bar'])
|
23
|
-
#end
|
24
|
-
|
25
|
-
def try_ro_print
|
26
|
-
foo = 'foo'
|
27
|
-
bar = 'bar'
|
28
|
-
ro_print vars('foo', 'bar')
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe Debug do
|
33
|
-
let(:c) { C.new }
|
34
|
-
|
35
|
-
it 'ro_raise' do
|
36
|
-
expect do
|
37
|
-
c.try_ro_raise
|
38
|
-
end.to raise_error RuntimeError
|
39
|
-
end
|
40
|
-
|
41
|
-
#describe 'ro_return' do
|
42
|
-
# it 'raise error when return a invalid argument' do
|
43
|
-
# expect do
|
44
|
-
# c.try_ro_return
|
45
|
-
# end.to raise_error RuntimeError
|
46
|
-
# end
|
47
|
-
#end
|
48
|
-
|
49
|
-
it 'ro_print' do
|
50
|
-
expect(c.try_ro_print).to be == "bar:bar"
|
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
|
-
|
76
|
-
end
|
1
|
+
#require 'spec_helper'
|
2
|
+
#
|
3
|
+
#
|
4
|
+
#class C
|
5
|
+
#
|
6
|
+
# include RoSupport::Debug
|
7
|
+
#
|
8
|
+
# def initialize
|
9
|
+
# @foo = 'foo'
|
10
|
+
# @bar = 'bar'
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
# def try_ro_raise
|
14
|
+
# foo = 'foo'
|
15
|
+
# bar = 'bar'
|
16
|
+
# ro_raise err('msg', output: ['@foo', '@bar', 'bar', 'foo'])
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# #def try_ro_return
|
20
|
+
# # foo = 'foo'
|
21
|
+
# # bar = 'bar'
|
22
|
+
# # ro_return valid(nil, output:['foo', 'bar'])
|
23
|
+
# #end
|
24
|
+
#
|
25
|
+
# def try_ro_print
|
26
|
+
# foo = 'foo'
|
27
|
+
# bar = 'bar'
|
28
|
+
# ro_print vars('foo', 'bar')
|
29
|
+
# end
|
30
|
+
#end
|
31
|
+
#
|
32
|
+
#describe Debug do
|
33
|
+
# let(:c) { C.new }
|
34
|
+
#
|
35
|
+
# it 'ro_raise' do
|
36
|
+
# expect do
|
37
|
+
# c.try_ro_raise
|
38
|
+
# end.to raise_error RuntimeError
|
39
|
+
# end
|
40
|
+
#
|
41
|
+
# #describe 'ro_return' do
|
42
|
+
# # it 'raise error when return a invalid argument' do
|
43
|
+
# # expect do
|
44
|
+
# # c.try_ro_return
|
45
|
+
# # end.to raise_error RuntimeError
|
46
|
+
# # end
|
47
|
+
# #end
|
48
|
+
#
|
49
|
+
# it 'ro_print' do
|
50
|
+
# expect(c.try_ro_print).to be == "bar:bar"
|
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
|
+
#
|
76
|
+
#end
|
@@ -1,43 +1,26 @@
|
|
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
|
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
|
+
#end
|
@@ -1,10 +1,7 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
include Misc
|
4
|
-
describe Misc do
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
#require 'spec_helper'
|
2
|
+
#
|
3
|
+
#include Misc
|
4
|
+
#describe Misc do
|
8
5
|
#describe Autoload do
|
9
6
|
# it 'all files in' do
|
10
7
|
# include Misc::Autoload
|
@@ -32,22 +29,4 @@ describe Misc do
|
|
32
29
|
# end
|
33
30
|
# end
|
34
31
|
#end
|
35
|
-
|
36
|
-
|
37
|
-
it 'set_instance_variable_from' do
|
38
|
-
pending
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'that' do
|
42
|
-
pending
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'self' do
|
46
|
-
pending
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'dir_load' do
|
50
|
-
pending
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
32
|
+
#end
|
@@ -1,27 +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
|
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,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require "ro_support/ro_guard/base_helper"
|
3
|
+
|
4
|
+
module ModHelper1
|
5
|
+
include ::RoSupport::GuardHelpers::BaseHelper
|
6
|
+
|
7
|
+
module ClassMethods
|
8
|
+
def try1
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class Klass
|
15
|
+
include ModHelper1
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "Klass" do
|
19
|
+
let(:o) do
|
20
|
+
Klass
|
21
|
+
end
|
22
|
+
|
23
|
+
it "#" do
|
24
|
+
expect(o).to respond_to :try1
|
25
|
+
expect(::Pry::Command.new).to respond_to :try1
|
26
|
+
expect(o.new).to respond_to :try1
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
describe "BaseHelper" do
|
32
|
+
|
33
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
include StringHandler
|
4
|
-
describe StringHandler do
|
5
|
-
before :all do
|
3
|
+
include ::RoSupport::StringHandler
|
6
4
|
|
5
|
+
describe "StringHandler" do
|
6
|
+
before :all do
|
7
7
|
end
|
8
8
|
|
9
9
|
it 'camelize' do
|
@@ -23,9 +23,5 @@ describe StringHandler do
|
|
23
23
|
it 'blank?' do
|
24
24
|
expect(' '.blank?).to be_true
|
25
25
|
end
|
26
|
-
it 'self' do
|
27
|
-
pending
|
28
|
-
end
|
29
|
-
|
30
26
|
end
|
31
27
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
require 'rspec'
|
2
|
-
require 'headless'
|
3
2
|
require 'faker'
|
4
3
|
require "ro_support"
|
5
|
-
include RoSupport
|
6
4
|
|
7
|
-
$root = File.expand_path("
|
5
|
+
$root = File.expand_path("../..", __FILE__)
|
8
6
|
$lib = File.join($root, 'lib')
|
9
7
|
$LOAD_PATH.unshift $root
|
10
8
|
$LOAD_PATH.unshift $lib
|
@@ -21,10 +19,6 @@ def cdfix(name)
|
|
21
19
|
end
|
22
20
|
|
23
21
|
RSpec.configure do |config|
|
24
|
-
config.before(:all) do
|
25
|
-
Headless.new.start
|
26
|
-
end
|
27
|
-
|
28
22
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
29
23
|
config.run_all_when_everything_filtered = true
|
30
24
|
config.filter_run :focus
|
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.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- db/seeds.rb
|
112
112
|
- lib/ro_support.rb
|
113
113
|
- lib/ro_support/rspec.rb
|
114
|
+
- lib/ro_support/out.rb
|
114
115
|
- lib/ro_support/string_handler/common.rb
|
115
116
|
- lib/ro_support/bash.rb
|
116
117
|
- lib/ro_support/rspec_helpers.rb
|
@@ -127,12 +128,17 @@ files:
|
|
127
128
|
- lib/ro_support/debug.rb
|
128
129
|
- lib/ro_support/git.rb
|
129
130
|
- lib/ro_support/misc.rb
|
131
|
+
- lib/ro_support/dsl/file.rb
|
130
132
|
- lib/ro_support/string_handler.rb
|
131
133
|
- lib/ro_support/guard.rb
|
134
|
+
- lib/ro_support/guard_helpers/base_helper.rb
|
135
|
+
- lib/ro_support/guard_helpers/md_helper.rb
|
136
|
+
- lib/ro_support/guard_helpers/erb_helper.rb
|
132
137
|
- lib/ro_support/ssh.rb
|
133
138
|
- lib/ro_support/log.rb
|
134
139
|
- lib/ro_support/file.rb
|
135
140
|
- lib/ro_support/ro_guard.rb
|
141
|
+
- lib/ro_support/load.rb
|
136
142
|
- lib/tasks/ro_support_tasks.rake
|
137
143
|
- Rakefile
|
138
144
|
- README.rdoc
|
@@ -155,6 +161,7 @@ files:
|
|
155
161
|
- spec/lib/ro_support/array_spec.rb
|
156
162
|
- spec/lib/ro_support/bash_spec.rb
|
157
163
|
- spec/lib/ro_support/misc/zw_spec.rb
|
164
|
+
- spec/lib/ro_support/ro_guard/base_helper_spec.rb
|
158
165
|
- spec/lib/ro_support/misc_spec.rb
|
159
166
|
- spec/lib/ro_support/debug_spec.rb
|
160
167
|
- spec/lib/ro_support/git_spec.rb
|
@@ -199,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
206
|
version: '0'
|
200
207
|
requirements: []
|
201
208
|
rubyforge_project:
|
202
|
-
rubygems_version: 2.0.
|
209
|
+
rubygems_version: 2.0.14
|
203
210
|
signing_key:
|
204
211
|
specification_version: 4
|
205
212
|
summary: ''
|
@@ -223,6 +230,7 @@ test_files:
|
|
223
230
|
- spec/lib/ro_support/array_spec.rb
|
224
231
|
- spec/lib/ro_support/bash_spec.rb
|
225
232
|
- spec/lib/ro_support/misc/zw_spec.rb
|
233
|
+
- spec/lib/ro_support/ro_guard/base_helper_spec.rb
|
226
234
|
- spec/lib/ro_support/misc_spec.rb
|
227
235
|
- spec/lib/ro_support/debug_spec.rb
|
228
236
|
- spec/lib/ro_support/git_spec.rb
|