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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6773a6a9e8bc3bedd824167c30782d260b62a6e
4
- data.tar.gz: c224b152e6a39aa6653568b2817eab495bb4c878
3
+ metadata.gz: c5349c64edaf35926e0cf79fbf375be1fe99aac4
4
+ data.tar.gz: fac2d88e71258296e20085dfd17cb82441b64de8
5
5
  SHA512:
6
- metadata.gz: 5c2df543e34ee5e5bbd1ebe152cd958f2e2b4aa33d633e64122f4c981996949f881c014ec66962cc5efec8b79d94803a46e80dfb88cd01c5d7cf845d4c71e47a
7
- data.tar.gz: 867c93e6db5d15fd98a72c07fb17e733b060840c63b2428559b5159636b5425a89393f5c10ea7c5738c9213a0624d56264aa7023f8f37d7a9a7512599608b038
6
+ metadata.gz: 179f30aec3b466475c5066574292afff1bfd356cedaa603f486226e09101be74aeea1358d4a982038710a649bd0e91801ab03280347e57c22272df257eb2bd3b
7
+ data.tar.gz: f5011dc156617cde6570de9c785f9629b0995c47810ef8a3222e694a3258f5256e8fa5b39ef0d33b24a4a7220bd796d1e9003375140e99e5522b6ed75d7d6ca7
@@ -1,3 +1,5 @@
1
+ exit
2
+ strigified_methods
1
3
  c
2
4
  methods.map(&:to_s).map { |method| method.indent(2) }
3
5
  methods.map(&:to_s)
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ .byebug_history
@@ -3,6 +3,7 @@ require "active_support/all"
3
3
 
4
4
  require "goku/factories/method"
5
5
  require "goku/factories/class"
6
+ require "goku/factories/module"
6
7
 
7
8
  require "goku/path"
8
9
  require "goku/version"
@@ -12,13 +12,15 @@ module Goku
12
12
  end
13
13
 
14
14
  desc "m PATH", "Create a module"
15
- def m(path)
15
+ def m(raw_path)
16
16
  path = Goku::Path.new(raw_path)
17
17
 
18
- puts path.full
19
- puts path.to_spec.full
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
@@ -1,3 +1,3 @@
1
1
  module Goku
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2"
3
3
  end
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.1.4
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