goku 0.1.4 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.byebug_history +2 -0
- data/.gitignore +1 -0
- data/lib/goku.rb +1 -0
- data/lib/goku/cli.rb +5 -3
- data/lib/goku/factories/module.rb +28 -0
- data/lib/goku/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5349c64edaf35926e0cf79fbf375be1fe99aac4
|
4
|
+
data.tar.gz: fac2d88e71258296e20085dfd17cb82441b64de8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 179f30aec3b466475c5066574292afff1bfd356cedaa603f486226e09101be74aeea1358d4a982038710a649bd0e91801ab03280347e57c22272df257eb2bd3b
|
7
|
+
data.tar.gz: f5011dc156617cde6570de9c785f9629b0995c47810ef8a3222e694a3258f5256e8fa5b39ef0d33b24a4a7220bd796d1e9003375140e99e5522b6ed75d7d6ca7
|
data/.byebug_history
CHANGED
data/.gitignore
CHANGED
data/lib/goku.rb
CHANGED
data/lib/goku/cli.rb
CHANGED
@@ -12,13 +12,15 @@ module Goku
|
|
12
12
|
end
|
13
13
|
|
14
14
|
desc "m PATH", "Create a module"
|
15
|
-
def m(
|
15
|
+
def m(raw_path)
|
16
16
|
path = Goku::Path.new(raw_path)
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
mod = Goku::Factories::Module.new(path.filename)
|
19
|
+
|
20
|
+
puts mod
|
20
21
|
end
|
21
22
|
|
22
23
|
map "module" => "m"
|
24
|
+
map "class" => "m"
|
23
25
|
end
|
24
26
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Goku
|
2
|
+
module Factories
|
3
|
+
class Module
|
4
|
+
|
5
|
+
attr_reader :name
|
6
|
+
attr_reader :methods
|
7
|
+
|
8
|
+
def initialize(name)
|
9
|
+
@name = name
|
10
|
+
@methods = []
|
11
|
+
end
|
12
|
+
|
13
|
+
def add_method(method)
|
14
|
+
@methods << method
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_s
|
18
|
+
strigified_methods = methods
|
19
|
+
.map(&:to_s)
|
20
|
+
.map { |method| method.indent(2) }
|
21
|
+
.join("\n\n")
|
22
|
+
|
23
|
+
"module #{name.camelcase}\n\n#{strigified_methods}\n\nend"
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/goku/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: goku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Šarčević
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- lib/goku/cli.rb
|
119
119
|
- lib/goku/factories/class.rb
|
120
120
|
- lib/goku/factories/method.rb
|
121
|
+
- lib/goku/factories/module.rb
|
121
122
|
- lib/goku/path.rb
|
122
123
|
- lib/goku/version.rb
|
123
124
|
homepage: https://github.com/shiroyasha/goku
|