goku 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/goku/cli.rb +18 -13
- data/lib/goku/factories/class.rb +8 -0
- data/lib/goku/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8904c9074e9d8ced1c6a98d418c8d6903c5cce8c
|
4
|
+
data.tar.gz: 1003b497bafc10713a370edf75571c7289bcaaa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4e0853efc58dda7190ca7a3456d5001a7d85e4870f3b7338d7247506ac11d6e3c1677ee35b1a4c5911e669f70a6ecd1fd96fa2d86f863d00a60a83e930961ae
|
7
|
+
data.tar.gz: 6bb0f6fb4657c6a56080a5d9441a90ebf7407d8522c82a25427b54d16963fbcc546911a5f61f219b03f7fb0c8ef28499f8f3fcb58ab78e5053c464f2426ad218
|
data/lib/goku/cli.rb
CHANGED
@@ -5,18 +5,9 @@ module Goku
|
|
5
5
|
def c(raw_path)
|
6
6
|
path = Goku::Path.new(raw_path)
|
7
7
|
|
8
|
-
modules = path
|
9
|
-
Goku::Factories::Module.new(module_name)
|
10
|
-
end
|
11
|
-
|
12
|
-
klass = Goku::Factories::Class.new(path.filename)
|
13
|
-
klass.add(Goku::Factories::Method.new("initialize"))
|
8
|
+
modules = create_modules(path)
|
14
9
|
|
15
|
-
modules.last.add(
|
16
|
-
|
17
|
-
modules.reverse.each_cons(2) do |submodule, parent_module|
|
18
|
-
parent_module.add(submodule)
|
19
|
-
end
|
10
|
+
modules.last.add(Goku::Factories::Class.new(path.filename))
|
20
11
|
|
21
12
|
puts modules.first.to_s
|
22
13
|
end
|
@@ -25,12 +16,26 @@ module Goku
|
|
25
16
|
def m(raw_path)
|
26
17
|
path = Goku::Path.new(raw_path)
|
27
18
|
|
28
|
-
|
19
|
+
modules = create_modules(path)
|
29
20
|
|
30
|
-
|
21
|
+
modules.last.add(Goku::Factories::Module.new(path.filename))
|
22
|
+
|
23
|
+
puts modules.first.to_s
|
31
24
|
end
|
32
25
|
|
33
26
|
map "module" => "m"
|
34
27
|
map "class" => "m"
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def create_modules(path)
|
32
|
+
modules = path.directories.drop(1).map { |m| Goku::Factories::Module.new(m) }
|
33
|
+
|
34
|
+
modules.reverse.each_cons(2) do |submodule, parent_module|
|
35
|
+
parent_module.add(submodule)
|
36
|
+
end
|
37
|
+
|
38
|
+
modules
|
39
|
+
end
|
35
40
|
end
|
36
41
|
end
|
data/lib/goku/factories/class.rb
CHANGED
data/lib/goku/version.rb
CHANGED