peek-devise 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fad45096e6a1255f1e099a6e7543d733c42547bda8bf406e0909971e6d791b6b
4
+ data.tar.gz: ce6494332651f65a3dafe616fdc9c552679c61098505c3615052aaef8006110d
5
+ SHA512:
6
+ metadata.gz: 7d9fa0fcdba0eb451140b9dc6b3bc3f9f5e98a80d2b9753aef6b01592b7bf112f660d12c0935cc5ec773639e315b737abe863970088a2ea57e116adf2bf4fac4
7
+ data.tar.gz: 1922e622e5cde17f7413a4e7f5da3eed5c1e0c846d336deba6b1d3fbea2f64644c4bc1d4cf539c0ee95adcba3db64fab2635d5694e1f8bad65a15bafc5eb07b1
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .vscode/
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # 1.0
2
+
3
+ - Initial release
4
+
5
+ # 1.0.1
6
+
7
+ - Added support for GIT_SHA and GIT_BRANCH env variables instead of shelling out to fetch them.
8
+
9
+ # 1.0.2
10
+
11
+ - Add support for additional options `:domain` and `:protocol`.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in peek-git.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2018 Gencer W. Genç
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Peek::Devise
2
+
3
+ Take a peek into the Devise info of your Rails application.
4
+
5
+ Things this peek view provides:
6
+
7
+ - View the current logged in user both by omniauth or direct using warden
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ gem 'peek-devise', github: 'gencer/peek-devise', branch: 'master'
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+
20
+ ## Usage
21
+
22
+ Add the following to your `config/initializers/peek.rb`:
23
+
24
+ ```ruby
25
+ Peek.into Peek::Views::Devise
26
+ ```
27
+
28
+ ## Contributing
29
+
30
+ 1. Fork it
31
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
32
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
33
+ 4. Push to the branch (`git push origin my-new-feature`)
34
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,12 @@
1
+ <div>
2
+ <span>
3
+ <span style="padding-top: 2px; padding-bottom: 2px; padding-right: 2px; padding-left: 4px; margin-right: 8px; border-radius: 3px; font-size: 11px; background-color: #ff4910; color: #fff;">
4
+ <%= view.user.id %>
5
+ </span>
6
+ <% if view.user.respond_to?(:email_decrypted) %>
7
+ <%= view.user.email_decrypted %>
8
+ <% else %>
9
+ <%= view.user.email %>
10
+ <% end %>
11
+ </span>
12
+ </div>
@@ -0,0 +1,3 @@
1
+ require 'peek/views/devise'
2
+ require 'peek-devise/version'
3
+ require 'peek-devise/railtie'
@@ -0,0 +1,20 @@
1
+ module Peek
2
+ module Devise
3
+ class Middleware
4
+ def initialize(app)
5
+ @app = app
6
+ end
7
+
8
+ def call(env)
9
+ Peek::Devise::Railtie.env = env
10
+ @app.call(env)
11
+ end
12
+ end
13
+ class Railtie < ::Rails::Engine
14
+ initializer "peek_devise_railtie.configure_rails_initialization" do |app|
15
+ app.middleware.use Peek::Devise::Middleware
16
+ end
17
+ attr_accessor :env
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ module Peek
2
+ module Devise
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
@@ -0,0 +1,16 @@
1
+ module Peek
2
+ module Views
3
+ class Devise < View
4
+ # Returns Peek::Views::Devise
5
+ def initialize(options = {}); end
6
+
7
+ def signed_in?
8
+ Peek::Devise::Railtie.env["warden"].authenticated?
9
+ end
10
+
11
+ def user
12
+ Peek::Devise::Railtie.env["warden"].user
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'peek-devise/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = 'peek-devise'
8
+ gem.version = Peek::Devise::VERSION
9
+ gem.authors = ['Gencer W. Genç']
10
+ gem.email = ['gencer@nienbo.co.uk']
11
+ gem.description = %q{Take a peek into the Devise info of your Rails application.}
12
+ gem.summary = %q{Take a peek into the Devise info of your Rails application.}
13
+ gem.homepage = 'https://github.com/gencer/peek-devise'
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ['lib']
19
+
20
+ gem.add_dependency 'peek'
21
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: peek-devise
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Gencer W. Genç
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-09-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: peek
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Take a peek into the Devise info of your Rails application.
28
+ email:
29
+ - gencer@nienbo.co.uk
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - CHANGELOG.md
36
+ - Gemfile
37
+ - LICENSE.txt
38
+ - README.md
39
+ - Rakefile
40
+ - app/views/peek/views/_devise.html.erb
41
+ - lib/peek-devise.rb
42
+ - lib/peek-devise/railtie.rb
43
+ - lib/peek-devise/version.rb
44
+ - lib/peek/views/devise.rb
45
+ - peek-devise.gemspec
46
+ homepage: https://github.com/gencer/peek-devise
47
+ licenses: []
48
+ metadata: {}
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubyforge_project:
65
+ rubygems_version: 2.7.6
66
+ signing_key:
67
+ specification_version: 4
68
+ summary: Take a peek into the Devise info of your Rails application.
69
+ test_files: []