json_voorhees 0.0.2 → 0.1.0

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.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +52 -4
  3. data/lib/generators/json_voorhees/app_make_authorizations/USAGE +1 -1
  4. data/lib/generators/json_voorhees/app_make_authorizations/app_make_authorizations_generator.rb +1 -0
  5. data/lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb +8 -1
  6. data/lib/generators/json_voorhees/app_make_tests/USAGE +1 -1
  7. data/lib/generators/json_voorhees/app_make_tests/app_make_tests_generator.rb +26 -0
  8. data/lib/generators/json_voorhees/app_make_tests/templates/factory.rb.erb +3 -1
  9. data/lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb +5 -0
  10. data/lib/generators/json_voorhees/app_make_tests/templates/no_auth_request.rb.erb +90 -0
  11. data/lib/generators/json_voorhees/app_scaffold/USAGE +9 -0
  12. data/lib/generators/json_voorhees/app_scaffold/app_scaffold_generator.rb +22 -0
  13. data/lib/generators/json_voorhees/engine_create_controller/USAGE +1 -1
  14. data/lib/generators/json_voorhees/engine_create_controller/engine_create_controller_generator.rb +11 -0
  15. data/lib/generators/json_voorhees/engine_create_controller/templates/controller_template.rb.erb +1 -1
  16. data/lib/generators/json_voorhees/engine_create_controller/templates/no_auth_controller_template.rb.erb +1 -1
  17. data/lib/generators/json_voorhees/engine_create_serializer/USAGE +1 -1
  18. data/lib/generators/json_voorhees/engine_create_serializer/engine_create_serializer_generator.rb +1 -0
  19. data/lib/generators/json_voorhees/engine_create_serializer/templates/serializer.rb.erb +13 -0
  20. data/lib/generators/json_voorhees/engine_scaffold/USAGE +9 -0
  21. data/lib/generators/json_voorhees/engine_scaffold/engine_scaffold_generator.rb +18 -0
  22. data/lib/generators/json_voorhees/massive_scaffold/USAGE +10 -0
  23. data/lib/generators/json_voorhees/massive_scaffold/massive_scaffold_generator.rb +23 -0
  24. data/lib/generators/json_voorhees/setup_app/setup_app_generator.rb +10 -0
  25. data/lib/json_voorhees/version.rb +1 -1
  26. data/test/lib/generators/json_voorhees/app_scaffold_generator_test.rb +16 -0
  27. data/test/lib/generators/json_voorhees/engine_scaffold_generator_test.rb +16 -0
  28. data/test/lib/generators/json_voorhees/massive_scaffold_generator_test.rb +16 -0
  29. data/test/test_app/Gemfile +23 -0
  30. data/test/test_app/Gemfile.lock +99 -1
  31. data/test/test_app/README.md +1 -0
  32. data/test/test_app/app/controllers/api/v1/api_controller.rb +26 -0
  33. data/test/test_app/app/controllers/app_index_controller.rb +4 -0
  34. data/test/test_app/app/controllers/application_controller.rb +5 -0
  35. data/test/test_app/app/controllers/main_controller.rb +4 -0
  36. data/test/test_app/app/views/app_index/app.html.erb +0 -0
  37. data/test/test_app/app/views/layouts/app_index.html.erb +9 -0
  38. data/test/test_app/app/views/layouts/application.html.erb +8 -3
  39. data/test/test_app/app/views/main/admin.html.erb +9 -0
  40. data/test/test_app/config/application.rb +4 -0
  41. data/test/test_app/config/routes.rb +8 -0
  42. data/test/test_app/db/development.sqlite3 +0 -0
  43. data/test/test_app/db/migrate/20140905145354_create_people_users.people.rb +12 -0
  44. data/test/test_app/db/migrate/20140905145355_create_arcadex_tokens.arcadex.rb +12 -0
  45. data/test/test_app/db/migrate/20140905145356_add_index_to_token.arcadex.rb +6 -0
  46. data/test/test_app/db/production.sqlite3 +0 -0
  47. data/test/test_app/db/schema.rb +19 -1
  48. data/test/test_app/db/test.sqlite3 +0 -0
  49. data/test/test_app/engines/people/Gemfile +14 -0
  50. data/test/test_app/engines/people/Gemfile.lock +92 -0
  51. data/test/test_app/engines/people/MIT-LICENSE +20 -0
  52. data/test/test_app/engines/people/README.md +1 -0
  53. data/test/test_app/engines/people/Rakefile +34 -0
  54. data/test/test_app/engines/people/app/assets/javascripts/people/application.js +13 -0
  55. data/test/test_app/engines/people/app/assets/javascripts/people/users.js +2 -0
  56. data/test/test_app/engines/people/app/assets/stylesheets/people/application.css +15 -0
  57. data/test/test_app/engines/people/app/assets/stylesheets/people/users.css +4 -0
  58. data/test/test_app/engines/people/app/assets/stylesheets/scaffold.css +56 -0
  59. data/test/test_app/engines/people/app/controllers/people/api/v1/application_controller.rb +5 -0
  60. data/test/test_app/engines/people/app/controllers/people/api/v1/users_controller.rb +124 -0
  61. data/test/test_app/engines/people/app/controllers/people/application_controller.rb +4 -0
  62. data/test/test_app/engines/people/app/controllers/people/users_controller.rb +62 -0
  63. data/test/test_app/engines/people/app/helpers/people/application_helper.rb +4 -0
  64. data/test/test_app/engines/people/app/helpers/people/users_helper.rb +4 -0
  65. data/test/test_app/engines/people/app/models/people/user.rb +26 -0
  66. data/test/test_app/engines/people/app/serializers/people/user_serializer.rb +39 -0
  67. data/test/test_app/engines/people/app/views/layouts/people/default/application.html.erb +14 -0
  68. data/test/test_app/engines/people/app/views/people/users/_form.html.erb +29 -0
  69. data/test/test_app/engines/people/app/views/people/users/edit.html.erb +6 -0
  70. data/test/test_app/engines/people/app/views/people/users/index.html.erb +29 -0
  71. data/test/test_app/engines/people/app/views/people/users/new.html.erb +5 -0
  72. data/test/test_app/engines/people/app/views/people/users/show.html.erb +19 -0
  73. data/test/test_app/engines/people/bin/rails +12 -0
  74. data/test/test_app/engines/people/config/routes.rb +24 -0
  75. data/test/test_app/engines/people/db/migrate/20140905145341_create_people_users.rb +11 -0
  76. data/test/test_app/engines/people/lib/people/engine.rb +5 -0
  77. data/test/test_app/engines/people/lib/people/version.rb +3 -0
  78. data/test/test_app/engines/people/lib/people.rb +4 -0
  79. data/test/test_app/engines/people/lib/tasks/people_tasks.rake +4 -0
  80. data/test/test_app/engines/people/people.gemspec +31 -0
  81. data/test/test_app/engines/people/test/controllers/people/users_controller_test.rb +51 -0
  82. data/test/test_app/{README.rdoc → engines/people/test/dummy/README.rdoc} +0 -0
  83. data/test/test_app/engines/people/test/dummy/Rakefile +6 -0
  84. data/test/test_app/engines/people/test/dummy/app/assets/javascripts/application.js +13 -0
  85. data/test/test_app/engines/people/test/dummy/app/assets/stylesheets/application.css +15 -0
  86. data/test/test_app/engines/people/test/dummy/app/controllers/application_controller.rb +5 -0
  87. data/test/test_app/engines/people/test/dummy/app/helpers/application_helper.rb +2 -0
  88. data/test/test_app/engines/people/test/dummy/app/views/layouts/application.html.erb +14 -0
  89. data/test/test_app/engines/people/test/dummy/bin/bundle +3 -0
  90. data/test/test_app/engines/people/test/dummy/bin/rails +4 -0
  91. data/test/test_app/engines/people/test/dummy/bin/rake +4 -0
  92. data/test/test_app/engines/people/test/dummy/config/application.rb +23 -0
  93. data/test/test_app/engines/people/test/dummy/config/boot.rb +5 -0
  94. data/test/test_app/engines/people/test/dummy/config/database.yml +25 -0
  95. data/test/test_app/engines/people/test/dummy/config/environment.rb +5 -0
  96. data/test/test_app/engines/people/test/dummy/config/environments/development.rb +37 -0
  97. data/test/test_app/engines/people/test/dummy/config/environments/production.rb +82 -0
  98. data/test/test_app/engines/people/test/dummy/config/environments/test.rb +39 -0
  99. data/test/test_app/engines/people/test/dummy/config/initializers/assets.rb +8 -0
  100. data/test/test_app/engines/people/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  101. data/test/test_app/engines/people/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  102. data/test/test_app/engines/people/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  103. data/test/test_app/engines/people/test/dummy/config/initializers/inflections.rb +16 -0
  104. data/test/test_app/engines/people/test/dummy/config/initializers/mime_types.rb +4 -0
  105. data/test/test_app/engines/people/test/dummy/config/initializers/session_store.rb +3 -0
  106. data/test/test_app/engines/people/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  107. data/test/test_app/engines/people/test/dummy/config/locales/en.yml +23 -0
  108. data/test/test_app/engines/people/test/dummy/config/routes.rb +4 -0
  109. data/test/test_app/engines/people/test/dummy/config/secrets.yml +22 -0
  110. data/test/test_app/engines/people/test/dummy/config.ru +4 -0
  111. data/test/test_app/engines/people/test/dummy/db/schema.rb +24 -0
  112. data/test/test_app/engines/people/test/dummy/public/404.html +67 -0
  113. data/test/test_app/engines/people/test/dummy/public/422.html +67 -0
  114. data/test/test_app/engines/people/test/dummy/public/500.html +66 -0
  115. data/test/test_app/engines/people/test/dummy/public/favicon.ico +0 -0
  116. data/test/test_app/engines/people/test/fixtures/people/users.yml +11 -0
  117. data/test/test_app/engines/people/test/helpers/people/users_helper_test.rb +6 -0
  118. data/test/test_app/engines/people/test/integration/navigation_test.rb +10 -0
  119. data/test/test_app/engines/people/test/models/people/user_test.rb +9 -0
  120. data/test/test_app/engines/people/test/people_test.rb +7 -0
  121. data/test/test_app/engines/people/test/test_helper.rb +15 -0
  122. data/test/test_app/gems/authorization/Gemfile +14 -0
  123. data/test/test_app/gems/authorization/Gemfile.lock +92 -0
  124. data/test/test_app/gems/authorization/MIT-LICENSE +20 -0
  125. data/test/test_app/gems/authorization/README.rdoc +3 -0
  126. data/test/test_app/gems/authorization/Rakefile +32 -0
  127. data/test/test_app/gems/authorization/authorization.gemspec +23 -0
  128. data/test/test_app/gems/authorization/lib/authorization/people/user.rb +82 -0
  129. data/test/test_app/gems/authorization/lib/authorization/version.rb +3 -0
  130. data/test/test_app/gems/authorization/lib/authorization.rb +3 -0
  131. data/test/test_app/gems/authorization/lib/tasks/authorization_tasks.rake +4 -0
  132. data/test/test_app/gems/authorization/test/authorization_test.rb +7 -0
  133. data/test/test_app/gems/authorization/test/dummy/README.rdoc +28 -0
  134. data/test/test_app/gems/authorization/test/dummy/Rakefile +6 -0
  135. data/test/test_app/gems/authorization/test/dummy/app/assets/javascripts/application.js +13 -0
  136. data/test/test_app/gems/authorization/test/dummy/app/assets/stylesheets/application.css +15 -0
  137. data/test/test_app/gems/authorization/test/dummy/app/controllers/application_controller.rb +5 -0
  138. data/test/test_app/gems/authorization/test/dummy/app/helpers/application_helper.rb +2 -0
  139. data/test/test_app/gems/authorization/test/dummy/app/views/layouts/application.html.erb +14 -0
  140. data/test/test_app/gems/authorization/test/dummy/bin/bundle +3 -0
  141. data/test/test_app/gems/authorization/test/dummy/bin/rails +4 -0
  142. data/test/test_app/gems/authorization/test/dummy/bin/rake +4 -0
  143. data/test/test_app/gems/authorization/test/dummy/config/application.rb +23 -0
  144. data/test/test_app/gems/authorization/test/dummy/config/boot.rb +5 -0
  145. data/test/test_app/gems/authorization/test/dummy/config/database.yml +25 -0
  146. data/test/test_app/gems/authorization/test/dummy/config/environment.rb +5 -0
  147. data/test/test_app/gems/authorization/test/dummy/config/environments/development.rb +37 -0
  148. data/test/test_app/gems/authorization/test/dummy/config/environments/production.rb +82 -0
  149. data/test/test_app/gems/authorization/test/dummy/config/environments/test.rb +39 -0
  150. data/test/test_app/gems/authorization/test/dummy/config/initializers/assets.rb +8 -0
  151. data/test/test_app/gems/authorization/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  152. data/test/test_app/gems/authorization/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  153. data/test/test_app/gems/authorization/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  154. data/test/test_app/gems/authorization/test/dummy/config/initializers/inflections.rb +16 -0
  155. data/test/test_app/gems/authorization/test/dummy/config/initializers/mime_types.rb +4 -0
  156. data/test/test_app/gems/authorization/test/dummy/config/initializers/session_store.rb +3 -0
  157. data/test/test_app/gems/authorization/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  158. data/test/test_app/gems/authorization/test/dummy/config/locales/en.yml +23 -0
  159. data/test/test_app/gems/authorization/test/dummy/config/routes.rb +56 -0
  160. data/test/test_app/gems/authorization/test/dummy/config/secrets.yml +22 -0
  161. data/test/test_app/gems/authorization/test/dummy/config.ru +4 -0
  162. data/test/test_app/gems/authorization/test/dummy/public/404.html +67 -0
  163. data/test/test_app/gems/authorization/test/dummy/public/422.html +67 -0
  164. data/test/test_app/gems/authorization/test/dummy/public/500.html +66 -0
  165. data/test/test_app/gems/authorization/test/dummy/public/favicon.ico +0 -0
  166. data/test/test_app/gems/authorization/test/test_helper.rb +15 -0
  167. data/test/test_app/log/development.log +195 -0
  168. data/test/test_app/log/production.log +20 -0
  169. data/test/test_app/log/test.log +8427 -0
  170. data/test/test_app/spec/controllers/app_index_controller_spec.rb +12 -0
  171. data/test/test_app/spec/engines/people/api/v1/models/user_spec.rb +59 -0
  172. data/test/test_app/spec/engines/people/api/v1/requests/user_spec.rb +154 -0
  173. data/test/test_app/spec/engines/people/api/v1/routing/user_spec.rb +77 -0
  174. data/test/test_app/spec/factories/people_user_factory.rb +14 -0
  175. data/test/test_app/spec/rails_helper.rb +47 -0
  176. data/test/test_app/spec/spec_helper.rb +78 -0
  177. data/test/test_app/spec/support/factory_girl.rb +16 -0
  178. data/test/test_app/spec/support/request_helpers.rb +7 -0
  179. metadata +293 -6
  180. data/test/test_app/test/test_helper.rb +0 -10
