lines-engine 0.5 → 0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +21 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +100 -70
- data/Guardfile +33 -0
- data/README.rdoc +12 -8
- data/app/assets/stylesheets/lines/article.scss +55 -31
- data/app/assets/stylesheets/lines/fonts.scss +1 -34
- data/app/assets/stylesheets/lines/general.scss +2 -0
- data/app/assets/stylesheets/lines/media_queries.scss +11 -5
- data/app/assets/stylesheets/lines/variables_and_mixins.scss +6 -0
- data/app/controllers/lines/articles_controller.rb +3 -2
- data/app/controllers/lines/password_resets_controller.rb +84 -0
- data/app/helpers/lines/application_helper.rb +2 -2
- data/app/mailers/lines/user_mailer.rb +11 -0
- data/app/models/lines/user.rb +41 -5
- data/app/views/layouts/lines/application.html.erb +1 -0
- data/app/views/lines/password_resets/edit.html.erb +26 -0
- data/app/views/lines/password_resets/new.html.erb +8 -0
- data/app/views/lines/sessions/new.html.erb +4 -0
- data/app/views/lines/shared/_flash.html.erb +8 -0
- data/app/views/lines/user_mailer/password_reset.html.erb +10 -0
- data/app/views/lines/user_mailer/password_reset.text.erb +8 -0
- data/certs/lines-engine.pem +21 -0
- data/config/lines_config.yml +4 -1
- data/config/routes.rb +5 -0
- data/db/migrate/20150421093311_add_reset_password_fields_to_users.rb +6 -0
- data/lib/generators/lines/copy_styles_generator.rb +13 -0
- data/lib/lines/version.rb +1 -1
- data/lines.gemspec +5 -2
- data/spec/dummy/config/environments/development.rb +5 -0
- data/spec/dummy/config/environments/test.rb +2 -0
- data/spec/dummy/config/lines_config.yml +4 -1
- data/spec/dummy/db/schema.rb +3 -1
- data/spec/dummy/test/mailers/previews/user_mailer_preview.rb +11 -0
- data/spec/features/article_spec.rb +0 -1
- data/spec/features/password_reset_spec.rb +48 -0
- data/spec/mailers/lines/user_mailer_spec.rb +24 -0
- metadata +51 -12
- metadata.gz.sig +0 -0
data/lib/lines/version.rb
CHANGED
data/lines.gemspec
CHANGED
@@ -14,6 +14,9 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.description = "LINES lets you manage your posts in a clear, consistent frontend. The gracefully slender editor keeps your editing simple and lets you just splash around in your ideas. Once you're happy, just hit publish and see your text, code examples, images, and links shine."
|
15
15
|
s.license = "LGPL3"
|
16
16
|
s.date = Date.today.to_s
|
17
|
+
s.required_ruby_version = '>= 1.9.3'
|
18
|
+
s.cert_chain = ['certs/lines-engine.pem']
|
19
|
+
s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
|
17
20
|
|
18
21
|
|
19
22
|
s.add_dependency 'orm_adapter', '>= 0.5'
|
@@ -24,9 +27,9 @@ Gem::Specification.new do |s|
|
|
24
27
|
s.add_dependency 'carrierwave', '~> 0.10.0', '>= 0.10.0'
|
25
28
|
s.add_dependency 'kaminari', '~> 0.16.1', '>= 0.16.1'
|
26
29
|
s.add_dependency 'pygments.rb', '~> 0.6.0', '>= 0.6.0'
|
27
|
-
s.add_dependency 'redcarpet', '~> 3.
|
30
|
+
s.add_dependency 'redcarpet', '~> 3.2.3', '>= 3.2.3'
|
28
31
|
s.add_dependency 'jquery-rails', '< 5', '>= 3.1.0'
|
29
|
-
s.add_dependency 'acts-as-taggable-on', '~> 3.
|
32
|
+
s.add_dependency 'acts-as-taggable-on', '~> 3.5', '>= 3.5'
|
30
33
|
s.add_dependency 'bcrypt', '~> 3.1.0', '>= 3.1.0'
|
31
34
|
s.add_dependency 'simple_form', '~> 3', '>= 3.0.0', '< 4'
|
32
35
|
s.add_dependency 'sitemap_generator', '~> 5.0.0', '>= 5.0.5'
|
@@ -34,4 +34,9 @@ Rails.application.configure do
|
|
34
34
|
|
35
35
|
# Raises error for missing translations
|
36
36
|
# config.action_view.raise_on_missing_translations = true
|
37
|
+
|
38
|
+
# Mailer
|
39
|
+
config.action_mailer.raise_delivery_errors = true
|
40
|
+
config.action_mailer.delivery_method = :test
|
41
|
+
config.action_mailer.default_url_options = { host: 'localhost:3000' }
|
37
42
|
end
|
@@ -49,7 +49,10 @@ secret_token: "afa4a436180a2febe9b814c6a57b6f3ad298aa82ce0ab4c9e8238713764b665e9
|
|
49
49
|
# Environment dependent configuration. Place your URLs here
|
50
50
|
development:
|
51
51
|
host: "localhost:3000"
|
52
|
+
from_email: 'noreply@example.com'
|
52
53
|
test:
|
53
54
|
host: "test.local"
|
55
|
+
from_email: 'noreply@example.com'
|
54
56
|
production:
|
55
|
-
host: "blog.opoloo.com"
|
57
|
+
host: "blog.opoloo.com"
|
58
|
+
from_email: 'noreply@example.com'
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20150421093311) do
|
15
15
|
|
16
16
|
create_table "friendly_id_slugs", force: true do |t|
|
17
17
|
t.string "slug", null: false
|
@@ -77,6 +77,8 @@ ActiveRecord::Schema.define(version: 20141027143656) do
|
|
77
77
|
t.string "password_digest"
|
78
78
|
t.datetime "created_at", null: false
|
79
79
|
t.datetime "updated_at", null: false
|
80
|
+
t.string "reset_digest"
|
81
|
+
t.datetime "reset_sent_at"
|
80
82
|
end
|
81
83
|
|
82
84
|
create_table "taggings", force: true do |t|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Preview all emails at http://localhost:3000/rails/mailers/user_mailer
|
2
|
+
class UserMailerPreview < ActionMailer::Preview
|
3
|
+
|
4
|
+
# Preview this email at
|
5
|
+
# http://localhost:3000/rails/mailers/user_mailer/password_reset
|
6
|
+
def password_reset
|
7
|
+
user = Lines::User.first
|
8
|
+
user.reset_token = Lines::User.generate_token
|
9
|
+
Lines::UserMailer.password_reset(user)
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
feature 'user resets password' do
|
4
|
+
before(:each) do
|
5
|
+
@user = FactoryGirl.create(:user, password: 'password1234')
|
6
|
+
visit lines.login_path
|
7
|
+
expect(page).to have_content "Forgot password"
|
8
|
+
click_on "Forgot password"
|
9
|
+
expect(page).to have_content "Email"
|
10
|
+
fill_in "Email", with: @user.email
|
11
|
+
click_on 'Submit'
|
12
|
+
expect(page).to have_content "Email sent with password reset instructions"
|
13
|
+
#generate new reset token
|
14
|
+
@user.create_reset_digest
|
15
|
+
visit lines.edit_password_reset_url(@user.reload.reset_token, email: @user.email)
|
16
|
+
expect(page).to have_content 'Password Confirmation'
|
17
|
+
end
|
18
|
+
|
19
|
+
scenario 'with valid password' do
|
20
|
+
fill_in "Password", with: 'testtest'
|
21
|
+
fill_in "Confirmation", with: 'testtest'
|
22
|
+
click_on 'Update password'
|
23
|
+
expect(page).to have_content 'Password has been reset.'
|
24
|
+
expect(@user.reload.reset_digest).to eq nil
|
25
|
+
end
|
26
|
+
|
27
|
+
scenario 'with password too short' do
|
28
|
+
fill_in "Password", with: 't'
|
29
|
+
fill_in "Confirmation", with: 't'
|
30
|
+
click_on 'Update password'
|
31
|
+
expect(page).to have_content 'too short'
|
32
|
+
end
|
33
|
+
|
34
|
+
scenario 'with empty password' do
|
35
|
+
fill_in "Password", with: ''
|
36
|
+
fill_in "Confirmation", with: ''
|
37
|
+
click_on 'Update password'
|
38
|
+
expect(page).to have_content "Password can't be blank"
|
39
|
+
end
|
40
|
+
|
41
|
+
scenario 'with password confirmation not matching' do
|
42
|
+
fill_in "Password", with: 'testtest'
|
43
|
+
fill_in "Confirmation", with: 'testtest234'
|
44
|
+
click_on 'Update password'
|
45
|
+
expect(page).to have_content 'not match'
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Lines
|
4
|
+
describe UserMailer do
|
5
|
+
describe "password_reset" do
|
6
|
+
let(:user) { FactoryGirl.create(:user) }
|
7
|
+
let(:mail) { UserMailer.password_reset(user) }
|
8
|
+
|
9
|
+
before(:each) do
|
10
|
+
user.create_reset_digest
|
11
|
+
end
|
12
|
+
|
13
|
+
it "renders the headers" do
|
14
|
+
mail.subject.should eq("Password reset")
|
15
|
+
mail.to.should eq([user.email])
|
16
|
+
end
|
17
|
+
|
18
|
+
it "renders the body" do
|
19
|
+
mail.body.encoded.should match("password")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lines-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Opoloo GbR
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDYDCCAkigAwIBAgIBATANBgkqhkiG9w0BAQUFADA7MQ0wCwYDVQQDDARpbmZv
|
14
|
+
MRYwFAYKCZImiZPyLGQBGRYGb3BvbG9vMRIwEAYKCZImiZPyLGQBGRYCZGUwHhcN
|
15
|
+
MTUwNDIxMTIyMzQ5WhcNMTYwNDIwMTIyMzQ5WjA7MQ0wCwYDVQQDDARpbmZvMRYw
|
16
|
+
FAYKCZImiZPyLGQBGRYGb3BvbG9vMRIwEAYKCZImiZPyLGQBGRYCZGUwggEiMA0G
|
17
|
+
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDxEm+2kvkvFdAyi6VKiSPvEbFLgvC7
|
18
|
+
+MnhXzkFGLOb4UFNB0uSK2xGdBf2QVDWmK8W19UQNWoXHv5Pfni0wmUJ5yoP7lNg
|
19
|
+
qMqZFK0tkDImsQRrfOndqNylVyy9vBn/YtyAYG/v+IGxEW59OoL1uvX4FnxJ3C07
|
20
|
+
P8I0gWPUlw4/UFSpzTj1r4IEeN21oYlgCSz98O5vZVkRZAVNmotxcn/+vcpERjZ+
|
21
|
+
ugolMzyEqC5Uztos/D4pSrtum/UIhDbYfzkoI78hZjsaKQQwbmJd9/WzI5FUqEhS
|
22
|
+
ucANoSTcibahVQ5Qg1AedJCTgO5Z2NBdCSXce8q5wx5W7BqNPNjML5VpAgMBAAGj
|
23
|
+
bzBtMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBSB4W9llLnHPI5e
|
24
|
+
OUL+IbfDGahfYjAZBgNVHREEEjAQgQ5pbmZvQG9wb2xvby5kZTAZBgNVHRIEEjAQ
|
25
|
+
gQ5pbmZvQG9wb2xvby5kZTANBgkqhkiG9w0BAQUFAAOCAQEAxSYCQ1c3Am0fpQZW
|
26
|
+
NNOiHDAcn8k8B4rFp0/llzsIH0WOttTnhYYHqKdnpWJms2xPOPppb9MD8d+HpBn4
|
27
|
+
mCIzpjfzE0RQ0RzzLUdfDXLJPjOaJ/vtKZMMBxfMivLfx8HZTGrVVVE3l8wPav/2
|
28
|
+
CMUyx9n4Yn6xztVzRbadZp3Q1O/Bsg7dFz7xVkxUEaM1oHGFR+HrWRX2ZyDpaUHJ
|
29
|
+
fNEZV3vwM6Ye3VRzeM3R7Z1R9e9FbUK6awQt/x4gAaI9m3LS85lbwuibKKpdYupp
|
30
|
+
5BNWA8E1pTLFIGuj2vWGF3LmLHATeyBGXNDBRf6XZUG124zSK5pxkJ5zm2uBhu00
|
31
|
+
+pn0Gw==
|
32
|
+
-----END CERTIFICATE-----
|
33
|
+
date: 2015-04-24 00:00:00.000000000 Z
|
12
34
|
dependencies:
|
13
35
|
- !ruby/object:Gem::Dependency
|
14
36
|
name: orm_adapter
|
@@ -170,20 +192,20 @@ dependencies:
|
|
170
192
|
requirements:
|
171
193
|
- - "~>"
|
172
194
|
- !ruby/object:Gem::Version
|
173
|
-
version: 3.
|
195
|
+
version: 3.2.3
|
174
196
|
- - ">="
|
175
197
|
- !ruby/object:Gem::Version
|
176
|
-
version: 3.
|
198
|
+
version: 3.2.3
|
177
199
|
type: :runtime
|
178
200
|
prerelease: false
|
179
201
|
version_requirements: !ruby/object:Gem::Requirement
|
180
202
|
requirements:
|
181
203
|
- - "~>"
|
182
204
|
- !ruby/object:Gem::Version
|
183
|
-
version: 3.
|
205
|
+
version: 3.2.3
|
184
206
|
- - ">="
|
185
207
|
- !ruby/object:Gem::Version
|
186
|
-
version: 3.
|
208
|
+
version: 3.2.3
|
187
209
|
- !ruby/object:Gem::Dependency
|
188
210
|
name: jquery-rails
|
189
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -210,20 +232,20 @@ dependencies:
|
|
210
232
|
requirements:
|
211
233
|
- - "~>"
|
212
234
|
- !ruby/object:Gem::Version
|
213
|
-
version: 3.
|
235
|
+
version: '3.5'
|
214
236
|
- - ">="
|
215
237
|
- !ruby/object:Gem::Version
|
216
|
-
version: 3.
|
238
|
+
version: '3.5'
|
217
239
|
type: :runtime
|
218
240
|
prerelease: false
|
219
241
|
version_requirements: !ruby/object:Gem::Requirement
|
220
242
|
requirements:
|
221
243
|
- - "~>"
|
222
244
|
- !ruby/object:Gem::Version
|
223
|
-
version: 3.
|
245
|
+
version: '3.5'
|
224
246
|
- - ">="
|
225
247
|
- !ruby/object:Gem::Version
|
226
|
-
version: 3.
|
248
|
+
version: '3.5'
|
227
249
|
- !ruby/object:Gem::Dependency
|
228
250
|
name: bcrypt
|
229
251
|
requirement: !ruby/object:Gem::Requirement
|
@@ -579,6 +601,7 @@ files:
|
|
579
601
|
- CHANGELOG.md
|
580
602
|
- Gemfile
|
581
603
|
- Gemfile.lock
|
604
|
+
- Guardfile
|
582
605
|
- LICENSE
|
583
606
|
- README.rdoc
|
584
607
|
- Rakefile
|
@@ -668,8 +691,10 @@ files:
|
|
668
691
|
- app/controllers/lines/admin/pictures_controller.rb
|
669
692
|
- app/controllers/lines/application_controller.rb
|
670
693
|
- app/controllers/lines/articles_controller.rb
|
694
|
+
- app/controllers/lines/password_resets_controller.rb
|
671
695
|
- app/controllers/lines/sessions_controller.rb
|
672
696
|
- app/helpers/lines/application_helper.rb
|
697
|
+
- app/mailers/lines/user_mailer.rb
|
673
698
|
- app/models/lines/article.rb
|
674
699
|
- app/models/lines/author.rb
|
675
700
|
- app/models/lines/authorable.rb
|
@@ -709,10 +734,16 @@ files:
|
|
709
734
|
- app/views/lines/articles/index.atom.builder
|
710
735
|
- app/views/lines/articles/index.html.erb
|
711
736
|
- app/views/lines/articles/show.html.erb
|
737
|
+
- app/views/lines/password_resets/edit.html.erb
|
738
|
+
- app/views/lines/password_resets/new.html.erb
|
712
739
|
- app/views/lines/sessions/new.html.erb
|
740
|
+
- app/views/lines/shared/_flash.html.erb
|
713
741
|
- app/views/lines/shared/_footer.html.erb
|
714
742
|
- app/views/lines/shared/_navigation.html.erb
|
743
|
+
- app/views/lines/user_mailer/password_reset.html.erb
|
744
|
+
- app/views/lines/user_mailer/password_reset.text.erb
|
715
745
|
- bin/rails
|
746
|
+
- certs/lines-engine.pem
|
716
747
|
- config/initializers/carrierwave_test.rb
|
717
748
|
- config/initializers/kaminari_config.rb
|
718
749
|
- config/initializers/load_config.rb
|
@@ -725,8 +756,10 @@ files:
|
|
725
756
|
- db/migrate/20140702160603_add_missing_unique_indices.acts_as_taggable_on_engine.rb
|
726
757
|
- db/migrate/20140702160604_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
|
727
758
|
- db/migrate/20141027143656_add_teaser_to_article.rb
|
759
|
+
- db/migrate/20150421093311_add_reset_password_fields_to_users.rb
|
728
760
|
- db/seeds.rb
|
729
761
|
- lib/generators/lines/README
|
762
|
+
- lib/generators/lines/copy_styles_generator.rb
|
730
763
|
- lib/generators/lines/install_generator.rb
|
731
764
|
- lib/generators/lines/templates/octorel.png
|
732
765
|
- lib/lines.rb
|
@@ -783,13 +816,16 @@ files:
|
|
783
816
|
- spec/dummy/public/422.html
|
784
817
|
- spec/dummy/public/500.html
|
785
818
|
- spec/dummy/public/favicon.ico
|
819
|
+
- spec/dummy/test/mailers/previews/user_mailer_preview.rb
|
786
820
|
- spec/dummy/vendor/screenshots/octorel.png
|
787
821
|
- spec/factories/articles.rb
|
788
822
|
- spec/factories/authors.rb
|
789
823
|
- spec/factories/pictures.rb
|
790
824
|
- spec/factories/users.rb
|
791
825
|
- spec/features/article_spec.rb
|
826
|
+
- spec/features/password_reset_spec.rb
|
792
827
|
- spec/features/user_logs_in_spec.rb
|
828
|
+
- spec/mailers/lines/user_mailer_spec.rb
|
793
829
|
- spec/models/article_spec.rb
|
794
830
|
- spec/models/lines/author_spec.rb
|
795
831
|
- spec/models/lines/picture_spec.rb
|
@@ -809,7 +845,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
809
845
|
requirements:
|
810
846
|
- - ">="
|
811
847
|
- !ruby/object:Gem::Version
|
812
|
-
version:
|
848
|
+
version: 1.9.3
|
813
849
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
814
850
|
requirements:
|
815
851
|
- - ">="
|
@@ -864,13 +900,16 @@ test_files:
|
|
864
900
|
- spec/dummy/public/422.html
|
865
901
|
- spec/dummy/public/500.html
|
866
902
|
- spec/dummy/public/favicon.ico
|
903
|
+
- spec/dummy/test/mailers/previews/user_mailer_preview.rb
|
867
904
|
- spec/dummy/vendor/screenshots/octorel.png
|
868
905
|
- spec/factories/articles.rb
|
869
906
|
- spec/factories/authors.rb
|
870
907
|
- spec/factories/pictures.rb
|
871
908
|
- spec/factories/users.rb
|
872
909
|
- spec/features/article_spec.rb
|
910
|
+
- spec/features/password_reset_spec.rb
|
873
911
|
- spec/features/user_logs_in_spec.rb
|
912
|
+
- spec/mailers/lines/user_mailer_spec.rb
|
874
913
|
- spec/models/article_spec.rb
|
875
914
|
- spec/models/lines/author_spec.rb
|
876
915
|
- spec/models/lines/picture_spec.rb
|
metadata.gz.sig
ADDED
Binary file
|