hancock-client 0.0.3 → 0.0.4

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.
data/README.md CHANGED
@@ -14,13 +14,14 @@ Dependencies
14
14
  % sudo gem sources -a http://gems.github.com
15
15
  http://gems.github.com added to sources
16
16
 
17
- % sudo gem install sinatra-sinatra
18
- % sudo gem install atmos-hancock
17
+ % sudo gem install sinatra hancock haml
19
18
 
20
19
  testing
21
20
  =======
22
21
  Rake works but I'm not 100% sure how to test this correctly
23
22
 
23
+ % sudo gem install rcov rack-test rspec safariwatir cucumber
24
+
24
25
  Application
25
26
  ===========
26
27
  The goal is to make it simple to write sso enabled apps.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'spec/rake/spectask'
6
6
  require 'cucumber/rake/task'
7
7
 
8
8
  GEM = "hancock-client"
9
- GEM_VERSION = "0.0.3"
9
+ GEM_VERSION = "0.0.4"
10
10
  AUTHOR = "Corey Donohoe"
11
11
  EMAIL = ['atmos@atmos.org', 'tim@spork.in']
12
12
  HOMEPAGE = "http://github.com/atmos/hancock-client"
@@ -21,7 +21,11 @@ module Sinatra
21
21
  app.helpers Hancock::SSO::Helpers
22
22
  app.enable :sessions
23
23
  app.disable :raise_errors
24
- # app.before { ensure_sso_authenticated unless request.path_info =~ %r!^/sso/log(in|out)! }
24
+ app.before do
25
+ unless request.path_info == '/sso/login'
26
+ throw(:halt, [302, {'Location' => '/sso/login'}, '']) unless session[:user_id]
27
+ end
28
+ end
25
29
 
26
30
  app.get '/sso/login' do
27
31
  if contact_id = params['id']
data/spec/client.rb CHANGED
@@ -5,7 +5,6 @@ module Hancock
5
5
  class Client < ::Hancock::Client::Default
6
6
  set :environment, :development
7
7
  get '/' do
8
- redirect '/sso/login' unless session[:user_id]
9
8
  haml(<<-HAML
10
9
  %table
11
10
  %thead
@@ -8,6 +8,6 @@ describe Sinatra::Hancock::SSO do
8
8
  it "should greet the user when authenticated" do
9
9
  pending
10
10
  get '/'
11
- last_response.body.should have_selector('p')
11
+ last_response.should have_selector('p')
12
12
  end
13
13
  end
data/spec/spec_helper.rb CHANGED
@@ -26,6 +26,4 @@ Spec::Runner.configure do |config|
26
26
  run Hancock::Spec::Client
27
27
  end
28
28
  end
29
- #config.before(:each) do
30
- #end
31
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hancock-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Donohoe
@@ -9,7 +9,7 @@ autorequire: hancock-client
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-21 00:00:00 -06:00
12
+ date: 2009-03-23 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency