userswitch 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +10 -12
- data/lib/tasks/userswitch.rake +1 -1
- data/lib/userswitch.rb +1 -1
- data/lib/userswitch/version.rb +1 -1
- data/userswitch.gemspec +6 -3
- metadata +3 -6
- data/us1.png +0 -0
- data/us2.png +0 -0
- data/us3.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b05181f0222c7708c28c54c0d2197b1fd392fc9c
|
4
|
+
data.tar.gz: d92b5c4587dab98a0391e4a531643d7235695f36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a244e38afe16741c6a6bfac9f2da3beb818be69b1caaa1aab1a6d5d23394f4ec1c5caa7340aee1f458c6612c628676f5fb487c862b0de05399179824f4d3ff2a
|
7
|
+
data.tar.gz: 1155f49246df8027cf7473ebc34f09957aead36629c3d11c0aed753b30d41e3b1b21bf64ef10b182d0cc9ecc85d3d02284468f2bbf5244b7648aca47ec2f17e9
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,34 +1,32 @@
|
|
1
|
-
#
|
1
|
+
# UserSwitch
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/userswitch.svg)](https://badge.fury.io/rb/userswitch)
|
4
4
|
|
5
|
-
|
5
|
+
UserSwitch is a Rails plugin for switching between commonly used roles and users. It's particularly useful for development and staging environments when you often need to switch between various accounts. It saves you from the hassle of logging in or out.
|
6
|
+
|
7
|
+
![alt](https://cloud.githubusercontent.com/assets/17185440/24801547/f2cb2c8a-1ba4-11e7-87a6-59911794d6c7.png)
|
6
8
|
|
7
9
|
## Example
|
8
10
|
|
9
11
|
By default, the gem will output a chain of buttons as follows
|
10
12
|
|
11
|
-
![pic1](https://cloud.githubusercontent.com/assets/8150171/24745257/45e699cc-1ab5-11e7-8064-1b978d38b896.png)
|
12
|
-
|
13
13
|
By clicking on a button, your Rails app will switch to a different user, that is, your session will change to that of a different account and save you the time you might otherwise spend clicking on logout links and filling in forms to log as a different user.
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
Different roles can have different colors so as to be more noticeable.
|
15
|
+
Different roles have different colors so as to be more noticeable. If we put mulitple "same role" users for testing, we can still see by color coding what role it belongs to.
|
18
16
|
|
19
|
-
![
|
17
|
+
![alt](https://cloud.githubusercontent.com/assets/17185440/24800120/04b1a614-1b9f-11e7-9584-3392ca40f125.gif)
|
20
18
|
|
21
19
|
## Requirements
|
22
20
|
```ruby
|
23
|
-
gem
|
24
|
-
gem
|
21
|
+
gem 'bootstrap'
|
22
|
+
gem 'devise'
|
25
23
|
```
|
26
24
|
|
27
25
|
## How to install
|
28
26
|
|
29
27
|
Add it to your app's Gemfile and run bundle
|
30
28
|
```ruby
|
31
|
-
gem
|
29
|
+
gem 'userswitch'
|
32
30
|
```
|
33
31
|
or install it manually
|
34
32
|
```ruby
|
@@ -39,7 +37,7 @@ gem install userswitch
|
|
39
37
|
Create userswitch.yml inside you config folder with:
|
40
38
|
|
41
39
|
```ruby
|
42
|
-
rake userswitch:
|
40
|
+
rake userswitch:install
|
43
41
|
```
|
44
42
|
|
45
43
|
Inside of your template/view, you can call users with (showing only users from yours userswitch.yml):
|
data/lib/tasks/userswitch.rake
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
namespace :userswitch do
|
2
2
|
desc 'create yml file'
|
3
3
|
|
4
|
-
task :
|
4
|
+
task :install do
|
5
5
|
path = 'config/userswitch.yml'
|
6
6
|
content = "## available colors: [red, dark-blue, light-blue, green, yellow, gray, white]
|
7
7
|
# name of role: color_name(need to be spelled right)
|
data/lib/userswitch.rb
CHANGED
@@ -7,7 +7,7 @@ module Userswitch
|
|
7
7
|
# if File.directory?('config/userswitch.yml')
|
8
8
|
YAML.load_file('config/userswitch.yml')
|
9
9
|
# else
|
10
|
-
# raise 'Havent created config/userswitch.yml file try running rake userswitch:
|
10
|
+
# raise 'Havent created config/userswitch.yml file try running rake userswitch:install'
|
11
11
|
# end
|
12
12
|
end
|
13
13
|
|
data/lib/userswitch/version.rb
CHANGED
data/userswitch.gemspec
CHANGED
@@ -29,7 +29,10 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
# s.add_runtime_dependency "rails"
|
33
|
+
# s.add_runtime_dependency "devise"
|
34
|
+
|
35
|
+
spec.add_development_dependency "bundler", "~> 1.14"
|
36
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
35
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: userswitch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kodius
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,9 +76,6 @@ files:
|
|
76
76
|
- lib/userswitch/engine.rb
|
77
77
|
- lib/userswitch/railtie.rb
|
78
78
|
- lib/userswitch/version.rb
|
79
|
-
- us1.png
|
80
|
-
- us2.png
|
81
|
-
- us3.png
|
82
79
|
- userswitch.gemspec
|
83
80
|
homepage: https://github.com/kodius/userswitch
|
84
81
|
licenses:
|
@@ -101,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
98
|
version: '0'
|
102
99
|
requirements: []
|
103
100
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
101
|
+
rubygems_version: 2.6.7
|
105
102
|
signing_key:
|
106
103
|
specification_version: 4
|
107
104
|
summary: Userswitch is a Rails plugin for switching between commonly used roles and
|
data/us1.png
DELETED
Binary file
|
data/us2.png
DELETED
Binary file
|
data/us3.png
DELETED
Binary file
|