sybil 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/lib/sybil/railtie.rb CHANGED
@@ -15,6 +15,9 @@ module Sybil
15
15
  # templates - Array of string layout names that Sybil will inject into
16
16
  options.layouts ||= %w{application}
17
17
 
18
+ # content_type - Regex that is matched against response.content_type to determine if Sybil should inject
19
+ options.content_type ||= /text\/html/i
20
+
18
21
  # inject_before - Either a string or a pattern that Sybil will inject itself before the last occurance of in response.body
19
22
  options.inject_before ||= /<\/body>/i
20
23
 
@@ -38,7 +41,7 @@ module Sybil
38
41
 
39
42
  private
40
43
  def inject_sybil
41
- if Rails.configuration.sybil.layouts.include?(_layout)
44
+ if Rails.configuration.sybil.layouts.include?(_layout) and (response.content_type =~ Rails.configuration.sybil.content_type)
42
45
  @users = instance_eval(&Rails.configuration.sybil.users)
43
46
  response.body = response.body.insert(response.body.rindex(Rails.configuration.sybil.inject_before),ERB.new(File.read(File.join(File.dirname(__FILE__),'user_picker.html.erb'))).result(binding))
44
47
  end
data/lib/sybil/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sybil
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/sybil.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Jim Ryan"]
10
10
  s.email = ["jim@room118solutions.com"]
11
- s.homepage = "http://github.com/jimryan/sybil"
11
+ s.homepage = "http://github.com/room118solutions/sybil"
12
12
  s.summary = %q{Easily switch between users during development of a Rails application}
13
13
  # s.description = %q{TODO: Write a gem description}
14
14
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sybil
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
  - Jim Ryan
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-23 00:00:00 -04:00
13
+ date: 2011-05-24 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
@@ -35,7 +35,7 @@ files:
35
35
  - rails/routes.rb
36
36
  - sybil.gemspec
37
37
  has_rdoc: true
38
- homepage: http://github.com/jimryan/sybil
38
+ homepage: http://github.com/room118solutions/sybil
39
39
  licenses: []
40
40
 
41
41
  post_install_message:
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  requirements: []
59
59
 
60
60
  rubyforge_project: sybil
61
- rubygems_version: 1.6.2
61
+ rubygems_version: 1.5.2
62
62
  signing_key:
63
63
  specification_version: 3
64
64
  summary: Easily switch between users during development of a Rails application