grape_bootstrap 0.0.2 → 0.0.3
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
|
+
OGFmNDA3OTExMDM5MWFlZDg1ZGMyODQ3YTM1NDdmODUxMzJlZTJiOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmIwMWY4ODg0MzY5NjBhNjdjYWFiNzdlMWZlYjBiZDA2ZGU0ZjhkZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjE3YWZiM2E0N2RkNjczZWFkZDczNGEwNzM4YTI4ZWI1ZTVmMTdhMWVhMjk1
|
10
|
+
YmVmYmFhOWIzYmYzYTViZjVhZmM2OWM4MGY0NzE2Zjg3MWRmOWVlODViNTAz
|
11
|
+
NjlmYmU0NWE2ZTdiMGFjZjdiM2QyNjA5ZmJjY2E4MjI1MTZjZTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDY2OTY2YTM0MjcyMWQwMjM1Nzc0NjgwYmFmYjg2MmVmM2FjOTNmMjJhNmI5
|
14
|
+
M2U0ZGYxMWQ0MDFjN2IwMjA0ODVkN2E0ZDEyODAyOWUyNTZmZmQ0YWUyOTdj
|
15
|
+
Mzg3MGRjNjBiZWIyMWVkZGRjMzc5OTIxOWQ2ODBkZDg5MWE3OWQ=
|
@@ -4,15 +4,13 @@ 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
|
-
|
10
7
|
def initialize path, type, options=[]
|
11
8
|
super path, options
|
12
9
|
if type.nil?
|
13
10
|
throw "Type not specified"
|
14
11
|
end
|
15
|
-
|
12
|
+
# Ugly hack for models vs api
|
13
|
+
@type = 'model' == type ? 'models' : type
|
16
14
|
@name = options.shift
|
17
15
|
|
18
16
|
if @name.nil?
|
@@ -34,16 +32,19 @@ module GrapeBootstrap
|
|
34
32
|
"..",
|
35
33
|
"templates",
|
36
34
|
"app",
|
37
|
-
template_type
|
35
|
+
template_type,
|
38
36
|
"new.rb.erb"
|
39
37
|
].join('/')
|
40
38
|
tpl = ERB.new(File.read(template_path))
|
41
|
-
target_path = "app/#{template_type
|
39
|
+
target_path = "app/#{template_type}/#{name.underscore}.rb"
|
42
40
|
|
43
|
-
File.open("#{@path}/#{target_path}", 'w') do |file|
|
41
|
+
File.open("#{@path}/#{target_path}", 'w+') do |file|
|
44
42
|
file << tpl.result(erb_binding.call)
|
45
43
|
end
|
46
44
|
end
|
45
|
+
|
46
|
+
alias_method :models, :render_template
|
47
|
+
alias_method :api, :render_template
|
47
48
|
end
|
48
49
|
end
|
49
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mate Marjai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape
|