json_voorhees 1.0.0 → 1.3.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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -48
  3. data/lib/generators/json_voorhees/app_environment/USAGE +8 -0
  4. data/lib/generators/json_voorhees/app_environment/app_environment_generator.rb +93 -0
  5. data/lib/generators/json_voorhees/app_make_admin/app_make_admin_generator.rb +19 -34
  6. data/lib/generators/json_voorhees/app_make_tests/app_make_tests_generator.rb +5 -19
  7. data/lib/generators/json_voorhees/app_make_user/app_make_user_generator.rb +13 -73
  8. data/lib/generators/json_voorhees/app_scaffold/app_scaffold_generator.rb +2 -12
  9. data/lib/generators/json_voorhees/engine_create_controller/engine_create_controller_generator.rb +1 -6
  10. data/lib/generators/json_voorhees/engine_scaffold/engine_scaffold_generator.rb +3 -12
  11. data/lib/generators/json_voorhees/massive_scaffold/massive_scaffold_generator.rb +12 -28
  12. data/lib/generators/json_voorhees/setup_app/setup_app_generator.rb +32 -97
  13. data/lib/generators/json_voorhees/setup_app/templates/api_controller_with_arcadex.rb +8 -23
  14. data/lib/generators/json_voorhees/setup_engine/setup_engine_generator.rb +0 -3
  15. data/lib/json_voorhees/version.rb +1 -1
  16. data/test/fresh_copy/test_app/Gemfile +12 -17
  17. data/test/fresh_copy/test_app/Gemfile.lock +56 -61
  18. data/test/fresh_copy/test_app/Rakefile +1 -1
  19. data/test/fresh_copy/test_app/app/assets/stylesheets/application.css +5 -3
  20. data/test/fresh_copy/test_app/app/views/layouts/application.html.erb +2 -2
  21. data/test/fresh_copy/test_app/bin/rails +4 -0
  22. data/test/fresh_copy/test_app/bin/rake +4 -0
  23. data/test/fresh_copy/test_app/bin/spring +18 -0
  24. data/test/fresh_copy/test_app/config/database.yml +8 -8
  25. data/test/fresh_copy/test_app/config/environment.rb +1 -1
  26. data/test/fresh_copy/test_app/config/environments/development.rb +10 -2
  27. data/test/fresh_copy/test_app/config/environments/production.rb +7 -9
  28. data/test/fresh_copy/test_app/config/environments/test.rb +5 -2
  29. data/test/fresh_copy/test_app/config/initializers/assets.rb +8 -0
  30. data/test/fresh_copy/test_app/config/initializers/cookies_serializer.rb +3 -0
  31. data/test/fresh_copy/test_app/config/initializers/mime_types.rb +0 -1
  32. data/test/fresh_copy/test_app/config/initializers/session_store.rb +1 -1
  33. data/test/fresh_copy/test_app/config/routes.rb +1 -1
  34. data/test/fresh_copy/test_app/config/secrets.yml +22 -0
  35. data/test/fresh_copy/test_app/public/404.html +20 -11
  36. data/test/fresh_copy/test_app/public/422.html +20 -11
  37. data/test/fresh_copy/test_app/public/500.html +19 -10
  38. data/test/fresh_copy/test_app/test/test_helper.rb +1 -6
  39. data/test/lib/generators/json_voorhees/app_environment_generator_test.rb +16 -0
  40. metadata +15 -21
  41. data/lib/generators/json_voorhees/app_make_admin/templates/views/admin_home_no_user +0 -1
  42. data/lib/generators/json_voorhees/app_make_tests/templates/no_auth_request.rb.erb +0 -114
  43. data/lib/generators/json_voorhees/app_make_user/templates/active_admin_register.rb.erb +0 -83
  44. data/lib/generators/json_voorhees/app_make_user/templates/user/include_authorization.rb +0 -4
  45. data/lib/generators/json_voorhees/app_make_user/templates/user/specs/factory_girl.rb +0 -14
  46. data/lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb +0 -61
  47. data/lib/generators/json_voorhees/app_make_user/templates/user/specs/no_arcadex_request_specs.rb +0 -85
  48. data/lib/generators/json_voorhees/app_make_user/templates/user/specs/request_specs.rb +0 -244
  49. data/lib/generators/json_voorhees/app_make_user/templates/user/specs/route_specs.rb +0 -91
  50. data/lib/generators/json_voorhees/app_make_user/templates/user/user_authorizations.rb +0 -92
  51. data/lib/generators/json_voorhees/app_make_user/templates/user/user_controller.rb +0 -169
  52. data/lib/generators/json_voorhees/app_make_user/templates/user/user_model.rb +0 -35
  53. data/lib/generators/json_voorhees/app_make_user/templates/user/user_routes.rb +0 -32
  54. data/lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb +0 -43
  55. data/lib/generators/json_voorhees/engine_create_controller/templates/no_auth_controller_template.rb.erb +0 -61
  56. data/lib/generators/json_voorhees/setup_app/templates/api_controller_no_arcadex.rb +0 -33
  57. data/test/fresh_copy/test_app/config/initializers/secret_token.rb +0 -12
