capykit 0.0.32 → 0.0.36
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/capykit/base/ref.rb +20 -14
- data/lib/capykit/base/util.rb +29 -17
- data/lib/capykit/version.rb +1 -1
- metadata +3 -3
data/lib/capykit/base/ref.rb
CHANGED
@@ -5,31 +5,29 @@ module Capykit::Base::Ref
|
|
5
5
|
|
6
6
|
def core_methods
|
7
7
|
arr=Capykit::Base::Core.public_instance_methods.sort
|
8
|
-
ar2=arr.select{|
|
8
|
+
ar2=arr.select{|xx|xx.length==1}
|
9
9
|
ar2 + (arr-ar2)
|
10
10
|
end
|
11
11
|
|
12
12
|
def capy_methods
|
13
13
|
arr=modules_methods.sort!
|
14
|
-
ar2=arr.select{|
|
14
|
+
ar2=arr.select{|xx|xx.length==1}
|
15
15
|
ar2 + (arr-ar2)
|
16
16
|
end
|
17
17
|
|
18
18
|
def auto_methods
|
19
19
|
arr=modules_methods.sort!
|
20
|
-
arr.select{|
|
20
|
+
arr.select{|xx|xx=~/^(aselector_|vsite_)/}
|
21
21
|
end
|
22
22
|
|
23
|
-
def execute_methods(pr='')
|
24
|
-
|
25
|
-
mo
|
26
|
-
pr=='' ? mo : mo.collect{|x|x[ym.length,99]}
|
23
|
+
def execute_methods(pr='x_')
|
24
|
+
mo=modules_methods.select{|xx|xx=~/^#{pr}/}.sort!
|
25
|
+
pr=='' ? mo : mo.collect{|xx|xx[pr.to_s.length,99]}
|
27
26
|
end
|
28
27
|
|
29
|
-
def test_methods(pr='')
|
30
|
-
|
31
|
-
mo
|
32
|
-
pr=='' ? mo : mo.collect{|x|x[ym.length,99]}
|
28
|
+
def test_methods(pr='x_')
|
29
|
+
mo=modules_methods.select{|xx|xx=~/^#{pr}/}.sort!
|
30
|
+
pr=='' ? mo : mo.collect{|xx|xx[pr.to_s.length,99]}
|
33
31
|
end
|
34
32
|
|
35
33
|
def tasks_methods(*arg)
|
@@ -37,14 +35,22 @@ module Capykit::Base::Ref
|
|
37
35
|
task_m='.*'
|
38
36
|
idx=nil
|
39
37
|
if arg!=[]
|
40
|
-
|
41
|
-
|
38
|
+
num =arg.select{|nn|nn.class==Fixnum}
|
39
|
+
cls =arg.select{|nn|nn.to_s[0,2]=='c_'}
|
40
|
+
mth =arg.select{|nn|nn.to_s[0,2]=='m_'}
|
41
|
+
arg -=num
|
42
|
+
arg -=cls
|
43
|
+
arg -=mth
|
44
|
+
idx =num[0]
|
45
|
+
task_c=cls[0].to_s[2,99] if cls[0]
|
46
|
+
task_m=mth[0].to_s[2,99] if mth[0]
|
47
|
+
task_m=arg[0] if !mth[0] && arg[0]
|
42
48
|
end
|
43
49
|
tr=[]
|
44
50
|
@tasks.each do|tk,tv|
|
45
51
|
if tk.to_s=~/#{task_c}/
|
46
52
|
tv.public_methods(nil).each do|tm|
|
47
|
-
tr << [tk,tm] if tm=~/#{task_m}/
|
53
|
+
tr << [tk,tm] if task_m.class==Fixnum || tm=~/#{task_m}/
|
48
54
|
#tasks_run << "tasks[:#{tk}].#{tm}" if tm=~/#{task_m}/
|
49
55
|
end
|
50
56
|
end
|
data/lib/capykit/base/util.rb
CHANGED
@@ -1,30 +1,42 @@
|
|
1
1
|
module Capykit::Base::Util
|
2
2
|
attr_reader :tasks
|
3
3
|
|
4
|
-
def x(
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
4
|
+
def x(*arg)
|
5
|
+
if arg==[]
|
6
|
+
execute_methods.each_with_index do |vv,ii|
|
7
|
+
puts "#{ii}. #{vv}"
|
8
|
+
end
|
9
|
+
nil
|
10
|
+
else
|
11
|
+
runs=[]
|
12
|
+
sym=arg.shift
|
13
|
+
exec=execute_methods(sym)
|
14
|
+
arg.each do |oth|
|
15
|
+
mul=(oth.to_s[-1,1]=='_')
|
16
|
+
rgx=mul ? /#{oth}/ : /#{oth}$/
|
17
|
+
runs+=exec.select{|pr|pr=~rgx}
|
18
|
+
end
|
19
|
+
p runs
|
20
|
+
runs.each do|xx|
|
21
|
+
met="x_#{xx}"
|
22
|
+
puts met
|
23
|
+
self.send met
|
24
|
+
end
|
17
25
|
end
|
18
26
|
end
|
19
27
|
|
28
|
+
def xc(*arg)
|
29
|
+
tasks_methods(*arg)
|
30
|
+
end
|
31
|
+
|
20
32
|
def xconf(xhash=nil)
|
21
33
|
if xhash==:clear
|
22
|
-
|
34
|
+
@@xconf={}
|
23
35
|
else
|
24
|
-
|
25
|
-
|
36
|
+
@@xconf||={}
|
37
|
+
@@xconf =@@xconf.merge xhash if xhash
|
26
38
|
end
|
27
|
-
|
39
|
+
@@xconf
|
28
40
|
end
|
29
41
|
|
30
42
|
#def x_se_go(kwd,sym=:g)
|
data/lib/capykit/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capykit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 87
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 36
|
10
|
+
version: 0.0.36
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Widi Harsojo
|