pineapples 0.1.0 → 0.3.34

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 (117) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rspec +1 -0
  4. data/.ruby-gemset +1 -0
  5. data/bin/pineapples +4 -9
  6. data/lib/pineapples/actions/apply.rb +34 -0
  7. data/lib/pineapples/actions/base/action.rb +72 -0
  8. data/lib/pineapples/actions/base/target.rb +136 -0
  9. data/lib/pineapples/actions/chmod.rb +28 -0
  10. data/lib/pineapples/actions/copy_file.rb +48 -0
  11. data/lib/pineapples/actions/create_file.rb +114 -0
  12. data/lib/pineapples/actions/directory.rb +115 -0
  13. data/lib/pineapples/actions/empty_directory.rb +71 -0
  14. data/lib/pineapples/actions/get.rb +38 -0
  15. data/lib/pineapples/actions/git.rb +17 -0
  16. data/lib/pineapples/actions/gsub_file.rb +36 -0
  17. data/lib/pineapples/actions/insert_into_file.rb +131 -0
  18. data/lib/pineapples/actions/inside.rb +69 -0
  19. data/lib/pineapples/actions/keep_file.rb +15 -0
  20. data/lib/pineapples/actions/prepend_to_class.rb +26 -0
  21. data/lib/pineapples/actions/rails/copy_migration.rb +67 -0
  22. data/lib/pineapples/actions/rails/erb_converters.rb +37 -0
  23. data/lib/pineapples/actions/rails/rails.rb +186 -0
  24. data/lib/pineapples/actions/remove_file.rb +28 -0
  25. data/lib/pineapples/actions/ruby.rb +49 -0
  26. data/lib/pineapples/actions/shell.rb +40 -0
  27. data/lib/pineapples/actions/template.rb +35 -0
  28. data/lib/pineapples/actions.rb +124 -39
  29. data/lib/pineapples/app_builder.rb +70 -0
  30. data/lib/pineapples/app_generator.rb +187 -0
  31. data/lib/pineapples/build_tasks/root_files.rb +23 -0
  32. data/lib/pineapples/error.rb +7 -0
  33. data/lib/pineapples/helpers.rb +34 -0
  34. data/lib/pineapples/parser.rb +37 -0
  35. data/lib/pineapples/setting.rb +155 -0
  36. data/lib/pineapples/settings.rb +31 -0
  37. data/lib/pineapples/templates/.buildpacks +2 -0
  38. data/lib/pineapples/templates/.editor-config +11 -0
  39. data/lib/pineapples/templates/.example.env.tt +11 -0
  40. data/lib/pineapples/templates/.example.rspec +3 -0
  41. data/lib/pineapples/templates/.gitignore +23 -0
  42. data/lib/pineapples/templates/Aptfile +0 -0
  43. data/lib/pineapples/templates/Gemfile.tt +89 -0
  44. data/lib/pineapples/templates/Guardfile +27 -0
  45. data/lib/pineapples/templates/Procfile +1 -0
  46. data/lib/pineapples/templates/README.md.tt +32 -0
  47. data/lib/pineapples/templates/Rakefile +6 -0
  48. data/lib/pineapples/templates/app/assets/javascripts/application.js +1 -0
  49. data/lib/pineapples/templates/app/assets/javascripts/libs.js +2 -0
  50. data/lib/pineapples/templates/app/assets/stylesheets/application.scss +1 -0
  51. data/lib/pineapples/templates/app/controllers/application_controller.rb.tt +48 -0
  52. data/lib/pineapples/templates/app/controllers/auth/confirmations_controller.rb +2 -0
  53. data/lib/pineapples/templates/app/controllers/pages_controller.rb +6 -0
  54. data/lib/pineapples/templates/app/helpers/application_helper.rb +59 -0
  55. data/lib/pineapples/templates/app/helpers/title_helper.rb +77 -0
  56. data/lib/pineapples/templates/app/models/user!=needs_user_model!.rb.tt +28 -0
  57. data/lib/pineapples/templates/app/views/common/_flashes.html.erb +16 -0
  58. data/lib/pineapples/templates/app/views/common/_footer.html.erb +3 -0
  59. data/lib/pineapples/templates/app/views/common/_header.html.erb +5 -0
  60. data/lib/pineapples/templates/app/views/layouts/application.html.erb.tt +33 -0
  61. data/lib/pineapples/templates/app/views/pages/home.html.erb +4 -0
  62. data/lib/pineapples/templates/bin/bundle +3 -0
  63. data/lib/pineapples/templates/bin/rails +8 -0
  64. data/lib/pineapples/templates/bin/rake +8 -0
  65. data/lib/pineapples/templates/bin/setup +33 -0
  66. data/lib/pineapples/templates/bin/spring +15 -0
  67. data/lib/pineapples/templates/browserlist +4 -0
  68. data/lib/pineapples/templates/config/application.rb.tt +43 -0
  69. data/lib/pineapples/templates/config/boot.rb +5 -0
  70. data/lib/pineapples/templates/config/database.yml.tt +20 -0
  71. data/lib/pineapples/templates/config/environment.rb +5 -0
  72. data/lib/pineapples/templates/config/environments/development.rb +64 -0
  73. data/lib/pineapples/templates/config/environments/production.rb +77 -0
  74. data/lib/pineapples/templates/config/environments/test.rb +34 -0
  75. data/lib/pineapples/templates/config/i18n-tasks.yml +13 -0
  76. data/lib/pineapples/templates/config/initializers/assets.rb +11 -0
  77. data/lib/pineapples/templates/config/initializers/backtrace_silencers.rb +7 -0
  78. data/lib/pineapples/templates/config/initializers/carrierwave.rb +22 -0
  79. data/lib/pineapples/templates/config/initializers/cookies_serializer.rb +3 -0
  80. data/lib/pineapples/templates/config/initializers/filter_parameters_logging.rb +4 -0
  81. data/lib/pineapples/templates/config/initializers/inflections.rb +16 -0
  82. data/lib/pineapples/templates/config/initializers/mime_types.rb +4 -0
  83. data/lib/pineapples/templates/config/initializers/pry.rb +10 -0
  84. data/lib/pineapples/templates/config/initializers/redis.rb +3 -0
  85. data/lib/pineapples/templates/config/initializers/session_store.rb.tt +3 -0
  86. data/lib/pineapples/templates/config/initializers/wrap_parameters.rb +14 -0
  87. data/lib/pineapples/templates/config/locales/en.yml +19 -0
  88. data/lib/pineapples/templates/config/puma.rb +21 -0
  89. data/lib/pineapples/templates/config/routes.rb.tt +10 -0
  90. data/lib/pineapples/templates/config/secrets.yml +11 -0
  91. data/lib/pineapples/templates/config/smtp.rb +11 -0
  92. data/lib/pineapples/templates/config.ru.tt +7 -0
  93. data/lib/pineapples/templates/db/migrate/01_enable_postgres_extensions.rb +15 -0
  94. data/lib/pineapples/templates/db/migrate/02_create_data_migrations.rb +14 -0
  95. data/lib/pineapples/templates/db/migrate/03_devise_create_users.rb +41 -0
  96. data/lib/pineapples/templates/db/migrate/04_add_role_field_to_users.rb +7 -0
  97. data/lib/pineapples/templates/lib/devise!=devise!/ajax_failure.rb +11 -0
  98. data/lib/pineapples/templates/lib/extensions/form_builder.rb +24 -0
  99. data/lib/pineapples/templates/lib/extensions/http_errors.rb +34 -0
  100. data/lib/pineapples/templates/lib/extensions/to_boolean.rb +45 -0
  101. data/lib/pineapples/templates/lib/logging/custom_rack_logger.rb +11 -0
  102. data/lib/pineapples/templates/lib/logging/custom_request_logger.rb +65 -0
  103. data/lib/pineapples/templates/lib/simple_form/components/append.rb +15 -0
  104. data/lib/pineapples/templates/lib/simple_form/components/prepend.rb +15 -0
  105. data/lib/pineapples/templates/lib/tasks/admin!=user_role_field!.rake +52 -0
  106. data/lib/pineapples/templates/lib/tasks/auto_annotate_models.rake +37 -0
  107. data/lib/pineapples/templates/lib/templates/erb/scaffold/_form.html.erb +14 -0
  108. data/lib/pineapples/templates/lib/virtus/virtus.rb +23 -0
  109. data/lib/pineapples/templates/public/404.html +67 -0
  110. data/lib/pineapples/templates/public/422.html +67 -0
  111. data/lib/pineapples/templates/public/500.html +66 -0
  112. data/lib/pineapples/templates/public/favicon.ico +0 -0
  113. data/lib/pineapples/templates/public/robots.txt +5 -0
  114. data/lib/pineapples/version.rb +1 -1
  115. data/lib/pineapples.rb +17 -2
  116. data/pineapples.gemspec +16 -15
  117. metadata +208 -2
