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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 779c4605787a20e176258d61c127f1d3d0a276ef
4
- data.tar.gz: 7545a12e7c7ead702ff8c98b97cc10bc3d324d8a
3
+ metadata.gz: 6d14191c8f63033292cc6c6a8f4968b4b9e2eae9
4
+ data.tar.gz: 4d815fea9bcaf8092648059e4f54707cbf0a34ee
5
5
  SHA512:
6
- metadata.gz: 6660d03803c6ec8282242f932c173eb6627793ba133e1487d4b01936db9e27322435d3ff5498d324b508ad0ac8b16dce94c89cf2adbaf3d1b7839dedac685bf0
7
- data.tar.gz: 357f8c4553e2343b3cc6187116e0315203510207b75ed5b12f64a1f9efe811e487cff0654429d698d9328807597e4fd95d0cdc164c08a1166b2c6f4be77b6b93
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.setup = ->
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
- # 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")
8
-
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()
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
@@ -0,0 +1,10 @@
1
+ .easy-sign-in
2
+ position: absolute
3
+ bottom: 0
4
+ left: 0
5
+ padding: 10px 20px
6
+ font-size: 12px
7
+ background: #fff
8
+ +box-shadow(0 0 10px black(0.3))
9
+ a
10
+ display: block
@@ -1,2 +1,6 @@
1
- class RailsEasySignIn
1
+ module RailsEasySignIn
2
+ VERSION = "0.0.4"
3
+
4
+ class Engine < ::Rails::Engine
5
+ end
2
6
  end
@@ -1,23 +1,25 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
- Gem::Specification.new do |s|
5
- s.name = "rails_easy_sign_in"
6
- s.version = "0.0.3"
7
- s.authors = ["Jordan Maguire"]
8
- s.email = ["jordan@thefrontiergroup.com.au"]
9
- s.homepage = "https://github.com/jordanmaguire/rails_easy_sign_in"
10
- s.summary = "Easy sign in for Rails apps"
11
- s.description = <<-EOF
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
- s.licenses = ['WTFPL']
17
+ gem.licenses = ['WTFPL']
18
18
 
19
- s.files = `git ls-files`.split("\n")
20
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
- s.require_paths = ["lib"]
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.3
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: 2014-11-19 00:00:00.000000000 Z
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")