marty 0.5.15 → 0.5.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +27 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +23 -0
  5. data/Gemfile +23 -0
  6. data/INDEPENDENCE_ISSUES.md +23 -0
  7. data/app/assets/images/marty/.gitkeep +0 -0
  8. data/app/components/marty/report_form.rb +9 -4
  9. data/gemini_deprecations.md +6 -0
  10. data/lib/marty/data_change.rb +99 -0
  11. data/lib/marty/data_conversion.rb +11 -3
  12. data/lib/marty/data_exporter.rb +9 -0
  13. data/lib/marty/version.rb +1 -1
  14. data/marty.gemspec +35 -0
  15. data/script/rails +8 -0
  16. data/spec/controllers/application_controller_spec.rb +52 -0
  17. data/spec/controllers/job_controller_spec.rb +226 -0
  18. data/spec/controllers/rpc_controller_spec.rb +379 -0
  19. data/spec/controllers/rpc_import_spec.rb +45 -0
  20. data/spec/dummy/README.rdoc +261 -0
  21. data/spec/dummy/Rakefile +7 -0
  22. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  23. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  24. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  25. data/spec/dummy/app/controllers/components_controller.rb +7 -0
  26. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  27. data/spec/dummy/app/mailers/.gitkeep +0 -0
  28. data/spec/dummy/app/models/.gitkeep +0 -0
  29. data/spec/dummy/app/models/gemini/amortization_type.rb +5 -0
  30. data/spec/dummy/app/models/gemini/bud_category.rb +7 -0
  31. data/spec/dummy/app/models/gemini/entity.rb +2 -0
  32. data/spec/dummy/app/models/gemini/extras/data_import.rb +5 -0
  33. data/spec/dummy/app/models/gemini/extras/settlement_import.rb +28 -0
  34. data/spec/dummy/app/models/gemini/fannie_bup.rb +29 -0
  35. data/spec/dummy/app/models/gemini/grouping.rb +8 -0
  36. data/spec/dummy/app/models/gemini/grouping_head_version.rb +14 -0
  37. data/spec/dummy/app/models/gemini/head.rb +7 -0
  38. data/spec/dummy/app/models/gemini/head_version.rb +14 -0
  39. data/spec/dummy/app/models/gemini/helper.rb +44 -0
  40. data/spec/dummy/app/models/gemini/loan_program.rb +11 -0
  41. data/spec/dummy/app/models/gemini/mortgage_type.rb +5 -0
  42. data/spec/dummy/app/models/gemini/simple.rb +6 -0
  43. data/spec/dummy/app/models/gemini/streamline_type.rb +16 -0
  44. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  45. data/spec/dummy/config.ru +4 -0
  46. data/spec/dummy/config/application.rb +82 -0
  47. data/spec/dummy/config/boot.rb +10 -0
  48. data/spec/dummy/config/database.yml.example +10 -0
  49. data/spec/dummy/config/environment.rb +5 -0
  50. data/spec/dummy/config/environments/development.rb +35 -0
  51. data/spec/dummy/config/environments/production.rb +69 -0
  52. data/spec/dummy/config/environments/test.rb +39 -0
  53. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  54. data/spec/dummy/config/initializers/delayed_job.rb +5 -0
  55. data/spec/dummy/config/initializers/inflections.rb +15 -0
  56. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  57. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  58. data/spec/dummy/config/initializers/session_store.rb +8 -0
  59. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  60. data/spec/dummy/config/locales/en.yml +5 -0
  61. data/spec/dummy/config/routes.rb +12 -0
  62. data/spec/dummy/db/migrate/20140801000000_create_groupings.rb +11 -0
  63. data/spec/dummy/db/migrate/20150406171536_create_categories.rb +27 -0
  64. data/spec/dummy/db/migrate/20150408200916_create_loan_programs.rb +26 -0
  65. data/spec/dummy/db/migrate/20150408201429_create_types.rb +21 -0
  66. data/spec/dummy/db/migrate/20150420000001_create_heads.rb +14 -0
  67. data/spec/dummy/db/migrate/20150420000002_create_head_versions.rb +15 -0
  68. data/spec/dummy/db/migrate/20150420000003_create_grouping_head_versions.rb +12 -0
  69. data/spec/dummy/db/migrate/20151023000001_create_simple.rb +12 -0
  70. data/spec/dummy/db/seeds.rb +8 -0
  71. data/spec/dummy/delorean/blame_report.dl +171 -0
  72. data/spec/dummy/delorean/data_report.dl +105 -0
  73. data/spec/dummy/delorean/fields.dl +52 -0
  74. data/spec/dummy/delorean/styles.dl +134 -0
  75. data/spec/dummy/lib/assets/.gitkeep +0 -0
  76. data/spec/dummy/lib/class_list.rb +3 -0
  77. data/spec/dummy/log/.gitkeep +0 -0
  78. data/spec/dummy/public/404.html +26 -0
  79. data/spec/dummy/public/422.html +26 -0
  80. data/spec/dummy/public/500.html +25 -0
  81. data/spec/dummy/public/favicon.ico +0 -0
  82. data/spec/dummy/public/icons/READ.txt +3 -0
  83. data/spec/dummy/public/icons/application_cascade.png +0 -0
  84. data/spec/dummy/public/icons/application_delete.png +0 -0
  85. data/spec/dummy/public/icons/application_put.png +0 -0
  86. data/spec/dummy/public/icons/application_view_detail.png +0 -0
  87. data/spec/dummy/public/icons/arrow_in.png +0 -0
  88. data/spec/dummy/public/icons/arrow_refresh.png +0 -0
  89. data/spec/dummy/public/icons/database_save.png +0 -0
  90. data/spec/dummy/public/icons/door_in.png +0 -0
  91. data/spec/dummy/public/icons/door_out.png +0 -0
  92. data/spec/dummy/public/icons/group.png +0 -0
  93. data/spec/dummy/public/icons/page_lightning.png +0 -0
  94. data/spec/dummy/public/icons/printer.png +0 -0
  95. data/spec/dummy/public/icons/report_disk.png +0 -0
  96. data/spec/dummy/public/icons/report_go.png +0 -0
  97. data/spec/dummy/public/icons/report_magnify.png +0 -0
  98. data/spec/dummy/public/icons/script.png +0 -0
  99. data/spec/dummy/public/icons/script_add.png +0 -0
  100. data/spec/dummy/public/icons/script_go.png +0 -0
  101. data/spec/dummy/public/icons/script_key.png +0 -0
  102. data/spec/dummy/public/icons/table_go.png +0 -0
  103. data/spec/dummy/public/icons/time.png +0 -0
  104. data/spec/dummy/public/icons/time_add.png +0 -0
  105. data/spec/dummy/public/icons/time_go.png +0 -0
  106. data/spec/dummy/public/icons/timeline_marker.png +0 -0
  107. data/spec/dummy/public/icons/user_add.png +0 -0
  108. data/spec/dummy/public/icons/user_delete.png +0 -0
  109. data/spec/dummy/public/icons/user_edit.png +0 -0
  110. data/spec/dummy/public/icons/wrench.png +0 -0
  111. data/spec/dummy/script/delayed_job +6 -0
  112. data/spec/dummy/script/rails +6 -0
  113. data/spec/features/javascripts/job_dashboard_live_search.js.coffee +8 -0
  114. data/spec/features/javascripts/login.js.coffee +8 -0
  115. data/spec/features/jobs_dashboard_netzke_spec.rb +24 -0
  116. data/spec/features/jobs_dashboard_spec.rb +49 -0
  117. data/spec/fixtures/scripts/load_tests/script1.dl +2 -0
  118. data/spec/fixtures/scripts/load_tests/script2.dl +2 -0
  119. data/spec/job_helper.rb +102 -0
  120. data/spec/lib/data_exporter_spec.rb +71 -0
  121. data/spec/lib/data_importer_spec.rb +461 -0
  122. data/spec/lib/xl_spec.rb +198 -0
  123. data/spec/lib/xl_styles_spec.rb +115 -0
  124. data/spec/models/api_auth_spec.rb +187 -0
  125. data/spec/models/posting_spec.rb +107 -0
  126. data/spec/models/promise_spec.rb +65 -0
  127. data/spec/models/script_spec.rb +187 -0
  128. data/spec/models/user_spec.rb +68 -0
  129. data/spec/requests/routes_spec.rb +12 -0
  130. data/spec/spec_helper.rb +61 -0
  131. data/spec/support/clean_db_helpers.rb +18 -0
  132. data/spec/support/delayed_job_helpers.rb +12 -0
  133. data/spec/support/user_helpers.rb +12 -0
  134. metadata +139 -89
  135. data/app/components/marty/auth_app.rb~ +0 -51
  136. data/app/components/marty/auth_app/javascripts/auth_app.js~ +0 -91
  137. data/app/components/marty/cm_form_panel.rb~ +0 -5
  138. data/app/components/marty/cm_grid_panel.rb~ +0 -35
  139. data/app/components/marty/data_import_view.rb~ +0 -142
  140. data/app/components/marty/extras/layout.rb~ +0 -46
  141. data/app/components/marty/live_search_grid_panel.rb~ +0 -49
  142. data/app/components/marty/main_auth_app.rb~ +0 -238
  143. data/app/components/marty/mcfly_grid_panel.rb~ +0 -80
  144. data/app/components/marty/new_posting_form.rb~ +0 -46
  145. data/app/components/marty/new_posting_window.rb~ +0 -21
  146. data/app/components/marty/pivot_grid.rb +0 -52
  147. data/app/components/marty/pivot_grid/endpoints.rb +0 -45
  148. data/app/components/marty/pivot_grid/javascripts/extensions.js +0 -150
  149. data/app/components/marty/pivot_grid/javascripts/pivot_grid.js +0 -86
  150. data/app/components/marty/pivot_grid/services.rb +0 -44
  151. data/app/components/marty/posting_grid.rb~ +0 -140
  152. data/app/components/marty/promise_view.rb~ +0 -157
  153. data/app/components/marty/promise_view/stylesheets/promise_view.css~ +0 -15
  154. data/app/components/marty/report_form.rb~ +0 -217
  155. data/app/components/marty/report_select.rb~ +0 -133
  156. data/app/components/marty/reporting.rb~ +0 -39
  157. data/app/components/marty/script_detail.rb~ +0 -430
  158. data/app/components/marty/script_form.rb~ +0 -233
  159. data/app/components/marty/script_form/javascripts/Ext.ux.form.field.CodeMirror.js~ +0 -909
  160. data/app/components/marty/script_grid.rb~ +0 -99
  161. data/app/components/marty/script_tester.rb~ +0 -213
  162. data/app/components/marty/scripting.rb~ +0 -124
  163. data/app/components/marty/select_report.rb~ +0 -143
  164. data/app/components/marty/simple_app.rb~ +0 -101
  165. data/app/components/marty/tag_grid.rb~ +0 -89
  166. data/app/components/marty/tree_panel.rb~ +0 -256
  167. data/app/components/marty/tree_panel/javascripts/tree_panel.js~ +0 -317
  168. data/app/components/marty/user_pivot.rb +0 -128
  169. data/app/components/marty/user_view.rb~ +0 -188
  170. data/app/controllers/marty/application_controller.rb~ +0 -133
  171. data/app/controllers/marty/components_controller.rb~ +0 -37
  172. data/app/controllers/marty/job_controller.rb~ +0 -28
  173. data/app/controllers/marty/rpc_controller.rb~ +0 -61
  174. data/app/helpers/marty/script_set.rb~ +0 -59
  175. data/app/models/marty/api_auth.rb~ +0 -48
  176. data/app/models/marty/data_change.rb~ +0 -141
  177. data/app/models/marty/enum.rb~ +0 -16
  178. data/app/models/marty/import_type.rb~ +0 -48
  179. data/app/models/marty/poop.rb~ +0 -169
  180. data/app/models/marty/posting.rb~ +0 -86
  181. data/app/models/marty/posting_type.rb~ +0 -21
  182. data/app/models/marty/promise.rb~ +0 -196
  183. data/app/models/marty/role.rb~ +0 -10
  184. data/app/models/marty/script.rb~ +0 -62
  185. data/app/models/marty/tag.rb~ +0 -91
  186. data/app/models/marty/user.rb~ +0 -148
  187. data/app/models/marty/user_role.rb~ +0 -13
  188. data/app/views/layouts/marty/application.html.erb~ +0 -11
  189. data/config/routes.rb~ +0 -10
  190. data/db/migrate/019_create_marty_postings.rb~ +0 -19
  191. data/db/migrate/095_create_marty_tags.rb~ +0 -19
  192. data/lib/marty.rb~ +0 -13
  193. data/lib/marty/content_handler.rb~ +0 -93
  194. data/lib/marty/data_exporter.rb~ +0 -137
  195. data/lib/marty/data_importer.rb~ +0 -114
  196. data/lib/marty/data_row_processor.rb~ +0 -206
  197. data/lib/marty/drop_folder_hook.rb~ +0 -17
  198. data/lib/marty/folder_hook.rb~ +0 -9
  199. data/lib/marty/lazy_column_loader.rb~ +0 -47
  200. data/lib/marty/mcfly_query.rb~ +0 -188
  201. data/lib/marty/migrations.rb~ +0 -65
  202. data/lib/marty/monkey.rb~ +0 -160
  203. data/lib/marty/permissions.rb~ +0 -69
  204. data/lib/marty/promise.rb~ +0 -41
  205. data/lib/marty/promise_job.rb~ +0 -121
  206. data/lib/marty/promise_proxy.rb~ +0 -69
  207. data/lib/marty/util.rb~ +0 -80
  208. data/lib/marty/version.rb~ +0 -3
  209. data/lib/marty/xl.rb~ +0 -526
  210. data/lib/pyxll/README.txt~ +0 -16
  211. data/lib/pyxll/gemini.py~ +0 -110
  212. data/lib/pyxll/pyxll.cfg~ +0 -12
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,15 @@
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
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,13 @@
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 top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < Marty::ApplicationController
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,7 @@
1
+ require 'marty/main_auth_app'
2
+
3
+ class ComponentsController < Marty::ApplicationController
4
+ def home
5
+ render inline: "<%= netzke :'main_auth_app' %>", layout: true
6
+ end
7
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,5 @@
1
+ class Gemini::AmortizationType < ActiveRecord::Base
2
+ extend Marty::Enum
3
+
4
+ self.table_name = 'gemini_amortization_types'
5
+ end
@@ -0,0 +1,7 @@
1
+ module Gemini
2
+ class BudCategory < ActiveRecord::Base
3
+ self.table_name = 'gemini_bud_categories'
4
+ has_mcfly append_only: true
5
+ mcfly_validates_uniqueness_of :name
6
+ end
7
+ end
@@ -0,0 +1,2 @@
1
+ class Gemini::Entity < ActiveRecord::Base
2
+ end
@@ -0,0 +1,5 @@
1
+ module Gemini::Extras::DataImport
2
+ def import_cleaner
3
+ where(obsoleted_dt: 'infinity').pluck(:id)
4
+ end
5
+ end
@@ -0,0 +1,28 @@
1
+ module Gemini::Extras::SettlementImport
2
+ def import_validation(ids)
3
+ validate_settlement_date(ids, 0)
4
+ end
5
+
6
+ def import_validation_allow_prior_month(ids)
7
+ validate_settlement_date(ids, 1)
8
+ end
9
+
10
+ private
11
+ def validate_settlement_date(ids, month_interval)
12
+ # Given a set of ids, make sure that settlement mm/yy are not more
13
+ # than x months older than current date.
14
+ bad = where("id IN (?) AND " +
15
+ "date_trunc('month', current_date) - " +
16
+ "INTERVAL '#{month_interval} month' > " +
17
+ "format('%s-%s-01', settlement_yy, settlement_mm)::date",
18
+ ids).limit(1)
19
+
20
+ return if bad.empty?
21
+
22
+ x = bad[0]
23
+
24
+ raise "One or more records failed validation. " +
25
+ "Settlement #{x.settlement_mm}/#{x.settlement_yy} is " +
26
+ "#{month_interval + 1 } or more months in the past."
27
+ end
28
+ end
@@ -0,0 +1,29 @@
1
+ module Gemini
2
+ class FannieBup < ActiveRecord::Base
3
+ extend Gemini::Extras::DataImport
4
+ extend Gemini::Extras::SettlementImport
5
+
6
+ self.table_name = 'gemini_fannie_bups'
7
+
8
+ has_mcfly
9
+ mcfly_validates_uniqueness_of :note_rate,
10
+ scope: [:entity_id,
11
+ :bud_category_id,
12
+ :settlement_mm,
13
+ :settlement_yy,
14
+ ]
15
+
16
+ belongs_to :entity
17
+ mcfly_belongs_to :bud_category
18
+
19
+ def self.import_preprocess(data)
20
+ data.map {
21
+ |rec|
22
+ rec["note_rate"].gsub! /\$/, ''
23
+ rec["buy_up"].gsub! /\%/, ''
24
+ rec["buy_down"].gsub! /\%/, ''
25
+ rec
26
+ }
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,8 @@
1
+ class Gemini::Grouping < ActiveRecord::Base
2
+ self.table_name = 'groupings'
3
+
4
+ has_mcfly append_only: true
5
+
6
+ validates_presence_of :name
7
+ mcfly_validates_uniqueness_of :name
8
+ end
@@ -0,0 +1,14 @@
1
+ class Gemini::GroupingHeadVersion < ActiveRecord::Base
2
+ self.table_name = 'grouping_head_versions'
3
+
4
+ has_mcfly
5
+
6
+ validates_presence_of \
7
+ :grouping_id,
8
+ :head_version_id
9
+
10
+ mcfly_validates_uniqueness_of :grouping_id, scope: [:head_version_id]
11
+
12
+ mcfly_belongs_to :grouping, class_name: "Gemini::Grouping"
13
+ mcfly_belongs_to :head_version, class_name: "Gemini::HeadVersion"
14
+ end
@@ -0,0 +1,7 @@
1
+ class Gemini::Head < ActiveRecord::Base
2
+ self.table_name = 'heads'
3
+
4
+ has_mcfly
5
+
6
+ mcfly_validates_uniqueness_of :name
7
+ end
@@ -0,0 +1,14 @@
1
+ class Gemini::HeadVersion < ActiveRecord::Base
2
+ self.table_name = 'head_versions'
3
+
4
+ has_mcfly
5
+
6
+ validates_presence_of \
7
+ :version,
8
+ :head_id
9
+
10
+ mcfly_validates_uniqueness_of :head_id,
11
+ scope: [:version]
12
+
13
+ mcfly_belongs_to :head
14
+ end
@@ -0,0 +1,44 @@
1
+ require 'delorean_lang'
2
+
3
+ class Gemini::Helper
4
+ include Delorean::Model
5
+
6
+ # Just for testing
7
+ delorean_fn :sleep, sig: 1 do
8
+ |seconds|
9
+ Kernel.sleep seconds
10
+ end
11
+
12
+ # Just for testing
13
+ delorean_fn :to_csv, sig: [1, 2] do
14
+ |*args|
15
+
16
+ # NOTE: can't use |data, config| due to delorean_fn weirdness.
17
+ data, config = args
18
+
19
+ Marty::DataExporter.to_csv(data, config)
20
+ end
21
+
22
+ # Just for testing
23
+ delorean_fn :import_data, sig: [2, 3] do
24
+ |import_type, data, col_sep|
25
+
26
+ col_sep ||= "\t"
27
+
28
+ raise "Insufficient permissions to run the data import" unless
29
+ import_type.allow_import?
30
+
31
+ Marty::DataImporter.do_import_summary(import_type.get_model_class,
32
+ data,
33
+ 'infinity',
34
+ import_type.cleaner_function,
35
+ import_type.validation_function,
36
+ col_sep,
37
+ false)
38
+ end
39
+
40
+ delorean_fn :infinity_dt, sig: 1 do
41
+ |pt|
42
+ Mcfly.is_infinity pt
43
+ end
44
+ end
@@ -0,0 +1,11 @@
1
+ class Gemini::LoanProgram < ActiveRecord::Base
2
+
3
+ self.table_name = 'gemini_loan_programs'
4
+
5
+ has_mcfly
6
+ mcfly_validates_uniqueness_of :name
7
+
8
+ belongs_to :amortization_type
9
+ belongs_to :mortgage_type
10
+ belongs_to :streamline_type
11
+ end
@@ -0,0 +1,5 @@
1
+ class Gemini::MortgageType < ActiveRecord::Base
2
+ extend Marty::Enum
3
+
4
+ self.table_name = 'gemini_mortgage_types'
5
+ end
@@ -0,0 +1,6 @@
1
+ module Gemini
2
+ class Simple < ActiveRecord::Base
3
+ self.table_name = 'gemini_simples'
4
+ mcfly_validates_uniqueness_of :group_id
5
+ end
6
+ end
@@ -0,0 +1,16 @@
1
+ class Gemini::StreamlineType < ActiveRecord::Base
2
+ extend Marty::Enum
3
+
4
+ self.table_name = 'gemini_streamline_types'
5
+
6
+ def self.seed
7
+ ["IRRRL",
8
+ "FHA Streamline",
9
+ "DURP",
10
+ "Refi Plus",
11
+ "Relief Refi Open Access",
12
+ "Relief Refi",
13
+ "Not Streamlined",
14
+ ].each { |n| Gemini::StreamlineType.create(name: n) }
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,82 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ require "active_model/railtie"
5
+ require "active_job/railtie"
6
+ require "active_record/railtie"
7
+ require "action_controller/railtie"
8
+ require "action_mailer/railtie"
9
+ require "action_view/railtie"
10
+ require "sprockets/railtie"
11
+
12
+ Bundler.require(*Rails.groups)
13
+ require "marty"
14
+
15
+ module Dummy
16
+ APP_ROOT = File.expand_path("..", __FILE__).freeze
17
+ class Application < Rails::Application
18
+ # Settings in config/environments/* take precedence over those specified here.
19
+ # Application configuration should go into files in config/initializers
20
+ # -- all .rb files in that directory are automatically loaded.
21
+
22
+ # Custom directories with classes and modules you want to be autoloadable.
23
+ config.autoload_paths += %W(#{config.root}/lib)
24
+
25
+ # Only load the plugins named here, in the order given (default is alphabetical).
26
+ # :all can be used as a placeholder for all plugins not explicitly named.
27
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
28
+
29
+ # Activate observers that should always be running.
30
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
31
+
32
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
33
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
34
+ # config.time_zone = 'Central Time (US & Canada)'
35
+
36
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
37
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
38
+ # config.i18n.default_locale = :de
39
+
40
+ # Configure the default encoding used in templates for Ruby 1.9.
41
+ config.encoding = "utf-8"
42
+
43
+ # Configure sensitive parameters which will be filtered from the log file.
44
+ config.filter_parameters += [:password]
45
+
46
+ # Enable escaping HTML in JSON.
47
+ config.active_support.escape_html_entities_in_json = true
48
+
49
+ # Use SQL instead of Active Record's schema dumper when creating the database.
50
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
51
+ # like if you have constraints or database-specific column types
52
+ # config.active_record.schema_format = :sql
53
+
54
+ # Enforce whitelist mode for mass assignment.
55
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
56
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
57
+ # parameters by using an attr_accessible or attr_protected declaration.
58
+ #config.active_record.whitelist_attributes = true
59
+
60
+ # Enable the asset pipeline
61
+ config.assets.enabled = true
62
+
63
+ # Version of your assets, change this if you want to expire all your assets
64
+ config.assets.version = '1.0'
65
+
66
+ config.paths["config/database"] = "#{APP_ROOT}/database.yml"
67
+
68
+ config.marty.auth_source = 'local'
69
+
70
+ config.marty.system_account = 'marty'
71
+ config.marty.local_password = 'marty'
72
+ config.marty.class_list = []
73
+ config.marty.roles = [
74
+ :admin,
75
+ :dev,
76
+ :viewer,
77
+ :user_manager,
78
+ ]
79
+ config.secret_key_base = "SECRET_KEY_BASE"
80
+ end
81
+ end
82
+ require "marty/permissions"
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,10 @@
1
+ common: &common
2
+ adapter: postgresql
3
+
4
+ development:
5
+ <<: *common
6
+ database: marty_dev
7
+
8
+ test:
9
+ <<: *common
10
+ database: marty_test
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,35 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ #config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Do not compress assets
29
+ config.assets.compress = false
30
+
31
+ # Expands the lines which load the assets
32
+ config.assets.debug = true
33
+
34
+ config.eager_load = false
35
+ end