@@ -3,43 +3,40 @@ require 'bundler'
3
3
  module JsonVoorhees
4
4
  class SetupAppGenerator < Rails::Generators::Base
5
5
  source_root File.expand_path('../templates', __FILE__)
6
- class_option :arcadex, :type => :boolean, :default => true, :description => "Include arcadex gem and authentication in api_controller"
7
- class_option :user, :type => :boolean, :default => true, :description => "Create an engine for the user class"
8
- class_option :test, :type => :boolean, :default => false, :description => "Set true if running tests to skip things like bundle update and git"
9
- class_option :admin, :type => :boolean, :default => true, :description => "Create an admin page"
10
- class_option :active_admin, :type => :boolean, :default => true, :description => "Setup the active_admin gem"
11
6
 
12
7
  def sprint
13
8
  create_file_structure
9
+ clone_arcadex
14
10
  all_gems
15
11
  run_bundle
16
12
  rspec
17
13
  api_controller
18
14
  include_middleware
19
- cors_route
20
- if options.admin?
21
- make_admin
22
- end
23
- if options.user?
24
- make_user
25
- end
15
+ make_admin
16
+ make_user
26
17
  run "rake railties:install:migrations"
27
18
  run_db_migrations
28
19
  routes
29
20
  make_controllers
30
- if options.arcadex? && options.active_admin?
31
- #run "rails generate active_admin:resource arcadex::token"
32
- custom_active_admin
33
- end
34
- if options.active_admin?
35
- seed_database
36
- end
21
+ custom_active_admin
22
+ seed_database
23
+ initializers
37
24
  run "wheneverize"
38
25
  run_git
39
26
  end
40
27
 
41
28
  private
42
29
 
30
+ def clone_arcadex
31
+ run "git clone https://www.github.com/cleor41/arcadex"
32
+ run "rm -rf arcadex/.git"
33
+ run "mv arcadex engines/arcadex"
34
+ end
35
+
36
+ def initializers
37
+ run "rails g json_voorhees:app_environment"
38
+ end
39
+
43
40
  def seed_database
44
41
  #db/seeds.rb
45
42
  inject_into_file "db/seeds.rb", after: "# Mayor.create(name: 'Emanuel', city: cities.first)\n" do <<-'RUBY'
@@ -56,57 +53,19 @@ module JsonVoorhees
56
53
  end
57
54
 
58
55
  def make_admin
59
- if !options.active_admin?
60
- if !options.arcadex? && !options.user?
61
- run "rails g json_voorhees:app_make_admin --skip-arcadex --skip-user --skip-active_admin"
62
- end
63
- if !options.arcadex? && options.user?
64
- run "rails g json_voorhees:app_make_admin --skip-arcadex --skip-active_admin"
65
- end
66
- if !options.user? && options.arcadex?
67
- run "rails g json_voorhees:app_make_admin --skip-user --skip-active_admin"
68
- end
69
- if options.user? && options.arcadex?
70
- run "rails g json_voorhees:app_make_admin --skip-active_admin"
71
- end
72
- else
73
- if !options.arcadex? && !options.user?
74
- run "rails g json_voorhees:app_make_admin --skip-arcadex --skip-user"
75
- end
76
- if !options.arcadex? && options.user?
77
- run "rails g json_voorhees:app_make_admin --skip-arcadex"
78
- end
79
- if !options.user? && options.arcadex?
80
- run "rails g json_voorhees:app_make_admin --skip-user"
81
- end
82
- if options.user? && options.arcadex?
83
- run "rails g json_voorhees:app_make_admin"
84
- end
85
- end
56
+ run "rails g json_voorhees:app_make_admin"
86
57
  end
