jungle_path 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,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9281d125031a92326508b2c2e95ca6ec1ff428d7
|
4
|
+
data.tar.gz: f7c3f540af52fd72836e2ffc52f1de0c642d78fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abe8387c20be14a497d9bea9188e03036f170e38d8c46145663e937e198c675ec9e7c151b5087b315c8f056611a6d15d6e12103a304bd12588f36417cfa9a7ab
|
7
|
+
data.tar.gz: 5b704801ffb5fb513c6e6f3f4e267bef3ed9a444d67c2ea401857a1ec56326d954e02b28e4d2f4cd516095fc4fc53d30b619076e583b81ab827840dcc812ca75
|
@@ -5,5 +5,5 @@ require 'jungle_path/gen/controllers'
|
|
5
5
|
require '../config/config.rb'
|
6
6
|
require '../schemas/schema'
|
7
7
|
|
8
|
-
JunglePath::Gen.controllers(
|
9
|
-
JunglePath::Gen.api(
|
8
|
+
JunglePath::Gen.controllers(jungle.application.root_dir, Schema::Base.models.values)
|
9
|
+
JunglePath::Gen.api(jungle.application.root_dir, Schema::Base.models.values)
|
@@ -1,20 +1,22 @@
|
|
1
1
|
# gen_controller.rb
|
2
2
|
require 'erb'
|
3
3
|
|
4
|
-
module
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
module JunglePath
|
5
|
+
module Gen
|
6
|
+
def self.controllers(app_root_path, tables, output_file='./controllers/generated.rb', controller_name_space='Controller', schema_require_relative='../schemas/schema', template_file=nil)
|
7
|
+
if template_file
|
8
|
+
template_file = ::File.expand_path(template_file, app_root_path)
|
9
|
+
else
|
10
|
+
template_file = ::File.expand_path('../controller/template.erb', ::File.dirname(__FILE__))
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
# template uses name_space and controller_name_space vars:``
|
14
|
+
template = ERB.new(File.read(template_file))
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
output_file = ::File.expand_path(output_file, app_root_path)
|
17
|
+
result = template.result(binding)
|
18
|
+
puts result
|
19
|
+
File.write(output_file, result)
|
20
|
+
end
|
19
21
|
end
|
20
22
|
end
|
data/lib/jungle_path/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jungle_path
|
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
|
- Michael VanZant
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|