rack-oauth2-server 1.4.5 → 1.4.6

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/test/setup.rb CHANGED
@@ -7,6 +7,7 @@ require "timecop"
7
7
  require "ap"
8
8
  require "json"
9
9
  $: << File.dirname(__FILE__) + "/../lib"
10
+ $: << File.expand_path(File.dirname(__FILE__) + "/..")
10
11
  require "rack/oauth2/server"
11
12
 
12
13
 
@@ -37,29 +38,45 @@ when "sinatra", nil
37
38
 
38
39
  when "rails"
39
40
 
40
- require "initializer"
41
- require "action_controller"
42
- RAILS_ROOT = File.dirname(__FILE__) + "/rails"
43
41
  RAILS_ENV = "test"
44
-
45
- class << Rails
46
- def vendor_rails?
47
- false
48
- end
42
+ RAILS_ROOT = File.dirname(__FILE__) + "/rails3"
43
+ begin
44
+ require "rails"
45
+ rescue LoadError
49
46
  end
50
- require RAILS_ROOT + "/config/environment"
51
- puts "Testing with Rails #{Rails.version}"
47
+
48
+ if defined?(Rails::Railtie)
49
+ # Rails 3.x
50
+ require "rack/oauth2/server/railtie"
51
+ require File.dirname(__FILE__) + "/rails3/config/environment"
52
+ puts "Testing with Rails #{Rails.version}"
52
53
 
53
- class Test::Unit::TestCase
54
- def app
55
- ActionController::Dispatcher.new
56
- end
54
+ class Test::Unit::TestCase
55
+ def app
56
+ Rails.application
57
+ end
57
58
 
58
- def admin!
59
+ def config
60
+ Rails.configuration.oauth
61
+ end
59
62
  end
60
63
 
61
- def config
62
- Rails.configuration.oauth
64
+ else
65
+ # Rails 2.x
66
+ RAILS_ROOT = File.dirname(__FILE__) + "/rails2"
67
+ require "initializer"
68
+ require "action_controller"
69
+ require File.dirname(__FILE__) + "/rails2/config/environment"
70
+ puts "Testing with Rails #{Rails.version}"
71
+
72
+ class Test::Unit::TestCase
73
+ def app
74
+ ActionController::Dispatcher.new
75
+ end
76
+
77
+ def config
78
+ Rails.configuration.oauth
79
+ end
63
80
  end
64
81
  end
65
82
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-oauth2-server
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 5
10
- version: 1.4.5
9
+ - 6
10
+ version: 1.4.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Assaf Arkin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-11 00:00:00 -08:00
18
+ date: 2010-11-14 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -93,6 +93,7 @@ files:
93
93
  - lib/rack/oauth2/admin/js/application.js
94
94
  - lib/rack/oauth2/admin/js/jquery.js
95
95
  - lib/rack/oauth2/admin/js/jquery.tmpl.js
96
+ - lib/rack/oauth2/admin/js/jquery.tools.js
96
97
  - lib/rack/oauth2/admin/js/sammy.js
97
98
  - lib/rack/oauth2/admin/js/sammy.json.js
98
99
  - lib/rack/oauth2/admin/js/sammy.storage.js
@@ -114,6 +115,7 @@ files:
114
115
  - lib/rack/oauth2/rails.rb
115
116
  - lib/rack/oauth2/server/errors.rb
116
117
  - lib/rack/oauth2/server/helper.rb
118
+ - lib/rack/oauth2/server/railtie.rb
117
119
  - lib/rack/oauth2/server/utils.rb
118
120
  - lib/rack/oauth2/server.rb
119
121
  - lib/rack/oauth2/sinatra.rb
@@ -124,13 +126,20 @@ files:
124
126
  - test/oauth/access_grant_test.rb
125
127
  - test/oauth/access_token_test.rb
126
128
  - test/oauth/authorization_test.rb
127
- - test/rails/app/controllers/api_controller.rb
128
- - test/rails/app/controllers/application_controller.rb
129
- - test/rails/app/controllers/oauth_controller.rb
130
- - test/rails/config/environment.rb
131
- - test/rails/config/environments/test.rb
132
- - test/rails/config/routes.rb
133
- - test/rails/log/test.log
129
+ - test/rails2/app/controllers/api_controller.rb
130
+ - test/rails2/app/controllers/application_controller.rb
131
+ - test/rails2/app/controllers/oauth_controller.rb
132
+ - test/rails2/config/environment.rb
133
+ - test/rails2/config/environments/test.rb
134
+ - test/rails2/config/routes.rb
135
+ - test/rails2/log/test.log
136
+ - test/rails3/app/controllers/api_controller.rb
137
+ - test/rails3/app/controllers/application_controller.rb
138
+ - test/rails3/app/controllers/oauth_controller.rb
139
+ - test/rails3/config/application.rb
140
+ - test/rails3/config/environment.rb
141
+ - test/rails3/config/routes.rb
142
+ - test/rails3/log/test.log
134
143
  - test/setup.rb
135
144
  - test/sinatra/my_app.rb
136
145
  - CHANGELOG
@@ -147,7 +156,7 @@ licenses: []
147
156
  post_install_message: To get started, run the command oauth2-server
148
157
  rdoc_options:
149
158
  - --title
150
- - rack-oauth2-server 1.4.5
159
+ - rack-oauth2-server 1.4.6
151
160
  - --main
152
161
  - README.rdoc
153
162
  - --webcvs