sinatra_warden 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,22 +1,3 @@
1
- source 'http://rubygems.org'
1
+ source :rubygems
2
2
 
3
- group :runtime do
4
- gem 'sinatra', '>= 0.9.4'
5
- gem 'warden', '>= 0.10.3'
6
- end
7
-
8
- group :test do
9
- gem 'rake'
10
- gem 'jeweler', '~> 1.3.0'
11
- gem 'bundler', '~> 0.9.7'
12
- gem 'rspec', '~> 1.2.9', :require => 'spec'
13
- gem 'yard', '>= 0.5.4'
14
- gem 'rack-test', '~> 0.5.0', :require => 'rack/test'
15
- gem 'rcov'
16
-
17
- gem 'do_sqlite3', '~> 0.10.0'
18
- gem 'dm-core', '~> 0.10.1'
19
- gem 'bcrypt-ruby', :require => 'bcrypt'
20
- gem 'haml'
21
- gem 'rack-flash', '~> 0.1.1', :require => 'rack-flash'
22
- end
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,64 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sinatra_warden (0.3.2)
5
+ sinatra (>= 1.0.0)
6
+ warden (~> 1.0)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ addressable (2.2.2)
12
+ bcrypt-ruby (2.1.2)
13
+ data_objects (0.10.2)
14
+ addressable (~> 2.1)
15
+ dm-core (1.0.2)
16
+ addressable (~> 2.2)
17
+ extlib (~> 0.9.15)
18
+ dm-do-adapter (1.0.2)
19
+ data_objects (~> 0.10.2)
20
+ dm-core (~> 1.0.2)
21
+ dm-migrations (1.0.2)
22
+ dm-core (~> 1.0.2)
23
+ dm-sqlite-adapter (1.0.2)
24
+ dm-do-adapter (~> 1.0.2)
25
+ do_sqlite3 (~> 0.10.2)
26
+ do_sqlite3 (0.10.2)
27
+ data_objects (= 0.10.2)
28
+ extlib (0.9.15)
29
+ haml (3.0.23)
30
+ rack (1.2.1)
31
+ rack-flash (0.1.1)
32
+ rack
33
+ rack-test (0.5.6)
34
+ rack (>= 1.0)
35
+ rake (0.8.7)
36
+ rcov (0.9.9)
37
+ rspec (1.2.9)
38
+ sinatra (1.1.0)
39
+ rack (~> 1.1)
40
+ tilt (~> 1.1)
41
+ tilt (1.1)
42
+ warden (1.0.1)
43
+ rack (>= 1.0.0)
44
+ yard (0.6.1)
45
+
46
+ PLATFORMS
47
+ ruby
48
+
49
+ DEPENDENCIES
50
+ bcrypt-ruby
51
+ dm-core (~> 1.0)
52
+ dm-migrations
53
+ dm-sqlite-adapter
54
+ do_sqlite3 (~> 0.10.0)
55
+ haml
56
+ rack-flash (~> 0.1.1)
57
+ rack-test (~> 0.5.0)
58
+ rake
59
+ rcov
60
+ rspec (~> 1.2.9)
61
+ sinatra (>= 1.0.0)
62
+ sinatra_warden!
63
+ warden (~> 1.0)
64
+ yard (>= 0.5.4)
data/README.rdoc CHANGED
@@ -43,6 +43,7 @@ Please read the wiki (http://wiki.github.com/jsmestad/sinatra_warden) for more i
43
43
  * Justin Smestad (http://github.com/jsmestad)
44
44
  * Daniel Neighman (http://github.com/hassox)
45
45
  * Shane Hanna (http://github.com/shanna)
46
+ * Alex - crhym3 (http://github.com/crhym3)
46
47
 
47
48
  == Copyright
48
49
 
data/Rakefile CHANGED
@@ -1,26 +1,6 @@
1
- require 'rake'
2
1
  require 'bundler'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "sinatra_warden"
8
- gem.summary = %Q{authentication system for using warden with sinatra}
9
- gem.description = %Q{basic helpers and authentication methods for using warden with sinatra also providing some hooks into Rack::Flash}
10
- gem.email = "justin.smestad@gmail.com"
11
- gem.homepage = "http://github.com/jsmestad/sinatra_warden"
12
- gem.authors = ["Justin Smestad", "Daniel Neighman"]
13
-
14
- bundle = Bundler::Definition.from_gemfile('Gemfile')
15
- bundle.dependencies.each do |dep|
16
- next unless dep.groups.include?(:runtime)
17
- gem.add_dependency(dep.name, dep.version_requirements.to_s)
18
- end
19
- end
20
- Jeweler::GemcutterTasks.new
21
- rescue LoadError
22
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
23
- end
2
+ Bundler::GemHelper.install_tasks
3
+ Bundler.setup :development
24
4
 
25
5
  require 'spec/rake/spectask'
26
6
  Spec::Rake::SpecTask.new(:spec) do |spec|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -1,3 +1,5 @@
1
+ require 'sinatra/base'
2
+
1
3
  module Sinatra
2
4
  module Warden
3
5
  module Helpers
@@ -30,7 +32,7 @@ module Sinatra
30
32
  #
31
33
  # @param [Symbol] the session scope to terminate
32
34
  def logout(scopes=nil)
33
- scopes ? warden.logout(scopes) : warden.logout
35
+ scopes ? warden.logout(scopes) : warden.logout(warden.config.default_scope)
34
36
  end
35
37
 
36
38
  # Access the user from the current session
@@ -79,7 +81,7 @@ module Sinatra
79
81
 
80
82
  app.set :auth_error_message, "Could not log you in."
81
83
  app.set :auth_success_message, "You have logged in successfully."
82
- app.set :auth_use_erb, false
84
+ app.set :auth_template_renderer, :haml
83
85
  app.set :auth_login_template, :login
84
86
 
85
87
  # OAuth Specific Settings
@@ -89,7 +91,7 @@ module Sinatra
89
91
  status 401
90
92
  warden.custom_failure! if warden.config.failure_app == self.class
91
93
  env['x-rack.flash'][:error] = options.auth_error_message if defined?(Rack::Flash)
92
- options.auth_use_erb ? erb(options.auth_login_template) : haml(options.auth_login_template)
94
+ self.send(options.auth_template_renderer, options.auth_login_template)
93
95
  end
94
96
 
95
97
  app.get '/login/?' do
@@ -98,7 +100,7 @@ module Sinatra
98
100
  session[:request_token_secret] = @auth_oauth_request_token.secret
99
101
  redirect @auth_oauth_request_token.authorize_url
100
102
  else
101
- options.auth_use_erb ? erb(options.auth_login_template) : haml(options.auth_login_template)
103
+ self.send(options.auth_template_renderer, options.auth_login_template)
102
104
  end
103
105
  end
104
106
 
@@ -0,0 +1,3 @@
1
+ module SinatraWarden
2
+ VERSION = "0.3.2"
3
+ end
@@ -3,65 +3,40 @@
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
+ require File.expand_path("../lib/sinatra_warden/version", __FILE__)
7
+
6
8
  Gem::Specification.new do |s|
7
9
  s.name = %q{sinatra_warden}
8
- s.version = "0.3.0"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
+ s.version = SinatraWarden::VERSION
11
+ s.platform = Gem::Platform::RUBY
11
12
  s.authors = ["Justin Smestad", "Daniel Neighman"]
12
- s.date = %q{2010-04-23}
13
- s.description = %q{basic helpers and authentication methods for using warden with sinatra also providing some hooks into Rack::Flash}
14
13
  s.email = %q{justin.smestad@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".gitignore",
22
- "Gemfile",
23
- "LICENSE",
24
- "README.rdoc",
25
- "Rakefile",
26
- "VERSION",
27
- "lib/sinatra_warden.rb",
28
- "lib/sinatra_warden/sinatra.rb",
29
- "sinatra_warden.gemspec",
30
- "spec/fixtures/basic_strategy.rb",
31
- "spec/fixtures/testing_login.rb",
32
- "spec/fixtures/user.rb",
33
- "spec/fixtures/views/login.haml",
34
- "spec/sinatra_warden_spec.rb",
35
- "spec/spec.opts",
36
- "spec/spec_helper.rb"
37
- ]
38
- s.homepage = %q{http://github.com/jsmestad/sinatra_warden}
39
- s.rdoc_options = ["--charset=UTF-8"]
40
- s.require_paths = ["lib"]
41
- s.rubygems_version = %q{1.3.6}
42
14
  s.summary = %q{authentication system for using warden with sinatra}
43
- s.test_files = [
44
- "spec/fixtures/basic_strategy.rb",
45
- "spec/fixtures/testing_login.rb",
46
- "spec/fixtures/user.rb",
47
- "spec/sinatra_warden_spec.rb",
48
- "spec/spec_helper.rb"
49
- ]
15
+ s.description = %q{basic helpers and authentication methods for using warden with sinatra also providing some hooks into Rack::Flash}
16
+
17
+ s.required_rubygems_version = ">= 1.3.6"
50
18
 
51
- if s.respond_to? :specification_version then
52
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
53
- s.specification_version = 3
19
+ s.rdoc_options = ["--charset=UTF-8"]
20
+
21
+ s.add_dependency 'sinatra', '>= 1.0.0'
22
+ s.add_dependency 'warden', '~> 1.0'
23
+
24
+ s.add_development_dependency 'rspec', '~> 1.2.9'
25
+ s.add_development_dependency 'yard', '>= 0.5.4'
26
+ s.add_development_dependency 'rack-test', '~> 0.5.0'
27
+ s.add_development_dependency 'rcov'
28
+ s.add_development_dependency 'rake'
54
29
 
55
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
56
- s.add_runtime_dependency(%q<sinatra>, [">= 0.9.4"])
57
- s.add_runtime_dependency(%q<warden>, [">= 0.10.3"])
58
- else
59
- s.add_dependency(%q<sinatra>, [">= 0.9.4"])
60
- s.add_dependency(%q<warden>, [">= 0.10.3"])
61
- end
62
- else
63
- s.add_dependency(%q<sinatra>, [">= 0.9.4"])
64
- s.add_dependency(%q<warden>, [">= 0.10.3"])
65
- end
30
+ s.add_development_dependency 'do_sqlite3', '~> 0.10.0'
31
+ s.add_development_dependency 'dm-core', '~> 1.0'
32
+ s.add_development_dependency 'dm-sqlite-adapter'
33
+ s.add_development_dependency 'dm-migrations'
34
+ s.add_development_dependency 'bcrypt-ruby'
35
+ s.add_development_dependency 'haml'
36
+ s.add_development_dependency 'rack-flash', '~> 0.1.1'
37
+
38
+ s.files = `git ls-files`.split("\n")
39
+ s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
40
+ s.require_path = 'lib'
66
41
  end
67
42
 
@@ -1,3 +1,6 @@
1
+ require 'rack/flash'
2
+ require "rack/test"
3
+
1
4
  Warden::Strategies.add(:password) do
2
5
  def valid?
3
6
  # params['email'] && params['password']
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,3 @@
1
- Bundler.require(:default, :runtime, :test)
2
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
3
 
@@ -7,7 +6,8 @@ ENV['RACK_ENV'] ||= 'test'
7
6
  require 'sinatra_warden'
8
7
  require 'spec'
9
8
  require 'spec/autorun'
10
-
9
+ require 'dm-core'
10
+ require 'dm-migrations'
11
11
  DataMapper.setup(:default, 'sqlite3::memory:')
12
12
 
13
13
  %w(fixtures support).each do |path|
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra_warden
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 23
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 3
8
- - 1
9
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - Justin Smestad
@@ -15,36 +16,218 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-04-25 00:00:00 -06:00
19
+ date: 2010-11-07 01:00:00 -06:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
22
- type: :runtime
23
- name: sinatra
24
23
  version_requirements: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
+ hash: 23
28
29
  segments:
30
+ - 1
29
31
  - 0
30
- - 9
31
- - 4
32
- version: 0.9.4
32
+ - 0
33
+ version: 1.0.0
33
34
  requirement: *id001
35
+ type: :runtime
36
+ name: sinatra
34
37
  prerelease: false
35
38
  - !ruby/object:Gem::Dependency
39
+ version_requirements: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ hash: 15
45
+ segments:
46
+ - 1
47
+ - 0
48
+ version: "1.0"
49
+ requirement: *id002
36
50
  type: :runtime
37
51
  name: warden
38
- version_requirements: &id002 !ruby/object:Gem::Requirement
52
+ prerelease: false
53
+ - !ruby/object:Gem::Dependency
54
+ version_requirements: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ hash: 13
60
+ segments:
61
+ - 1
62
+ - 2
63
+ - 9
64
+ version: 1.2.9
65
+ requirement: *id003
66
+ type: :development
67
+ name: rspec
68
+ prerelease: false
69
+ - !ruby/object:Gem::Dependency
70
+ version_requirements: &id004 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 3
76
+ segments:
77
+ - 0
78
+ - 5
79
+ - 4
80
+ version: 0.5.4
81
+ requirement: *id004
82
+ type: :development
83
+ name: yard
84
+ prerelease: false
85
+ - !ruby/object:Gem::Dependency
86
+ version_requirements: &id005 !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ~>
90
+ - !ruby/object:Gem::Version
91
+ hash: 11
92
+ segments:
93
+ - 0
94
+ - 5
95
+ - 0
96
+ version: 0.5.0
97
+ requirement: *id005
98
+ type: :development
99
+ name: rack-test
100
+ prerelease: false
101
+ - !ruby/object:Gem::Dependency
102
+ version_requirements: &id006 !ruby/object:Gem::Requirement
103
+ none: false
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ hash: 3
108
+ segments:
109
+ - 0
110
+ version: "0"
111
+ requirement: *id006
112
+ type: :development
113
+ name: rcov
114
+ prerelease: false
115
+ - !ruby/object:Gem::Dependency
116
+ version_requirements: &id007 !ruby/object:Gem::Requirement
117
+ none: false
39
118
  requirements:
40
119
  - - ">="
41
120
  - !ruby/object:Gem::Version
121
+ hash: 3
122
+ segments:
123
+ - 0
124
+ version: "0"
125
+ requirement: *id007
126
+ type: :development
127
+ name: rake
128
+ prerelease: false
129
+ - !ruby/object:Gem::Dependency
130
+ version_requirements: &id008 !ruby/object:Gem::Requirement
131
+ none: false
132
+ requirements:
133
+ - - ~>
134
+ - !ruby/object:Gem::Version
135
+ hash: 55
42
136
  segments:
43
137
  - 0
44
138
  - 10
45
- - 3
46
- version: 0.10.3
47
- requirement: *id002
139
+ - 0
140
+ version: 0.10.0
141
+ requirement: *id008
142
+ type: :development
143
+ name: do_sqlite3
144
+ prerelease: false
145
+ - !ruby/object:Gem::Dependency
146
+ version_requirements: &id009 !ruby/object:Gem::Requirement
147
+ none: false
148
+ requirements:
149
+ - - ~>
150
+ - !ruby/object:Gem::Version
151
+ hash: 15
152
+ segments:
153
+ - 1
154
+ - 0
155
+ version: "1.0"
156
+ requirement: *id009
157
+ type: :development
158
+ name: dm-core
159
+ prerelease: false
160
+ - !ruby/object:Gem::Dependency
161
+ version_requirements: &id010 !ruby/object:Gem::Requirement
162
+ none: false
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ hash: 3
167
+ segments:
168
+ - 0
169
+ version: "0"
170
+ requirement: *id010
171
+ type: :development
172
+ name: dm-sqlite-adapter
173
+ prerelease: false
174
+ - !ruby/object:Gem::Dependency
175
+ version_requirements: &id011 !ruby/object:Gem::Requirement
176
+ none: false
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ hash: 3
181
+ segments:
182
+ - 0
183
+ version: "0"
184
+ requirement: *id011
185
+ type: :development
186
+ name: dm-migrations
187
+ prerelease: false
188
+ - !ruby/object:Gem::Dependency
189
+ version_requirements: &id012 !ruby/object:Gem::Requirement
190
+ none: false
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ hash: 3
195
+ segments:
196
+ - 0
197
+ version: "0"
198
+ requirement: *id012
199
+ type: :development
200
+ name: bcrypt-ruby
201
+ prerelease: false
202
+ - !ruby/object:Gem::Dependency
203
+ version_requirements: &id013 !ruby/object:Gem::Requirement
204
+ none: false
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ hash: 3
209
+ segments:
210
+ - 0
211
+ version: "0"
212
+ requirement: *id013
213
+ type: :development
214
+ name: haml
215
+ prerelease: false
216
+ - !ruby/object:Gem::Dependency
217
+ version_requirements: &id014 !ruby/object:Gem::Requirement
218
+ none: false
219
+ requirements:
220
+ - - ~>
221
+ - !ruby/object:Gem::Version
222
+ hash: 25
223
+ segments:
224
+ - 0
225
+ - 1
226
+ - 1
227
+ version: 0.1.1
228
+ requirement: *id014
229
+ type: :development
230
+ name: rack-flash
48
231
  prerelease: false
49
232
  description: basic helpers and authentication methods for using warden with sinatra also providing some hooks into Rack::Flash
50
233
  email: justin.smestad@gmail.com
@@ -52,19 +235,20 @@ executables: []
52
235
 
53
236
  extensions: []
54
237
 
55
- extra_rdoc_files:
56
- - LICENSE
57
- - README.rdoc
238
+ extra_rdoc_files: []
239
+
58
240
  files:
59
241
  - .document
60
242
  - .gitignore
61
243
  - Gemfile
244
+ - Gemfile.lock
62
245
  - LICENSE
63
246
  - README.rdoc
64
247
  - Rakefile
65
248
  - VERSION
66
249
  - lib/sinatra_warden.rb
67
250
  - lib/sinatra_warden/sinatra.rb
251
+ - lib/sinatra_warden/version.rb
68
252
  - sinatra_warden.gemspec
69
253
  - spec/fixtures/basic_strategy.rb
70
254
  - spec/fixtures/testing_login.rb
@@ -74,7 +258,7 @@ files:
74
258
  - spec/spec.opts
75
259
  - spec/spec_helper.rb
76
260
  has_rdoc: true
77
- homepage: http://github.com/jsmestad/sinatra_warden
261
+ homepage:
78
262
  licenses: []
79
263
 
80
264
  post_install_message:
@@ -83,29 +267,31 @@ rdoc_options:
83
267
  require_paths:
84
268
  - lib
85
269
  required_ruby_version: !ruby/object:Gem::Requirement
270
+ none: false
86
271
  requirements:
87
272
  - - ">="
88
273
  - !ruby/object:Gem::Version
274
+ hash: 3
89
275
  segments:
90
276
  - 0
91
277
  version: "0"
92
278
  required_rubygems_version: !ruby/object:Gem::Requirement
279
+ none: false
93
280
  requirements:
94
281
  - - ">="
95
282
  - !ruby/object:Gem::Version
283
+ hash: 23
96
284
  segments:
97
- - 0
98
- version: "0"
285
+ - 1
286
+ - 3
287
+ - 6
288
+ version: 1.3.6
99
289
  requirements: []
100
290
 
101
291
  rubyforge_project:
102
- rubygems_version: 1.3.6
292
+ rubygems_version: 1.3.7
103
293
  signing_key:
104
294
  specification_version: 3
105
295
  summary: authentication system for using warden with sinatra
106
- test_files:
107
- - spec/fixtures/basic_strategy.rb
108
- - spec/fixtures/testing_login.rb
109
- - spec/fixtures/user.rb
110
- - spec/sinatra_warden_spec.rb
111
- - spec/spec_helper.rb
296
+ test_files: []
297
+