q_auth_ruby_client 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/q_auth_ruby_client/sessions_controller.rb +1 -5
- data/app/helpers/q_auth_ruby_client/api_helper.rb +13 -0
- data/app/helpers/q_auth_ruby_client/application_helper.rb +24 -0
- data/app/helpers/q_auth_ruby_client/notification_helper.rb +9 -0
- data/lib/q_auth_ruby_client/engine.rb +11 -0
- data/lib/q_auth_ruby_client/version.rb +1 -1
- metadata +23 -5
- data/app/assets/javascripts/q_auth_ruby_client/application.js +0 -13
- data/app/assets/stylesheets/q_auth_ruby_client/application.css +0 -15
- data/app/views/layouts/q_auth_ruby_client/application.html.erb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06cfa0eca623027d630cfd8dfc02c3e9f246fe80
|
4
|
+
data.tar.gz: 27834add5d33e7f98e94858ac1fbef75ec3c57e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19c4dc2106049bd246fe3879a33db96e116e3a52a546939536357d13c8951f0a6d49f93085aab35fa8909492a7b336a83b901446b0def4942fb0f08611305549
|
7
|
+
data.tar.gz: 469fe5249bc0f35fa09eb073ffed7a42e0fe844e2a88c3d2aebc785a073a805e198b5d224cf200138207ea63848c8cf186a0574f20f1b7d021c1c34553da55a2
|
@@ -31,14 +31,10 @@ class QAuthRubyClient::SessionsController < ApplicationController
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def sign_out
|
34
|
-
|
35
|
-
store_flash_message("You have successfully signed out", :notice)
|
36
|
-
|
34
|
+
set_flash_message("You have successfully signed out", :notice)
|
37
35
|
# Reseting the auth token for user when he logs out.
|
38
36
|
# @current_user.update_attribute :auth_token, SecureRandom.hex
|
39
|
-
|
40
37
|
session.delete(:id)
|
41
|
-
|
42
38
|
redirect_to default_redirect_url_after_sign_out
|
43
39
|
end
|
44
40
|
|
@@ -47,6 +47,19 @@ module QAuthRubyClient
|
|
47
47
|
["true", "t", "1", "yes"].include?(params[:debug].to_s.downcase.strip) # || Rails.env == "development"
|
48
48
|
end
|
49
49
|
|
50
|
+
# def prepare_data
|
51
|
+
# @data = yield
|
52
|
+
# @body = {}
|
53
|
+
# end
|
54
|
+
|
55
|
+
# def render_json(**options)
|
56
|
+
# options.reverse_merge!(
|
57
|
+
# status: 200,
|
58
|
+
# success: true,
|
59
|
+
# body: @body
|
60
|
+
# )
|
61
|
+
# end
|
62
|
+
|
50
63
|
## This method will accept a proc, execute it and render the json
|
51
64
|
def render_json_response(proc_code)
|
52
65
|
|
@@ -1,4 +1,28 @@
|
|
1
1
|
module QAuthRubyClient
|
2
2
|
module ApplicationHelper
|
3
|
+
## Returns new photo url or edit existing photo url based on
|
4
|
+
# object is associated with photo or not
|
5
|
+
# == Examples
|
6
|
+
# >>> upload_image_link(@user, admin_user_path(@user), :profile_picture)
|
7
|
+
# => "/admin/images/new" OR
|
8
|
+
# => "/admin/images/1/edit"
|
9
|
+
def upload_image_link(object, redirect_url, assoc_name=:photo)
|
10
|
+
photo_object = nil
|
11
|
+
photo_object = object.send(assoc_name) if object.respond_to?(assoc_name)
|
12
|
+
|
13
|
+
if photo_object.present? && photo_object.persisted?
|
14
|
+
edit_admin_image_path(photo_object,
|
15
|
+
:redirect_url => redirect_url,
|
16
|
+
:imageable_id => object.id,
|
17
|
+
:imageable_type => object.class.to_s,
|
18
|
+
:image_type => photo_object.class.name)
|
19
|
+
else
|
20
|
+
photo_object = object.send("build_#{assoc_name}")
|
21
|
+
new_admin_image_path(:redirect_url => redirect_url,
|
22
|
+
:imageable_id => object.id,
|
23
|
+
:imageable_type => object.class.to_s,
|
24
|
+
:image_type => photo_object.class.name)
|
25
|
+
end
|
26
|
+
end
|
3
27
|
end
|
4
28
|
end
|
@@ -1,5 +1,16 @@
|
|
1
1
|
module QAuthRubyClient
|
2
2
|
class Engine < ::Rails::Engine
|
3
3
|
isolate_namespace QAuthRubyClient
|
4
|
+
|
5
|
+
initializer "q_auth_ruby_client.configure_rails_initialization" do |app|
|
6
|
+
ActiveSupport.on_load :action_controller do
|
7
|
+
include QAuthRubyClient::ApiHelper
|
8
|
+
include QAuthRubyClient::NotificationHelper
|
9
|
+
include QAuthRubyClient::SessionsHelper
|
10
|
+
helper QAuthRubyClient::ApiHelper
|
11
|
+
helper QAuthRubyClient::NotificationHelper
|
12
|
+
helper QAuthRubyClient::SessionsHelper
|
13
|
+
end
|
14
|
+
end
|
4
15
|
end
|
5
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: q_auth_ruby_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krishnaprasad Varma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,6 +30,26 @@ dependencies:
|
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 4.1.5
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: poodle-rb
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 0.0.4
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.0.1
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.0.4
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.0.1
|
33
53
|
- !ruby/object:Gem::Dependency
|
34
54
|
name: typhoeus
|
35
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,16 +101,14 @@ files:
|
|
81
101
|
- MIT-LICENSE
|
82
102
|
- README.rdoc
|
83
103
|
- Rakefile
|
84
|
-
- app/assets/javascripts/q_auth_ruby_client/application.js
|
85
|
-
- app/assets/stylesheets/q_auth_ruby_client/application.css
|
86
104
|
- app/controllers/q_auth_ruby_client/application_controller.rb
|
87
105
|
- app/controllers/q_auth_ruby_client/sessions_controller.rb
|
88
106
|
- app/helpers/q_auth_ruby_client/api_helper.rb
|
89
107
|
- app/helpers/q_auth_ruby_client/application_helper.rb
|
108
|
+
- app/helpers/q_auth_ruby_client/notification_helper.rb
|
90
109
|
- app/helpers/q_auth_ruby_client/sessions_helper.rb
|
91
110
|
- app/models/q_auth_ruby_client/user.rb
|
92
111
|
- app/models/user.rb
|
93
|
-
- app/views/layouts/q_auth_ruby_client/application.html.erb
|
94
112
|
- app/views/sessions/sign_in.html.erb
|
95
113
|
- config/locales/q_auth_ruby_client.en.yml
|
96
114
|
- config/routes.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree .
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
-
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
-
* file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>QAuthRubyClient</title>
|
5
|
-
<%= stylesheet_link_tag "q_auth_ruby_client/application", media: "all" %>
|
6
|
-
<%= javascript_include_tag "q_auth_ruby_client/application" %>
|
7
|
-
<%= csrf_meta_tags %>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<%= yield %>
|
12
|
-
|
13
|
-
</body>
|
14
|
-
</html>
|