87
58
 
88
59
  def make_user
89
- if !options.active_admin?
90
- if !options.arcadex?
91
- run "rails g json_voorhees:app_make_user --skip-arcadex --skip-active_admin"
92
- else
93
- run "rails g json_voorhees:app_make_user --skip-active_admin"
94
- end
95
- else
96
- if !options.arcadex?
97
- run "rails g json_voorhees:app_make_user --skip-arcadex"
98
- else
99
- run "rails g json_voorhees:app_make_user"
100
- end
101
- end
60
+ run "rails g json_voorhees:app_make_user"
102
61
  run_bundle
103
62
  end
104
63
 
105
64
  def include_middleware
106
65
  inject_into_file 'config/application.rb', after: "class Application < Rails::Application\n" do <<-'RUBY'
107
66
 
108
- #So Rails-Api doesn't remove all of the middleware
109
- config.api_only = false
67
+ #So Rails-Api doesn't remove all of the middleware
68
+ config.api_only = false
110
69
 
111
70
  RUBY
112
71
  end
@@ -120,32 +79,17 @@ module JsonVoorhees
120
79
  end
121
80
  end
122
81
 
123
- def cors_route
124
- route "#This is to handle the CORS preflight request, it only catches the options action.
125
- controller \'api/v1/api\' do
126
- match \'*unmatched_route\', :to => \'api/v1/api#route_options\', via: [:options]
127
- end"
128
- end
129
-
130
82
  def make_controllers
131
83
  generate "controller", "app_index app"
132
84
  run "rm -f app/controllers/app_index_controller.rb"
133
85
  copy_file "app_index_controller.rb", "app/controllers/app_index_controller.rb"
134
- if !options.active_admin? && options.admin?
135
- generate "controller", "main admin"
136
- run "rm -f spec/controllers/main_controller_spec.rb"
137
- end
138
86
  #Copy the views over
139
87
  copy_file "views/app", "app/views/app_index/app.html.erb"
140
88
  copy_file "views/app_index", "app/views/layouts/app_index.html.erb"
141
89
  end
142
90
 
143
91
  def api_controller
144
- if options.arcadex?
145
- copy_file "api_controller_with_arcadex.rb", "app/controllers/api/v1/api_controller.rb"
146
- else
147
- copy_file "api_controller_no_arcadex.rb", "app/controllers/api/v1/api_controller.rb"
148
- end
92
+ copy_file "api_controller_with_arcadex.rb", "app/controllers/api/v1/api_controller.rb"
149
93
  end
150
94
 
151
95
  def rspec
@@ -187,19 +131,14 @@ module JsonVoorhees
187
131
  gem 'bcrypt', '~> 3.1.7'
188
132
  gem 'type_cartographer'
189
133
  gem 'devise', "~> 3.2.4"
190
- if options.arcadex?
191
- gem 'arcadex', '~> 1.1.3'
192
- end
193
- if options.admin?
194
- gem 'autoprefixer-rails'
195
- gem 'bootstrap-sass', '~> 3.2.0'
196
- end
197
- if options.active_admin?
198
- gem 'activeadmin', :git => 'https://github.com/activeadmin/activeadmin.git', :branch => "master"
199
- gem 'defcon', '~> 1.2.3'
200
- end
134
+ gem 'arcadex', :path => "engines/arcadex"
135
+ gem 'autoprefixer-rails'
136
+ gem 'bootstrap-sass', '~> 3.2.0'
137
+ gem 'activeadmin', :git => 'https://github.com/activeadmin/activeadmin.git', :branch => "master"
138
+ #gem 'defcon', '~> 1.2.3'
201
139
  gem 'authorization', :path => "gems/authorization"
202
140
  gem 'whenever', :require => false
141
+ gem 'rack-cors', :require => 'rack/cors'
203
142
  #gem 'websocket-rails'