@@ -1,9 +1,26 @@
1
1
  PATH
2
2
  remote: ../../../json_voorhees
3
3
  specs:
4
- json_voorhees (0.0.1)
4
+ json_voorhees (0.0.2)
5
5
  rails (>= 4.0.0)
6
6
 
7
+ PATH
8
+ remote: engines/people
9
+ specs:
10
+ people (0.0.1)
11
+ active_model_serializers (~> 0.8.0)
12
+ arcadex
13
+ bcrypt (~> 3.1.7)
14
+ rails (~> 4.1.5)
15
+ rails-api
16
+ type_cartographer
17
+
18
+ PATH
19
+ remote: gems/authorization
20
+ specs:
21
+ authorization (0.0.1)
22
+ rails (~> 4.1.5)
23
+
7
24
  GEM
8
25
  remote: https://rubygems.org/
9
26
  specs:
@@ -20,6 +37,8 @@ GEM
20
37
  activesupport (= 4.1.5)
21
38
  builder (~> 3.1)
22
39
  erubis (~> 2.7.0)
40
+ active_model_serializers (0.8.2)
41
+ activemodel (>= 3.0)
23
42
  activemodel (4.1.5)
24
43
  activesupport (= 4.1.5)
25
44
  builder (~> 3.1)
@@ -33,8 +52,24 @@ GEM
33
52
  minitest (~> 5.1)
