goku 0.1.3 → 0.1.4

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: 776341da05c544fc602e6a1eb8a08600d5591263
4
- data.tar.gz: 0b6aff84049e139254a3a2cb05e079e63fea6e65
3
+ metadata.gz: e6773a6a9e8bc3bedd824167c30782d260b62a6e
4
+ data.tar.gz: c224b152e6a39aa6653568b2817eab495bb4c878
5
5
  SHA512:
6
- metadata.gz: 124795947a1c067c4dae64d71c122bcbd47e411c733b37df242d0ade7e6407402c81c96877535751cee0edb456b296df80385dd835d7a6bffe8034f2f295c1a2
7
- data.tar.gz: ffd1051312be156c5495d9317570988311a1bc3548ae65dbe8d95e1f9c04b61b0f72fae6a4db06f4525b33b857029aea986d61f343101a5470e8c21b92f9be26
6
+ metadata.gz: 5c2df543e34ee5e5bbd1ebe152cd958f2e2b4aa33d633e64122f4c981996949f881c014ec66962cc5efec8b79d94803a46e80dfb88cd01c5d7cf845d4c71e47a
7
+ data.tar.gz: 867c93e6db5d15fd98a72c07fb17e733b060840c63b2428559b5159636b5425a89393f5c10ea7c5738c9213a0624d56264aa7023f8f37d7a9a7512599608b038
@@ -0,0 +1,6 @@
1
+ c
2
+ methods.map(&:to_s).map { |method| method.indent(2) }
3
+ methods.map(&:to_s)
4
+ add_method(Goku::Factories::Method.new(:initialize))
5
+ methods.map(&:to_s)
6
+ methods.map(:to_s)
@@ -19,8 +19,10 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "thor", "~> 0.19"
22
+ spec.add_dependency "activesupport", "~> 4.2"
22
23
 
23
24
  spec.add_development_dependency "bundler", "~> 1.11"
24
25
  spec.add_development_dependency "rake", "~> 10.0"
25
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
+ spec.add_development_dependency "byebug", "~> 5.0"
26
28
  end
@@ -1,4 +1,8 @@
1
1
  require "thor"
2
+ require "active_support/all"
3
+
4
+ require "goku/factories/method"
5
+ require "goku/factories/class"
2
6
 
3
7
  require "goku/path"
4
8
  require "goku/version"
@@ -5,8 +5,10 @@ module Goku
5
5
  def c(raw_path)
6
6
  path = Goku::Path.new(raw_path)
7
7
 
8
- puts path.full
9
- puts path.to_spec.full
8
+ klass = Goku::Factories::Class.new(path.filename)
9
+ klass.add_method(Goku::Factories::Method.new("initialize"))
10
+
11
+ puts klass
10
12
  end
11
13
 
12
14
  desc "m PATH", "Create a module"
@@ -0,0 +1,28 @@
1
+ module Goku
2
+ module Factories
3
+ class Class
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
+ "class #{name.camelcase}\n\n#{strigified_methods}\n\nend"
24
+ end
25
+
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,17 @@
1
+ module Goku
2
+ module Factories
3
+ class Method
4
+
5
+ attr_reader :name
6
+
7
+ def initialize(name)
8
+ @name = name
9
+ end
10
+
11
+ def to_s
12
+ "def #{name}\nend"
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Goku
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Šarčević
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.19'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '4.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '4.2'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: byebug
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '5.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '5.0'
69
97
  description:
70
98
  email:
71
99
  - igor@renderedtext.com
@@ -74,6 +102,7 @@ executables:
74
102
  extensions: []
75
103
  extra_rdoc_files: []
76
104
  files:
105
+ - ".byebug_history"
77
106
  - ".gitignore"
78
107
  - ".rspec"
79
108
  - CODE_OF_CONDUCT.md
@@ -87,6 +116,8 @@ files:
87
116
  - goku.gemspec
88
117
  - lib/goku.rb
89
118
  - lib/goku/cli.rb
119
+ - lib/goku/factories/class.rb
120
+ - lib/goku/factories/method.rb
90
121
  - lib/goku/path.rb
91
122
  - lib/goku/version.rb
92
123
  homepage: https://github.com/shiroyasha/goku