sybil 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sybil/railtie.rb +4 -1
- data/lib/sybil/version.rb +1 -1
- data/sybil.gemspec +1 -1
- metadata +4 -4
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
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/
|
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.
|
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-
|
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/
|
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.
|
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
|