grape_bootstrap 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTExMWM1NWQ2OWZhODJjN2I4OWY5MThhMjU1ODI3YjEzZDNiYzMyYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzEzM2ZhYThlZTAxN2VlODE2M2M3MTI1MDNhODM4OTYxZjFjNzBhOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmMyYTJjY2EzNDNkNWRiY2Y2ODMwOGY1NTBhZGM0YTEzNmU1MDQ4NWI2NTRm
|
10
|
+
YmQ1NDEzZTMxODBiZjMxNzI2M2IxNzUzMDY4MzQ5NzliN2EwMjA0YzdiYjQ3
|
11
|
+
ZjJlNWQ4OWY2ZTRjNGZlMWJhM2VmYmVhNjk5MWJkNDcwYWIxOTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDk2MzhlM2UxMDcxYmFkMWRiZWFmYzUwOGEyMWFlZmQ5MjYxZDg0ODY5MzU3
|
14
|
+
YWUyMDQ2ZjJlM2Q5YTNiNjA1MDE1MGE4YTZjM2JkNTllNDQyNjA1ODNjN2Mx
|
15
|
+
NjkxOTA0YTlhMmI4OTE2NDMyNjY2NzNlYjRhMWVjZGUxODUwMDU=
|
@@ -4,25 +4,24 @@ require 'active_support/core_ext'
|
|
4
4
|
module GrapeBootstrap
|
5
5
|
module Commands
|
6
6
|
class Generate < Base
|
7
|
+
alias_method :model, :render_template
|
8
|
+
alias_method :api, :render_template
|
9
|
+
|
7
10
|
def initialize path, type, options=[]
|
8
11
|
super path, options
|
9
12
|
if type.nil?
|
10
13
|
throw "Type not specified"
|
11
14
|
end
|
12
15
|
@type = type
|
16
|
+
@name = options.shift
|
13
17
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
def model name
|
18
|
-
if name.nil?
|
19
|
-
throw "Model needs a name to be generated"
|
18
|
+
if @name.nil?
|
19
|
+
throw "#{@type} needs a name to be generated"
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
self.send @type.downcase, @name
|
23
23
|
end
|
24
24
|
|
25
|
-
private
|
26
25
|
def render_template name
|
27
26
|
template_type = @type
|
28
27
|
erb_binding = -> {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mate Marjai
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- lib/grape_bootstrap/templates/README.md.erb
|
75
75
|
- lib/grape_bootstrap/templates/Rakefile.erb
|
76
76
|
- lib/grape_bootstrap/templates/app/api/base.rb.erb
|
77
|
+
- lib/grape_bootstrap/templates/app/api/new.rb.erb
|
77
78
|
- lib/grape_bootstrap/templates/app/api/status.rb.erb
|
78
79
|
- lib/grape_bootstrap/templates/app/models/new.rb.erb
|
79
80
|
- lib/grape_bootstrap/templates/application.rb.erb
|