34
53
  thread_safe (~> 0.1)
35
54
  tzinfo (~> 1.1)
55
+ annotate (2.6.5)
56
+ activerecord (>= 2.3.0)
57
+ rake (>= 0.8.7)
58
+ arcadex (1.0.4)
59
+ devise (>= 3.2.4)
60
+ rails (>= 4.0.0)
36
61
  arel (5.0.1.20140414130214)
62
+ bcrypt (3.1.7)
63
+ better_errors (1.1.0)
64
+ coderay (>= 1.0.0)
65
+ erubis (>= 2.6.6)
66
+ binding_of_caller (0.7.2)
67
+ debug_inspector (>= 0.0.1)
37
68
  builder (3.2.2)
69
+ byebug (3.2.0)
70
+ columnize (~> 0.8)
71
+ debugger-linecache (~> 1.2)
72
+ coderay (1.1.0)
38
73
  coffee-rails (4.0.1)
39
74
  coffee-script (>= 2.2.0)
40
75
  railties (>= 4.0.0, < 5.0)
@@ -42,8 +77,27 @@ GEM
42
77
  coffee-script-source
43
78
  execjs
44
79
  coffee-script-source (1.8.0)
80
+ columnize (0.8.9)
81
+ database_cleaner (1.3.0)
82
+ debug_inspector (0.0.2)
83
+ debugger-linecache (1.2.0)
84
+ devise (3.2.4)
85
+ bcrypt (~> 3.0)
86
+ orm_adapter (~> 0.1)
87
+ railties (>= 3.2.6, < 5)
88
+ thread_safe (~> 0.1)
89
+ warden (~> 1.2.3)
90
+ diff-lcs (1.2.5)
45
91
  erubis (2.7.0)