204
143
  end
205
144
 
@@ -214,10 +153,8 @@ module JsonVoorhees
214
153
  end
215
154
 
216
155
  def run_bundle
217
- if !options.test?
218
- Bundler.with_clean_env do
219
- run "bundle install"
220
- end
156
+ Bundler.with_clean_env do
157
+ run "bundle install"
221
158
  end
222
159
  end
223
160
 
@@ -228,11 +165,9 @@ module JsonVoorhees
228
165
  end
229
166
 
230
167
  def run_git
231
- if !options.test?
232
- git :init
233
- git add: "."
234
- run "git commit -m \"Initial commit\""
235
- end
168
+ git :init
169
+ git add: "."
170
+ run "git commit -m \"Initial commit\""
236
171
  end
237
172
 
238
173
  end
@@ -1,8 +1,6 @@
1
1
  class Api::V1::ApiController < ::ActionController::API
2
2
 
3
3
  before_action :authenticate_user
4
- after_filter :cors_set_access_control_headers
5
- skip_before_filter :authenticate_user, :only => [:route_options]
6
4
 
7
5
  def route_options
8
6
  cors_preflight_check
@@ -29,13 +27,18 @@ class Api::V1::ApiController < ::ActionController::API
29
27
  end
30
28
 
31
29
  def set_hash
32
- #["current_user","current_token"] Make this true to check for email also
33
- @instance_hash = ::Arcadex::Authentication.full_authentication(params,request,false)
30
+ #["current_owner","current_token"] Make this true to check for email also
31
+ #@instance_hash = ::Arcadex::Authentication.get_instance(params,request,"Auth-Token")
32
+ @instance_hash = ::Arcadex::Authentication.authenticate_owner_with_index(params,request,"Auth-Token","Email","email",true)
33
+ #Ignore the token if the user's account is locked
34
+ if !current_user.nil? && current_user.locked
35
+ @instance_hash = nil
36
+ end
34
37
  end
35
38
 
36
39
  def current_user
37
40
  if !@instance_hash.nil?
38
- return @instance_hash["current_user"]
41
+ return @instance_hash["current_owner"]
39
42
  else
40
43
  return nil
41
44
  end
@@ -48,23 +51,5 @@ class Api::V1::ApiController < ::ActionController::API
48
51
  return nil
49
52
  end
50
53
  end
51
-
52
- def cors_set_access_control_headers
53
- response.headers['Access-Control-Allow-Origin'] = '*'
54
- response.headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, PATCH, DELETE, OPTIONS'
55
- response.headers['Access-Control-Allow-Headers'] = '*, Origin, Content-Type, Accept, Authorization, Token, Auth-Token, Email'
56
- response.headers['Access-Control-Expose-Headers'] = '*'
57
- response.headers['Access-Control-Max-Age'] = "1728000"
58
- end
59
-
60
- def cors_preflight_check
61
- #if request.method == 'OPTIONS'
62
- request.headers['Access-Control-Allow-Origin'] = '*'
63
- request.headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, PATCH, DELETE, OPTIONS'
64
- request.headers['Access-Control-Allow-Headers'] = '*, X-Requested-With, X-Prototype-Version, Token, Auth-Token, Email'
65
- request.headers['Access-Control-Max-Age'] = '1728000'
66
- render :text => '', :content_type => 'text/plain'
67
- #end
68
- end
69
54
 
70
55
  end
@@ -28,9 +28,6 @@ module JsonVoorhees
28
28
  inject_into_file "config/routes.rb", after: "#{module_name.camelize}::Engine.routes.draw do\n" do <<-'RUBY'
29
29
 
30
30
  #root to: "controller_name#index"
31
- #scope 'admin' do
32
-
33
- #end
34
31
 
35
32
  scope 'api' do
36
33
  scope '1' do
@@ -1,3 +1,3 @@
1
1
  module JsonVoorhees
2
- VERSION = "1.0.0"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -1,37 +1,31 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem "json_voorhees", :path => "../../../json_voorhees"
4
- # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
- gem 'rails', '4.0.4'
6
3
 
