rails_easy_sign_in 0.0.3 → 0.0.4
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/README.md +18 -1
- data/app/assets/javascripts/rails_easy_sign_in.js.coffee +15 -15
- data/app/assets/stylesheets/rails_easy_sign_in.css.sass +10 -0
- data/lib/rails_easy_sign_in.rb +5 -1
- data/rails_easy_sign_in.gemspec +15 -13
- metadata +19 -4
- data/app/assets/javascripts/jordan.js +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d14191c8f63033292cc6c6a8f4968b4b9e2eae9
|
4
|
+
data.tar.gz: 4d815fea9bcaf8092648059e4f54707cbf0a34ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 519f5e272000645349c23b6ffb202da162bb2c7b7ab6fe89ea55733c21b95117c7a71a71213ac27a6011a851bd680d9adf65a96654750fa0eae8da8b57971625
|
7
|
+
data.tar.gz: 8cb5f3857c1ed7c784b7acc92b48a66610f88b5f488b7e78a525a8b6df80c51bfd4f27416a1aa7dba6e1295ef4037067402f63c1222a00e0c4c01e0aa901e8af
|
data/README.md
CHANGED
@@ -1 +1,18 @@
|
|
1
|
-
# Rails Easy Sign In
|
1
|
+
# Rails Easy Sign In
|
2
|
+
|
3
|
+
Adds a sign in box to your login page to allow automatic sign in. Useful in development environments.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
1. Add ```gem 'rails_easy_sign_in' ``` to the development group of the _Gemfile_ and bundle.
|
8
|
+
2. Add ```#= require rails_easy_sign_in``` to _application.js_
|
9
|
+
3. Add ```@import rails_easy_sign_in``` to _application.css.sass_
|
10
|
+
5. Add ```config.should_show_easy_login = true``` to _config/environtments/development.rb_
|
11
|
+
4. Add the following to _app/views/devise/sessions/new.html.haml_:
|
12
|
+
|
13
|
+
```
|
14
|
+
- if Rails.application.config.should_show_easy_login
|
15
|
+
.easy-sign-in
|
16
|
+
= link_to 'Sign in as Administrator', '#', data: { email: "admin@example.com", password: "password" }
|
17
|
+
= link_to 'Sign in as Member', '#', data: { email: "member@example.com", password: "password" }
|
18
|
+
```
|
@@ -1,18 +1,18 @@
|
|
1
|
-
EasySignIn
|
1
|
+
EasySignIn =
|
2
|
+
setup: ->
|
3
|
+
# These are based on devise's field names, for a User model.
|
4
|
+
# Ghetto support for authentication with either an email or a username
|
5
|
+
$emailField = $("#user_email")
|
6
|
+
$usernameField = $("#user_username")
|
7
|
+
$passwordField = $("#user_password")
|
2
8
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
event.preventDefault()
|
12
|
-
$el = $(this)
|
13
|
-
$emailField.val($el.data('email'))
|
14
|
-
$usernameField.val($el.data('username'))
|
15
|
-
$passwordField.val($el.data('password'))
|
16
|
-
$("form").submit()
|
9
|
+
if $emailField || $usernameField
|
10
|
+
$("a").filter("[data-email], [data-username]").click (event) ->
|
11
|
+
event.preventDefault()
|
12
|
+
$el = $(this)
|
13
|
+
$emailField.val($el.data('email'))
|
14
|
+
$usernameField.val($el.data('username'))
|
15
|
+
$passwordField.val($el.data('password'))
|
16
|
+
$("form").submit()
|
17
17
|
|
18
18
|
$(document).ready(EasySignIn.setup).on "page:load", EasySignIn.setup
|
data/lib/rails_easy_sign_in.rb
CHANGED
data/rails_easy_sign_in.gemspec
CHANGED
@@ -1,23 +1,25 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
3
|
|
4
|
-
Gem::Specification.new do |
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = "rails_easy_sign_in"
|
6
|
+
gem.version = "0.0.4"
|
7
|
+
gem.authors = ["Jordan Maguire", "Steven Webb"]
|
8
|
+
gem.email = ["jordan@thefrontiergroup.com.au"]
|
9
|
+
gem.homepage = "https://github.com/jordanmaguire/rails_easy_sign_in"
|
10
|
+
gem.summary = "Easy sign in for Rails apps"
|
11
|
+
gem.description = <<-EOF
|
12
12
|
Too many users not enough brain memory?
|
13
13
|
|
14
14
|
Use Rails easy sign in to add an easy menu for signing in with different users. Never
|
15
15
|
need to remember users for demo-ing an app again.
|
16
16
|
EOF
|
17
|
-
|
17
|
+
gem.licenses = ['WTFPL']
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
gem.files = `git ls-files`.split("\n")
|
20
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
|
+
gem.require_paths = ["lib"]
|
23
|
+
|
24
|
+
gem.add_dependency "railties"
|
23
25
|
end
|
metadata
CHANGED
@@ -1,15 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_easy_sign_in
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan Maguire
|
8
|
+
- Steven Webb
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
12
|
+
date: 2015-04-09 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: railties
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
13
28
|
description: |2
|
14
29
|
Too many users not enough brain memory?
|
15
30
|
|
@@ -29,8 +44,8 @@ files:
|
|
29
44
|
- Gemfile
|
30
45
|
- README.md
|
31
46
|
- Rakefile
|
32
|
-
- app/assets/javascripts/jordan.js
|
33
47
|
- app/assets/javascripts/rails_easy_sign_in.js.coffee
|
48
|
+
- app/assets/stylesheets/rails_easy_sign_in.css.sass
|
34
49
|
- lib/rails_easy_sign_in.rb
|
35
50
|
- license.txt
|
36
51
|
- rails_easy_sign_in.gemspec
|
@@ -1 +0,0 @@
|
|
1
|
-
alert("yolo")
|