46
92
  execjs (2.2.1)
93
+ factory_girl (4.4.0)
94
+ activesupport (>= 3.0.0)
95
+ factory_girl_rails (4.4.1)
96
+ factory_girl (~> 4.4.0)
97
+ railties (>= 3.0.0)
98
+ figaro (0.7.0)
99
+ bundler (~> 1.0)
100
+ rails (>= 3, < 5)
47
101
  hike (1.2.3)
48
102
  i18n (0.6.11)
49
103
  jbuilder (2.1.3)
@@ -53,12 +107,16 @@ GEM
53
107
  railties (>= 3.0, < 5.0)
54
108
  thor (>= 0.14, < 2.0)
55
109
  json (1.8.1)
110
+ kaminari (0.16.1)
111
+ actionpack (>= 3.0.0)
112
+ activesupport (>= 3.0.0)
56
113
  mail (2.5.4)
57
114
  mime-types (~> 1.16)
58
115
  treetop (~> 1.4.8)
59
116
  mime-types (1.25.1)
60
117
  minitest (5.4.1)
61
118
  multi_json (1.10.1)
119
+ orm_adapter (0.5.0)
62
120
  polyglot (0.3.5)
63
121
  rack (1.5.2)
64
122
  rack-test (0.6.2)
@@ -73,6 +131,9 @@ GEM
73
131
  bundler (>= 1.3.0, < 2.0)
