gitkeeper 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 357d09ab805c69fde0a983dd46ca92d88207633a
4
- data.tar.gz: 869c7f7c735a1983a1765f3c9b880154eddbeb99
3
+ metadata.gz: d4c2d83f4bb91775e262d97457fc7f255d2e8c0e
4
+ data.tar.gz: da5c3aa49a7558ec1baf6095768bd6b6a51f7426
5
5
  SHA512:
6
- metadata.gz: 5e80391c2eb16040f670d7468c504c6eaed678addbe00a5e7c7370c6c7497c21cf98265c2ee3dcd0b8e531122a858526f10eb18bf0200bbbbbdeb63e640f5835
7
- data.tar.gz: 4316dd7ab20cf39be8ff98f7c1b76c9fb8f55ba1a6dc5cdfb49af04510583c7f7e1b82a711df689049b061d755820b46dbbaa4af849d82167c35bd5158ec4997
6
+ metadata.gz: 6bc53cbee8de283a5c0ed02b452565255988ee116dabdb7d07efcb78cba387806eccf31544ed7ce2b320285985f117fe3b1d98a7dae7632fcae8d84232e17d9d
7
+ data.tar.gz: 3ef5126511e0a26948df4f45123c38cfcd70fc661cf5cc47c00b14a46e63226afb1e2b90d1d7d47a595a81f2378ca3dcfa299ab9f02170722cd0942e4c5f3b65
@@ -62,3 +62,4 @@ Visit the following URL
62
62
  http://localhost:3000/auth/github/
63
63
 
64
64
  This project rocks and uses MIT-LICENSE.
65
+
@@ -1,25 +1,23 @@
1
1
  require_dependency "gitkeeper/application_controller"
2
2
 
3
3
  module Gitkeeper
4
- class SessionsController < ApplicationController
5
- # def create
6
- # raise request.env["omniauth.auth"].to_yaml
7
- # Rails.logger.info "\r\n" + "#{Time.now} " + "auth = #{auth}" + "\r\n"
8
- # end
9
-
10
- # def new
11
- # redirect_to '/auth/#{config['provider']}'
12
- # end
13
-
4
+ class AuthController < ApplicationController
5
+ before_filter :current_user
6
+
7
+ def index
8
+ end
9
+
14
10
  # binding.pry
15
11
  def create
12
+ # raise request.env["omniauth.auth"].to_yaml
13
+ # Rails.logger.info "\r\n" + "#{Time.now} " + "auth = #{auth}" + "\r\n"
16
14
  user_find_or_create_from_auth_hash(request.env['omniauth.auth'])
17
- redirect_to '/'
15
+ redirect_to '/auth'
18
16
  end
19
17
 
20
18
  def destroy
21
19
  session[:user_id] = nil
22
- redirect_to '/'
20
+ redirect_to '/auth'
23
21
  end
24
22
 
25
23
  protected
@@ -27,5 +25,9 @@ module Gitkeeper
27
25
  user = User.where(nickname: auth['info']['nickname']).first || User.create_with_omniauth(auth)
28
26
  session[:user_id] = user.id.to_s
29
27
  end
28
+
30
29
  end
31
30
  end
31
+
32
+
33
+
@@ -1,4 +1,4 @@
1
1
  module Gitkeeper
2
- module HomeHelper
2
+ module AuthHelper
3
3
  end
4
4
  end
@@ -10,7 +10,7 @@
10
10
 
11
11
  <div id="user_nav">
12
12
  <%= link_to "Sign in with Github", "/auth/github" %>
13
- <%= link_to "Sign out", "/signout" %>
13
+ <%= link_to "Sign out", "/auth/signout" %>
14
14
  </div>
15
15
 
16
16
  <%= yield %>
@@ -1,12 +1,6 @@
1
1
  Gitkeeper::Engine.routes.draw do
2
+ root to: 'auth#index'
2
3
 
3
- root 'home#index'
4
-
5
- # get '/signin', to: 'sessions#new'
6
- get '/signout', to: 'sessions#destroy'
7
- # get '/auth/:provider', to: 'errors#error'
8
- # get '/auth/:provider/callback', to: 'sessions#create', as: 'signin'
9
- get ':provider/callback', to: 'sessions#create'
10
-
11
- # get ':provider/callback', to: 'auth#callback'
4
+ get '/signout', to: 'auth#destroy'
5
+ get ':provider/callback', to: 'auth#create'
12
6
  end
@@ -1,3 +1,3 @@
1
1
  module Gitkeeper
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitkeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca G. Soave
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-05 00:00:00.000000000 Z
11
+ date: 2013-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.1.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: mongoid
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: An engine for Rails 4.0.0, MongoID, OmniAuth, to Sign in with Github
70
84
  email:
71
85
  - luca.soave@gmail.com
@@ -73,18 +87,16 @@ executables: []
73
87
  extensions: []
74
88
  extra_rdoc_files: []
75
89
  files:
90
+ - app/controllers/gitkeeper/auth_controller.rb
76
91
  - app/controllers/gitkeeper/application_controller.rb
77
- - app/controllers/gitkeeper/home_controller.rb
78
- - app/controllers/gitkeeper/sessions_controller.rb
79
92
  - app/assets/javascripts/gitkeeper/application.js
80
- - app/assets/javascripts/gitkeeper/home.js
93
+ - app/assets/javascripts/gitkeeper/auth.js
94
+ - app/assets/stylesheets/gitkeeper/auth.css
81
95
  - app/assets/stylesheets/gitkeeper/application.css
82
- - app/assets/stylesheets/gitkeeper/home.css
83
96
  - app/helpers/gitkeeper/application_helper.rb
84
- - app/helpers/gitkeeper/sessions_helper.rb
85
- - app/helpers/gitkeeper/home_helper.rb
97
+ - app/helpers/gitkeeper/auth_helper.rb
86
98
  - app/models/gitkeeper/user.rb
87
- - app/views/gitkeeper/home/index.html.erb
99
+ - app/views/gitkeeper/auth/index.html.erb
88
100
  - app/views/layouts/gitkeeper/application.html.erb
89
101
  - config/routes.rb
90
102
  - config/mongoid.yml
@@ -1,12 +0,0 @@
1
- require_dependency "gitkeeper/application_controller"
2
-
3
- module Gitkeeper
4
- class HomeController < ApplicationController
5
- before_filter :current_user
6
-
7
- def index
8
- end
9
- end
10
- end
11
-
12
-
@@ -1,4 +0,0 @@
1
- module Gitkeeper
2
- module SessionsHelper
3
- end
4
- end