4
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
+ gem 'rails', '4.1.6'
6
+ gem "json_voorhees", :path => "../../../json_voorhees"
7
7
  # Use sqlite3 as the database for Active Record
8
8
  gem 'sqlite3'
9
-
10
9
  # Use SCSS for stylesheets
11
- gem 'sass-rails', '~> 4.0.2'
12
-
10
+ gem 'sass-rails', '~> 4.0.3'
13
11
  # Use Uglifier as compressor for JavaScript assets
14
12
  gem 'uglifier', '>= 1.3.0'
15
-
16
13
  # Use CoffeeScript for .js.coffee assets and views
17
14
  gem 'coffee-rails', '~> 4.0.0'
18
-
19
15
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
20
- # gem 'therubyracer', platforms: :ruby
16
+ # gem 'therubyracer', platforms: :ruby
21
17
 
22
18
  # Use jquery as the JavaScript library
23
19
  gem 'jquery-rails'
24
-
25
20
  # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
26
21
  gem 'turbolinks'
27
-
28
22
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
29
- gem 'jbuilder', '~> 1.2'
23
+ gem 'jbuilder', '~> 2.0'
24
+ # bundle exec rake doc:rails generates the API under doc/api.
25
+ gem 'sdoc', '~> 0.4.0', group: :doc
30
26
 
31
- group :doc do
32
- # bundle exec rake doc:rails generates the API under doc/api.
33
- gem 'sdoc', require: false
34
- end
27
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
28
+ gem 'spring', group: :development
35
29
 
36
30
  # Use ActiveModel has_secure_password
37
31
  # gem 'bcrypt', '~> 3.1.7'
@@ -40,7 +34,8 @@ end
40
34
  # gem 'unicorn'
41
35
 
42
36
  # Use Capistrano for deployment
43
- # gem 'capistrano', group: :development
37
+ # gem 'capistrano-rails', group: :development
44
38
 
45
39
  # Use debugger
46
40
  # gem 'debugger', group: [:development, :test]
41
+
@@ -1,38 +1,34 @@
1
- PATH
2
- remote: ../../../json_voorhees
3
- specs:
4
- json_voorhees (0.2.3)
5
- rails (>= 4.0.0)
6
-
7
1
  GEM
8
2
  remote: https://rubygems.org/
9
3
  specs:
10
- actionmailer (4.0.4)
11
- actionpack (= 4.0.4)
12
- mail (~> 2.5.4)
13
- actionpack (4.0.4)
14
- activesupport (= 4.0.4)
15
- builder (~> 3.1.0)
16
- erubis (~> 2.7.0)
4
+ actionmailer (4.1.6)
5
+ actionpack (= 4.1.6)
6
+ actionview (= 4.1.6)
7
+ mail (~> 2.5, >= 2.5.4)
8
+ actionpack (4.1.6)
9
+ actionview (= 4.1.6)
10
+ activesupport (= 4.1.6)
17
11
  rack (~> 1.5.2)
18
12
  rack-test (~> 0.6.2)
19
- activemodel (4.0.4)
20
- activesupport (= 4.0.4)
21
- builder (~> 3.1.0)
22
- activerecord (4.0.4)
23
- activemodel (= 4.0.4)
24
- activerecord-deprecated_finders (~> 1.0.2)
25
- activesupport (= 4.0.4)
26
- arel (~> 4.0.0)
27
- activerecord-deprecated_finders (1.0.3)
28
- activesupport (4.0.4)
13
+ actionview (4.1.6)
14
+ activesupport (= 4.1.6)
15
+ builder (~> 3.1)
16
+ erubis (~> 2.7.0)
17
+ activemodel (4.1.6)
18
+ activesupport (= 4.1.6)
19
+ builder (~> 3.1)
20
+ activerecord (4.1.6)
21
+ activemodel (= 4.1.6)
22
+ activesupport (= 4.1.6)
23
+ arel (~> 5.0.0)
24
+ activesupport (4.1.6)
29
25
  i18n (~> 0.6, >= 0.6.9)
30
- minitest (~> 4.2)
31
- multi_json (~> 1.3)
26
+ json (~> 1.7, >= 1.7.7)
27
+ minitest (~> 5.1)
32
28
  thread_safe (~> 0.1)