74
132
  railties (= 4.1.5)
75
133
  sprockets-rails (~> 2.0)
134
+ rails-api (0.2.1)
135
+ actionpack (>= 3.2.11)
136
+ railties (>= 3.2.11)
76
137
  railties (4.1.5)
77
138
  actionpack (= 4.1.5)
78
139
  activesupport (= 4.1.5)
@@ -81,6 +142,22 @@ GEM
81
142
  rake (10.3.2)
82
143
  rdoc (4.1.1)
83
144
  json (~> 1.4)
145
+ rspec-core (3.0.4)
146
+ rspec-support (~> 3.0.0)
147
+ rspec-expectations (3.0.4)
148
+ diff-lcs (>= 1.2.0, < 2.0)
149
+ rspec-support (~> 3.0.0)
150
+ rspec-mocks (3.0.4)
151
+ rspec-support (~> 3.0.0)
152
+ rspec-rails (3.0.2)
153
+ actionpack (>= 3.0)
154
+ activesupport (>= 3.0)
155
+ railties (>= 3.0)
156
+ rspec-core (~> 3.0.0)
157
+ rspec-expectations (~> 3.0.0)
158
+ rspec-mocks (~> 3.0.0)
159
+ rspec-support (~> 3.0.0)
160
+ rspec-support (3.0.4)
84
161
  sass (3.2.19)
