happy_seed 0.0.11 → 0.0.12
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/happy_seed.rb +69 -88
- data/lib/generators/happy_seed/admin/admin_generator.rb +3 -2
- data/lib/generators/happy_seed/admin/templates/app/admin/campaigns.rb +1 -1
- data/lib/generators/happy_seed/admin/templates/app/admin/newsletter.rb +1 -1
- data/lib/generators/happy_seed/admin/templates/app/admin/user.rb +1 -0
- data/lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb +1 -1
- data/lib/generators/happy_seed/admin/templates/app/views/admin/_chart.html.haml +2 -3
- data/lib/generators/happy_seed/admin/templates/vendor/assets/javascripts/chartkick.js +0 -1
- data/lib/generators/happy_seed/base/base_generator.rb +2 -9
- data/lib/generators/happy_seed/base/templates/app/views/setup/index.html.haml +3 -0
- data/lib/generators/happy_seed/base/templates/lib/tasks/haml2erb.rake +34 -0
- data/lib/generators/happy_seed/bootstrap/bootstrap_generator.rb +7 -3
- data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/application.css.scss +12 -0
- data/lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb +5 -13
- data/lib/generators/happy_seed/bootstrap/templates/app/views/application/_flashes.html.haml +1 -5
- data/lib/generators/happy_seed/bootstrap/templates/app/views/application/_header.html.haml +9 -15
- data/lib/generators/happy_seed/bootstrap/templates/lib/templates/haml/scaffold/_form.html.haml +3 -17
- data/lib/generators/happy_seed/devise/devise_generator.rb +11 -12
- data/lib/generators/happy_seed/devise/templates/app/views/application/_account_dropdown.html.haml +11 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/passwords/edit.html.haml +6 -19
- data/lib/generators/happy_seed/devise/templates/app/views/devise/passwords/new.html.haml +7 -14
- data/lib/generators/happy_seed/devise/templates/app/views/devise/registrations/edit.html.haml +50 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/registrations/new.html.haml +11 -20
- data/lib/generators/happy_seed/devise/templates/app/views/devise/sessions/new.html.haml +8 -25
- data/lib/generators/happy_seed/devise/templates/spec/features/forgot_password_spec.rb +1 -1
- data/lib/generators/happy_seed/facebook/facebook_generator.rb +2 -2
- data/lib/generators/happy_seed/happy_seed_generator.rb +12 -19
- data/lib/generators/happy_seed/instagram/instagram_generator.rb +1 -1
- data/lib/generators/happy_seed/jazz_hands/jazz_hands_generator.rb +3 -10
- data/lib/generators/happy_seed/omniauth/omniauth_generator.rb +14 -11
- data/lib/generators/happy_seed/omniauth/templates/app/controllers/omniauth_callbacks_controller.rb +23 -10
- data/lib/generators/happy_seed/omniauth/templates/app/controllers/registrations_controller.rb +17 -0
- data/lib/generators/happy_seed/omniauth/templates/app/models/form_user.rb +20 -0
- data/lib/generators/happy_seed/omniauth/templates/make_email_nullable.rb +7 -0
- data/lib/generators/happy_seed/omniauth/templates/spec/factories/oauth.rb +5 -0
- data/lib/generators/happy_seed/omniauth/templates/spec/features/registration_spec.rb +81 -0
- data/lib/generators/happy_seed/splash/splash_generator.rb +6 -3
- data/lib/generators/happy_seed/static/templates/Gemfile.lock +162 -0
- data/lib/generators/happy_seed/static_blog/templates/Gemfile.lock +6 -6
- data/lib/generators/happy_seed/twitter/twitter_generator.rb +1 -1
- data/lib/happy_seed/cli.rb +2 -2
- data/lib/happy_seed/version.rb +1 -1
- metadata +23 -22
- data/lib/generators/happy_seed/omniauth/templates/add_name_to_users.rb +0 -5
- data/lib/generators/happy_seed/omniauth/templates/app/controllers/users_controller.rb +0 -31
- data/lib/generators/happy_seed/omniauth/templates/app/views/users/finish_signup.html.haml +0 -26
- data/lib/generators/happy_seed/omniauth/templates/app/views/users/show.html.haml +0 -5
- data/lib/generators/happy_seed/omniauth/templates/user.rb +0 -53
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +0 -5
data/lib/happy_seed/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: happy_seed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Will Schenk
|
@@ -9,48 +9,48 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ~>
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 4.
|
20
|
+
version: '4.2'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - ~>
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 4.
|
27
|
+
version: '4.2'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: thor
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: sqlite3
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
description: HappySeed is a project that will build up a rails apps using some common
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/generators/happy_seed/admin/templates/app/admin/campaigns.rb
|
71
71
|
- lib/generators/happy_seed/admin/templates/app/admin/dashboard.rb
|
72
72
|
- lib/generators/happy_seed/admin/templates/app/admin/newsletter.rb
|
73
|
+
- lib/generators/happy_seed/admin/templates/app/admin/user.rb
|
73
74
|
- lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb
|
74
75
|
- lib/generators/happy_seed/admin/templates/app/views/admin/_chart.html.haml
|
75
76
|
- lib/generators/happy_seed/admin/templates/docs/README.07.admin.rdoc
|
@@ -95,6 +96,7 @@ files:
|
|
95
96
|
- lib/generators/happy_seed/base/templates/application_controller.rb
|
96
97
|
- lib/generators/happy_seed/base/templates/config/unicorn.rb
|
97
98
|
- lib/generators/happy_seed/base/templates/docs/README.00.base.rdoc
|
99
|
+
- lib/generators/happy_seed/base/templates/lib/tasks/haml2erb.rake
|
98
100
|
- lib/generators/happy_seed/base/templates/spec/controllers/application_controller_spec.rb
|
99
101
|
- lib/generators/happy_seed/base/templates/spec/controllers/setup_controller_spec.rb
|
100
102
|
- lib/generators/happy_seed/bootstrap/bootstrap_generator.rb
|
@@ -118,8 +120,10 @@ files:
|
|
118
120
|
- lib/generators/happy_seed/bootstrap/templates/lib/templates/haml/scaffold/show.html.haml
|
119
121
|
- lib/generators/happy_seed/bootstrap/templates/lib/templates/rails/scaffold_controller/controller.rb
|
120
122
|
- lib/generators/happy_seed/devise/devise_generator.rb
|
123
|
+
- lib/generators/happy_seed/devise/templates/app/views/application/_account_dropdown.html.haml
|
121
124
|
- lib/generators/happy_seed/devise/templates/app/views/devise/passwords/edit.html.haml
|
122
125
|
- lib/generators/happy_seed/devise/templates/app/views/devise/passwords/new.html.haml
|
126
|
+
- lib/generators/happy_seed/devise/templates/app/views/devise/registrations/edit.html.haml
|
123
127
|
- lib/generators/happy_seed/devise/templates/app/views/devise/registrations/new.html.haml
|
124
128
|
- lib/generators/happy_seed/devise/templates/app/views/devise/sessions/new.html.haml
|
125
129
|
- lib/generators/happy_seed/devise/templates/docs/README.03.devise.rdoc
|
@@ -135,15 +139,15 @@ files:
|
|
135
139
|
- lib/generators/happy_seed/jazz_hands/templates/config/initializers/jazz_hands.rb
|
136
140
|
- lib/generators/happy_seed/jazz_hands/templates/docs/README.12.jazz_hands.rdoc
|
137
141
|
- lib/generators/happy_seed/omniauth/omniauth_generator.rb
|
138
|
-
- lib/generators/happy_seed/omniauth/templates/add_name_to_users.rb
|
139
142
|
- lib/generators/happy_seed/omniauth/templates/app/controllers/omniauth_callbacks_controller.rb
|
140
|
-
- lib/generators/happy_seed/omniauth/templates/app/controllers/
|
143
|
+
- lib/generators/happy_seed/omniauth/templates/app/controllers/registrations_controller.rb
|
144
|
+
- lib/generators/happy_seed/omniauth/templates/app/models/form_user.rb
|
141
145
|
- lib/generators/happy_seed/omniauth/templates/app/models/identity.rb
|
142
|
-
- lib/generators/happy_seed/omniauth/templates/app/views/users/finish_signup.html.haml
|
143
|
-
- lib/generators/happy_seed/omniauth/templates/app/views/users/show.html.haml
|
144
146
|
- lib/generators/happy_seed/omniauth/templates/docs/README.04.omniauth.rdoc
|
147
|
+
- lib/generators/happy_seed/omniauth/templates/make_email_nullable.rb
|
148
|
+
- lib/generators/happy_seed/omniauth/templates/spec/factories/oauth.rb
|
149
|
+
- lib/generators/happy_seed/omniauth/templates/spec/features/registration_spec.rb
|
145
150
|
- lib/generators/happy_seed/omniauth/templates/spec/models/identity_spec.rb
|
146
|
-
- lib/generators/happy_seed/omniauth/templates/user.rb
|
147
151
|
- lib/generators/happy_seed/plugin/plugin_generator.rb
|
148
152
|
- lib/generators/happy_seed/plugin/templates/.autotest
|
149
153
|
- lib/generators/happy_seed/plugin/templates/.rspec
|
@@ -164,6 +168,7 @@ files:
|
|
164
168
|
- lib/generators/happy_seed/static/static_generator.rb
|
165
169
|
- lib/generators/happy_seed/static/templates/.gitignore
|
166
170
|
- lib/generators/happy_seed/static/templates/Gemfile
|
171
|
+
- lib/generators/happy_seed/static/templates/Gemfile.lock
|
167
172
|
- lib/generators/happy_seed/static/templates/config.rb
|
168
173
|
- lib/generators/happy_seed/static/templates/data/site.yml
|
169
174
|
- lib/generators/happy_seed/static/templates/source/images/.gitkeep
|
@@ -245,8 +250,6 @@ files:
|
|
245
250
|
- test/dummy/config/locales/en.yml
|
246
251
|
- test/dummy/config/routes.rb
|
247
252
|
- test/dummy/config/secrets.yml
|
248
|
-
- test/dummy/db/test.sqlite3
|
249
|
-
- test/dummy/log/test.log
|
250
253
|
- test/dummy/public/404.html
|
251
254
|
- test/dummy/public/422.html
|
252
255
|
- test/dummy/public/500.html
|
@@ -263,17 +266,17 @@ require_paths:
|
|
263
266
|
- lib
|
264
267
|
required_ruby_version: !ruby/object:Gem::Requirement
|
265
268
|
requirements:
|
266
|
-
- -
|
269
|
+
- - ">="
|
267
270
|
- !ruby/object:Gem::Version
|
268
271
|
version: '0'
|
269
272
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
270
273
|
requirements:
|
271
|
-
- -
|
274
|
+
- - ">="
|
272
275
|
- !ruby/object:Gem::Version
|
273
276
|
version: '0'
|
274
277
|
requirements: []
|
275
278
|
rubyforge_project:
|
276
|
-
rubygems_version: 2.
|
279
|
+
rubygems_version: 2.4.5
|
277
280
|
signing_key:
|
278
281
|
specification_version: 4
|
279
282
|
summary: HappySeed is a project that will build up a rails apps using some common
|
@@ -307,8 +310,6 @@ test_files:
|
|
307
310
|
- test/dummy/config/routes.rb
|
308
311
|
- test/dummy/config/secrets.yml
|
309
312
|
- test/dummy/config.ru
|
310
|
-
- test/dummy/db/test.sqlite3
|
311
|
-
- test/dummy/log/test.log
|
312
313
|
- test/dummy/public/404.html
|
313
314
|
- test/dummy/public/422.html
|
314
315
|
- test/dummy/public/500.html
|
@@ -1,31 +0,0 @@
|
|
1
|
-
class UsersController < ApplicationController
|
2
|
-
before_action :set_user, :only => :finish_signup
|
3
|
-
before_filter :authenticate_user!, :except => :finish_signup
|
4
|
-
|
5
|
-
def show
|
6
|
-
@user = current_user
|
7
|
-
end
|
8
|
-
|
9
|
-
def finish_signup
|
10
|
-
if request.patch? && params[:user] #&& params[:user][:email]
|
11
|
-
if current_user.update(user_params)
|
12
|
-
# current_user.skip_reconfirmation!
|
13
|
-
sign_in(current_user, :bypass => true)
|
14
|
-
redirect_to current_user, notice: 'Your profile was successfully updated.'
|
15
|
-
else
|
16
|
-
@show_errors = true
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
def set_user
|
23
|
-
@user = User.find(params[:id])
|
24
|
-
end
|
25
|
-
|
26
|
-
def user_params
|
27
|
-
accessible = [ :name, :email ] # extend with your own params
|
28
|
-
accessible << [ :password, :password_confirmation ] unless params[:user][:password].blank?
|
29
|
-
params.require(:user).permit(accessible)
|
30
|
-
end
|
31
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
.container
|
2
|
-
.row
|
3
|
-
.col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3.col-sm-8.col-sm-offset-2
|
4
|
-
.panel.panel-default.only
|
5
|
-
|
6
|
-
.panel-heading
|
7
|
-
Add Email
|
8
|
-
|
9
|
-
.panel-body
|
10
|
-
= form_for(current_user, :as => 'user', :url => finish_signup_path(current_user), :html => { role: 'form'}) do |f|
|
11
|
-
- if @show_errors && current_user.errors.any?
|
12
|
-
#error_explanation
|
13
|
-
- current_user.errors.full_messages.each do |msg|
|
14
|
-
= msg
|
15
|
-
%br
|
16
|
-
|
17
|
-
.form-group
|
18
|
-
= f.label :email, :class=>'control-label col-sm-3'
|
19
|
-
.col-sm-9= f.text_field :email, :autofocus => true, :value => '', class: 'form-control input-lg', placeholder: 'Example: email@me.com'
|
20
|
-
|
21
|
-
%p.col-sm-9.help-block
|
22
|
-
Please confirm your email address. No spam.
|
23
|
-
|
24
|
-
.form-group
|
25
|
-
.col-lg-9.col-lg-offset-3
|
26
|
-
= f.submit "Continue", :class=>'btn btn-primary form-control'
|
@@ -1,53 +0,0 @@
|
|
1
|
-
|
2
|
-
TEMP_EMAIL_PREFIX = 'change@me'
|
3
|
-
TEMP_EMAIL_REGEX = /\Achange@me/
|
4
|
-
|
5
|
-
has_many :identities
|
6
|
-
|
7
|
-
# validates_format_of :email, :without => TEMP_EMAIL_REGEX, on: :update
|
8
|
-
|
9
|
-
def self.find_for_oauth(auth, signed_in_resource = nil)
|
10
|
-
|
11
|
-
# Get the identity and user if they exist
|
12
|
-
identity = Identity.find_for_oauth(auth)
|
13
|
-
|
14
|
-
# If a signed_in_resource is provided it always overrides the existing user
|
15
|
-
# to prevent the identity being locked with accidentally created accounts.
|
16
|
-
# Note that this may leave zombie accounts (with no associated identity) which
|
17
|
-
# can be cleaned up at a later date.
|
18
|
-
user = signed_in_resource ? signed_in_resource : identity.user
|
19
|
-
|
20
|
-
# Create the user if needed
|
21
|
-
if user.nil?
|
22
|
-
|
23
|
-
# Get the existing user by email if the provider gives us a verified email.
|
24
|
-
# If no verified email was provided we assign a temporary email and ask the
|
25
|
-
# user to verify it on the next step via UsersController.finish_signup
|
26
|
-
email_is_verified = auth.info.email && (auth.info.verified || auth.info.verified_email)
|
27
|
-
email = auth.info.email if email_is_verified
|
28
|
-
user = User.where(:email => email).first if email
|
29
|
-
|
30
|
-
# Create the user if it's a new registration
|
31
|
-
if user.nil?
|
32
|
-
user = User.new(
|
33
|
-
# name: auth.extra.raw_info.name,
|
34
|
-
#username: auth.info.nickname || auth.uid,
|
35
|
-
email: email ? email : "#{TEMP_EMAIL_PREFIX}-#{auth.uid}-#{auth.provider}.com",
|
36
|
-
password: Devise.friendly_token[0,20]
|
37
|
-
)
|
38
|
-
# user.skip_confirmation!
|
39
|
-
user.save!
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# Associate the identity with the user if needed
|
44
|
-
if identity.user != user
|
45
|
-
identity.user = user
|
46
|
-
identity.save!
|
47
|
-
end
|
48
|
-
user
|
49
|
-
end
|
50
|
-
|
51
|
-
def email_verified?
|
52
|
-
self.email && self.email !~ TEMP_EMAIL_REGEX
|
53
|
-
end
|
data/test/dummy/db/test.sqlite3
DELETED
File without changes
|