easy_login 1.2.3 → 1.3.0

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: baebd252eaab3ea9508ed62420d49ac9db5f21f9
4
- data.tar.gz: 20fe3eb02fb0876ac7d992064df2425d89d4bf45
3
+ metadata.gz: c71315035ea81df325d76eab8ab2f4818f8ce99d
4
+ data.tar.gz: f210d6d83509cfdc458b1827eccf4c35b8fca874
5
5
  SHA512:
6
- metadata.gz: c5f4ae2b4ad547058fb44a402dce1aae357955a294178dca0c3e9bbe31e47a7e259e81eab8cf3f32da517bb4b032ba6327d75cce62d2cdc6cd68714b8b8fef9b
7
- data.tar.gz: be7f243664cfb1526c2cbbf682b7f31917143512e1136298ebeb2d73eca4228eb813536106fd2820f91bad53689dcf0ba3c7e51fe101751e0d8fe3152a76936d
6
+ metadata.gz: 81479889ff8dcf1b261b2290b684b8f814091b253d3f7215680baf5f70f36150edfefd4cfdbae4ba492937dfefdeb0b427878bca076938a26c147102e461bcef
7
+ data.tar.gz: 6461bea509ef705b122446a57e0aec9deb24a75cc424df4efd54a8b764f219a161db92856170d7f446056106abff61d0bfb2327fbaaf02060d17e14c52a24cba
data/README.md CHANGED
@@ -21,6 +21,10 @@ Install it yourself as:
21
21
 
22
22
  $ gem install easy_login
23
23
 
24
+ And then run command to init a config file
25
+
26
+ $ bundle exec rails generate easy_login:init
27
+
24
28
  ## Usage
25
29
 
26
30
  Add config in `config/application.rb` or `config/environments/*.rb`
@@ -42,8 +46,9 @@ include EasyLogin
42
46
  And then abosultely use all methods above in controller and view
43
47
 
44
48
  Also you can declare a redirect schema for differenct user accessing differect
45
- controller and action
46
- Add a config file to `config/http_permissions.yml` as following
49
+ controller and action by editing config file `config/http_permissions.yml`
50
+
51
+ The following is a default code of `config/http_permissions.yml`
47
52
 
48
53
  ```yaml
49
54
  default:
@@ -1,3 +1,3 @@
1
1
  module EasyLogin
2
- VERSION = "1.2.3"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -0,0 +1,12 @@
1
+ require 'rails/generators/base'
2
+
3
+ module EasyLogin
4
+ class InitGenerator < Rails::Generators::Base
5
+ source_root File.expand_path('../../templates', __FILE__)
6
+ desc 'EasyLogin Initialize'
7
+
8
+ def init_steps
9
+ copy_file 'http_permissions.yml', 'config/http_permissions.yml'
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ default:
2
+ ope: pass
3
+ customer: pass
4
+ unsigned: redirect_to->login_users_path
5
+ users:
6
+ login:
7
+ ope: redirect_to->root_path
8
+ customer: redirect_to->root_path
9
+ tools:
10
+ default:
11
+ customer: raise->Routing Error
12
+ unsigned: redirect_to->/tools/login
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_login
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - goshan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-29 00:00:00.000000000 Z
11
+ date: 2017-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,6 +79,8 @@ files:
79
79
  - lib/easy_login/permission.rb
80
80
  - lib/easy_login/session.rb
81
81
  - lib/easy_login/version.rb
82
+ - lib/generators/easy_login/init_generator.rb
83
+ - lib/generators/templates/http_permissions.yml
82
84
  - pkg/easy_login-0.1.0.gem
83
85
  - pkg/easy_login-0.1.1.gem
84
86
  - pkg/easy_login-0.1.2.gem