33
- tzinfo (~> 0.3.37)
34
- arel (4.0.2)
35
- builder (3.1.4)
29
+ tzinfo (~> 1.1)
30
+ arel (5.0.1.20140414130214)
31
+ builder (3.2.2)
36
32
  coffee-rails (4.0.1)
37
33
  coffee-script (>= 2.2.0)
38
34
  railties (>= 4.0.0, < 5.0)
@@ -41,41 +37,41 @@ GEM
41
37
  execjs
42
38
  coffee-script-source (1.8.0)
43
39
  erubis (2.7.0)
44
- execjs (2.2.1)
40
+ execjs (2.2.2)
45
41
  hike (1.2.3)
46
42
  i18n (0.6.11)
47
- jbuilder (1.5.3)
48
- activesupport (>= 3.0.0)
49
- multi_json (>= 1.2.0)
43
+ jbuilder (2.2.4)
44
+ activesupport (>= 3.0.0, < 5)
45
+ multi_json (~> 1.2)
50
46
  jquery-rails (3.1.2)
51
47
  railties (>= 3.0, < 5.0)
52
48
  thor (>= 0.14, < 2.0)
53
49
  json (1.8.1)
54
- mail (2.5.4)
55
- mime-types (~> 1.16)
56
- treetop (~> 1.4.8)
57
- mime-types (1.25.1)
58
- minitest (4.7.5)
50
+ mail (2.6.1)
51
+ mime-types (>= 1.16, < 3)
52
+ mime-types (2.4.3)
53
+ minitest (5.4.2)
59
54
  multi_json (1.10.1)
60
- polyglot (0.3.5)
61
55
  rack (1.5.2)
62
56
  rack-test (0.6.2)
63
57
  rack (>= 1.0)
64
- rails (4.0.4)
65
- actionmailer (= 4.0.4)
66
- actionpack (= 4.0.4)
67
- activerecord (= 4.0.4)
68
- activesupport (= 4.0.4)
58
+ rails (4.1.6)
59
+ actionmailer (= 4.1.6)
60
+ actionpack (= 4.1.6)
61
+ actionview (= 4.1.6)
62
+ activemodel (= 4.1.6)
63
+ activerecord (= 4.1.6)
64
+ activesupport (= 4.1.6)
69
65
  bundler (>= 1.3.0, < 2.0)
70
- railties (= 4.0.4)
71
- sprockets-rails (~> 2.0.0)
72
- railties (4.0.4)
73
- actionpack (= 4.0.4)
74
- activesupport (= 4.0.4)
66
+ railties (= 4.1.6)
67
+ sprockets-rails (~> 2.0)
68
+ railties (4.1.6)
69
+ actionpack (= 4.1.6)
70
+ activesupport (= 4.1.6)
75
71
  rake (>= 0.8.7)
76
72
  thor (>= 0.18.1, < 2.0)
77
73
  rake (10.3.2)
78
- rdoc (4.1.1)
74
+ rdoc (4.1.2)
79
75
  json (~> 1.4)
80
76
  sass (3.2.19)
81
77
  sass-rails (4.0.3)
@@ -86,25 +82,24 @@ GEM
86
82
  sdoc (0.4.1)
87
83
  json (~> 1.7, >= 1.7.7)
88
84
  rdoc (~> 4.0)
85
+ spring (1.1.3)
89
86
  sprockets (2.11.0)
90
87
  hike (~> 1.2)
91
88
  multi_json (~> 1.0)
92
89
  rack (~> 1.0)
93
90
  tilt (~> 1.1, != 1.3.0)
94
- sprockets-rails (2.0.1)
91
+ sprockets-rails (2.2.0)
95
92
  actionpack (>= 3.0)
96
93
  activesupport (>= 3.0)
97
- sprockets (~> 2.8)
94
+ sprockets (>= 2.8, < 4.0)
98
95
  sqlite3 (1.3.9)
99
96
  thor (0.19.1)
100
97
  thread_safe (0.3.4)
101
98
  tilt (1.4.1)
102
- treetop (1.4.15)
103
- polyglot
104
- polyglot (>= 0.3.1)
105
- turbolinks (2.3.0)
99
+ turbolinks (2.4.0)
106
100
  coffee-rails
