decko 0.11.5 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/card_controller.rb +4 -0
- data/lib/card_controller/errors.rb +11 -13
- data/lib/card_controller/response.rb +0 -12
- data/lib/card_controller/rest.rb +14 -4
- data/lib/decko.rb +2 -15
- data/lib/decko/all.rb +2 -0
- data/lib/decko/application.rb +8 -89
- data/lib/decko/cli.rb +1 -7
- data/lib/decko/commands.rb +17 -110
- data/lib/decko/commands/application.rb +2 -2
- data/lib/decko/commands/cucumber_command.rb +8 -7
- data/lib/decko/commands/cucumber_command/parser.rb +2 -2
- data/lib/decko/engine.rb +1 -45
- data/lib/decko/generators.rb +17 -0
- data/lib/decko/mods_spec_helper.rb +1 -1
- data/lib/decko/railtie.rb +27 -0
- data/lib/decko/script_decko_loader.rb +5 -38
- data/lib/decko/tasks/cucumber.rake +25 -16
- data/lib/decko/tasks/decko.rake +7 -28
- data/lib/decko/tasks/decko/benchmark.rake +38 -0
- data/lib/decko/tasks/decko/docs.rake +1 -1
- data/lib/decko/tasks/decko/seed.rake +16 -7
- data/lib/generators/deck/deck_generator.rb +12 -0
- metadata +25 -72
- data/lib/decko/commands/command.rb +0 -28
- data/lib/decko/commands/rake_command.rb +0 -42
- data/lib/decko/commands/rake_command/parser.rb +0 -35
- data/lib/decko/commands/rspec_command.rb +0 -36
- data/lib/decko/commands/rspec_command/parser.rb +0 -97
- data/lib/decko/config/environments/cucumber.rb +0 -41
- data/lib/decko/config/environments/cypress.rb +0 -100
- data/lib/decko/config/environments/development.rb +0 -95
- data/lib/decko/config/environments/production.rb +0 -75
- data/lib/decko/config/environments/profile.rb +0 -33
- data/lib/decko/config/environments/test.rb +0 -69
- data/lib/decko/config/initializers/secret_token.rb +0 -15
- data/lib/decko/config/initializers/sedate_parser.rb +0 -8
- data/lib/decko/config/initializers/session_store.rb +0 -2
- data/lib/decko/generators/deck/USAGE +0 -9
- data/lib/decko/generators/deck/deck_generator.rb +0 -134
- data/lib/decko/generators/deck/deck_generator/deck_helper.rb +0 -110
- data/lib/decko/generators/deck/deck_generator/interactive.rb +0 -120
- data/lib/decko/generators/deck/deck_generator/rails_overrides.rb +0 -54
- data/lib/decko/generators/deck/templates/Gemfile.erb +0 -56
- data/lib/decko/generators/deck/templates/Rakefile.erb +0 -6
- data/lib/decko/generators/deck/templates/bin/spring.erb +0 -20
- data/lib/decko/generators/deck/templates/config.ru.erb +0 -11
- data/lib/decko/generators/deck/templates/config/application.rb.erb +0 -107
- data/lib/decko/generators/deck/templates/config/boot.rb.erb +0 -11
- data/lib/decko/generators/deck/templates/config/cucumber.yml +0 -1
- data/lib/decko/generators/deck/templates/config/databases/frontbase.yml +0 -34
- data/lib/decko/generators/deck/templates/config/databases/ibm_db.yml +0 -89
- data/lib/decko/generators/deck/templates/config/databases/jdbc.yml +0 -65
- data/lib/decko/generators/deck/templates/config/databases/jdbcmysql.yml +0 -36
- data/lib/decko/generators/deck/templates/config/databases/jdbcpostgresql.yml +0 -46
- data/lib/decko/generators/deck/templates/config/databases/jdbcsqlite3.yml +0 -23
- data/lib/decko/generators/deck/templates/config/databases/mysql.yml +0 -37
- data/lib/decko/generators/deck/templates/config/databases/oracle.yml +0 -42
- data/lib/decko/generators/deck/templates/config/databases/postgresql.yml +0 -39
- data/lib/decko/generators/deck/templates/config/databases/sqlite3.yml +0 -21
- data/lib/decko/generators/deck/templates/config/deck.yml +0 -10
- data/lib/decko/generators/deck/templates/config/environment.rb.erb +0 -5
- data/lib/decko/generators/deck/templates/config/initializers/cypress.rb +0 -12
- data/lib/decko/generators/deck/templates/config/puma.rb +0 -16
- data/lib/decko/generators/deck/templates/config/routes.rb.erb +0 -11
- data/lib/decko/generators/deck/templates/config/storage.yml +0 -0
- data/lib/decko/generators/deck/templates/gitignore +0 -18
- data/lib/decko/generators/deck/templates/pryrc +0 -6
- data/lib/decko/generators/deck/templates/public/files/htaccess +0 -9
- data/lib/decko/generators/deck/templates/public/robots.txt +0 -13
- data/lib/decko/generators/deck/templates/rspec.erb +0 -6
- data/lib/decko/generators/deck/templates/script/decko +0 -6
- data/lib/decko/generators/deck/templates/script/decko_cucumber +0 -8
- data/lib/decko/generators/deck/templates/script/decko_rspec +0 -8
- data/lib/decko/generators/deck/templates/script/delayed_job +0 -5
- data/lib/decko/generators/deck/templates/simplecov.rb.erb +0 -34
- data/lib/decko/generators/deck/templates/spec/javascripts/support/deck_jasmine.yml.erb +0 -56
- data/lib/decko/generators/deck/templates/spec/javascripts/support/decko_jasmine.yml.erb +0 -74
- data/lib/decko/generators/deck/templates/spec/spec_helper.rb +0 -1
- data/rails/application-routes.rb +0 -3
- data/rails/assets/external_link.png +0 -0
- data/rails/assets/jasmine/404.html +0 -27
- data/rails/assets/jasmine/500.html +0 -28
- data/rails/assets/jasmine/card_form.html +0 -13
- data/rails/assets/jquery.min.map +0 -1
- data/rails/engine-routes.rb +0 -53
- data/script/autospec +0 -4
- data/script/decko +0 -6
- data/script/rails +0 -6
@@ -1,100 +0,0 @@
|
|
1
|
-
Decko::Engine.configure do
|
2
|
-
config.cache_classes = false
|
3
|
-
end
|
4
|
-
|
5
|
-
# -*- encoding : utf-8 -*-
|
6
|
-
|
7
|
-
Decko.application.class.configure do
|
8
|
-
# Settings specified here will take precedence over those in config/application.rb
|
9
|
-
|
10
|
-
config.view_cache = false
|
11
|
-
|
12
|
-
config.eager_load = false
|
13
|
-
|
14
|
-
config.machine_refresh = :eager
|
15
|
-
config.compress_javascript = false
|
16
|
-
|
17
|
-
# In the development environment your application's code is reloaded on
|
18
|
-
# every request. This slows down response time but is perfect for development
|
19
|
-
# since you don't have to restart the web server when you make code changes.
|
20
|
-
config.cache_classes = false
|
21
|
-
config.reload_classes_only_on_change = false
|
22
|
-
|
23
|
-
# if defined?(RailsDevTweaks)
|
24
|
-
# config.dev_tweaks.autoload_rules do
|
25
|
-
# skip "/files"
|
26
|
-
# skip "/favicon.ico"
|
27
|
-
# skip /view\=status/
|
28
|
-
# end
|
29
|
-
# end
|
30
|
-
|
31
|
-
# Log error messages when you accidentally call methods on nil.
|
32
|
-
config.whiny_nils = true
|
33
|
-
|
34
|
-
# Show full error reports and disable caching
|
35
|
-
config.consider_all_requests_local = true
|
36
|
-
config.action_controller.perform_caching = false
|
37
|
-
|
38
|
-
# Don't care if the mailer can't send
|
39
|
-
config.action_mailer.raise_delivery_errors = false
|
40
|
-
|
41
|
-
# Print deprecation notices to the Rails logger
|
42
|
-
config.active_support.deprecation = :log
|
43
|
-
|
44
|
-
# See everything in the log (default is :info)
|
45
|
-
config.log_level = :debug
|
46
|
-
|
47
|
-
# if false, most rendering errors will be rescued and made visible only
|
48
|
-
# in the nest where the error occurred
|
49
|
-
config.raise_all_rendering_errors = true
|
50
|
-
|
51
|
-
# if false, application will raise errors that make it to controller.
|
52
|
-
config.rescue_all_in_controller = false
|
53
|
-
|
54
|
-
# config.performance_logger = {
|
55
|
-
# methods: [:event, :search, :fetch, :view], # choose methods to log
|
56
|
-
# min_time: 100, # show only method calls that are slower than 100ms
|
57
|
-
# max_depth: 3, # show nested method calls only up to depth 3
|
58
|
-
# details: true # show method arguments and sql
|
59
|
-
# log_level: :info
|
60
|
-
# }
|
61
|
-
|
62
|
-
# Only use best-standards-support built into browsers
|
63
|
-
config.action_dispatch.best_standards_support = :builtin
|
64
|
-
|
65
|
-
# Do not compress assets
|
66
|
-
# config.assets.compress = false
|
67
|
-
#
|
68
|
-
# # Expands the lines which load the assets
|
69
|
-
# config.assets.debug = false
|
70
|
-
#
|
71
|
-
# # This needs to be on for tinymce to work, because several important files (themes, etc) are only served statically
|
72
|
-
# config.serve_static_files = ENV['STATIC_ASSETS'] || true
|
73
|
-
#
|
74
|
-
# # Setting a bogus directory so rails won't find public/assets in dev mode.
|
75
|
-
# # Normally you could skip that by not serving static assets, but that breaks tinymce (see above)
|
76
|
-
# config.assets.prefix = "dynamic-assets"
|
77
|
-
|
78
|
-
# Log the query plan for queries taking more than this (works
|
79
|
-
# with SQLite, MySQL, and PostgreSQL)
|
80
|
-
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
81
|
-
|
82
|
-
# if File.exists?(File.join(Rails.root,'tmp', 'debug.txt'))
|
83
|
-
# require 'ruby-debug'
|
84
|
-
# Debugger.wait_connection = true
|
85
|
-
# Debugger.start_remote
|
86
|
-
# File.delete(File.join(Rails.root,'tmp', 'debug.txt'))
|
87
|
-
# end
|
88
|
-
|
89
|
-
config.action_mailer.perform_deliveries = false
|
90
|
-
|
91
|
-
# Use Pry instead of IRB
|
92
|
-
silence_warnings do
|
93
|
-
require "pry"
|
94
|
-
config.console = Pry
|
95
|
-
rescue LoadError
|
96
|
-
end
|
97
|
-
# config.session_store :cookie_store
|
98
|
-
end
|
99
|
-
|
100
|
-
# Paperclip.options[:command_path] = "/opt/local/bin"
|
@@ -1,95 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
|
3
|
-
Decko::Engine.configure do
|
4
|
-
config.cache_classes = false
|
5
|
-
end
|
6
|
-
|
7
|
-
Decko.application.class.configure do
|
8
|
-
# Settings specified here will take precedence over those in config/application.rb
|
9
|
-
|
10
|
-
config.view_cache = false
|
11
|
-
|
12
|
-
config.eager_load = false
|
13
|
-
|
14
|
-
config.machine_refresh = :eager
|
15
|
-
config.compress_javascript = false
|
16
|
-
|
17
|
-
# In the development environment your application's code is reloaded on
|
18
|
-
# every request. This slows down response time but is perfect for development
|
19
|
-
# since you don't have to restart the web server when you make code changes.
|
20
|
-
config.cache_classes = false
|
21
|
-
config.reload_classes_only_on_change = true
|
22
|
-
|
23
|
-
# Log error messages when you accidentally call methods on nil.
|
24
|
-
config.whiny_nils = true
|
25
|
-
|
26
|
-
# Show full error reports and disable caching
|
27
|
-
config.consider_all_requests_local = true
|
28
|
-
config.action_controller.perform_caching = false
|
29
|
-
|
30
|
-
# Don't care if the mailer can't send
|
31
|
-
config.action_mailer.raise_delivery_errors = false
|
32
|
-
|
33
|
-
# Print deprecation notices to the Rails logger
|
34
|
-
config.active_support.deprecation = :log
|
35
|
-
|
36
|
-
# See everything in the log (default is :info)
|
37
|
-
config.log_level = :debug
|
38
|
-
|
39
|
-
# if false, most rendering errors will be rescued and made visible only
|
40
|
-
# in the nest where the error occurred
|
41
|
-
config.raise_all_rendering_errors = true
|
42
|
-
|
43
|
-
# if false, application will raise errors that make it to controller.
|
44
|
-
config.rescue_all_in_controller = false
|
45
|
-
|
46
|
-
# config.performance_logger = {
|
47
|
-
# methods: [:event, :search, :fetch, :view], # choose methods to log
|
48
|
-
# min_time: 100, # show only method calls that are slower than 100ms
|
49
|
-
# max_depth: 3, # show nested method calls only up to depth 3
|
50
|
-
# details: true # show method arguments and sql
|
51
|
-
# log_level: :info
|
52
|
-
# }
|
53
|
-
|
54
|
-
# Only use best-standards-support built into browsers
|
55
|
-
config.action_dispatch.best_standards_support = :builtin
|
56
|
-
|
57
|
-
# Do not compress assets
|
58
|
-
# config.assets.compress = false
|
59
|
-
#
|
60
|
-
# # Expands the lines which load the assets
|
61
|
-
# config.assets.debug = false
|
62
|
-
#
|
63
|
-
# # This needs to be on for tinymce to work, because several important files
|
64
|
-
# (themes, etc) are only served statically
|
65
|
-
# config.serve_static_files = ENV['STATIC_ASSETS'] || true
|
66
|
-
#
|
67
|
-
# # Setting a bogus directory so rails won't find public/assets in dev mode.
|
68
|
-
# # Normally you could skip that by not serving static assets, but that breaks
|
69
|
-
# tinymce (see above)
|
70
|
-
# config.assets.prefix = "dynamic-assets"
|
71
|
-
|
72
|
-
# Log the query plan for queries taking more than this (works
|
73
|
-
# with SQLite, MySQL, and PostgreSQL)
|
74
|
-
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
75
|
-
|
76
|
-
# if File.exists?(File.join(Rails.root,'tmp', 'debug.txt'))
|
77
|
-
# require 'ruby-debug'
|
78
|
-
# Debugger.wait_connection = true
|
79
|
-
# Debugger.start_remote
|
80
|
-
# File.delete(File.join(Rails.root,'tmp', 'debug.txt'))
|
81
|
-
# end
|
82
|
-
|
83
|
-
config.action_mailer.perform_deliveries = false
|
84
|
-
|
85
|
-
# Use Pry instead of IRB
|
86
|
-
silence_warnings do
|
87
|
-
require "pry"
|
88
|
-
config.console = Pry
|
89
|
-
rescue LoadError
|
90
|
-
end
|
91
|
-
|
92
|
-
# config.session_store :cookie_store
|
93
|
-
end
|
94
|
-
|
95
|
-
# Paperclip.options[:command_path] = "/opt/local/bin"
|
@@ -1,75 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
|
3
|
-
Decko.application.class.configure do
|
4
|
-
# Settings specified here will take precedence over those in config/application.rb
|
5
|
-
|
6
|
-
config.eager_load = true
|
7
|
-
|
8
|
-
# temporary fix for formerly autoloaded files that stopped autoloading in Rails 5
|
9
|
-
# TODO: configure eager_load_paths explicitly (and remove this)
|
10
|
-
config.enable_dependency_loading = true
|
11
|
-
|
12
|
-
# Code is not reloaded between requests
|
13
|
-
config.cache_classes = true
|
14
|
-
|
15
|
-
# Full error reports are disabled and caching is turned on
|
16
|
-
config.consider_all_requests_local = false
|
17
|
-
config.action_controller.perform_caching = true
|
18
|
-
|
19
|
-
# Disable Rails's static asset server (Apache or nginx will already do this)
|
20
|
-
config.serve_static_files = defined?(Rails::Server)
|
21
|
-
|
22
|
-
# Compress JavaScripts and CSS
|
23
|
-
config.assets.compress = true
|
24
|
-
|
25
|
-
# Don't fallback to assets pipeline if a precompiled asset is missed
|
26
|
-
config.assets.compile = false
|
27
|
-
|
28
|
-
# Generate digests for assets URLs
|
29
|
-
config.assets.digest = true
|
30
|
-
|
31
|
-
# Defaults to Rails.root.join("public/assets")
|
32
|
-
# config.assets.manifest = File.join(Decko.gem_root, "public/assets")
|
33
|
-
|
34
|
-
# Specifies the header that your server uses for sending files
|
35
|
-
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
36
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
37
|
-
|
38
|
-
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
39
|
-
# config.force_ssl = true
|
40
|
-
|
41
|
-
# See everything in the log (default is :info)
|
42
|
-
config.log_level = :info
|
43
|
-
|
44
|
-
# Use a different logger for distributed setups
|
45
|
-
# config.logger = SyslogLogger.new
|
46
|
-
|
47
|
-
# Use a different cache store in production
|
48
|
-
# config.cache_store = :mem_cache_store
|
49
|
-
|
50
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
51
|
-
# config.action_controller.asset_host = "http://assets.example.com"
|
52
|
-
|
53
|
-
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
54
|
-
config.assets.precompile += %w[application-all.css application-print.css barebones.css
|
55
|
-
html5shiv-printshiv.js]
|
56
|
-
|
57
|
-
# Disable delivery errors, bad email addresses will be ignored
|
58
|
-
# config.action_mailer.raise_delivery_errors = false
|
59
|
-
|
60
|
-
# Enable threaded mode
|
61
|
-
# config.threadsafe!
|
62
|
-
|
63
|
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
64
|
-
# the I18n.default_locale when a translation can not be found)
|
65
|
-
config.i18n.fallbacks = true
|
66
|
-
|
67
|
-
# Send deprecation notices to registered listeners
|
68
|
-
config.active_support.deprecation = :notify
|
69
|
-
|
70
|
-
# cache the list of set module objects on card objects
|
71
|
-
config.cache_set_module_list = true
|
72
|
-
|
73
|
-
# if false, application will raise errors that make it to controller.
|
74
|
-
config.rescue_all_in_controller = true
|
75
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
|
3
|
-
Decko.application.class.configure do
|
4
|
-
# Settings specified here will take precedence over those in config/environment.rb
|
5
|
-
# The profile environment should match the same settings
|
6
|
-
# as the production environment to give a reasonalbe
|
7
|
-
# approximation of performance. However, it should
|
8
|
-
# definitely not use the production databse!
|
9
|
-
|
10
|
-
config.eager_load = true
|
11
|
-
|
12
|
-
# Cache classes - otherwise your code
|
13
|
-
# will run approximately 5 times slower and the
|
14
|
-
# profiling results will be overwhelmed by Rails
|
15
|
-
# dependency loading mechanism
|
16
|
-
config.cache_classes = true
|
17
|
-
|
18
|
-
# Don't check template timestamps - once again this
|
19
|
-
# is to avoid IO times overwhelming profile results
|
20
|
-
config.action_view.cache_template_loading = true
|
21
|
-
|
22
|
-
# This is debatable, but turn off action controller
|
23
|
-
# caching to see how long it really takes to run
|
24
|
-
# queries and render templates
|
25
|
-
config.action_controller.perform_caching = true
|
26
|
-
|
27
|
-
# Turn off most logging
|
28
|
-
config.log_level = :info
|
29
|
-
|
30
|
-
config.active_support.deprecation = :log
|
31
|
-
|
32
|
-
config.action_mailer.perform_deliveries = false
|
33
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
|
3
|
-
Decko.application.class.configure do
|
4
|
-
# Settings specified here will take precedence over those in config/application.rb
|
5
|
-
|
6
|
-
config.eager_load = false
|
7
|
-
|
8
|
-
config.machine_refresh = :never
|
9
|
-
|
10
|
-
# The test environment is used exclusively to run your application's
|
11
|
-
# test suite. You never need to work with it otherwise. Remember that
|
12
|
-
# your test database is "scratch space" for the test suite and is wiped
|
13
|
-
# and recreated between test runs. Don't rely on the data there!
|
14
|
-
config.cache_classes = false
|
15
|
-
|
16
|
-
config.assets.enabled = true if Object.const_defined?(:JasmineRails)
|
17
|
-
|
18
|
-
config.persistent_cache = false
|
19
|
-
config.prepopulate_cache = true
|
20
|
-
|
21
|
-
# Configure static asset server for tests with Cache-Control for performance
|
22
|
-
config.serve_static_files = true
|
23
|
-
config.static_cache_control = "public, max-age=3600"
|
24
|
-
|
25
|
-
# Log error messages when you accidentally call methods on nil
|
26
|
-
config.whiny_nils = true
|
27
|
-
|
28
|
-
# Show full error reports and disable caching
|
29
|
-
config.consider_all_requests_local = true
|
30
|
-
config.action_controller.perform_caching = false
|
31
|
-
|
32
|
-
# Raise exceptions instead of rendering exception templates
|
33
|
-
config.action_dispatch.show_exceptions = false
|
34
|
-
|
35
|
-
# Disable request forgery protection in test environment
|
36
|
-
config.action_controller.allow_forgery_protection = false
|
37
|
-
|
38
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
39
|
-
# The :test delivery method accumulates sent emails in the
|
40
|
-
# ActionMailer::Base.deliveries array.
|
41
|
-
config.action_mailer.delivery_method = :test
|
42
|
-
config.action_mailer.perform_deliveries = true
|
43
|
-
config.action_mailer.default charset: "utf-8"
|
44
|
-
|
45
|
-
# config.action_mailer.delivery_method = :smtp
|
46
|
-
# config.action_mailer.smtp_settings = { address: "localhost", port: 1025 }
|
47
|
-
|
48
|
-
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
49
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
50
|
-
# like if you have constraints or database-specific column types
|
51
|
-
# config.active_record.schema_format = :sql
|
52
|
-
|
53
|
-
# FIXME: - add back the next one when we go back to 3.2
|
54
|
-
# Raise exception on mass assignment protection for Active Record models
|
55
|
-
# config.active_record.mass_assignment_sanitizer = :strict
|
56
|
-
|
57
|
-
# Print deprecation notices to the stderr
|
58
|
-
config.active_support.deprecation = :stderr
|
59
|
-
|
60
|
-
config.raise_all_rendering_errors = true
|
61
|
-
|
62
|
-
config.rescue_all_in_controller = false
|
63
|
-
# Use Pry instead of IRB
|
64
|
-
silence_warnings do
|
65
|
-
require "pry"
|
66
|
-
config.console = Pry
|
67
|
-
rescue LoadError
|
68
|
-
end
|
69
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
|
3
|
-
# Be sure to restart your server when you modify this file.
|
4
|
-
|
5
|
-
# Your secret key for verifying the integrity of signed cookies.
|
6
|
-
# If you change this key, all old signed cookies will become invalid!
|
7
|
-
# Make sure the secret is at least 30 characters and all random,
|
8
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
9
|
-
|
10
|
-
Decko.config.secret_token = "65632e048d6c80d1e63c911e1a40a51072413543f3182e0261"\
|
11
|
-
"b52e3812b2c9f0ee81828fa5688a34c13a78e438a4b56f4971"\
|
12
|
-
"35dc079a4e4460733d555968a2f8"
|
13
|
-
Decko.config.secret_key_base = "65632e048d6c80d1e63c911e1a40a51072413543f3182e0"\
|
14
|
-
"261b52e3812b2c9f0ee81828fa5688a34c13a78e438a4b5"\
|
15
|
-
"6f497135dc079a4e4460733d555968a2f8"
|
@@ -1,134 +0,0 @@
|
|
1
|
-
require "rails/generators/app_base"
|
2
|
-
|
3
|
-
module Decko
|
4
|
-
module Generators
|
5
|
-
module Deck
|
6
|
-
# Create new Decks (Decko Applications)
|
7
|
-
class DeckGenerator < Rails::Generators::AppBase
|
8
|
-
require "decko/generators/deck/deck_generator/rails_overrides"
|
9
|
-
require "decko/generators/deck/deck_generator/deck_helper"
|
10
|
-
|
11
|
-
include RailsOverrides
|
12
|
-
include DeckHelper
|
13
|
-
|
14
|
-
source_root File.expand_path("templates", __dir__)
|
15
|
-
|
16
|
-
# All but the first aliases should be considered deprecated
|
17
|
-
class_option "monkey",
|
18
|
-
type: :boolean, aliases: %w[-M --mod-dev],
|
19
|
-
default: false, group: :runtime,
|
20
|
-
desc: "Prepare deck for monkey (mod developer)"
|
21
|
-
|
22
|
-
class_option "platypus",
|
23
|
-
type: :boolean, aliases: %w[-P --core-dev -c],
|
24
|
-
default: false, group: :runtime,
|
25
|
-
desc: "Prepare deck for platypus (core development)"
|
26
|
-
|
27
|
-
class_option "repo-path",
|
28
|
-
type: :string, aliases: %w[-R -g --gem-path],
|
29
|
-
default: "", group: :runtime,
|
30
|
-
desc: "Path to local decko repository " \
|
31
|
-
"(Default, use env DECKO_REPO_PATH)"
|
32
|
-
|
33
|
-
class_option :database,
|
34
|
-
type: :string, aliases: %w[-D -d], default: "mysql",
|
35
|
-
desc: "Preconfigure for selected database " \
|
36
|
-
"(options: #{DATABASES.join('/')})"
|
37
|
-
|
38
|
-
class_option "interactive",
|
39
|
-
type: :boolean, aliases: %w[-I -i], default: false, group: :runtime,
|
40
|
-
desc: "Prompt with dynamic installation options"
|
41
|
-
|
42
|
-
public_task :set_default_accessors!
|
43
|
-
public_task :create_root
|
44
|
-
|
45
|
-
def self.banner
|
46
|
-
"decko new #{arguments.map(&:usage).join(' ')} [options]"
|
47
|
-
end
|
48
|
-
|
49
|
-
# Generator works its way through each public method below
|
50
|
-
|
51
|
-
def core_files
|
52
|
-
erb_template "config.ru"
|
53
|
-
erb_template "Gemfile"
|
54
|
-
erb_template "Rakefile"
|
55
|
-
end
|
56
|
-
|
57
|
-
def empty_dirs
|
58
|
-
%w[mod log files tmp].each { |dirname| empty_directory_with_keep_file dirname }
|
59
|
-
end
|
60
|
-
|
61
|
-
def dotfiles
|
62
|
-
copy_file "pryrc", ".pryrc"
|
63
|
-
copy_file "gitignore", ".gitignore"
|
64
|
-
template "rspec.erb", ".rspec"
|
65
|
-
template "simplecov.rb.erb", ".simplecov"
|
66
|
-
end
|
67
|
-
|
68
|
-
def config
|
69
|
-
inside "config" do
|
70
|
-
erb_template "application.rb"
|
71
|
-
erb_template "routes.rb"
|
72
|
-
erb_template "environment.rb"
|
73
|
-
erb_template "boot.rb"
|
74
|
-
template "databases/#{options[:database]}.yml", "database.yml"
|
75
|
-
template "cucumber.yml"
|
76
|
-
template "storage.yml"
|
77
|
-
template "initializers/cypress.rb" if platypus?
|
78
|
-
template "puma.rb"
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
def public
|
83
|
-
inside "public" do
|
84
|
-
template "robots.txt"
|
85
|
-
inside("files") { template "htaccess", ".htaccess" }
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
def spring
|
90
|
-
inside("bin") { erb_template "spring" }
|
91
|
-
end
|
92
|
-
|
93
|
-
def script
|
94
|
-
directory("script") { |content| "#{shebang}\n" + content }
|
95
|
-
chmod "script", 0o755 & ~File.umask, verbose: false
|
96
|
-
end
|
97
|
-
|
98
|
-
def spec
|
99
|
-
inside "spec" do
|
100
|
-
if platypus?
|
101
|
-
jasmine_yml :decko
|
102
|
-
else
|
103
|
-
jasmine_yml :deck
|
104
|
-
template "spec_helper.rb"
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
public_task :run_bundle
|
110
|
-
|
111
|
-
def seed_data
|
112
|
-
if options["interactive"]
|
113
|
-
Interactive.new(destination_root, (monkey? || platypus?)).run
|
114
|
-
else
|
115
|
-
puts "Now:
|
116
|
-
1. Run `cd #{File.basename(destination_root)}` to enter your new deck directory
|
117
|
-
2. Run `decko seed` to seed your database (see config/database.yml).
|
118
|
-
3. Run `decko server` to start your server"
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
protected
|
123
|
-
|
124
|
-
def database_gemfile_entry
|
125
|
-
return [] if options[:skip_active_record]
|
126
|
-
|
127
|
-
gem_name, gem_version = gem_for_database
|
128
|
-
msg = "Use #{options[:database]} as the database for Active Record"
|
129
|
-
GemfileEntry.version gem_name, gem_version, msg
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|