85
162
  sass-rails (4.0.3)
86
163
  railties (>= 4.0.0, < 5.0)
@@ -109,24 +186,45 @@ GEM
109
186
  polyglot (>= 0.3.1)
110
187
  turbolinks (2.3.0)
111
188
  coffee-rails
189
+ type_cartographer (1.0.0)
190
+ rails (>= 4.0.0)
112
191
  tzinfo (1.2.2)
113
192
  thread_safe (~> 0.1)
114
193
  uglifier (2.5.3)
115
194
  execjs (>= 0.3.0)
116
195
  json (>= 1.8.0)
196
+ warden (1.2.3)
197
+ rack (>= 1.0)
117
198
 
118
199
  PLATFORMS
119
200
  ruby
120
201
 
121
202
  DEPENDENCIES
203
+ active_model_serializers (~> 0.8.0)
204
+ annotate (>= 2.6.0)
205
+ arcadex (~> 1.0.4)
206
+ authorization!
207
+ bcrypt (~> 3.1.7)
208
+ better_errors (~> 1.1.0)
209
+ binding_of_caller (~> 0.7.1)
210
+ byebug (~> 3.2.0)
122
211
  coffee-rails (~> 4.0.0)
212
+ database_cleaner (~> 1.3.0)
213
+ devise (~> 3.2.4)
214
+ factory_girl_rails (~> 4.0)
215
+ figaro (~> 0.7.0)
123
216
  jbuilder (~> 2.0)
124
217
  jquery-rails
125
218
  json_voorhees!
219
+ kaminari
220
+ people!
126
221
  rails (= 4.1.5)
222
+ rails-api
223
+ rspec-rails (~> 3.0.0)
127
224
  sass-rails (~> 4.0.3)
128
225
  sdoc (~> 0.4.0)
129
226
  spring
130
227
  sqlite3
131
228
  turbolinks
229
+ type_cartographer
132
230
  uglifier (>= 1.3.0)
@@ -0,0 +1 @@
1
+ # Describe your application here
@@ -0,0 +1,26 @@
1
+ class Api::V1::ApiController < ::ActionController::API
2
+
3
+ before_action :authenticate_user
4
+
5
+ private
6
+
7
+ def authenticate_user
8
+ #["current_user","current_token"] Make this true to check for email also
9
+ @instance_hash = ::Arcadex.full_authentication(params,request,false)
10
+ if @instance_hash.nil?
11
+ render :json => {errors: "User is not logged in, register or log in"} , status: :unauthorized
12
+ end
13
+ end
14
+
15
+ def current_user
16
+ if !@instance_hash.nil?
17
+ @instance_hash["current_user"]
18
+ end
19
+ end
20
+
21
+ def current_token
22
+ if !@instance_hash.nil?
23
+ @instance_hash["current_token"]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,4 @@
1
+ class AppIndexController < ActionController::Base
2
+ def app
3
+ end
4
+ end
@@ -2,4 +2,9 @@ class ApplicationController < ActionController::Base
2
2
  # Prevent CSRF attacks by raising an exception.
3
3
  # For APIs, you may want to use :null_session instead.
4
4
  protect_from_forgery with: :exception
5
+
6
+ #This needs to be put inside a config file. but this is good for now
7
+ #This only requires the password for the admin section of the website
8
+ http_basic_authenticate_with name: "admin", password: "password"
9
+
5
10
  end
