mvpkit 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +30 -0
  3. data/Gemfile.lock +329 -0
  4. data/LICENSE.txt +20 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.md +134 -0
  7. data/Rakefile +52 -0
  8. data/VERSION +1 -0
  9. data/app/assets/javascripts/mvp/application.js +1 -0
  10. data/app/assets/stylesheets/mvp/application.scss +0 -0
  11. data/app/controllers/concerns/mvp/analytics_concern.rb +78 -0
  12. data/app/controllers/concerns/mvp/seo_concern.rb +25 -0
  13. data/app/controllers/concerns/mvp/session_concern.rb +44 -0
  14. data/app/controllers/mvp/analytics_controller.rb +12 -0
  15. data/app/controllers/mvp/seo_controller.rb +11 -0
  16. data/app/controllers/mvp/styleguide_controller.rb +23 -0
  17. data/app/helpers/minimum_viable_product/body_helper.rb +14 -0
  18. data/app/helpers/minimum_viable_product/bootstrap_helper.rb +38 -0
  19. data/app/helpers/minimum_viable_product/styleguide_helper.rb +4 -0
  20. data/app/models/concerns/mvp/slugification.rb +24 -0
  21. data/app/views/layouts/minimum_viable_product/_instrumentation.html.erb +100 -0
  22. data/app/views/layouts/minimum_viable_product/_meta.html.erb +37 -0
  23. data/app/views/layouts/minimum_viable_product/application.html.erb +19 -0
  24. data/app/views/minimum_viable_product/styleguide/_example.html.erb +6 -0
  25. data/app/views/minimum_viable_product/styleguide/bootstrap/_buttons.html.erb +191 -0
  26. data/app/views/minimum_viable_product/styleguide/bootstrap/_forms.html.erb +192 -0
  27. data/app/views/minimum_viable_product/styleguide/bootstrap/_header.html.erb +48 -0
  28. data/app/views/minimum_viable_product/styleguide/bootstrap/_panels.html.erb +16 -0
  29. data/app/views/minimum_viable_product/styleguide/bootstrap/_tables.html.erb +34 -0
  30. data/app/views/minimum_viable_product/styleguide/bootstrap/_typography.html.erb +51 -0
  31. data/app/views/minimum_viable_product/styleguide/bootstrap.html.erb +43 -0
  32. data/app/views/minimum_viable_product/styleguide/elements/_grouping.html.erb +1 -0
  33. data/app/views/minimum_viable_product/styleguide/elements/partials/_row_groups_of.html.erb +7 -0
  34. data/app/views/minimum_viable_product/styleguide/index.html.erb +17 -0
  35. data/app/views/minimum_viable_product/styleguide/layouts/basic.html.erb +4 -0
  36. data/app/views/minimum_viable_product/styleguide/layouts/carousel.html.erb +120 -0
  37. data/app/views/minimum_viable_product/styleguide/layouts/cover.html.erb +34 -0
  38. data/assets/js/application.js +31 -0
  39. data/assets/js/init/controllers.js +26 -0
  40. data/assets/js/init/forms.js +12 -0
  41. data/bin/mvp +78 -0
  42. data/bin/rails +12 -0
  43. data/config/initializers/assets.rb +2 -0
  44. data/config/initializers/canonical_host.rb +3 -0
  45. data/config/initializers/cloudinary.rb +7 -0
  46. data/config/initializers/geocoder.rb +9 -0
  47. data/config/initializers/iteration.rb +33 -0
  48. data/config/initializers/project.rb +1 -0
  49. data/config/initializers/rollbar.rb +59 -0
  50. data/config/initializers/routing.rb +7 -0
  51. data/config/initializers/spoof_ip.rb +33 -0
  52. data/config/initializers/ssl.rb +14 -0
  53. data/config/routes.rb +6 -0
  54. data/lib/mvp/engine.rb +22 -0
  55. data/lib/mvp/ext/nil.rb +5 -0
  56. data/lib/mvp/ext/string.rb +7 -0
  57. data/lib/mvpkit.rb +6 -0
  58. data/lib/tasks/sitemap.rake +42 -0
  59. data/mvpkit.gemspec +245 -0
  60. data/package.json +43 -0
  61. data/project/.gitignore +45 -0
  62. data/project/Gemfile +33 -0
  63. data/project/Gemfile.lock +437 -0
  64. data/project/Procfile +2 -0
  65. data/project/README.md +117 -0
  66. data/project/Rakefile +14 -0
  67. data/project/app/controllers/application_controller.rb +12 -0
  68. data/project/app/controllers/conversions_controller.rb +24 -0
  69. data/project/app/controllers/examples_controller.rb +2 -0
  70. data/project/app/controllers/home_controller.rb +7 -0
  71. data/project/app/decorators/.keep +0 -0
  72. data/project/app/helpers/application_helper.rb +24 -0
  73. data/project/app/mailers/.keep +0 -0
  74. data/project/app/models/conversion.rb +4 -0
  75. data/project/app/views/examples/index.html.erb +1 -0
  76. data/project/app/views/examples/mustache/template.mustache +1 -0
  77. data/project/app/views/examples/mustache.html.erb +18 -0
  78. data/project/app/views/home/conversion.html.erb +12 -0
  79. data/project/app/views/home/index.html.erb +28 -0
  80. data/project/app/views/layouts/_header.html.erb +16 -0
  81. data/project/app/views/layouts/_includes.html.erb +7 -0
  82. data/project/app/views/layouts/application.html.erb +17 -0
  83. data/project/app/views/layouts/modal.html.erb +14 -0
  84. data/project/assets/images/.keep +0 -0
  85. data/project/assets/images/favicon.ico +0 -0
  86. data/project/assets/javascripts/controllers/home.coffee +15 -0
  87. data/project/assets/javascripts/pack.js +9 -0
  88. data/project/assets/stylesheets/config/variables.scss +876 -0
  89. data/project/assets/stylesheets/layout/basic.scss +6 -0
  90. data/project/assets/stylesheets/layout/carousel.scss +127 -0
  91. data/project/assets/stylesheets/layout/cover.scss +129 -0
  92. data/project/assets/stylesheets/lib/spacing.scss +55 -0
  93. data/project/assets/stylesheets/skin/style.scss +16 -0
  94. data/project/assets/stylesheets/style.scss +8 -0
  95. data/project/bin/bundle +3 -0
  96. data/project/bin/rails +9 -0
  97. data/project/bin/rake +9 -0
  98. data/project/bin/setup +32 -0
  99. data/project/bin/spring +15 -0
  100. data/project/config/application.rb +32 -0
  101. data/project/config/boot.rb +3 -0
  102. data/project/config/database.yml +19 -0
  103. data/project/config/environment.rb +5 -0
  104. data/project/config/environments/development.rb +67 -0
  105. data/project/config/environments/production.rb +93 -0
  106. data/project/config/environments/test.rb +42 -0
  107. data/project/config/initializers/assets.rb +11 -0
  108. data/project/config/initializers/backtrace_silencers.rb +7 -0
  109. data/project/config/initializers/cookies_serializer.rb +3 -0
  110. data/project/config/initializers/filter_parameter_logging.rb +4 -0
  111. data/project/config/initializers/inflections.rb +16 -0
  112. data/project/config/initializers/mime_types.rb +4 -0
  113. data/project/config/initializers/mustache.rb +7 -0
  114. data/project/config/initializers/rails_admin.rb +43 -0
  115. data/project/config/initializers/session_store.rb +3 -0
  116. data/project/config/initializers/simple_form.rb +177 -0
  117. data/project/config/initializers/wrap_parameters.rb +14 -0
  118. data/project/config/locales/en.yml +23 -0
  119. data/project/config/locales/simple_form.en.yml +31 -0
  120. data/project/config/routes.rb +13 -0
  121. data/project/config/secrets.yml +8 -0
  122. data/project/config/sitemap.rb +28 -0
  123. data/project/config.ru +4 -0
  124. data/project/db/migrate/20160728235100_create_conversions.rb +9 -0
  125. data/project/db/schema.rb +25 -0
  126. data/project/db/seeds.rb +7 -0
  127. data/project/lib/assets/.keep +0 -0
  128. data/project/lib/tasks/heroku.rake +70 -0
  129. data/project/log/.keep +0 -0
  130. data/project/log/development.log +48216 -0
  131. data/project/log/production.log +0 -0
  132. data/project/package.json +44 -0
  133. data/project/public/404.html +67 -0
  134. data/project/public/422.html +67 -0
  135. data/project/public/500.html +66 -0
  136. data/project/public/assets/javascripts/448c34a56d699c29117adc64c43affeb.woff2 +0 -0
  137. data/project/public/assets/javascripts/89889688147bd7575d6327160d64e760.svg +288 -0
  138. data/project/public/assets/javascripts/e18bbf611f2a2e43afc071aa2f4e1512.ttf +0 -0
  139. data/project/public/assets/javascripts/f4769f9bdb7466be65088239c12046d1.eot +0 -0
  140. data/project/public/assets/javascripts/fa2772327f55d8198301fdb8bcfc8158.woff +0 -0
  141. data/project/public/assets/javascripts/pack.js +31367 -0
  142. data/project/public/assets/javascripts/pack.js.map +1 -0
  143. data/project/public/assets/pack.js +17220 -0
  144. data/project/public/assets/style.css +7477 -0
  145. data/project/vendor/assets/javascripts/.keep +0 -0
  146. data/project/vendor/assets/stylesheets/.keep +0 -0
  147. data/project/webpack.config.js +67 -0
  148. data/test/helper.rb +34 -0
  149. data/test/test_minimum_viable_product.rb +7 -0
  150. metadata +473 -0