107
- tzinfo (0.3.41)
101
+ tzinfo (1.2.2)
102
+ thread_safe (~> 0.1)
108
103
  uglifier (2.5.3)
109
104
  execjs (>= 0.3.0)
110
105
  json (>= 1.8.0)
@@ -114,12 +109,12 @@ PLATFORMS
114
109
 
115
110
  DEPENDENCIES
116
111
  coffee-rails (~> 4.0.0)
117
- jbuilder (~> 1.2)
112
+ jbuilder (~> 2.0)
118
113
  jquery-rails
119
- json_voorhees!
120
- rails (= 4.0.4)
121
- sass-rails (~> 4.0.2)
122
- sdoc
114
+ rails (= 4.1.6)
115
+ sass-rails (~> 4.0.3)
116
+ sdoc (~> 0.4.0)
117
+ spring
123
118
  sqlite3
124
119
  turbolinks
125
120
  uglifier (>= 1.3.0)
@@ -3,4 +3,4 @@
3
3
 
4
4
  require File.expand_path('../config/application', __FILE__)
5
5
 
6
- TestApp::Application.load_tasks
6
+ Rails.application.load_tasks
@@ -5,9 +5,11 @@
5
5
  * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
6
  * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
7
  *
8
- * You're free to add application-wide styles to this file and they'll appear at the top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
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.
10
12
  *
11
- *= require_self
12
13
  *= require_tree .
14
+ *= require_self
13
15
  */
@@ -2,8 +2,8 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>TestApp</title>
5
- <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
- <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
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>
@@ -1,4 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
2
6
  APP_PATH = File.expand_path('../../config/application', __FILE__)
3
7
  require_relative '../config/boot'
4
8
  require 'rails/commands'
@@ -1,4 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
2
6
  require_relative '../config/boot'
3
7
  require 'rake'
4
8
  Rake.application.run
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast
4
+ # It gets overwritten when you run the `spring binstub` command
5
+
6
+ unless defined?(Spring)
7
+ require "rubygems"
8
+ require "bundler"
9
+
10
+ if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
11
+ ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
12
+ ENV["GEM_HOME"] = ""
13
+ Gem.paths = ENV
14
+
15
+ gem "spring", match[1]
16
+ require "spring/binstub"
17
+ end
18
+ end
@@ -3,23 +3,23 @@
3
3
  #
4
4
  # Ensure the SQLite 3 gem is defined in your Gemfile
5
5
  # gem 'sqlite3'
6
- development:
6
+ #
7
+ default: &default
7
8
  adapter: sqlite3
8
- database: db/development.sqlite3
9
9
  pool: 5
10
10
  timeout: 5000
11
11
 
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
12
16
  # Warning: The database defined as "test" will be erased and
13
17
  # re-generated from your development database when you run "rake".
14
18
  # Do not set this db to the same as development or production.
15
19
  test:
16
- adapter: sqlite3
20
+ <<: *default
17
21
  database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
22
 
21
23
  production:
22
- adapter: sqlite3
24
+ <<: *default
23
25
  database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
@@ -2,4 +2,4 @@
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
4
  # Initialize the Rails application.
5
- TestApp::Application.initialize!
5
+ Rails.application.initialize!
@@ -1,4 +1,4 @@
1
- TestApp::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -19,11 +19,19 @@ TestApp::Application.configure do
19
19
  # Print deprecation notices to the Rails logger.
20
20
  config.active_support.deprecation = :log
21
21
 
22
- # Raise an error on page load if there are pending migrations
22
+ # Raise an error on page load if there are pending migrations.
23
23
  config.active_record.migration_error = :page_load
24
24
 
25
25
  # Debug mode disables concatenation and preprocessing of assets.
26
26
  # This option may cause significant delays in view rendering with a large
27
27
  # number of complex assets.
28
28
  config.assets.debug = true
29
+
30
+ # Adds additional error checking when serving assets at runtime.
31
+ # Checks for improperly declared sprockets dependencies.
32
+ # Raises helpful error messages.
33
+ config.assets.raise_runtime_errors = true
34
+
35
+ # Raises error for missing translations
36
+ # config.action_view.raise_on_missing_translations = true
29
37
  end