chr 0.5.7 → 0.5.8
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.
- checksums.yaml +4 -4
- data/.scss-style.yml +3 -3
- data/{LICENSE → LICENSE.md} +0 -0
- data/README.md +24 -10
- data/app/assets/javascripts/chr/list_tabs.coffee +1 -2
- data/app/assets/javascripts/chr/view_tabs.coffee +7 -6
- data/app/assets/stylesheets/chr/layout.scss +15 -2
- data/app/assets/stylesheets/chr/themes/basic.scss +8 -16
- data/chr.gemspec +33 -34
- data/lib/chr.rb +9 -12
- data/lib/chr/version.rb +1 -1
- metadata +8 -51
- data/app/assets/javascripts/vendor/slip.js +0 -804
- data/bin/chr +0 -13
- data/docs/bootstrap.md +0 -23
- data/docs/demo.png +0 -0
- data/docs/notes.md +0 -3
- data/docs/rails.md +0 -233
- data/lib/chr/app_builder.rb +0 -378
- data/lib/chr/generators/app_generator.rb +0 -211
- data/lib/generators/chr/controller_generator.rb +0 -18
- data/templates/Gemfile.erb +0 -41
- data/templates/Procfile +0 -1
- data/templates/README.md.erb +0 -45
- data/templates/_analytics.html.erb +0 -1
- data/templates/_flashes.html.erb +0 -7
- data/templates/_javascript.html.erb +0 -5
- data/templates/application.coffee +0 -2
- data/templates/application.scss +0 -1
- data/templates/application.yml +0 -6
- data/templates/application_gitignore +0 -15
- data/templates/application_layout.html.erb.erb +0 -17
- data/templates/bin_setup.erb +0 -35
- data/templates/body_class_helper.rb +0 -15
- data/templates/bundler_audit.rake +0 -12
- data/templates/carrierwave.rb +0 -21
- data/templates/character_admin.coffee.erb +0 -38
- data/templates/character_admin.scss +0 -14
- data/templates/character_admin_index.html.erb +0 -5
- data/templates/character_admin_layout.html.erb.erb +0 -21
- data/templates/character_base_controller.rb +0 -14
- data/templates/dev.rake +0 -12
- data/templates/devise_overrides_passwords_controller.rb +0 -11
- data/templates/devise_overrides_passwords_edit.html.erb +0 -31
- data/templates/devise_overrides_passwords_new.html.erb +0 -19
- data/templates/devise_overrides_sessions_controller.rb +0 -20
- data/templates/devise_overrides_sessions_new.html.erb +0 -29
- data/templates/errors.rb +0 -34
- data/templates/json_encoding.rb +0 -1
- data/templates/puma.rb +0 -18
- data/templates/routes.rb +0 -86
- data/templates/sample.env +0 -6
- data/templates/secrets.yml +0 -14
- data/templates/smtp.rb +0 -9
- data/templates/staging.rb +0 -5
@@ -1,211 +0,0 @@
|
|
1
|
-
require 'rails/generators'
|
2
|
-
require 'rails/generators/rails/app/app_generator'
|
3
|
-
|
4
|
-
module Chr
|
5
|
-
class AppGenerator < Rails::Generators::AppGenerator
|
6
|
-
|
7
|
-
|
8
|
-
class_option :skip_active_record, type: :boolean, aliases: "-O", default: true,
|
9
|
-
desc: "Skip Active Record files"
|
10
|
-
|
11
|
-
class_option :skip_test_unit, type: :boolean, aliases: "-T", default: true,
|
12
|
-
desc: "Skip Test::Unit files"
|
13
|
-
|
14
|
-
class_option :skip_turbolinks, type: :boolean, default: true,
|
15
|
-
desc: "Skip turbolinks gem"
|
16
|
-
|
17
|
-
class_option :skip_bundle, type: :boolean, aliases: "-B", default: true,
|
18
|
-
desc: "Don't run bundle install"
|
19
|
-
|
20
|
-
|
21
|
-
def finish_template
|
22
|
-
invoke :chr_customization
|
23
|
-
super
|
24
|
-
end
|
25
|
-
|
26
|
-
|
27
|
-
def chr_customization
|
28
|
-
invoke :customize_gemfile
|
29
|
-
invoke :setup_development_environment
|
30
|
-
invoke :setup_test_environment
|
31
|
-
invoke :setup_production_environment
|
32
|
-
invoke :setup_staging_environment
|
33
|
-
invoke :setup_secret_token
|
34
|
-
invoke :create_application_views
|
35
|
-
invoke :configure_app
|
36
|
-
invoke :create_application_assets
|
37
|
-
invoke :copy_miscellaneous_files
|
38
|
-
invoke :customize_error_pages
|
39
|
-
invoke :setup_devise
|
40
|
-
invoke :setup_character
|
41
|
-
invoke :setup_database
|
42
|
-
invoke :setup_git
|
43
|
-
# invoke :create_heroku_apps
|
44
|
-
# invoke :create_github_repo
|
45
|
-
invoke :setup_bundler_audit
|
46
|
-
#invoke :setup_spring
|
47
|
-
invoke :outro
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
def customize_gemfile
|
52
|
-
build :replace_gemfile
|
53
|
-
build :set_ruby_to_version_being_used
|
54
|
-
|
55
|
-
bundle_command 'install'
|
56
|
-
end
|
57
|
-
|
58
|
-
|
59
|
-
def setup_development_environment
|
60
|
-
say 'Setting up the development environment'
|
61
|
-
#build :raise_on_delivery_errors
|
62
|
-
build :raise_on_unpermitted_parameters
|
63
|
-
build :provide_setup_script
|
64
|
-
build :provide_dev_prime_task
|
65
|
-
build :configure_generators
|
66
|
-
end
|
67
|
-
|
68
|
-
|
69
|
-
def setup_test_environment
|
70
|
-
say 'Setting up the test environment'
|
71
|
-
# @todo
|
72
|
-
end
|
73
|
-
|
74
|
-
|
75
|
-
def setup_production_environment
|
76
|
-
say 'Setting up the production environment'
|
77
|
-
build :configure_smtp
|
78
|
-
build :configure_rack_timeout
|
79
|
-
build :enable_rack_canonical_host
|
80
|
-
build :enable_rack_deflater
|
81
|
-
build :setup_asset_host
|
82
|
-
end
|
83
|
-
|
84
|
-
|
85
|
-
def setup_staging_environment
|
86
|
-
say 'Setting up the staging environment'
|
87
|
-
build :setup_staging_environment
|
88
|
-
end
|
89
|
-
|
90
|
-
|
91
|
-
def setup_secret_token
|
92
|
-
say 'Moving secret token out of version control'
|
93
|
-
build :setup_secret_token
|
94
|
-
end
|
95
|
-
|
96
|
-
|
97
|
-
def create_application_views
|
98
|
-
say 'Creating application views'
|
99
|
-
build :create_partials_directory
|
100
|
-
build :create_shared_analytics
|
101
|
-
build :create_shared_flashes
|
102
|
-
build :create_shared_javascripts
|
103
|
-
build :create_application_layout
|
104
|
-
build :create_body_class_helper
|
105
|
-
end
|
106
|
-
|
107
|
-
|
108
|
-
def configure_app
|
109
|
-
say 'Configuring app'
|
110
|
-
build :configure_action_mailer
|
111
|
-
build :configure_puma
|
112
|
-
build :setup_foreman
|
113
|
-
end
|
114
|
-
|
115
|
-
|
116
|
-
def create_application_assets
|
117
|
-
say 'Create application stylesheets and javascripts'
|
118
|
-
build :setup_stylesheets
|
119
|
-
build :setup_javascripts
|
120
|
-
end
|
121
|
-
|
122
|
-
|
123
|
-
def copy_miscellaneous_files
|
124
|
-
say 'Copying miscellaneous support files'
|
125
|
-
build :copy_miscellaneous_files
|
126
|
-
end
|
127
|
-
|
128
|
-
|
129
|
-
def customize_error_pages
|
130
|
-
say 'Customizing the 500/404/422 pages'
|
131
|
-
build :customize_error_pages
|
132
|
-
end
|
133
|
-
|
134
|
-
|
135
|
-
def setup_devise
|
136
|
-
say "Setup devise"
|
137
|
-
build :setup_devise
|
138
|
-
end
|
139
|
-
|
140
|
-
|
141
|
-
def setup_character
|
142
|
-
say "Setup character"
|
143
|
-
build :setup_character_routes
|
144
|
-
build :setup_character_base_controller
|
145
|
-
build :configure_devise_for_character
|
146
|
-
build :setup_character_views
|
147
|
-
build :setup_character_stylesheets
|
148
|
-
build :setup_character_javascripts
|
149
|
-
build :setup_character_assets
|
150
|
-
build :setup_carrierwave
|
151
|
-
end
|
152
|
-
|
153
|
-
|
154
|
-
def setup_git
|
155
|
-
if !options[:skip_git]
|
156
|
-
say 'Initializing git'
|
157
|
-
invoke :setup_gitignore
|
158
|
-
invoke :init_git
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
|
-
|
163
|
-
def setup_gitignore
|
164
|
-
build :gitignore_files
|
165
|
-
end
|
166
|
-
|
167
|
-
|
168
|
-
def init_git
|
169
|
-
build :init_git
|
170
|
-
end
|
171
|
-
|
172
|
-
|
173
|
-
def setup_database
|
174
|
-
say 'Setting up database'
|
175
|
-
build :initialize_mongoid
|
176
|
-
end
|
177
|
-
|
178
|
-
|
179
|
-
def setup_bundler_audit
|
180
|
-
say "Setting up bundler-audit"
|
181
|
-
build :setup_bundler_audit
|
182
|
-
end
|
183
|
-
|
184
|
-
|
185
|
-
def setup_spring
|
186
|
-
say "Springifying binstubs"
|
187
|
-
build :setup_spring
|
188
|
-
end
|
189
|
-
|
190
|
-
|
191
|
-
def outro
|
192
|
-
say 'Congratulations! You just created a new Character.'
|
193
|
-
end
|
194
|
-
|
195
|
-
|
196
|
-
protected
|
197
|
-
|
198
|
-
def get_builder_class
|
199
|
-
Chr::AppBuilder
|
200
|
-
end
|
201
|
-
|
202
|
-
|
203
|
-
def using_active_record?
|
204
|
-
!options[:skip_active_record]
|
205
|
-
end
|
206
|
-
|
207
|
-
end
|
208
|
-
end
|
209
|
-
|
210
|
-
|
211
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'rails/generators/base'
|
2
|
-
|
3
|
-
module Chr
|
4
|
-
module Generators
|
5
|
-
class ControllerGenerator < Rails::Generators::Base
|
6
|
-
def create_controller
|
7
|
-
generate "controller", "admin/#{ARGV[0]} --skip-template-engine"
|
8
|
-
|
9
|
-
inject_into_file(
|
10
|
-
"config/routes.rb",
|
11
|
-
"\n\t\tresources :#{ARGV[0]}",
|
12
|
-
after: "namespace :admin do",
|
13
|
-
)
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/templates/Gemfile.erb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
ruby '<%= Chr::RUBY_VERSION %>'
|
3
|
-
|
4
|
-
gem 'rails', '<%= Chr::RAILS_VERSION %>'
|
5
|
-
gem 'sass-rails', '~> 5.0'
|
6
|
-
gem 'uglifier'
|
7
|
-
gem 'coffee-rails', '~> 4.1.0'
|
8
|
-
gem 'jquery-rails'
|
9
|
-
gem 'puma'
|
10
|
-
gem 'recipient_interceptor'
|
11
|
-
gem 'rack-canonical-host'
|
12
|
-
gem 'awesome_print'
|
13
|
-
gem 'bson_ext'
|
14
|
-
gem 'mongoid', '~> 5.0.0'
|
15
|
-
gem 'fog'
|
16
|
-
gem 'fog-aws'
|
17
|
-
gem 'rack-host-redirect'
|
18
|
-
gem 'mongosteen', '>= 0.2.0'
|
19
|
-
gem 'chr', '>= 0.5.6'
|
20
|
-
gem 'ants', '>= 0.3.12'
|
21
|
-
gem 'loft', '>= 0.3.1'
|
22
|
-
gem 'journal', github: 'alexkravets/journal'
|
23
|
-
|
24
|
-
group :development do
|
25
|
-
gem 'spring'
|
26
|
-
gem 'web-console'
|
27
|
-
end
|
28
|
-
|
29
|
-
group :development, :test do
|
30
|
-
gem 'figaro'
|
31
|
-
gem 'byebug'
|
32
|
-
gem 'quiet_assets'
|
33
|
-
gem 'bundler-audit', require: false
|
34
|
-
gem 'factory_girl_rails'
|
35
|
-
gem 'dotenv-rails'
|
36
|
-
end
|
37
|
-
|
38
|
-
group :staging, :production do
|
39
|
-
gem 'rack-timeout'
|
40
|
-
gem 'rails_12factor'
|
41
|
-
end
|
data/templates/Procfile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
web: bundle exec puma -p $PORT -C ./config/puma.rb
|
data/templates/README.md.erb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# <%= app_name.humanize %>
|
2
|
-
|
3
|
-
|
4
|
-
## Getting Started
|
5
|
-
|
6
|
-
After you have cloned this repo, run this setup script to set up your machine
|
7
|
-
with the necessary dependencies to run and test this app:
|
8
|
-
|
9
|
-
% ./bin/setup
|
10
|
-
|
11
|
-
It assumes you have a machine equipped with Ruby, Postgres, etc. If not, set up
|
12
|
-
your machine with [this script].
|
13
|
-
|
14
|
-
[this script]: https://github.com/thoughtbot/laptop
|
15
|
-
|
16
|
-
After setting up, you can run the application using [foreman]:
|
17
|
-
|
18
|
-
% foreman start
|
19
|
-
|
20
|
-
If you don't have `foreman`, see [Foreman's install instructions][foreman]. It
|
21
|
-
is [purposefully excluded from the project's `Gemfile`][exclude].
|
22
|
-
|
23
|
-
[foreman]: https://github.com/ddollar/foreman
|
24
|
-
[exclude]: https://github.com/ddollar/foreman/pull/437#issuecomment-41110407
|
25
|
-
|
26
|
-
|
27
|
-
## Deploying to Heroku
|
28
|
-
|
29
|
-
This project is ready to deploy to [Heroku](https://heroku.com), still before that
|
30
|
-
please install plugins for mongodb, email & make sure these variables are set
|
31
|
-
in your app ENV:
|
32
|
-
|
33
|
-
MONGODB_URI
|
34
|
-
ASSET_HOST
|
35
|
-
AWS_ACCESS_KEY_ID
|
36
|
-
AWS_SECRET_ACCESS_KEY
|
37
|
-
FOG_DIRECTORY
|
38
|
-
HOST
|
39
|
-
SMTP_ADDRESS
|
40
|
-
SMTP_DOMAIN
|
41
|
-
SMTP_PASSWORD
|
42
|
-
SMTP_USERNAME
|
43
|
-
|
44
|
-
|
45
|
-
Good luck, have fun, program well and program in style!
|
@@ -1 +0,0 @@
|
|
1
|
-
<% # @todo: add analytics scripts %>
|
data/templates/_flashes.html.erb
DELETED
data/templates/application.scss
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
@import "normalize-rails";
|
data/templates/application.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8" />
|
5
|
-
<!-- META TAGS ============================================================ -->
|
6
|
-
<%%= display_meta_tags %>
|
7
|
-
<!-- ====================================================================== -->
|
8
|
-
<meta name="viewport" content="initial-scale=1" />
|
9
|
-
<%%= stylesheet_link_tag :application, media: "all" %>
|
10
|
-
<%%= csrf_meta_tags %>
|
11
|
-
</head>
|
12
|
-
<body class="<%%= body_class %>">
|
13
|
-
<%%= render "flashes" -%>
|
14
|
-
<%%= yield %>
|
15
|
-
<%%= render "javascript" %>
|
16
|
-
</body>
|
17
|
-
</html>
|
data/templates/bin_setup.erb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
#!/usr/bin/env sh
|
2
|
-
|
3
|
-
# Set up Rails app. Run this script immediately after cloning the codebase.
|
4
|
-
# https://github.com/thoughtbot/guides/tree/master/protocol
|
5
|
-
|
6
|
-
# Exit if any subcommand fails
|
7
|
-
set -e
|
8
|
-
|
9
|
-
# Set up Ruby dependencies via Bundler
|
10
|
-
gem install bundler --conservative
|
11
|
-
bundle check || bundle install
|
12
|
-
|
13
|
-
# Set up configurable environment variables
|
14
|
-
if [ ! -f .env ]; then
|
15
|
-
cp .sample.env .env
|
16
|
-
fi
|
17
|
-
|
18
|
-
# Set up database and add any development seed data
|
19
|
-
bin/rake dev:prime
|
20
|
-
|
21
|
-
# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
|
22
|
-
mkdir -p .git/safe
|
23
|
-
|
24
|
-
# Pick a port for Foreman
|
25
|
-
if ! grep --quiet --no-messages --fixed-strings 'port' .foreman; then
|
26
|
-
printf 'port: <%= config[:port_number] %>\n' >> .foreman
|
27
|
-
fi
|
28
|
-
|
29
|
-
if ! command -v foreman > /dev/null; then
|
30
|
-
gem install foreman
|
31
|
-
fi
|
32
|
-
|
33
|
-
# Only if this isn't CI
|
34
|
-
# if [ -z "$CI" ]; then
|
35
|
-
# fi
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Body class helper striped our from:
|
2
|
-
# https://github.com/thoughtbot/flutie/blob/master/lib/flutie/body_class_helper.rb
|
3
|
-
module BodyClassHelper
|
4
|
-
def body_class(options = {})
|
5
|
-
extra_body_classes_symbol = options[:extra_body_classes_symbol] || :extra_body_classes
|
6
|
-
qualified_controller_name = controller.controller_path.gsub('/','-')
|
7
|
-
basic_body_class = "#{qualified_controller_name} #{qualified_controller_name}-#{controller.action_name}"
|
8
|
-
|
9
|
-
if content_for?(extra_body_classes_symbol)
|
10
|
-
[basic_body_class, content_for(extra_body_classes_symbol)].join(' ')
|
11
|
-
else
|
12
|
-
basic_body_class
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
if Rails.env.development? || Rails.env.test?
|
2
|
-
require "bundler/audit/cli"
|
3
|
-
|
4
|
-
namespace :bundler do
|
5
|
-
desc "Updates the ruby-advisory-db and runs audit"
|
6
|
-
task :audit do
|
7
|
-
%w(update check).each do |command|
|
8
|
-
Bundler::Audit::CLI.start [command]
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|