@@ -0,0 +1,4 @@
1
+ class MainController < ApplicationController
2
+ def admin
3
+ end
4
+ end
File without changes
@@ -0,0 +1,9 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title></title>
5
+ </head>
6
+ <body>
7
+ <%= yield %>
8
+ </body>
9
+ </html>
@@ -1,14 +1,19 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>TestApp</title>
5
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
- <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
4
+ <title></title>
5
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
9
9
  <body>
10
10
 
11
11
  <%= yield %>
12
12
 
13
+ <% if !current_page?(main_app.root_url) %>
14
+ <br><br>
15
+ <%= link_to 'admin_home', main_app.admin_path %>
16
+ <% end %>
17
+
13
18
  </body>
14
19
  </html>
@@ -0,0 +1,9 @@
1
+ <h1>ADMIN</h1>
2
+
3
+ <ul>
4
+ <li>People Engine</li>
5
+ <li><%= link_to 'user_index', people.users_path %></li>
6
+
7
+ <li>Arcadex Engine</li>
8
+ <li><%= link_to 'token_index', arcadex.tokens_path %></li>
9
+ </ul>
@@ -8,6 +8,10 @@ Bundler.require(*Rails.groups)
8
8
 
9
9
  module TestApp
10
10
  class Application < Rails::Application
11
+
12
+ #So Rails-Api doesn't remove all of the middleware
13
+ config.api_only = false
14
+
11
15
  # Settings in config/environments/* take precedence over those specified here.
12
16
  # Application configuration should go into files in config/initializers
13
17
  # -- all .rb files in that directory are automatically loaded.
@@ -1,4 +1,12 @@
1
1
  Rails.application.routes.draw do
2
+ get 'main/admin'
3
+
4
+ get 'app_index/app'
5
+
6
+ get 'admin' => 'main#admin', as: "admin" #admin_path
7
+ root to: "app_index#app"
8
+ mount Arcadex::Engine, at: '/'
9
+ mount People::Engine, at: '/'
2
10
  # The priority is based upon order of creation: first created -> highest priority.
3
11
  # See how all your routes lay out with "rake routes".
4
12
 
Binary file
@@ -0,0 +1,12 @@
1
+ # This migration comes from people (originally 20140905145341)
2
+ class CreatePeopleUsers < ActiveRecord::Migration
3
+ def change
4
+ create_table :people_users do |t|
5
+ t.string :username
6
+ t.string :email
7
+ t.string :password_digest
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # This migration comes from arcadex (originally 20140806194834)
2
+ class CreateArcadexTokens < ActiveRecord::Migration
3
+ def change
4
+ create_table :arcadex_tokens do |t|
5
+ t.integer :imageable_id
6
+ t.string :imageable_type
7
+ t.string :auth_token
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from arcadex (originally 20140806202340)
2
+ class AddIndexToToken < ActiveRecord::Migration
3
+ def change
4
+ add_index :arcadex_tokens, :auth_token, unique: true
5
+ end
6
+ end
Binary file
@@ -11,6 +11,24 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 0) do
14
+ ActiveRecord::Schema.define(version: 20140905145356) do
15
+
16
+ create_table "arcadex_tokens", force: true do |t|
17
+ t.integer "imageable_id"
18
+ t.string "imageable_type"
19
+ t.string "auth_token"
20
+ t.datetime "created_at"
21
+ t.datetime "updated_at"
22
+ end
23
+
24
+ add_index "arcadex_tokens", ["auth_token"], name: "index_arcadex_tokens_on_auth_token", unique: true
25
+
26
+ create_table "people_users", force: true do |t|
27
+ t.string "username"
28
+ t.string "email"
29
+ t.string "password_digest"
30
+ t.datetime "created_at"
31
+ t.datetime "updated_at"
32
+ end
15
33
 
16
34
  end
