pineapples 0.1.0 → 0.3.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/bin/pineapples +4 -9
- data/lib/pineapples/actions/apply.rb +34 -0
- data/lib/pineapples/actions/base/action.rb +72 -0
- data/lib/pineapples/actions/base/target.rb +136 -0
- data/lib/pineapples/actions/chmod.rb +28 -0
- data/lib/pineapples/actions/copy_file.rb +48 -0
- data/lib/pineapples/actions/create_file.rb +114 -0
- data/lib/pineapples/actions/directory.rb +115 -0
- data/lib/pineapples/actions/empty_directory.rb +71 -0
- data/lib/pineapples/actions/get.rb +38 -0
- data/lib/pineapples/actions/git.rb +17 -0
- data/lib/pineapples/actions/gsub_file.rb +36 -0
- data/lib/pineapples/actions/insert_into_file.rb +131 -0
- data/lib/pineapples/actions/inside.rb +69 -0
- data/lib/pineapples/actions/keep_file.rb +15 -0
- data/lib/pineapples/actions/prepend_to_class.rb +26 -0
- data/lib/pineapples/actions/rails/copy_migration.rb +67 -0
- data/lib/pineapples/actions/rails/erb_converters.rb +37 -0
- data/lib/pineapples/actions/rails/rails.rb +186 -0
- data/lib/pineapples/actions/remove_file.rb +28 -0
- data/lib/pineapples/actions/ruby.rb +49 -0
- data/lib/pineapples/actions/shell.rb +40 -0
- data/lib/pineapples/actions/template.rb +35 -0
- data/lib/pineapples/actions.rb +124 -39
- data/lib/pineapples/app_builder.rb +70 -0
- data/lib/pineapples/app_generator.rb +187 -0
- data/lib/pineapples/build_tasks/root_files.rb +23 -0
- data/lib/pineapples/error.rb +7 -0
- data/lib/pineapples/helpers.rb +34 -0
- data/lib/pineapples/parser.rb +37 -0
- data/lib/pineapples/setting.rb +155 -0
- data/lib/pineapples/settings.rb +31 -0
- data/lib/pineapples/templates/.buildpacks +2 -0
- data/lib/pineapples/templates/.editor-config +11 -0
- data/lib/pineapples/templates/.example.env.tt +11 -0
- data/lib/pineapples/templates/.example.rspec +3 -0
- data/lib/pineapples/templates/.gitignore +23 -0
- data/lib/pineapples/templates/Aptfile +0 -0
- data/lib/pineapples/templates/Gemfile.tt +89 -0
- data/lib/pineapples/templates/Guardfile +27 -0
- data/lib/pineapples/templates/Procfile +1 -0
- data/lib/pineapples/templates/README.md.tt +32 -0
- data/lib/pineapples/templates/Rakefile +6 -0
- data/lib/pineapples/templates/app/assets/javascripts/application.js +1 -0
- data/lib/pineapples/templates/app/assets/javascripts/libs.js +2 -0
- data/lib/pineapples/templates/app/assets/stylesheets/application.scss +1 -0
- data/lib/pineapples/templates/app/controllers/application_controller.rb.tt +48 -0
- data/lib/pineapples/templates/app/controllers/auth/confirmations_controller.rb +2 -0
- data/lib/pineapples/templates/app/controllers/pages_controller.rb +6 -0
- data/lib/pineapples/templates/app/helpers/application_helper.rb +59 -0
- data/lib/pineapples/templates/app/helpers/title_helper.rb +77 -0
- data/lib/pineapples/templates/app/models/user!=needs_user_model!.rb.tt +28 -0
- data/lib/pineapples/templates/app/views/common/_flashes.html.erb +16 -0
- data/lib/pineapples/templates/app/views/common/_footer.html.erb +3 -0
- data/lib/pineapples/templates/app/views/common/_header.html.erb +5 -0
- data/lib/pineapples/templates/app/views/layouts/application.html.erb.tt +33 -0
- data/lib/pineapples/templates/app/views/pages/home.html.erb +4 -0
- data/lib/pineapples/templates/bin/bundle +3 -0
- data/lib/pineapples/templates/bin/rails +8 -0
- data/lib/pineapples/templates/bin/rake +8 -0
- data/lib/pineapples/templates/bin/setup +33 -0
- data/lib/pineapples/templates/bin/spring +15 -0
- data/lib/pineapples/templates/browserlist +4 -0
- data/lib/pineapples/templates/config/application.rb.tt +43 -0
- data/lib/pineapples/templates/config/boot.rb +5 -0
- data/lib/pineapples/templates/config/database.yml.tt +20 -0
- data/lib/pineapples/templates/config/environment.rb +5 -0
- data/lib/pineapples/templates/config/environments/development.rb +64 -0
- data/lib/pineapples/templates/config/environments/production.rb +77 -0
- data/lib/pineapples/templates/config/environments/test.rb +34 -0
- data/lib/pineapples/templates/config/i18n-tasks.yml +13 -0
- data/lib/pineapples/templates/config/initializers/assets.rb +11 -0
- data/lib/pineapples/templates/config/initializers/backtrace_silencers.rb +7 -0
- data/lib/pineapples/templates/config/initializers/carrierwave.rb +22 -0
- data/lib/pineapples/templates/config/initializers/cookies_serializer.rb +3 -0
- data/lib/pineapples/templates/config/initializers/filter_parameters_logging.rb +4 -0
- data/lib/pineapples/templates/config/initializers/inflections.rb +16 -0
- data/lib/pineapples/templates/config/initializers/mime_types.rb +4 -0
- data/lib/pineapples/templates/config/initializers/pry.rb +10 -0
- data/lib/pineapples/templates/config/initializers/redis.rb +3 -0
- data/lib/pineapples/templates/config/initializers/session_store.rb.tt +3 -0
- data/lib/pineapples/templates/config/initializers/wrap_parameters.rb +14 -0
- data/lib/pineapples/templates/config/locales/en.yml +19 -0
- data/lib/pineapples/templates/config/puma.rb +21 -0
- data/lib/pineapples/templates/config/routes.rb.tt +10 -0
- data/lib/pineapples/templates/config/secrets.yml +11 -0
- data/lib/pineapples/templates/config/smtp.rb +11 -0
- data/lib/pineapples/templates/config.ru.tt +7 -0
- data/lib/pineapples/templates/db/migrate/01_enable_postgres_extensions.rb +15 -0
- data/lib/pineapples/templates/db/migrate/02_create_data_migrations.rb +14 -0
- data/lib/pineapples/templates/db/migrate/03_devise_create_users.rb +41 -0
- data/lib/pineapples/templates/db/migrate/04_add_role_field_to_users.rb +7 -0
- data/lib/pineapples/templates/lib/devise!=devise!/ajax_failure.rb +11 -0
- data/lib/pineapples/templates/lib/extensions/form_builder.rb +24 -0
- data/lib/pineapples/templates/lib/extensions/http_errors.rb +34 -0
- data/lib/pineapples/templates/lib/extensions/to_boolean.rb +45 -0
- data/lib/pineapples/templates/lib/logging/custom_rack_logger.rb +11 -0
- data/lib/pineapples/templates/lib/logging/custom_request_logger.rb +65 -0
- data/lib/pineapples/templates/lib/simple_form/components/append.rb +15 -0
- data/lib/pineapples/templates/lib/simple_form/components/prepend.rb +15 -0
- data/lib/pineapples/templates/lib/tasks/admin!=user_role_field!.rake +52 -0
- data/lib/pineapples/templates/lib/tasks/auto_annotate_models.rake +37 -0
- data/lib/pineapples/templates/lib/templates/erb/scaffold/_form.html.erb +14 -0
- data/lib/pineapples/templates/lib/virtus/virtus.rb +23 -0
- data/lib/pineapples/templates/public/404.html +67 -0
- data/lib/pineapples/templates/public/422.html +67 -0
- data/lib/pineapples/templates/public/500.html +66 -0
- data/lib/pineapples/templates/public/favicon.ico +0 -0
- data/lib/pineapples/templates/public/robots.txt +5 -0
- data/lib/pineapples/version.rb +1 -1
- data/lib/pineapples.rb +17 -2
- data/pineapples.gemspec +16 -15
- metadata +208 -2
@@ -0,0 +1,41 @@
|
|
1
|
+
class DeviseCreateUsers < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table(:users) do |t|
|
4
|
+
## Database authenticatable
|
5
|
+
t.string :email, null: false, default: ""
|
6
|
+
t.string :encrypted_password, null: false, default: ""
|
7
|
+
|
8
|
+
## Recoverable
|
9
|
+
t.string :reset_password_token
|
10
|
+
t.datetime :reset_password_sent_at
|
11
|
+
|
12
|
+
## Rememberable
|
13
|
+
t.datetime :remember_created_at
|
14
|
+
|
15
|
+
## Trackable
|
16
|
+
t.integer :sign_in_count, default: 0, null: false
|
17
|
+
t.datetime :current_sign_in_at
|
18
|
+
t.datetime :last_sign_in_at
|
19
|
+
t.inet :current_sign_in_ip
|
20
|
+
t.inet :last_sign_in_ip
|
21
|
+
|
22
|
+
## Confirmable
|
23
|
+
t.string :confirmation_token
|
24
|
+
t.datetime :confirmed_at
|
25
|
+
t.datetime :confirmation_sent_at
|
26
|
+
t.string :unconfirmed_email # Only if using reconfirmable
|
27
|
+
|
28
|
+
## Lockable
|
29
|
+
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
30
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
31
|
+
# t.datetime :locked_at
|
32
|
+
|
33
|
+
t.timestamps null: false
|
34
|
+
end
|
35
|
+
|
36
|
+
add_index :users, :email, unique: true
|
37
|
+
add_index :users, :reset_password_token, unique: true
|
38
|
+
add_index :users, :confirmation_token, unique: true
|
39
|
+
# add_index :users, :unlock_token, unique: true
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module ActionView::Helpers
|
2
|
+
class FormBuilder
|
3
|
+
|
4
|
+
def inputs(options = {}, &block)
|
5
|
+
update_options_with_class!(options, 'form-inputs')
|
6
|
+
@template.content_tag(:div, options) { yield }
|
7
|
+
end
|
8
|
+
|
9
|
+
def actions(options = {}, &block)
|
10
|
+
update_options_with_class!(options, 'form-actions')
|
11
|
+
@template.content_tag(:div, options) { yield }
|
12
|
+
end
|
13
|
+
|
14
|
+
protected
|
15
|
+
|
16
|
+
def update_options_with_class!(options, klass)
|
17
|
+
options[:class] ||= ''
|
18
|
+
class_string = options[:class].blank? ? klass : " #{klass}"
|
19
|
+
options[:class] << class_string
|
20
|
+
options
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'net/smtp'
|
3
|
+
|
4
|
+
# Example:
|
5
|
+
# begin
|
6
|
+
# some http call
|
7
|
+
# rescue *HTTP_ERRORS => error
|
8
|
+
# notify_hoptoad error
|
9
|
+
# end
|
10
|
+
|
11
|
+
HTTP_ERRORS = [
|
12
|
+
EOFError,
|
13
|
+
Errno::ECONNRESET,
|
14
|
+
Errno::EINVAL,
|
15
|
+
Net::HTTPBadResponse,
|
16
|
+
Net::HTTPHeaderSyntaxError,
|
17
|
+
Net::ProtocolError,
|
18
|
+
Timeout::Error
|
19
|
+
]
|
20
|
+
|
21
|
+
SMTP_SERVER_ERRORS = [
|
22
|
+
IOError,
|
23
|
+
Net::SMTPAuthenticationError,
|
24
|
+
Net::SMTPServerBusy,
|
25
|
+
Net::SMTPUnknownError,
|
26
|
+
TimeoutError
|
27
|
+
]
|
28
|
+
|
29
|
+
SMTP_CLIENT_ERRORS = [
|
30
|
+
Net::SMTPFatalError,
|
31
|
+
Net::SMTPSyntaxError
|
32
|
+
]
|
33
|
+
|
34
|
+
SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS
|
@@ -0,0 +1,45 @@
|
|
1
|
+
class String
|
2
|
+
def to_bool
|
3
|
+
return true if self == true || self =~ (/^(true|t|yes|y|1)$/i)
|
4
|
+
return false if self.blank? || self =~ (/^(false|f|no|n|0)$/i)
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
class Symbol
|
9
|
+
def to_bool
|
10
|
+
truthy = [:true, :t, :yes, :y]
|
11
|
+
truthy.include?(self)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Numeric
|
16
|
+
def to_bool
|
17
|
+
self.nonzero?
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class TrueClass
|
22
|
+
def to_i
|
23
|
+
1
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_bool
|
27
|
+
self
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class FalseClass
|
32
|
+
def to_i
|
33
|
+
0
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_bool
|
37
|
+
self
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class NilClass
|
42
|
+
def to_bool
|
43
|
+
false
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
if !Rails.env.production?
|
2
|
+
require 'show_data'
|
3
|
+
|
4
|
+
module CustomRequestLogger
|
5
|
+
class LogSubscriber < ActiveSupport::LogSubscriber
|
6
|
+
INTERNAL_PARAMS = %w(controller action format _method only_path)
|
7
|
+
|
8
|
+
def start_processing(event)
|
9
|
+
payload = event.payload
|
10
|
+
params = payload[:params].except(*INTERNAL_PARAMS)
|
11
|
+
format = payload[:format]
|
12
|
+
format = format.to_s.upcase if format.is_a?(Symbol)
|
13
|
+
|
14
|
+
info "Action: #{payload[:controller]}##{payload[:action]} \nFormat: #{format}"
|
15
|
+
#logger.info "Parameters: #{params.inspect}" unless params.empty?
|
16
|
+
end
|
17
|
+
|
18
|
+
def process_action(event)
|
19
|
+
indent = 8
|
20
|
+
payload = event.payload
|
21
|
+
param_method = payload[:params]['_method']
|
22
|
+
status = compute_status(payload)
|
23
|
+
path = payload[:path]
|
24
|
+
params = payload[:params].except(*INTERNAL_PARAMS)
|
25
|
+
|
26
|
+
redirect_to = Thread.current[:redirect_to]
|
27
|
+
Thread.current[:redirect_to] = nil
|
28
|
+
|
29
|
+
message = "Status: #{status} for \"#{path}\" \n"
|
30
|
+
message << "Redirect URL: #{redirect_to} \n" if redirect_to
|
31
|
+
message << "Params: #{format_data(params, indent)} \n" if params.present?
|
32
|
+
|
33
|
+
info(message)
|
34
|
+
end
|
35
|
+
|
36
|
+
def redirect_to(event)
|
37
|
+
Thread.current[:redirect_to] = event.payload[:location]
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
def compute_status(payload)
|
42
|
+
status = payload[:status]
|
43
|
+
if status.nil? && payload[:exception].present?
|
44
|
+
exception_class_name = payload[:exception].first
|
45
|
+
status = ActionDispatch::ExceptionWrapper.status_code_for_exception(exception_class_name)
|
46
|
+
end
|
47
|
+
status
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
class Formatter < Logger::Formatter
|
53
|
+
def call(severity, time, progname, msg)
|
54
|
+
msg = msg.is_a?(String) ? msg : msg.inspect
|
55
|
+
"#{Rails.env.production? ? severity : ''} #{time.utc.strftime('%F %T')} #{msg} \n"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
%w(process_action start_processing).each do |event|
|
61
|
+
ActiveSupport::Notifications.unsubscribe "#{event}.action_controller"
|
62
|
+
end
|
63
|
+
|
64
|
+
CustomRequestLogger::LogSubscriber.attach_to :action_controller
|
65
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module SimpleForm
|
2
|
+
module Components
|
3
|
+
module Append
|
4
|
+
def append(wrapper_options = nil)
|
5
|
+
@append ||= options[:append].to_s.html_safe if options[:append].present?
|
6
|
+
end
|
7
|
+
|
8
|
+
def has_append?
|
9
|
+
append.present?
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
SimpleForm::Inputs::Base.send(:include, SimpleForm::Components::Append)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module SimpleForm
|
2
|
+
module Components
|
3
|
+
module Prepend
|
4
|
+
def prepend(wrapper_options = nil)
|
5
|
+
@prepend ||= options[:prepend].to_s.html_safe if options[:prepend].present?
|
6
|
+
end
|
7
|
+
|
8
|
+
def has_prepend?
|
9
|
+
prepend.present?
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
SimpleForm::Inputs::Base.send(:include, SimpleForm::Components::Prepend)
|
@@ -0,0 +1,52 @@
|
|
1
|
+
namespace :admin do
|
2
|
+
desc 'Create admin user'
|
3
|
+
task create: :environment do
|
4
|
+
require 'highline/import'
|
5
|
+
|
6
|
+
begin
|
7
|
+
email = ask('Email: ')
|
8
|
+
existing_user = User.find_by_email(email)
|
9
|
+
|
10
|
+
# check if user account already exists
|
11
|
+
if existing_user
|
12
|
+
admin = existing_user
|
13
|
+
# user already exists, ask for password reset
|
14
|
+
reset_password = ask('User with this email already exists! Do you want to reset the password for this email? (Y/n) ')
|
15
|
+
if yes?(reset_password)
|
16
|
+
begin
|
17
|
+
password = ask('Password: ') { |q| q.echo = 'x' }
|
18
|
+
password_confirmation = ask('Repeat password: ') { |q| q.echo = 'x' }
|
19
|
+
end while password != password_confirmation
|
20
|
+
admin.password = password
|
21
|
+
admin.password_confirmation = password
|
22
|
+
end
|
23
|
+
else
|
24
|
+
# create new user otherwise
|
25
|
+
admin = User.new(email: email, confirmed_at: Time.current)
|
26
|
+
begin
|
27
|
+
password = ask('Password: ') { |q| q.echo = 'x' }
|
28
|
+
password_confirmation = ask('Repeat password: ') { |q| q.echo = 'x' }
|
29
|
+
end while password != password_confirmation
|
30
|
+
admin.password = password
|
31
|
+
admin.password_confirmation = password
|
32
|
+
end
|
33
|
+
|
34
|
+
saved = admin.save
|
35
|
+
if !saved
|
36
|
+
puts admin.errors.full_messages.join("\n")
|
37
|
+
next
|
38
|
+
end
|
39
|
+
|
40
|
+
grant_admin = ask('Do you want to grant Admin privileges to this account? (Y/n) ')
|
41
|
+
if yes?(grant_admin)
|
42
|
+
admin.role = :admin
|
43
|
+
say("\nYour account now has Admin privileges!") if admin.save
|
44
|
+
end
|
45
|
+
end while !saved
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def yes?(string)
|
50
|
+
string = string.strip.downcase
|
51
|
+
string.empty? || string == 'y' || string == 'yes'
|
52
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# NOTE: only doing this in development as some production environments (Heroku)
|
2
|
+
# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
|
3
|
+
# NOTE: to have a dev-mode tool do its thing in production.
|
4
|
+
if Rails.env.development?
|
5
|
+
task :set_annotation_options do
|
6
|
+
# You can override any of these by setting an environment variable of the
|
7
|
+
# same name.
|
8
|
+
Annotate.set_defaults({
|
9
|
+
'position_in_routes' => "before",
|
10
|
+
'position_in_class' => "before",
|
11
|
+
'position_in_test' => "before",
|
12
|
+
'position_in_fixture' => "before",
|
13
|
+
'position_in_factory' => "before",
|
14
|
+
'position_in_serializer' => "before",
|
15
|
+
'show_foreign_keys' => "true",
|
16
|
+
'show_indexes' => "true",
|
17
|
+
'simple_indexes' => "false",
|
18
|
+
'model_dir' => "app/models",
|
19
|
+
'include_version' => "false",
|
20
|
+
'require' => "",
|
21
|
+
'exclude_tests' => "false",
|
22
|
+
'exclude_fixtures' => "false",
|
23
|
+
'exclude_factories' => "false",
|
24
|
+
'exclude_serializers' => "false",
|
25
|
+
'ignore_model_sub_dir' => "false",
|
26
|
+
'skip_on_db_migrate' => "false",
|
27
|
+
'format_bare' => "true",
|
28
|
+
'format_rdoc' => "false",
|
29
|
+
'format_markdown' => "false",
|
30
|
+
'sort' => "false",
|
31
|
+
'force' => "false",
|
32
|
+
'trace' => "false",
|
33
|
+
})
|
34
|
+
end
|
35
|
+
|
36
|
+
Annotate.load_tasks
|
37
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
|
2
|
+
<%%= f.error_notification %>
|
3
|
+
|
4
|
+
<%%= f.inputs do %>
|
5
|
+
<%- attributes.each do |attribute| -%>
|
6
|
+
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
|
7
|
+
<%- end -%>
|
8
|
+
<%% end %>
|
9
|
+
|
10
|
+
<%%= f.actions do %>
|
11
|
+
<%%= f.button :submit %>
|
12
|
+
<%% end %>
|
13
|
+
|
14
|
+
<%% end %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# monkey patch to generate attribute? predicate methods for Virtus attributes, a-la Rails
|
2
|
+
module Virtus
|
3
|
+
class Attribute
|
4
|
+
def define_accessor_methods(attribute_set)
|
5
|
+
attribute_set.define_reader_method(self, name, options[:reader])
|
6
|
+
attribute_set.define_writer_method(self, "#{name}=", options[:writer])
|
7
|
+
attribute_set.define_presence_method(self, "#{name}?", options[:reader])
|
8
|
+
end
|
9
|
+
|
10
|
+
module Accessor
|
11
|
+
def presence(instance)
|
12
|
+
instance.instance_variable_get(instance_variable_name).present?
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
class AttributeSet
|
18
|
+
def define_presence_method(attribute, method_name, visibility)
|
19
|
+
define_method(method_name) { attribute.presence(self) }
|
20
|
+
send(visibility, method_name)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/404.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/422.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/500.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
62
|
+
</div>
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
64
|
+
</div>
|
65
|
+
</body>
|
66
|
+
</html>
|
File without changes
|
data/lib/pineapples/version.rb
CHANGED
data/lib/pineapples.rb
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
-
require '
|
1
|
+
require 'colorize'
|
2
|
+
require 'highline/import'
|
3
|
+
require 'inquirer'
|
4
|
+
require 'active_support/core_ext/object/blank'
|
5
|
+
require 'active_support/core_ext/string/inflections'
|
6
|
+
|
7
|
+
require 'English'
|
8
|
+
#require 'erb'
|
9
|
+
require 'fileutils'
|
10
|
+
require 'ostruct'
|
11
|
+
require 'optparse'
|
12
|
+
require 'pathname'
|
13
|
+
require 'securerandom'
|
2
14
|
|
3
|
-
require 'pineapples/
|
15
|
+
require 'pineapples/version'
|
16
|
+
require 'pineapples/error'
|
17
|
+
require 'pineapples/app_generator'
|
18
|
+
require 'pineapples/parser'
|