google_authentication 0.1.0 → 0.1.1

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/CHANGES.markdown ADDED
@@ -0,0 +1,7 @@
1
+ ## 0.1.1, released 2011-07-04
2
+
3
+ * Changed define_routes? implementation, old implementation is buggy
4
+
5
+ ## 0.1.0, released 2011-07-04
6
+
7
+ * Initial version
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{google_authentication}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Fabio Napoleoni"]
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  ".document",
21
21
  ".rspec",
22
22
  ".rvmrc",
23
+ "CHANGES.markdown",
23
24
  "Gemfile",
24
25
  "Guardfile",
25
26
  "LICENSE.txt",
@@ -29,7 +29,12 @@ module GoogleAuthentication
29
29
  # to the application
30
30
  # @return [bool] true iff the GoogleAuthentication model is already defined
31
31
  def self.define_routes?
32
- Object.const_defined?(model_name.to_s.camelize)
32
+ begin
33
+ Object.const_get(model_name.to_s.camelize)
34
+ rescue NameError
35
+ return false
36
+ end
37
+ return true
33
38
  end
34
39
 
35
40
  # Return a symbol which is used to build devise routes
@@ -13,6 +13,12 @@ describe GoogleAuthentication do
13
13
  GoogleAuthentication.define_routes?.should be_true
14
14
  end
15
15
 
16
+ it "should return true for a new class" do
17
+ class Car; end
18
+ GoogleAuthentication.stub(:model_name).and_return(:car)
19
+ GoogleAuthentication.define_routes?.should be_true
20
+ end
21
+
16
22
  it "should return false with non existent class" do
17
23
  GoogleAuthentication.stub(:model_name).and_return(:monster)
18
24
  GoogleAuthentication.define_routes?.should be_false
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: google_authentication
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Fabio Napoleoni
@@ -180,6 +180,7 @@ files:
180
180
  - .document
181
181
  - .rspec
182
182
  - .rvmrc
183
+ - CHANGES.markdown
183
184
  - Gemfile
184
185
  - Guardfile
185
186
  - LICENSE.txt
@@ -268,7 +269,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
268
269
  requirements:
269
270
  - - ">="
270
271
  - !ruby/object:Gem::Version
271
- hash: 3681346546884680919
272
+ hash: -2474828222469363557
272
273
  segments:
273
274
  - 0
274
275
  version: "0"