divining_rod 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,7 +36,8 @@ _app/controllers/mobile\_controller.rb_
36
36
 
37
37
  def detect_mobile_type
38
38
  # If the profile isn't matched it defaults to request.format
39
- @profile = DiviningRod::Profile.new(request).format
39
+ @profile = DiviningRod::Profile.new(request)
40
+ request.format = @profile.format
40
41
  end
41
42
 
42
43
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{divining_rod}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mark Percival"]
@@ -7,7 +7,7 @@ module DiviningRod
7
7
  attr_reader :match
8
8
 
9
9
  def initialize(request)
10
- @request = request
10
+ @request = request.clone #Lets not mess with the real one
11
11
  matchers.each do |matcher|
12
12
  @match = matcher if matcher.matches?(request)
13
13
  break if @match
@@ -66,7 +66,7 @@ describe DiviningRod do
66
66
  describe "without a default definition" do
67
67
 
68
68
  before :each do
69
- @request = mock("rails_request", :user_agent => 'Foo Fone')
69
+ @request = mock("rails_request", :user_agent => 'Foo Fone', :format => :html)
70
70
  DiviningRod::Matchers.clear_definitions
71
71
  DiviningRod::Matchers.define do |map|
72
72
  map.ua /iPhone/, :webkit, :tags => [:iphone, :youtube, :geolocate]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: divining_rod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Percival