Binary file
@@ -0,0 +1,14 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Declare your gem's dependencies in people.gemspec.
4
+ # Bundler will treat runtime dependencies like base dependencies, and
5
+ # development dependencies will be added by default to the :development group.
6
+ gemspec
7
+
8
+ # Declare any dependencies that are still in development here instead of in
9
+ # your gemspec. These might include edge Rails or gems from your path or
10
+ # Git. Remember to move these dependencies to your gemspec before releasing
11
+ # your gem to rubygems.org.
12
+
13
+ # To use debugger
14
+ # gem 'debugger'
@@ -0,0 +1,92 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ people (0.0.1)
5
+ rails (~> 4.1.5)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (4.1.5)
11
+ actionpack (= 4.1.5)
12
+ actionview (= 4.1.5)
13
+ mail (~> 2.5.4)
14
+ actionpack (4.1.5)
15
+ actionview (= 4.1.5)
16
+ activesupport (= 4.1.5)
17
+ rack (~> 1.5.2)
18
+ rack-test (~> 0.6.2)
19
+ actionview (4.1.5)
20
+ activesupport (= 4.1.5)
21
+ builder (~> 3.1)
22
+ erubis (~> 2.7.0)
23
+ activemodel (4.1.5)
24
+ activesupport (= 4.1.5)
25
+ builder (~> 3.1)
26
+ activerecord (4.1.5)
27
+ activemodel (= 4.1.5)
28
+ activesupport (= 4.1.5)
29
+ arel (~> 5.0.0)
30
+ activesupport (4.1.5)
31
+ i18n (~> 0.6, >= 0.6.9)
32
+ json (~> 1.7, >= 1.7.7)
33
+ minitest (~> 5.1)
34
+ thread_safe (~> 0.1)
35
+ tzinfo (~> 1.1)
36
+ arel (5.0.1.20140414130214)
37
+ builder (3.2.2)
38
+ erubis (2.7.0)
39
+ hike (1.2.3)
40
+ i18n (0.6.11)
41
+ json (1.8.1)
42
+ mail (2.5.4)
43
+ mime-types (~> 1.16)
44
+ treetop (~> 1.4.8)
45
+ mime-types (1.25.1)
46
+ minitest (5.4.1)
47
+ multi_json (1.10.1)
48
+ polyglot (0.3.5)
49
+ rack (1.5.2)
50
+ rack-test (0.6.2)
51
+ rack (>= 1.0)
52
+ rails (4.1.5)
53
+ actionmailer (= 4.1.5)
54
+ actionpack (= 4.1.5)
55
+ actionview (= 4.1.5)
56
+ activemodel (= 4.1.5)
57
+ activerecord (= 4.1.5)
58
+ activesupport (= 4.1.5)
59
+ bundler (>= 1.3.0, < 2.0)
60
+ railties (= 4.1.5)
61
+ sprockets-rails (~> 2.0)
62
+ railties (4.1.5)
63
+ actionpack (= 4.1.5)
64
+ activesupport (= 4.1.5)
65
+ rake (>= 0.8.7)
66
+ thor (>= 0.18.1, < 2.0)
67
+ rake (10.3.2)
68
+ sprockets (2.12.1)
69
+ hike (~> 1.2)
70
+ multi_json (~> 1.0)
71
+ rack (~> 1.0)
72
+ tilt (~> 1.1, != 1.3.0)
73
+ sprockets-rails (2.1.4)
74
+ actionpack (>= 3.0)
75
+ activesupport (>= 3.0)
76
+ sprockets (~> 2.8)
77
+ sqlite3 (1.3.9)
78
+ thor (0.19.1)
79
+ thread_safe (0.3.4)
80
+ tilt (1.4.1)
81
+ treetop (1.4.15)
82
+ polyglot
83
+ polyglot (>= 0.3.1)
84
+ tzinfo (1.2.2)
85
+ thread_safe (~> 0.1)
86
+
87
+ PLATFORMS
88
+ ruby
89
+
90
+ DEPENDENCIES
91
+ people!
92
+ sqlite3
@@ -0,0 +1,20 @@
1
+ Copyright 2014 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ # Describe your engine here
@@ -0,0 +1,34 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'People'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+
22
+ Bundler::GemHelper.install_tasks
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+
34
+ task default: :test
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -0,0 +1,5 @@
1
+ module People
2
+ class Api::V1::ApplicationController < ::Api::V1::ApiController
3
+
4
+ end
5
+ end