@@ -0,0 +1,33 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
+ <meta name="description" content="">
8
+ <%%= csrf_meta_tags %>
9
+ <title><%%= title %></title>
10
+
11
+ <%%= stylesheet_link_tag 'application', media: 'all' %>
12
+
13
+ <%%= javascript_include_tag 'libs' %>
14
+ <%%= javascript_include_tag 'application' %>
15
+
16
+ <%%= yield(:head) %>
17
+ </head>
18
+ <body>
19
+ <!--[if lt IE 8]>
20
+ <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
21
+ <![endif]-->
22
+
23
+ <%%= render 'common/header' %>
24
+
25
+ <main role="main">
26
+ <%%= render 'common/flashes' %>
27
+ <%%= yield %>
28
+ </main>
29
+
30
+ <%%= render 'common/footer' %>
31
+
32
+ </body>
33
+ </html>
@@ -0,0 +1,4 @@
1
+ <p>
2
+ Welcome Home!
3
+ </p>
4
+
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError
5
+ end
6
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
7
+ require_relative '../config/boot'
8
+ require 'rails/commands'
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ require_relative '../config/boot'
7
+ require 'rake'
8
+ Rake.application.run
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+
5
+ # path to your application root.
6
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
7
+
8
+ Dir.chdir APP_ROOT do
9
+ # This script is a starting point to setup your application.
10
+ # Add necessary setup steps to this file:
11
+
12
+ puts "== Installing dependencies =="
13
+ system "gem install bundler --conservative"
14
+ system "bundle check || bundle install"
15
+
16
+ # puts "\n== Copying sample files =="
17
+ # unless File.exist?("config/database.yml")
18
+ # system "cp config/database.yml.sample config/database.yml"
19
+ # end
20
+
21
+ # Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in your shell rc file
22
+ FileUtils.mkdir_p '.git/safe'
23
+
24
+ puts "\n== Preparing database =="
25
+ system "bundle exec rake db:setup"
26
+
27
+ puts "\n== Removing old logs and tempfiles =="
28
+ system "rm -f log/*"
29
+ system "rm -rf tmp/cache"
30
+
31
+ puts "\n== Restarting application server =="
32
+ system "touch tmp/restart.txt"
33
+ end
@@ -0,0 +1,15 @@
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
+ Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
12
+ gem "spring", match[1]
13
+ require "spring/binstub"
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ Last 2 versions
2
+ Explorer >= 9
3
+ iOS >= 7.1
4
+ Android >= 4.4
@@ -0,0 +1,43 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+
7
+ # Require platform-specific gems
8
+ platform = RUBY_PLATFORM.match(/(linux|darwin)/)[0].to_sym
9
+ Bundler.require(platform)
10
+
11
+ module <%= app_const_base %>
12
+ class Application < Rails::Application
13
+ require_all "#{Rails.root}/lib/extensions"
14
+ require_all "#{Rails.root}/lib/logging" if !Rails.env.production?
15
+ <%= comment_if_not :carrierwave %>require_all "#{Rails.root}/lib/carrierwave"
16
+ require_all "#{Rails.root}/lib/virtus"
17
+ <%= comment_if_not :devise %>require_all "#{Rails.root}/lib/devise"
18
+ require_all "#{Rails.root}/lib/simple_form"
19
+ require "#{Rails.root}/config/smtp"
20
+
21
+ config.generators do |generate|
22
+ generate.scaffold_controller :responders_controller
23
+ generate.helper false
24
+ generate.template_engine <%= template_engine %>
25
+ generate.javascript_engine false
26
+ generate.stylesheets false
27
+
28
+ generate.test_framework :rspec
29
+ generate.request_specs false
30
+ generate.routing_specs false
31
+ generate.view_specs false
32
+ end
33
+
34
+ config.i18n.enforce_available_locales = true
35
+
36
+ config.active_job.queue_adapter = :sidekiq
37
+
38
+ config.action_controller.action_on_unpermitted_parameters = :raise
39
+
40
+ # Do not swallow errors in after_commit/after_rollback callbacks.
41
+ config.active_record.raise_in_transactional_callbacks = true
42
+ end
43
+ end
@@ -0,0 +1,5 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
+
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
4
+
5
+ require_relative '../lib/extensions/env_wrapper'
@@ -0,0 +1,20 @@
1
+ development: &default
2
+ adapter: postgresql
3
+ database: <%= app_name %>_dev
4
+ encoding: utf8
5
+ host: localhost
6
+ min_messages: warning
7
+ pool: <%%= Integer(ENV.fetch('DB_POOL', 5)) %>
8
+ reaping_frequency: <%%= Integer(ENV.fetch('DB_REAPING_FREQUENCY', 10)) %>
9
+ timeout: 5000
10
+
11
+ test:
12
+ <<: *default
13
+ database: <%= app_name %>_test
14
+
15
+ production: &deploy
16
+ encoding: utf8
17
+ min_messages: warning
18
+ pool: <%%= [Integer(ENV.fetch('MAX_THREADS', 5)), Integer(ENV.fetch('DB_POOL', 5))].max %>
19
+ timeout: 5000
20
+ url: <%%= ENV.fetch('DATABASE_URL', '') %>
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,64 @@
1
+ Rails.application.configure do
2
+ config.cache_classes = false
3
+ config.eager_load = false
4
+
5
+ # Show full error reports and disable caching.
6
+ config.consider_all_requests_local = true
7
+ config.action_controller.perform_caching = false
8
+
9
+ # Print deprecation notices to the Rails logger.
10
+ config.active_support.deprecation = :log
11
+
12
+ # Raise an error on page load if there are pending migrations.
13
+ config.active_record.migration_error = :page_load
14
+
15
+ config.assets.debug = true
16
+
17
+ # Source maps for SASS
18
+ config.sass.inline_source_maps = true
19
+
20
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
21
+ # yet still be able to expire them through the digest params.
22
+ config.assets.digest = true
23
+
24
+ # Adds additional error checking when serving assets at runtime.
25
+ # Checks for improperly declared sprockets dependencies.
26
+ # Raises helpful error messages.
27
+ config.assets.raise_runtime_errors = true
28
+
29
+ config.action_view.logger = nil
30
+ config.quiet_assets = false if ENV['LOG_ASSETS']
31
+
32
+ url = ENV['DOMAIN_URL'] || 'http://localhost:3000'
33
+
34
+ Rails.application.routes.default_url_options = {url: url}
35
+
36
+ config.action_mailer.delivery_method = :smtp
37
+
38
+ config.action_mailer.smtp_settings = SMTP_SETTINGS
39
+
40
+ config.action_mailer.default_url_options = {url: url}
41
+
42
+ config.action_mailer.raise_delivery_errors = true
43
+ # config.action_mailer.delivery_method = :test
44
+
45
+ config.web_console.whitelisted_ips = '192.168.0.0/16'
46
+ config.web_console.whiny_requests = false
47
+
48
+ # Settings specified here will take precedence over those in config/application.rb.
49
+ live_reload_options = {
50
+ min_delay: 1000, # default 1000
51
+ max_delay: 15_000, # default 60_000
52
+ no_swf: true
53
+ #source: :livereload
54
+
55
+ #live_reload_port: 56789, # default 35729
56
+ #host: url.host,
57
+ #ignore: [ %r{dont/modify\.html$} ]
58
+ }
59
+
60
+ config.middleware.insert_after(ActionDispatch::Static, Rack::LiveReload, live_reload_options)
61
+
62
+ # Raises error for missing translations
63
+ config.action_view.raise_on_missing_translations = true
64
+ end
@@ -0,0 +1,77 @@
1
+ Rails.application.configure do
2
+ # Code is not reloaded between requests.
3
+ config.cache_classes = true
4
+
5
+ # Rake tasks automatically ignore this option for performance.
6
+ config.eager_load = true
7
+
8
+ # Full error reports are disabled
9
+ config.consider_all_requests_local = false
10
+
11
+ config.action_controller.perform_caching = true
12
+
13
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
14
+ # For large-scale production use, consider using a caching reverse proxy like
15
+ # NGINX, varnish or squid.
16
+ # config.action_dispatch.rack_cache = true
17
+
18
+ # Disable serving static files from the `/public` folder by default since
19
+ # Apache or NGINX already handles this.
20
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES']
21
+
22
+ # Compress JavaScripts and CSS.
23
+ config.assets.js_compressor = :uglifier
24
+ config.assets.css_compressor = :sass
25
+
26
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
27
+ config.assets.compile = false
28
+ config.assets.digest = true
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ config.log_level = :debug
34
+
35
+ # Prepend all log lines with the following tags.
36
+ # config.log_tags = [ :subdomain, :uuid ]
37
+
38
+ # Use a different logger for distributed setups.
39
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
40
+
41
+ # Use a different cache store in production.
42
+ # config.cache_store = :mem_cache_store
43
+
44
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
45
+ # config.action_controller.asset_host = 'http://assets.example.com'
46
+
47
+ # Ignore bad email addresses and do not raise email delivery errors.
48
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
49
+ # config.action_mailer.raise_delivery_errors = false
50
+
51
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
52
+ # the I18n.default_locale when a translation cannot be found).
53
+ config.i18n.fallbacks = true
54
+
55
+ config.active_support.deprecation = :notify
56
+
57
+ config.log_formatter = ::Logger::Formatter.new
58
+
59
+ config.active_record.dump_schema_after_migration = false
60
+
61
+ domain_url = URI.parse(ENV.fetch('DOMAIN_URL'))
62
+
63
+ Rails.application.routes.default_url_options[:host] = domain_url.host
64
+
65
+ config.action_mailer.default_url_options = {url: domain_url.url}
66
+
67
+ config.action_mailer.delivery_method = :smtp
68
+ config.action_mailer.smtp_settings = SMTP_SETTINGS
69
+
70
+ config.action_dispatch.rack_cache = {
71
+ metastore: ENV.fetch('REDIS_URL'),
72
+ entitystore: 'file:tmp/cache/rack/body'
73
+ }
74
+
75
+ config.static_cache_control = 'public, max-age=2592000'
76
+
77
+ end
@@ -0,0 +1,34 @@
1
+ Rails.application.configure do
2
+ config.cache_classes = true
3
+
4
+ # preload Rails before running tests to leverage spring
5
+ # TODO: figure this out
6
+ config.eager_load = false
7
+
8
+ # Configure static file server for tests with Cache-Control for performance.
9
+ config.serve_static_files = true
10
+ config.static_cache_control = 'public, max-age=3600'
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+
15
+ config.action_controller.perform_caching = false
16
+
17
+ config.action_controller.allow_forgery_protection = false
18
+
19
+ # Raise exceptions instead of rendering exception templates.
20
+ config.action_dispatch.show_exceptions = false
21
+
22
+ config.action_mailer.delivery_method = :test
23
+ config.action_mailer.default_url_options = { host: 'www.example.com' }
24
+
25
+ # Print deprecation notices to the stderr.
26
+ config.active_support.deprecation = :stderr
27
+
28
+ config.active_support.test_order = :random
29
+
30
+ # Raises error for missing translations
31
+ config.action_view.raise_on_missing_translations = true
32
+
33
+ config.active_job.queue_adapter = :inline
34
+ end
@@ -0,0 +1,13 @@
1
+ search:
2
+ paths:
3
+ - 'app/controllers'
4
+ - 'app/helpers'
5
+ - 'app/presenters'
6
+ - 'app/views'
7
+
8
+ ignore_unused:
9
+ - activerecord.*
10
+ - date.*
11
+ - simple_form.*
12
+ - time.*
13
+ - titles.*
@@ -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 = (ENV['ASSETS_VERSION'] || '1.0')
5
+
6
+ # Add additional assets to the asset load path
7
+ # Rails.application.config.assets.paths << Emoji.images_path
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( libs.js livereload.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,22 @@
1
+ CarrierWave.configure do |config|
2
+ config.root = Rails.root.join('tmp')
3
+ config.cache_dir = 'carrierwave'
4
+
5
+ if Rails.env.production?
6
+ config.storage = :aws
7
+ config.aws_authenticated_url_expiration = 60 * 60 * 24 * 7
8
+
9
+ config.aws_attributes = {
10
+ expires: 1.week.from_now.httpdate,
11
+ cache_control: 'max-age=604800'
12
+ }
13
+
14
+ config.aws_credentials = {
15
+ aws_access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
16
+ aws_secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY')
17
+ }
18
+
19
+ config.aws_bucket = ENV.fetch('AWS_BUCKET')
20
+ end
21
+
22
+ end
@@ -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, :password_confirmation]
@@ -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,10 @@
1
+ # Show red environment name in pry prompt for non development environments
2
+ if !Rails.env.development?
3
+ old_prompt = Pry.config.prompt
4
+ env = Pry::Helpers::Text.red(Rails.env.upcase)
5
+ Pry.config.prompt = [
6
+ proc { |*a| "#{env} #{old_prompt.first.call(*a)}" },
7
+ proc { |*a| "#{env} #{old_prompt.second.call(*a)}" },
8
+ ]
9
+ end
10
+
@@ -0,0 +1,3 @@
1
+ url = URI.parse(ENV.fetch('REDIS_URL'))
2
+
3
+ $redis = Redis.new(url: url, driver: :hiredis)
@@ -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: '_<%= app_name %>_session'
@@ -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,19 @@
1
+ en:
2
+ date:
3
+ formats:
4
+ default:
5
+ "%m/%d/%Y"
6
+ with_weekday:
7
+ "%a %m/%d/%y"
8
+
9
+ time:
10
+ formats:
11
+ default:
12
+ "%a, %b %-d, %Y at %r"
13
+ date:
14
+ "%b %-d, %Y"
15
+ short:
16
+ "%B %d"
17
+
18
+ titles:
19
+ application: <%= app_name.humanize %>
@@ -0,0 +1,21 @@
1
+ # https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server
2
+
3
+ # The environment variable WEB_CONCURRENCY may be set to a default value based
4
+ # on dyno size. To manually configure this value use heroku config:set
5
+ # WEB_CONCURRENCY.
6
+ workers Integer(ENV.fetch('WEB_CONCURRENCY', 3))
7
+ threads_count = Integer(ENV.fetch('MAX_THREADS', 5))
8
+ threads(threads_count, threads_count)
9
+
10
+ preload_app!
11
+
12
+ rackup DefaultRackup
13
+ environment ENV.fetch('RACK_ENV', 'development')
14
+
15
+ on_worker_boot do
16
+ # Worker specific setup for Rails 4.1+
17
+ # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
18
+ ActiveRecord::Base.establish_connection
19
+ puts 'Reconnecting Rails.cache'
20
+ Rails.cache.reconnect
21
+ end
@@ -0,0 +1,10 @@
1
+ Rails.application.routes.draw do
2
+ <% if devise? -%>
3
+ devise_for :users, controllers: {registrations: 'auth/registrations',
4
+ confirmations: 'auth/confirmations',
5
+ passwords: 'auth/passwords',
6
+ sessions: 'auth/sessions'}
7
+ <% end -%>
8
+
9
+ root 'pages#home'
10
+ end
@@ -0,0 +1,11 @@
1
+ default: &default
2
+ secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
3
+
4
+ development:
5
+ <<: *default
6
+
7
+ test:
8
+ <<: *default
9
+
10
+ production:
11
+ <<: *default
@@ -0,0 +1,11 @@
1
+ SMTP_SETTINGS = {
2
+ authentication: ENV.fetch('SMTP_AUTHENTICATION', :plain).to_sym,
3
+ enable_starttls_auto: ENV.fetch('SMTP_STARTTLS', false),
4
+
5
+ address: ENV.fetch('SMTP_ADDRESS'), # example: "smtp.sendgrid.net"
6
+ domain: ENV.fetch('SMTP_DOMAIN'), # example: "heroku.com"
7
+ port: ENV.fetch('SMTP_PORT', 587),
8
+
9
+ user_name: ENV.fetch('SMTP_USERNAME'),
10
+ password: ENV.fetch('SMTP_PASSWORD')
11
+ }
@@ -0,0 +1,7 @@
1
+ require ::File.expand_path('../config/environment', __FILE__)
2
+ <% if carrierwave? && heroku? -%>
3
+
4
+ use Rack::Static, urls: ['/carrierwave'], root: 'tmp'
5
+
6
+ <% end -%>
7
+ run Rails.application
@@ -0,0 +1,15 @@
1
+ class EnablePostgresExtensions < ActiveRecord::Migration
2
+ def self.up
3
+ enable_extension 'plpgsql' if !extension_enabled? 'plpgsql'
4
+ enable_extension 'hstore' if !extension_enabled? 'hstore'
5
+ enable_extension 'ltree' if !extension_enabled? 'ltree'
6
+ enable_extension 'uuid-ossp' if !extension_enabled? 'uuid-ossp'
7
+ end
8
+
9
+ def self.down
10
+ disable_extension 'plpgsql' if extension_enabled? 'plpgsql'
11
+ disable_extension 'hstore' if extension_enabled? 'hstore'
12
+ disable_extension 'ltree' if extension_enabled? 'ltree'
13
+ disable_extension 'uuid-ossp' if extension_enabled? 'uuid-ossp'
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ # This migration comes from seed_migration (originally 20140310150145)
2
+ class CreateDataMigrations < ActiveRecord::Migration
3
+ def up
4
+ create_table SeedMigration.migration_table_name do |t|
5
+ t.string :version
6
+ t.integer :runtime
7
+ t.datetime :migrated_on
8
+ end
9
+ end
10
+
11
+ def down
12
+ drop_table SeedMigration.migration_table_name
13
+ end
14
+ end