@@ -0,0 +1,11 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path
7
+ Rails.application.config.assets.paths << Rails.root.join('public', 'assets', 'javascripts')
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,7 @@
1
+ SmtRails.configure do |config|
2
+ config.template_extension = 'mustache' # change extension of mustache templates
3
+ config.action_view_key = 'mustache' # change name of key for rendering in ActionView mustache template
4
+ config.template_namespace = 'SMT' # change templates namespace in javascript
5
+ # config.template_base_path = Rails.root.join("assets", "templates") # templates dir
6
+ config.template_base_path = Rails.root.join("app", "views")
7
+ end
@@ -0,0 +1,43 @@
1
+ RailsAdmin.config do |config|
2
+ config.authorize_with do
3
+ if ENV["ADMIN_USER"] && ENV["ADMIN_PASSWORD"]
4
+ authenticate_or_request_with_http_basic('Site Message') do |username, password|
5
+ username == ENV["ADMIN_USER"] && password == ENV["ADMIN_PASSWORD"]
6
+ end
7
+ end
8
+ end
9
+ ### Popular gems integration
10
+
11
+ ## == Devise ==
12
+ # config.authenticate_with do
13
+ # warden.authenticate! scope: :user
14
+ # end
15
+ # config.current_user_method(&:current_user)
16
+
17
+ ## == Cancan ==
18
+ # config.authorize_with :cancan
19
+
20
+ ## == Pundit ==
21
+ # config.authorize_with :pundit
22
+
23
+ ## == PaperTrail ==
24
+ # config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0
25
+
26
+ ### More at https://github.com/sferik/rails_admin/wiki/Base-configuration
27
+
28
+ config.actions do
29
+ dashboard # mandatory
30
+ index # mandatory
31
+ new
32
+ export
33
+ bulk_delete
34
+ show
35
+ edit
36
+ delete
37
+ show_in_app
38
+
39
+ ## With an audit adapter, you can add:
40
+ # history_index
41
+ # history_show
42
+ end
43
+ end
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '___PROJECT_NAME_SLUG___session'
@@ -0,0 +1,177 @@
1
+ SimpleForm.setup do |config|
2
+ config.label_text = lambda { |label, required, explicit_label| "#{label}" }
3
+ config.error_notification_class = 'alert alert-danger'
4
+ config.button_class = 'btn btn-default'
5
+ config.boolean_label_class = nil
6
+
7
+ config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
8
+ b.use :html5
9
+ b.use :placeholder
10
+ b.optional :maxlength
11
+ b.optional :pattern
12
+ b.optional :min_max
13
+ b.optional :readonly
14
+ b.use :label, class: 'form-control-label'
15
+
16
+ b.use :input, class: 'form-control'
17
+ b.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
18
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
19
+ end
20
+
21
+ config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
22
+ b.use :html5
23
+ b.use :placeholder
24
+ b.optional :maxlength
25
+ b.optional :readonly
26
+ b.use :label, class: 'form-control-label'
27
+
28
+ b.use :input
29
+ b.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
30
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
31
+ end
32
+
33
+ config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
34
+ b.use :html5
35
+ b.optional :readonly
36
+
37
+ b.wrapper tag: 'div', class: 'checkbox' do |ba|
38
+ ba.use :label_input
39
+ end
40
+
41
+ b.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
42
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
43
+ end
44
+
45
+ config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
46
+ b.use :html5
47
+ b.optional :readonly
48
+ b.use :label, class: 'form-control-label'
49
+ b.use :input
50
+ b.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
51
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
52
+ end
53
+
54
+ config.wrappers :horizontal_form, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
55
+ b.use :html5
56
+ b.use :placeholder
57
+ b.optional :maxlength
58
+ b.optional :pattern
59
+ b.optional :min_max
60
+ b.optional :readonly
61
+ b.use :label, class: 'col-sm-3 form-control-label'
62
+
63
+ b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
64
+ ba.use :input, class: 'form-control'
65
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
66
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
67
+ end
68
+ end
69
+
70
+ config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
71
+ b.use :html5
72
+ b.use :placeholder
73
+ b.optional :maxlength
74
+ b.optional :readonly
75
+ b.use :label, class: 'col-sm-3 form-control-label'
76
+
77
+ b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
78
+ ba.use :input
79
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
80
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
81
+ end
82
+ end
83
+
84
+ config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
85
+ b.use :html5
86
+ b.optional :readonly
87
+
88
+ b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr|
89
+ wr.wrapper tag: 'div', class: 'checkbox' do |ba|
90
+ ba.use :label_input
91
+ end
92
+
93
+ wr.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
94
+ wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
95
+ end
96
+ end
97
+
98
+ config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
99
+ b.use :html5
100
+ b.optional :readonly
101
+
102
+ b.use :label, class: 'col-sm-3 form-control-label'
103
+
104
+ b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
105
+ ba.use :input
106
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
107
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
108
+ end
109
+ end
110
+
111
+ config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
112
+ b.use :html5
113
+ b.use :placeholder
114
+ b.optional :maxlength
115
+ b.optional :pattern
116
+ b.optional :min_max
117
+ b.optional :readonly
118
+ b.use :label, class: 'sr-only'
119
+
120
+ b.use :input, class: 'form-control'
121
+ b.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
122
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
123
+ end
124
+
125
+ config.wrappers :multi_select, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
126
+ b.use :html5
127
+ b.optional :readonly
128
+ b.use :label, class: 'form-control-label'
129
+ b.wrapper tag: 'div', class: 'form-inline' do |ba|
130
+ ba.use :input, class: 'form-control'
131
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
132
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
133
+ end
134
+ end
135
+ # Wrappers for forms and inputs using the Bootstrap toolkit.
136
+ # Check the Bootstrap docs (http://getbootstrap.com)
137
+ # to learn about the different styles for forms and inputs,
138
+ # buttons and other elements.
139
+ config.default_wrapper = :vertical_form
140
+ config.wrapper_mappings = {
141
+ check_boxes: :vertical_radio_and_checkboxes,
142
+ radio_buttons: :vertical_radio_and_checkboxes,
143
+ file: :vertical_file_input,
144
+ boolean: :vertical_boolean,
145
+ datetime: :multi_select,
146
+ date: :multi_select,
147
+ time: :multi_select
148
+ }
149
+
150
+ config.wrappers :vertical_input_group, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
151
+ b.use :html5
152
+ b.use :placeholder
153
+ b.use :label, class: 'form-control-label'
154
+
155
+ b.wrapper tag: 'div' do |ba|
156
+ ba.wrapper tag: 'div', class: 'input-group col-sm-12' do |append|
157
+ append.use :input, class: 'form-control'
158
+ end
159
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
160
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
161
+ end
162
+ end
163
+
164
+ config.wrappers :horizontal_input_group, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
165
+ b.use :html5
166
+ b.use :placeholder
167
+ b.use :label, class: 'col-sm-3 form-control-label'
168
+
169
+ b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
170
+ ba.wrapper tag: 'div', class: 'input-group col-sm-12' do |append|
171
+ append.use :input, class: 'form-control'
172
+ end
173
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
174
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
175
+ end
176
+ end
177
+ end
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,31 @@
1
+ en:
2
+ simple_form:
3
+ "yes": 'Yes'
4
+ "no": 'No'
5
+ required:
6
+ text: 'required'
7
+ mark: '*'
8
+ # You can uncomment the line below if you need to overwrite the whole required html.
9
+ # When using html, text and mark won't be used.
10
+ # html: '<abbr title="required">*</abbr>'
11
+ error_notification:
12
+ default_message: "Please review the problems below:"
13
+ # Examples
14
+ # labels:
15
+ # defaults:
16
+ # password: 'Password'
17
+ # user:
18
+ # new:
19
+ # email: 'E-mail to sign in.'
20
+ # edit:
21
+ # email: 'E-mail.'
22
+ # hints:
23
+ # defaults:
24
+ # username: 'User name to sign in.'
25
+ # password: 'No special characters, please.'
26
+ # include_blanks:
27
+ # defaults:
28
+ # age: 'Rather not say'
29
+ # prompts:
30
+ # defaults:
31
+ # age: 'Select your age'
@@ -0,0 +1,13 @@
1
+ Rails.application.routes.draw do
2
+ # mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
3
+ mount MVP::Engine => "/"
4
+
5
+ scope path: '/examples' do
6
+ get 'mustache', to: 'examples#mustache', as: :mustache_example
7
+ get '', to: 'examples#index', as: :examples
8
+ end
9
+
10
+ get 'conversion', to: 'home#conversion', as: :conversion
11
+ resource :conversion, only: [:create]
12
+ root 'home#index'
13
+ end
@@ -0,0 +1,8 @@
1
+ development:
2
+ secret_key_base: makesuretochangethisifyoucareaboutdevelopmentenvironmentforsomereason
3
+ test:
4
+ secret_key_base: makesuretochangethisifyoucareabouttestenvironmentforsomereason
5
+ staging:
6
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
7
+ production:
8
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,28 @@
1
+ SitemapGenerator::Sitemap.default_host = "http://#{ENV['HOST_DOMAIN']}"
2
+ SitemapGenerator::Sitemap.public_path = 'tmp/sitemaps/'
3
+
4
+ SitemapGenerator::Sitemap.create do
5
+ # Put links creation logic here.
6
+ #
7
+ # The root path '/' and sitemap index file are added automatically for you.
8
+ # Links are added to the Sitemap in the order they are specified.
9
+ #
10
+ # Usage: add(path, options={})
11
+ # (default options are used if you don't specify)
12
+ #
13
+ # Defaults: :priority => 0.5, :changefreq => 'weekly',
14
+ # :lastmod => Time.now, :host => default_host
15
+ #
16
+ # Examples:
17
+ #
18
+ # Add '/articles'
19
+ #
20
+ # add articles_path, :priority => 0.7, :changefreq => 'daily'
21
+ #
22
+ # Add all articles:
23
+ #
24
+ # Article.find_each do |article|
25
+ # add article_path(article), :lastmod => article.updated_at
26
+ # end
27
+ add root_url
28
+ end
data/project/config.ru ADDED
@@ -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 Rails.application
@@ -0,0 +1,9 @@
1
+ class CreateConversions < ActiveRecord::Migration
2
+ def change
3
+ create_table :conversions do |t|
4
+ t.string :email
5
+
6
+ t.timestamps null: false
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,25 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20160728235100) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "conversions", force: :cascade do |t|
20
+ t.string "email"
21
+ t.datetime "created_at", null: false
22
+ t.datetime "updated_at", null: false
23
+ end
24
+
25
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
File without changes
@@ -0,0 +1,70 @@
1
+ require 'json'
2
+
3
+ def run(cmd, quiet=true)
4
+ puts "Running #{cmd}" if ENV['DEBUG'] == 'true'
5
+ command = [cmd]
6
+ command << "&>/dev/null" if quiet
7
+ system(command.join(' '))
8
+ end
9
+
10
+ namespace :heroku do
11
+ desc 'Pull down production database'
12
+ task :import => ['heroku:dump:postgres', 'heroku:import:postgres'] do
13
+ puts "Done"
14
+ end
15
+
16
+ namespace :capture do
17
+ task :postgres do
18
+ puts "Capturing Production Backup ..."
19
+ run("heroku pg:backups capture --app __PROJECT_NAME__", false)
20
+ end
21
+ end
22
+
23
+ namespace :dump do
24
+ task :postgres do
25
+ Rake::Task["heroku:capture:postgres"].execute if ENV['CAPTURE']
26
+ puts "Loading Production Dump ..."
27
+ run("curl -o tmp/latest.dump `heroku pg:backups public-url --app __PROJECT_NAME__`")
28
+ end
29
+
30
+ task :clean do
31
+ run("rm tmp/latest.dump")
32
+ end
33
+ end
34
+
35
+ namespace :import do
36
+ task :postgres => ['kill_postgres_connections','db:drop','db:create'] do
37
+ config = Rails.configuration.database_configuration
38
+ host = config[Rails.env]["host"]
39
+ database = config[Rails.env]["database"]
40
+ username = config[Rails.env]["username"]
41
+ password = config[Rails.env]["password"]
42
+
43
+ puts "Importing to #{database} ..."
44
+
45
+ cmd = ["pg_restore --verbose --clean --no-acl --no-owner"]
46
+ cmd << "-h #{host}" if host.present?
47
+ cmd << "-U #{username}" if username.present?
48
+ cmd << "-p #{password}" if password.present?
49
+ cmd << "-d #{database}"
50
+ cmd << "tmp/latest.dump"
51
+ run(cmd.join(' '))
52
+ end
53
+
54
+ task :kill_postgres_connections => :environment do
55
+ env = "development"
56
+ db_config = Rails.configuration.database_configuration[env]
57
+ fail(ArgumentError, "Could not find db config entry for env (#{env})") unless db_config
58
+ db_name = db_config['database']
59
+
60
+ # thanks to http://stackoverflow.com/questions/12924466/capistrano-with-postgresql-error-database-is-being-accessed-by-other-users
61
+ # previously, we were kill'ing the postgres processes: http://stackoverflow.com/questions/2369744/rails-postgres-drop-error-database-is-being-accessed-by-other-users
62
+ cmd = %(psql -c "SELECT pid, pg_terminate_backend(pid) as terminated FROM pg_stat_activity WHERE pid <> pg_backend_pid();" -d '#{db_name}')
63
+
64
+ unless run(cmd)
65
+ fail $?.inspect
66
+ end
67
+ end
68
+
69
+ end
70
+ end
data/project/log/.keep ADDED
File without changes