happy_seed 0.0.19 → 0.0.21
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/Rakefile +4 -69
- data/bin/rails +12 -0
- data/bin/rspec +16 -0
- data/happy_seed.rb +5 -1
- data/happy_seed.txt +25 -18
- data/lib/generators/happy_seed/admin/admin_generator.rb +40 -5
- data/lib/generators/happy_seed/admin/templates/app/admin/campaigns.rb +10 -14
- data/lib/generators/happy_seed/admin/templates/app/admin/newsletter.rb +2 -2
- data/lib/generators/happy_seed/admin/templates/app/admin/user.rb +4 -1
- data/lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb +1 -1
- data/lib/generators/happy_seed/admin/templates/docs/README.07.admin.rdoc +33 -4
- data/lib/generators/happy_seed/angular_view/templates/docs/README.11.angular_view.rdoc +2 -4
- data/lib/generators/happy_seed/api/api_generator.rb +38 -39
- data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/base_controller.rb +4 -5
- data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/model_hash.rb +3 -20
- data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/user_tokens_controller.rb +13 -36
- data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/users_controller.rb +14 -40
- data/lib/generators/happy_seed/api/templates/config/initializers/apitome.rb +1 -1
- data/lib/generators/happy_seed/api/templates/docs/README.01.api.rdoc +4 -1
- data/lib/generators/happy_seed/api/templates/docs/api.md +2 -2
- data/lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/user_tokens_spec.rb +10 -53
- data/lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/users_spec.rb +17 -61
- data/lib/generators/happy_seed/base/base_generator.rb +47 -19
- data/lib/generators/happy_seed/base/templates/app/controllers/setup_controller.rb +1 -1
- data/lib/generators/happy_seed/base/templates/app/views/setup/index.html.haml +6 -3
- data/lib/generators/happy_seed/base/templates/application_controller.rb +1 -1
- data/lib/generators/happy_seed/base/templates/docs/README.00.base.rdoc +3 -3
- data/lib/generators/happy_seed/bootstrap/bootstrap_generator.rb +5 -2
- data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/application.scss +5 -1
- data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/components/_profile_panels.scss +62 -0
- data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/components/_slideup_header.scss +51 -0
- data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/shared/_grid.scss +0 -12
- data/lib/generators/happy_seed/bootstrap/templates/app/views/application/_javascripts.html.haml +7 -4
- data/lib/generators/happy_seed/bootstrap/templates/docs/README.01.bootstrap.rdoc +3 -0
- data/lib/generators/happy_seed/ckeditor/ckeditor_generator.rb +31 -0
- data/lib/generators/happy_seed/ckeditor/templates/docs/README.01.ckeditor.rdoc +35 -0
- data/lib/generators/happy_seed/devise/devise_generator.rb +12 -19
- data/lib/generators/happy_seed/devise/templates/app/views/devise/confirmations/new.html.haml +17 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/confirmation_instructions.html.erb +14 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/confirmation_instructions.text.rhtml +7 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/password_change.html.erb +3 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/reset_password_instructions.html.erb +15 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/reset_password_instructions.text.erb +11 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/passwords/edit.html.haml +14 -13
- data/lib/generators/happy_seed/devise/templates/app/views/devise/passwords/new.html.haml +12 -16
- data/lib/generators/happy_seed/devise/templates/app/views/devise/registrations/edit.html.haml +28 -40
- data/lib/generators/happy_seed/devise/templates/app/views/devise/registrations/new.html.haml +16 -24
- data/lib/generators/happy_seed/devise/templates/app/views/devise/sessions/new.html.haml +13 -18
- data/lib/generators/happy_seed/devise/templates/app/views/devise/shared/_links.html.erb +25 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/unlocks/new.html.erb +16 -0
- data/lib/generators/happy_seed/devise/templates/docs/README.03.devise.rdoc +2 -2
- data/lib/generators/happy_seed/devise/templates/spec/factories/users.rb +5 -4
- data/lib/generators/happy_seed/devise/templates/spec/features/registration_spec.rb +149 -0
- data/lib/generators/happy_seed/devise/templates/spec/mailers/previews/devise_preview.rb +28 -0
- data/lib/generators/happy_seed/devise_confirmable/devise_confirmable_generator.rb +45 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/add_confirmable_to_devise.rb +24 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/app/controllers/confirmations_controller.rb +10 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/app/views/devise/invitations/edit.html.haml +22 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/app/views/devise/invitations/new.html.haml +20 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/app/views/devise/mailer/invitation_instructions.html.erb +20 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/docs/README.03.devise_confirmable.rdoc +23 -0
- data/lib/generators/happy_seed/devise_invitable/devise_invitable_generator.rb +3 -1
- data/lib/generators/happy_seed/devise_invitable/templates/app/views/devise/invitations/edit.html.haml +3 -2
- data/lib/generators/happy_seed/devise_invitable/templates/app/views/devise/invitations/new.html.haml +3 -2
- data/lib/generators/happy_seed/devise_invitable/templates/app/views/devise/mailer/invitation_instructions.html.erb +20 -0
- data/lib/generators/happy_seed/devise_invitable/templates/spec/features/invitations_spec.rb +61 -0
- data/lib/generators/happy_seed/facebook/facebook_generator.rb +2 -0
- data/lib/generators/happy_seed/facebook/templates/spec/features/facebook_registration_spec.rb +72 -0
- data/lib/generators/happy_seed/googleoauth/googleoauth_generator.rb +1 -1
- data/lib/generators/happy_seed/happy_seed_generator.rb +1 -3
- data/lib/generators/happy_seed/html_email/html_email_generator.rb +32 -0
- data/lib/generators/happy_seed/html_email/templates/app/views/layouts/mailer.html.erb +244 -0
- data/lib/generators/happy_seed/html_email/templates/docs/README.01.html_email.rdoc +25 -0
- data/lib/generators/happy_seed/omniauth/omniauth_generator.rb +4 -2
- data/lib/generators/happy_seed/omniauth/templates/app/controllers/omniauth_callbacks_controller.rb +3 -13
- data/lib/generators/happy_seed/omniauth/templates/app/models/identity.rb +13 -9
- data/lib/generators/happy_seed/omniauth/templates/docs/README.04.omniauth.rdoc +5 -5
- data/lib/generators/happy_seed/omniauth/templates/spec/factories/oauth.rb +6 -1
- data/lib/generators/happy_seed/omniauth/templates/spec/features/oauth_registration_spec.rb +80 -0
- data/lib/generators/happy_seed/omniauth/templates/spec/models/identity_spec.rb +39 -12
- data/lib/generators/happy_seed/omniauth/templates/{app/models/form_user.rb → user.rb} +4 -5
- data/lib/generators/happy_seed/plugin/plugin_generator.rb +13 -11
- data/lib/generators/happy_seed/react/react_generator.rb +36 -0
- data/lib/generators/happy_seed/react/templates/docs/README.10.react.rdoc +20 -0
- data/lib/generators/happy_seed/roles/roles_generator.rb +38 -0
- data/lib/generators/happy_seed/roles/templates/ability.rb +9 -0
- data/lib/generators/happy_seed/roles/templates/docs/README.03.roles.rdoc +23 -0
- data/lib/generators/happy_seed/simple_cms/simple_cms_generator.rb +41 -0
- data/lib/generators/happy_seed/simple_cms/templates/app/admin/simple_content.rb +42 -0
- data/lib/generators/happy_seed/simple_cms/templates/app/controllers/simple_content_controller.rb +7 -0
- data/lib/generators/happy_seed/simple_cms/templates/app/models/simple_content.rb +5 -0
- data/lib/generators/happy_seed/simple_cms/templates/app/views/splash/faq.html.haml +13 -0
- data/lib/generators/happy_seed/simple_cms/templates/app/views/splash/index.html.haml +79 -0
- data/lib/generators/happy_seed/simple_cms/templates/application_helper.rb +18 -0
- data/lib/generators/happy_seed/simple_cms/templates/create_simple_contents.rb +14 -0
- data/lib/generators/happy_seed/simple_cms/templates/docs/README.04.simple_cms.rdoc +32 -0
- data/lib/generators/happy_seed/simple_cms/templates/spec/factories/oauth.rb +10 -0
- data/lib/generators/happy_seed/simple_cms/templates/spec/features/oauth_registration_spec.rb +80 -0
- data/lib/generators/happy_seed/simple_cms/templates/spec/models/identity_spec.rb +49 -0
- data/lib/generators/happy_seed/splash/templates/app/assets/stylesheets/splash.css.scss +119 -84
- data/lib/generators/happy_seed/splash/templates/app/controllers/splash_controller.rb +1 -1
- data/lib/generators/happy_seed/splash/templates/app/views/layouts/splash.html.haml +15 -18
- data/lib/generators/happy_seed/splash/templates/app/views/splash/index.html.haml +54 -92
- data/lib/generators/happy_seed/splash/templates/docs/README.02.splash.rdoc +2 -2
- data/lib/generators/happy_seed/splash/templates/spec/controllers/splash_controller_spec.rb +11 -3
- data/lib/generators/happy_seed/static/templates/source/stylesheets/application.css.scss +1 -1
- data/lib/generators/happy_seed/static_blog/templates/Gemfile.lock +45 -49
- data/lib/generators/happy_seed/twitter/templates/spec/features/twitter_oauth_registration_spec.rb +57 -0
- data/lib/generators/happy_seed/twitter/twitter_generator.rb +2 -1
- data/lib/happy_seed/cli.rb +1 -1
- data/lib/happy_seed/engine.rb +12 -0
- data/lib/happy_seed/version.rb +1 -1
- data/lib/tasks/seed.rake +56 -0
- data/{test → spec}/dummy/Rakefile +0 -0
- data/spec/dummy/app/assets/config/manifest.js +5 -0
- data/{test → spec}/dummy/app/assets/javascripts/application.js +3 -3
- data/spec/dummy/app/assets/javascripts/cable.coffee +11 -0
- data/{test → spec}/dummy/app/assets/stylesheets/application.css +4 -4
- data/spec/dummy/app/channels/application_cable/channel.rb +5 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +5 -0
- data/{test → spec}/dummy/app/controllers/application_controller.rb +0 -0
- data/{test → spec}/dummy/app/helpers/application_helper.rb +0 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/{test → spec}/dummy/bin/bundle +0 -0
- data/{test → spec}/dummy/bin/rails +1 -1
- data/{test → spec}/dummy/bin/rake +0 -0
- data/spec/dummy/bin/setup +34 -0
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/config.ru +8 -0
- data/spec/dummy/config/application.rb +21 -0
- data/{test → spec}/dummy/config/boot.rb +0 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/{test → spec}/dummy/config/database.yml +0 -0
- data/{test → spec}/dummy/config/environment.rb +0 -0
- data/{test → spec}/dummy/config/environments/development.rb +28 -3
- data/{test → spec}/dummy/config/environments/production.rb +29 -24
- data/{test → spec}/dummy/config/environments/test.rb +6 -3
- data/spec/dummy/config/initializers/active_record_belongs_to_required_by_default.rb +6 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/{test → spec}/dummy/config/initializers/assets.rb +3 -0
- data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
- data/spec/dummy/config/initializers/callback_terminator.rb +6 -0
- data/{test → spec}/dummy/config/initializers/cookies_serializer.rb +3 -1
- data/{test → spec}/dummy/config/initializers/filter_parameter_logging.rb +0 -0
- data/{test → spec}/dummy/config/initializers/inflections.rb +0 -0
- data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -0
- data/spec/dummy/config/initializers/per_form_csrf_tokens.rb +4 -0
- data/spec/dummy/config/initializers/request_forgery_protection.rb +4 -0
- data/{test → spec}/dummy/config/initializers/session_store.rb +0 -0
- data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +2 -2
- data/{test → spec}/dummy/config/locales/en.yml +0 -0
- data/spec/dummy/config/puma.rb +47 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/{test → spec}/dummy/config/secrets.yml +3 -3
- data/spec/dummy/db/schema.rb +16 -0
- data/{test → spec}/dummy/public/404.html +0 -0
- data/{test → spec}/dummy/public/422.html +0 -0
- data/{test → spec}/dummy/public/500.html +0 -0
- data/{test/dummy/public/favicon.ico → spec/dummy/public/apple-touch-icon-precomposed.png} +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/rails_helper.rb +58 -0
- data/spec/spec_helper.rb +91 -0
- metadata +195 -89
- data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/configurations_controller.rb +0 -11
- data/lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/configurations_spec.rb +0 -21
- data/lib/generators/happy_seed/base/templates/config/puma.rb +0 -15
- data/lib/generators/happy_seed/base/templates/spec/support/controller_helpers.rb +0 -12
- data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/sections/_profile_page.scss +0 -9
- data/lib/generators/happy_seed/bootstrap/templates/lib/templates/haml/scaffold/_form.html.haml +0 -5
- data/lib/generators/happy_seed/devise/templates/spec/features/forgot_password_spec.rb +0 -54
- data/lib/generators/happy_seed/devise/templates/test/mailers/previews/devise_preview.rb +0 -13
- data/lib/generators/happy_seed/omniauth/templates/spec/features/registration_spec.rb +0 -81
- data/lib/generators/happy_seed/static/templates/Gemfile.lock +0 -158
- data/lib/tasks/seed_tasks.rake +0 -4
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -23
- data/test/dummy/config/initializers/jazz_hands.rb +0 -5
- data/test/dummy/config/routes.rb +0 -56
- data/test/seed_test.rb +0 -7
- data/test/test_helper.rb +0 -15
@@ -22,31 +22,35 @@ module HappySeed
|
|
22
22
|
gem 'haml-rails'
|
23
23
|
|
24
24
|
gem_group :development, :test do
|
25
|
-
gem
|
26
|
-
gem
|
27
|
-
gem
|
28
|
-
gem
|
29
|
-
gem
|
30
|
-
gem
|
31
|
-
gem
|
32
|
-
gem
|
33
|
-
gem
|
34
|
-
gem
|
25
|
+
gem 'sqlite3'
|
26
|
+
gem 'rspec', '~> 3.5.0'
|
27
|
+
gem 'rspec-rails', '~> 3.5.0'
|
28
|
+
gem 'factory_girl_rails'
|
29
|
+
gem 'capybara'
|
30
|
+
gem 'cucumber-rails', branch: 'rails-5', require: false
|
31
|
+
gem 'guard-rspec', '~> 4.6.4', require: false
|
32
|
+
gem 'guard-cucumber'
|
33
|
+
gem 'database_cleaner'
|
34
|
+
gem 'spring-commands-rspec'
|
35
35
|
gem 'spring-commands-cucumber'
|
36
|
-
gem
|
37
|
-
gem
|
38
|
-
gem
|
39
|
-
gem "faker"
|
36
|
+
gem 'launchy'
|
37
|
+
gem 'vcr'
|
38
|
+
gem 'faker'
|
40
39
|
gem 'dotenv-rails'
|
41
40
|
gem 'rdiscount'
|
41
|
+
gem 'rails-controller-testing'
|
42
|
+
gem 'better_errors'
|
43
|
+
gem 'binding_of_caller'
|
42
44
|
end
|
43
45
|
|
44
46
|
gem_group :test do
|
45
|
-
gem
|
47
|
+
gem 'webmock'
|
48
|
+
gem 'fakeredis', require: 'fakeredis/rspec'
|
46
49
|
end
|
47
50
|
|
48
51
|
gem_group :production do
|
49
52
|
gem 'pg'
|
53
|
+
gem 'lograge'
|
50
54
|
end
|
51
55
|
|
52
56
|
Bundler.with_clean_env do
|
@@ -70,16 +74,33 @@ module HappySeed
|
|
70
74
|
|
71
75
|
# Use the spring version and also run everything on startup
|
72
76
|
gsub_file "Guardfile", 'cmd: "bundle exec rspec"', 'cmd: "bin/rspec", all_on_start: true'
|
73
|
-
gsub_file "Guardfile", 'guard "cucumber"', 'guard "cucumber", cli: "--color --strict"'
|
77
|
+
# gsub_file "Guardfile", 'guard "cucumber"', 'guard "cucumber", cli: "--color --strict"'
|
74
78
|
|
75
79
|
directory '.'
|
76
80
|
append_to_file '.gitignore', ".env\n"
|
77
81
|
|
78
82
|
remove_file "application_controller.rb"
|
83
|
+
remove_file "test"
|
79
84
|
|
80
|
-
inject_into_file 'app/controllers/application_controller.rb',
|
81
|
-
|
82
|
-
|
85
|
+
inject_into_file 'app/controllers/application_controller.rb',
|
86
|
+
File.read( find_in_source_paths('application_controller.rb') ),
|
87
|
+
after: /protect_from_forgery.*\n/
|
88
|
+
|
89
|
+
inject_into_class 'config/application.rb',
|
90
|
+
:Application,
|
91
|
+
" config.assets.paths << Rails.root.join('vendor', 'assets', 'bower_components')"
|
92
|
+
|
93
|
+
inject_into_file 'config/environments/test.rb',
|
94
|
+
" config.log_level = :error\n",
|
95
|
+
before: "end\n"
|
96
|
+
|
97
|
+
inject_into_file 'config/environments/development.rb',
|
98
|
+
" config.assets.quiet = true\n",
|
99
|
+
before: "end\n"
|
100
|
+
|
101
|
+
inject_into_file 'config/environments/production.rb',
|
102
|
+
" config.lograge.enabled = true\n config.assets.quiet = true\n",
|
103
|
+
before: "end\n"
|
83
104
|
|
84
105
|
begin
|
85
106
|
inject_into_file 'spec/rails_helper.rb', "require 'webmock/rspec'\n", after: "'rspec/rails'\n"
|
@@ -89,11 +110,18 @@ module HappySeed
|
|
89
110
|
|
90
111
|
begin
|
91
112
|
inject_into_file 'spec/rails_helper.rb', "\n config.include FactoryGirl::Syntax::Methods\n", :before => "\nend\n"
|
113
|
+
inject_into_file 'spec/rails_helper.rb', "\n [:controller, :view, :request].each do |type|\n config.include ::Rails::Controller::Testing::TestProcess, :type => type\n config.include ::Rails::Controller::Testing::TemplateAssertions, :type => type\n config.include ::Rails::Controller::Testing::Integration, :type => type\n end", :before => "\nend\n"
|
92
114
|
append_to_file 'spec/rails_helper.rb', "\nVCR.configure do |c|\n c.cassette_library_dir = Rails.root.join('spec', 'vcr')\n c.hook_into :webmock\nend\n"
|
93
115
|
rescue
|
94
116
|
say_status :spec, "Unable to add factory girl and VCR to rails_helper.rb", :red
|
95
117
|
end
|
96
118
|
|
119
|
+
begin
|
120
|
+
inject_into_file 'Rakefile', "module TempFixForRakeLastComment\n def last_comment\n last_description\n end\nend\nRake::Application.send :include, TempFixForRakeLastComment\n", before: "Rails.application.load_tasks"
|
121
|
+
rescue
|
122
|
+
say_status :spec, "Unable to add Rake workaround for last_comment"
|
123
|
+
end
|
124
|
+
|
97
125
|
route "get '/setup' => 'setup#index'"
|
98
126
|
route "root 'setup#index'"
|
99
127
|
end
|
@@ -2,8 +2,10 @@
|
|
2
2
|
%html
|
3
3
|
%head
|
4
4
|
%title HappySeed Generator setup page
|
5
|
-
|
6
|
-
|
5
|
+
= javascript_include_tag 'application'
|
6
|
+
= csrf_meta_tags
|
7
|
+
/ %script{:src=>"https://code.jquery.com/jquery-2.1.3.min.js"}
|
8
|
+
/ %script{:src=>"//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"}
|
7
9
|
%link{:href=>"//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css", :rel=>"stylesheet"}
|
8
10
|
:css
|
9
11
|
#nav { margin-top: 25px; }
|
@@ -19,7 +21,8 @@
|
|
19
21
|
.col-sm-3
|
20
22
|
.panel.panel-default.affix#nav
|
21
23
|
.panel-heading
|
22
|
-
|
24
|
+
%h3.panel-title
|
25
|
+
Nav
|
23
26
|
.panel-body
|
24
27
|
%ul.list-unstyled
|
25
28
|
%li
|
@@ -17,13 +17,13 @@ The `happy_seed:base` generator installs `dotenv-rails`, `puma`, http site authe
|
|
17
17
|
|
18
18
|
### Why do you want this?
|
19
19
|
|
20
|
-
Haml is great and we like it better than balancing out closing tags. meta-tags makes it easy to flesh out SEO.
|
20
|
+
Haml is great and we like it better than balancing out closing tags. The meta-tags gem makes it easy to flesh out SEO.
|
21
21
|
|
22
22
|
Turbolinks tend to be more trouble than they are worth. Outside of making web site analytics slightly more cumbersome, we end up having trouble with debugging and testing. Turbolinks work by having all of the javascript of the page loaded and resident and only replacing the body of the page when the user loads up a new page. When everything works correctly this makes things faster; when it doesn't work correctly, you end up tracking down issues where DOM event handlers aren't correctly attached.
|
23
23
|
|
24
24
|
dotenv-rails mimics the way that heroku starts up the application even when using "rails s", rather than foreman. This pulls in data from the .env file. In the case where you only have the web application in the Procfile, its easier to read through the log file when you use rails s rather than foreman. .env is also a good way to make sure that none of your configuration stuff is stuck away in code somewhere.
|
25
25
|
|
26
|
-
|
26
|
+
This setups puma and foreman (a Procfile) which mirrors the default setup of heroku.
|
27
27
|
|
28
28
|
Finally we setup some basic HTTP auth and a simple setup controller to help navigate what seed has generated for you. By default the HTTP auth stuff is off (i.e. no user/pass set) but the basic idea is that before you open things up to the world you can share your app to a limited group of people.
|
29
29
|
|
@@ -46,4 +46,4 @@ If the `HTTP_AUTH_*` variables are set, `application_controller` will force them
|
|
46
46
|
|
47
47
|
### What needs to be done?
|
48
48
|
|
49
|
-
Even though the setup controller only works locally, you should plan on removing the `setup_controller` since it shows the configuration variables.
|
49
|
+
Even though the setup controller only works locally, you should plan on removing the `setup_controller` since it shows the configuration variables.
|
@@ -17,9 +17,11 @@ module HappySeed
|
|
17
17
|
gem 'meta-tags', :require => 'meta_tags'
|
18
18
|
gem 'responders', '~> 2.0'
|
19
19
|
gem 'bh'
|
20
|
+
gem 'simple_form'
|
20
21
|
|
21
22
|
Bundler.with_clean_env do
|
22
23
|
run "bundle install --without production"
|
24
|
+
run "rails generate simple_form:install --bootstrap"
|
23
25
|
end
|
24
26
|
|
25
27
|
remove_file 'app/views/layouts/application.html.erb'
|
@@ -36,11 +38,12 @@ module HappySeed
|
|
36
38
|
HAML
|
37
39
|
end
|
38
40
|
|
39
|
-
inject_into_file 'config/application.rb', before: "end\nend\n" do <<-'RUBY'
|
40
|
-
|
41
|
+
inject_into_file 'config/application.rb', before: " end\nend\n" do <<-'RUBY'
|
42
|
+
config.action_view.field_error_proc = Proc.new { |html_tag, instance| html_tag }
|
41
43
|
config.generators do |g|
|
42
44
|
g.stylesheets = false
|
43
45
|
g.scaffold_controller "scaffold_controller"
|
46
|
+
g.test_framework :rspec, fixture: true, fixture_replacement: :factory_girl, helper_specs: false, view_specs: false, routing_specs: false, controller_specs: false
|
44
47
|
end
|
45
48
|
|
46
49
|
RUBY
|
@@ -20,6 +20,9 @@
|
|
20
20
|
@import 'bootstrap-sprockets';
|
21
21
|
@import 'bootstrap';
|
22
22
|
|
23
|
+
// Uncomment if you want to use the default bootstrap theme
|
24
|
+
// @import 'bootstrap/theme';
|
25
|
+
|
23
26
|
|
24
27
|
// --------------Global definitions--------------------
|
25
28
|
// For example (add your own!!):
|
@@ -35,9 +38,10 @@
|
|
35
38
|
// --------------Components----------------------------
|
36
39
|
// Create your own and modify/extend Bootstrap's. For example:
|
37
40
|
@import 'components/panel';
|
41
|
+
@import 'components/profile_panels';
|
38
42
|
|
39
43
|
|
40
44
|
// --------------Sections------------------------------
|
41
45
|
// Page-specific styles. These should *only* be used as a last
|
42
46
|
// resort if you really truly can't style your content more generally.
|
43
|
-
@import 'sections/profile_page';
|
47
|
+
// @import 'sections/profile_page';
|
@@ -0,0 +1,62 @@
|
|
1
|
+
// This is used by the devise generated views.
|
2
|
+
// --------------Profile page section--------------------
|
3
|
+
//
|
4
|
+
// Styles specific to a single page. These should only be used as
|
5
|
+
// a LAST resort unless you're taking the symatic approach and
|
6
|
+
// actually using this to describe the parts of your document.
|
7
|
+
//
|
8
|
+
// .profile-page {
|
9
|
+
// The less here the better!!
|
10
|
+
// }
|
11
|
+
|
12
|
+
// This is used by the devise generated views.
|
13
|
+
.small_screen_flush {
|
14
|
+
@media (max-width: $screen-xs-max) {
|
15
|
+
padding-left: 0;
|
16
|
+
padding-right: 0;
|
17
|
+
|
18
|
+
.panel {
|
19
|
+
border-radius: 0;
|
20
|
+
border: none;
|
21
|
+
.panel-heading {
|
22
|
+
border-radius: 0;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
.profile {
|
29
|
+
border: 0;
|
30
|
+
&.large_panel {
|
31
|
+
@extend .col-sm-9;
|
32
|
+
@extend .small_screen_flush;
|
33
|
+
}
|
34
|
+
&.sidebar {
|
35
|
+
@extend .col-sm-3;
|
36
|
+
@extend .small_screen_flush;
|
37
|
+
}
|
38
|
+
|
39
|
+
&.center {
|
40
|
+
@extend .col-lg-6;
|
41
|
+
@extend .col-lg-offset-3;
|
42
|
+
|
43
|
+
@extend .col-md-6;
|
44
|
+
@extend .col-md-offset-3;
|
45
|
+
|
46
|
+
@extend .col-sm-8;
|
47
|
+
@extend .col-sm-offset-2;
|
48
|
+
|
49
|
+
@extend .small_screen_flush;
|
50
|
+
|
51
|
+
.panel-footer {
|
52
|
+
@include clearfix;
|
53
|
+
.buttons {
|
54
|
+
float: right;
|
55
|
+
}
|
56
|
+
|
57
|
+
.links {
|
58
|
+
float: left;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
$slideup-navbar-height: $navbar-height !default;
|
2
|
+
|
3
|
+
header.slideup {
|
4
|
+
position: static;
|
5
|
+
|
6
|
+
height: $slideup-navbar-height;
|
7
|
+
|
8
|
+
.navbar {
|
9
|
+
border:none;
|
10
|
+
@include box-shadow( 0 0 4px rgba(0, 0, 0, .14), 0 4px 8px rgba(0, 0, 0, .28) );
|
11
|
+
transition: background-color .2s, height .5s, box-shadow .5s;
|
12
|
+
|
13
|
+
.navbar-brand {
|
14
|
+
transition: all .2s;
|
15
|
+
transition-timing-function: ease-out;
|
16
|
+
|
17
|
+
|
18
|
+
text-transform: uppercase;
|
19
|
+
letter-spacing: 1px;
|
20
|
+
}
|
21
|
+
|
22
|
+
li > a {
|
23
|
+
transition: all .2s;
|
24
|
+
transition-timing-function: ease-out;
|
25
|
+
|
26
|
+
font-size: 10px;
|
27
|
+
text-transform: uppercase;
|
28
|
+
letter-spacing: 1px;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
&.affix-top {
|
33
|
+
.navbar {
|
34
|
+
height: $slideup-navbar-height;
|
35
|
+
@include box-shadow( none );
|
36
|
+
}
|
37
|
+
.navbar-brand {
|
38
|
+
padding: (($slideup-navbar-height - 20)/2) 15px;
|
39
|
+
}
|
40
|
+
|
41
|
+
.navbar-toggle {
|
42
|
+
margin-top: (($slideup-navbar-height - 20)/2);
|
43
|
+
}
|
44
|
+
|
45
|
+
li > a {
|
46
|
+
padding-top: (($slideup-navbar-height - 20)/2);
|
47
|
+
padding-bottom: (($slideup-navbar-height - 20)/2);
|
48
|
+
font-size: 12px;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
@@ -1,14 +1,2 @@
|
|
1
1
|
// --------------Grid------------------------------------------
|
2
2
|
//
|
3
|
-
|
4
|
-
// This is used by the devise generated views.
|
5
|
-
.center-panel {
|
6
|
-
@extend .col-lg-6;
|
7
|
-
@extend .col-lg-offset-3;
|
8
|
-
|
9
|
-
@extend .col-md-6;
|
10
|
-
@extend .col-md-offset-3;
|
11
|
-
|
12
|
-
@extend .col-sm-8;
|
13
|
-
@extend .col-sm-offset-2;
|
14
|
-
}
|
data/lib/generators/happy_seed/bootstrap/templates/app/views/application/_javascripts.html.haml
CHANGED
@@ -6,7 +6,10 @@
|
|
6
6
|
-# Google Analytics
|
7
7
|
- if !ENV['GOOGLE_ANALYTICS_SITE_ID'].blank?
|
8
8
|
:javascript
|
9
|
-
|
10
|
-
(
|
11
|
-
|
12
|
-
|
9
|
+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
10
|
+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
11
|
+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
12
|
+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
13
|
+
|
14
|
+
ga('create', '#{ ENV['GOOGLE_ANALYTICS_SITE_ID'] }', 'auto');
|
15
|
+
ga('send', 'pageview');
|
@@ -7,6 +7,7 @@ The happy_seed bootstrap generator
|
|
7
7
|
|
8
8
|
* Installs bootstrap-sass
|
9
9
|
* Installs modernizr-rails
|
10
|
+
* Installs and configures simple_form
|
10
11
|
* Organizes the app/assets directory
|
11
12
|
* Organizes the app/views/layouts and app/views/application directories
|
12
13
|
* Sets up some application_helper methods to make working with forms easier
|
@@ -20,6 +21,8 @@ Bootstrap should be the base of all our projects going forward. This creates a
|
|
20
21
|
|
21
22
|
The splash generator builds on this, but doesn't use the main "application.css" stylesheets or javascripts. The layout here should be used for the application proper.
|
22
23
|
|
24
|
+
Easier forms with simple_form.
|
25
|
+
|
23
26
|
Better scaffolding means that it's easier to just whip up things to get started. While you will obviously eventually rewrite all of this code, it's good to have working stuff to start with that doesn't look painful.
|
24
27
|
|
25
28
|
### Environment Variables
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'generators/happy_seed/happy_seed_generator'
|
2
|
+
require 'generators/happy_seed/bootstrap/bootstrap_generator'
|
3
|
+
|
4
|
+
module HappySeed
|
5
|
+
module Generators
|
6
|
+
class CkeditorGenerator < HappySeedGenerator
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
|
9
|
+
def self.fingerprint
|
10
|
+
gem_available? 'ckeditor'
|
11
|
+
end
|
12
|
+
|
13
|
+
def install_html_email
|
14
|
+
return if already_installed
|
15
|
+
|
16
|
+
require_generator BootstrapGenerator
|
17
|
+
|
18
|
+
gem 'ckeditor'
|
19
|
+
|
20
|
+
Bundler.with_clean_env do
|
21
|
+
run "bundle install --without production"
|
22
|
+
end
|
23
|
+
|
24
|
+
inject_into_file "config/environments/production.rb", " config.assets.precompile += Ckeditor.assets\n config.assets.precompile += ['ckeditor/*']\n", before: "end\n"
|
25
|
+
inject_into_file "app/assets/javascripts/application.js", "\n//= require ckeditor/init", after: "//= require bootstrap-sprockets"
|
26
|
+
|
27
|
+
directory "."
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
HappySeed Ckeditor Email Install
|
2
|
+
=================
|
3
|
+
|
4
|
+
### What does this do?
|
5
|
+
|
6
|
+
* Includes ckeditor, a WYSIWYG editor for adding html to your documents. For a detailed explanation of everything you can do with ckeditor see the documentation for the gem [here.](https://github.com/galetahub/ckeditor)
|
7
|
+
|
8
|
+
|
9
|
+
### Why do you want this?
|
10
|
+
|
11
|
+
Easy html body editor for when you need to add html content through your admin panel/form/etc. Ckeditor is a great solution for this and makes it very easy.
|
12
|
+
|
13
|
+
### Environment Variables
|
14
|
+
|
15
|
+
n/a
|
16
|
+
|
17
|
+
### What needs to be done?
|
18
|
+
|
19
|
+
Pass in :ckeditor to simple_form.
|
20
|
+
|
21
|
+
```
|
22
|
+
$ rails g scaffold post title:string body:text
|
23
|
+
```
|
24
|
+
|
25
|
+
```
|
26
|
+
= simple_form_for(@post) do |f|
|
27
|
+
= f.error_notification
|
28
|
+
|
29
|
+
.form-inputs
|
30
|
+
= f.input :title
|
31
|
+
= f.input :body, as: :ckeditor
|
32
|
+
|
33
|
+
.form-actions
|
34
|
+
= f.button :submit
|
35
|
+
```
|