json_voorhees 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/generators/json_voorhees/setup_app/setup_app_generator.rb +14 -4
- data/lib/generators/json_voorhees/setup_app/templates/views/_footer.html.erb +10 -0
- data/lib/generators/json_voorhees/setup_app/templates/views/_header.html.erb +31 -0
- data/lib/generators/json_voorhees/setup_app/templates/views/admin_home_no_user +1 -0
- data/lib/generators/json_voorhees/setup_app/templates/views/admin_home_with_user +1 -0
- data/lib/generators/json_voorhees/setup_app/templates/views/application +3 -4
- data/lib/generators/json_voorhees/setup_app/templates/views/application.css.scss +2 -0
- data/lib/generators/json_voorhees/setup_engine/templates/application_controller.rb.erb +1 -1
- data/lib/json_voorhees/version.rb +1 -1
- metadata +7 -4
- data/lib/generators/json_voorhees/setup_app/templates/views/admin_no_user +0 -6
- data/lib/generators/json_voorhees/setup_app/templates/views/admin_with_user +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 878670ab1b564fa06f8cc57cdef277d8dd7029c0
|
4
|
+
data.tar.gz: f701b48a6325ae3f9d533e45cc17b323265be7ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4969344eab5dbdcc2bb818bf0ce3e5156204c38f82e838047e0d64f6856f271599ad2f107ebd318a4219bd211c5251307c8a84a28ae9ee56494390341837731c
|
7
|
+
data.tar.gz: 666d33437dfb4e7967ff3f6ecab84750bfe4c91aeab97af8ce4c3740d206de79c336e9ecb0c52c50a36c7e9ff0837dd309dae9ed9ea8787928bd1395154c6b6c
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ The factory girl factory may not be setup correction depending on your passed ty
|
|
47
47
|
2. (in app) rails g json_voorhees:setup_app
|
48
48
|
3. Create engine
|
49
49
|
4. Mount engine
|
50
|
-
5. (in engine) rails g json_voorhees:setup_engine [engine name]
|
50
|
+
5. (in engine) rails g json_voorhees:setup_engine [engine name] and make sure rails is the same version
|
51
51
|
6. Add json_voorhees to the engines gemspec
|
52
52
|
7. (in app) rails g json_voorhees:massive_scaffod [engine name] [resource name] [api_version] [field:type field:type]
|
53
53
|
8. Fix the engines route file
|
@@ -31,15 +31,17 @@ module JsonVoorhees
|
|
31
31
|
private
|
32
32
|
|
33
33
|
def make_admin
|
34
|
-
if options.user?
|
34
|
+
if options.user? && options.arcadex?
|
35
35
|
#copy admin page with user engine
|
36
|
-
copy_file "views/
|
36
|
+
copy_file "views/admin_home_with_user", "app/views/main/admin.html.erb"
|
37
37
|
else
|
38
38
|
#copy admin page without user engine
|
39
|
-
copy_file "views/
|
39
|
+
copy_file "views/admin_home_no_user", "app/views/main/admin.html.erb"
|
40
40
|
end
|
41
41
|
run "rm -f app/views/layouts/application.html.erb"
|
42
42
|
copy_file "views/application", "app/views/layouts/application.html.erb"
|
43
|
+
template "views/_header.html.erb", "app/views/layouts/_header.html.erb"
|
44
|
+
copy_file "views/_footer.html.erb", "app/views/layouts/_footer.html.erb"
|
43
45
|
inject_into_file 'app/controllers/application_controller.rb', after: "protect_from_forgery with: :exception\n" do <<-'RUBY'
|
44
46
|
|
45
47
|
#This needs to be put inside a config file. but this is good for now
|
@@ -48,6 +50,9 @@ module JsonVoorhees
|
|
48
50
|
|
49
51
|
RUBY
|
50
52
|
end
|
53
|
+
run "rm -f app/assets/stylesheets/application.css"
|
54
|
+
copy_file "views/application.css.scss", "app/assets/stylesheets/application.css.scss"
|
55
|
+
append_file "app/assets/javascripts/application.js", "//= require bootstrap-sprockets"
|
51
56
|
end
|
52
57
|
|
53
58
|
def include_middleware
|
@@ -70,6 +75,7 @@ module JsonVoorhees
|
|
70
75
|
run "rm -f app/controllers/app_index_controller.rb"
|
71
76
|
copy_file "app_index_controller.rb", "app/controllers/app_index_controller.rb"
|
72
77
|
generate "controller", "main admin"
|
78
|
+
#Copy admin views
|
73
79
|
run "rm -f spec/controllers/main_controller_spec.rb"
|
74
80
|
#Copy the views over
|
75
81
|
copy_file "views/app", "app/views/app_index/app.html.erb"
|
@@ -187,8 +193,12 @@ module JsonVoorhees
|
|
187
193
|
gem 'type_cartographer'
|
188
194
|
gem 'devise', "~> 3.2.4"
|
189
195
|
if options.arcadex?
|
190
|
-
gem 'arcadex'
|
196
|
+
gem 'arcadex'#, '~> 1.0.4'
|
191
197
|
end
|
198
|
+
if options.admin?
|
199
|
+
gem 'autoprefixer-rails'
|
200
|
+
gem 'bootstrap-sass', '~> 3.2.0'
|
201
|
+
end
|
192
202
|
end
|
193
203
|
|
194
204
|
def dev_test_gems
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<footer class="footer">
|
2
|
+
<nav class="navbar navbar-inverse navbar-fixed-bottom" role="navigation">
|
3
|
+
<div class="container">
|
4
|
+
<ul class="text-center">
|
5
|
+
<li style="display:block" class="text-info">App Name</li>
|
6
|
+
<li style="display:block"><a href="#">Github path</a></li>
|
7
|
+
</ul>
|
8
|
+
</div>
|
9
|
+
</nav>
|
10
|
+
</footer>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<nav class="navbar navbar-inverse" role="navigation">
|
2
|
+
<div class="container-fluid">
|
3
|
+
<!-- Collect the nav links, forms, and other content for toggling -->
|
4
|
+
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
5
|
+
<ul class="nav navbar-nav">
|
6
|
+
<li class="active"><%%= link_to "Admin", main_app.admin_path %></a></li>
|
7
|
+
<li class="dropdown">
|
8
|
+
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> Engines <span class="caret"></span></a>
|
9
|
+
<ul class="dropdown-menu" role="menu">
|
10
|
+
<% if options.user? %>
|
11
|
+
<li class="list-group-item active">People</li>
|
12
|
+
<li class="divider"></li>
|
13
|
+
<li><%%= link_to "Users", people.users_path %></li>
|
14
|
+
<li class="divider"></li>
|
15
|
+
<li class="list-group-item active">Arcadex</li>
|
16
|
+
<li class="divider"></li>
|
17
|
+
<li><%%= link_to "Tokens", arcadex.tokens_path %></li>
|
18
|
+
<% else %>
|
19
|
+
<!-- <li class="list-group-item active">User Engine</li> -->
|
20
|
+
<li class="divider"></li>
|
21
|
+
<% end %>
|
22
|
+
</ul>
|
23
|
+
</li>
|
24
|
+
</ul>
|
25
|
+
|
26
|
+
<ul class="nav navbar-nav navbar-right">
|
27
|
+
<li><%%= link_to "Root", main_app.root_path %></li>
|
28
|
+
</ul>
|
29
|
+
</div><!-- /.navbar-collapse -->
|
30
|
+
</div><!-- /.container-fluid -->
|
31
|
+
</nav>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1> Admin </h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1> Admin </h1>
|
@@ -8,12 +8,11 @@
|
|
8
8
|
</head>
|
9
9
|
<body>
|
10
10
|
|
11
|
+
<%= render 'layouts/header' %>
|
12
|
+
|
11
13
|
<%= yield %>
|
12
14
|
|
13
|
-
|
14
|
-
<br><br>
|
15
|
-
<%= link_to 'admin_home', main_app.admin_path %>
|
16
|
-
<% end %>
|
15
|
+
<%= render 'layouts/footer' %>
|
17
16
|
|
18
17
|
</body>
|
19
18
|
</html>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_voorhees
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cleophus Robinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -96,11 +96,14 @@ files:
|
|
96
96
|
- lib/generators/json_voorhees/setup_app/templates/user/user_model.rb
|
97
97
|
- lib/generators/json_voorhees/setup_app/templates/user/user_routes.rb
|
98
98
|
- lib/generators/json_voorhees/setup_app/templates/user/user_serializer.rb
|
99
|
-
- lib/generators/json_voorhees/setup_app/templates/views/
|
100
|
-
- lib/generators/json_voorhees/setup_app/templates/views/
|
99
|
+
- lib/generators/json_voorhees/setup_app/templates/views/_footer.html.erb
|
100
|
+
- lib/generators/json_voorhees/setup_app/templates/views/_header.html.erb
|
101
|
+
- lib/generators/json_voorhees/setup_app/templates/views/admin_home_no_user
|
102
|
+
- lib/generators/json_voorhees/setup_app/templates/views/admin_home_with_user
|
101
103
|
- lib/generators/json_voorhees/setup_app/templates/views/app
|
102
104
|
- lib/generators/json_voorhees/setup_app/templates/views/app_index
|
103
105
|
- lib/generators/json_voorhees/setup_app/templates/views/application
|
106
|
+
- lib/generators/json_voorhees/setup_app/templates/views/application.css.scss
|
104
107
|
- lib/generators/json_voorhees/setup_engine/USAGE
|
105
108
|
- lib/generators/json_voorhees/setup_engine/setup_engine_generator.rb
|
106
109
|
- lib/generators/json_voorhees/setup_engine/templates/api_controller.rb.erb
|