Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

whitespace

  • Loading branch information...
commit 9886eed7ce6ff8453c696c0eb98392b06e7d8614 1 parent 83b2698
@faun faun authored
View
4 browser_detect.gemspec
@@ -10,8 +10,8 @@ Gem::Specification.new do |s|
s.homepage = "http://github.com/traction/browser_detect"
s.summary = "A simple rails browser detection plugin"
s.description = <<-END
- Simple rails browser detection based on original plugin by Richard Livsey"
- END
+ Simple rails browser detection based on original plugin by Richard Livsey"
+ END
s.required_rubygems_version = ">= 1.3.6"
s.rubyforge_project = "browser_detect"
View
4 init.rb
@@ -1,5 +1,5 @@
if Rails::VERSION::MAJOR == 2
- ActionView::Base.send(:include, BrowserDetect)
+ ActionView::Base.send(:include, BrowserDetect)
else
- require "railtie" if defined?(Rails)
+ require "railtie" if defined?(Rails)
end
View
4 lib/railtie.rb
@@ -1,9 +1,9 @@
# lib/browser_detect/railtie.rb
module BrowserDetectHelper
- class Railtie < Rails::Railtie
+ class Railtie < Rails::Railtie
initializer "browser_detect.configure_rails_initialization" do
ApplicationController.send(:include, BrowserDetect)
end
- end
+ end
end
View
58 test/test_helper.rb
@@ -6,40 +6,40 @@
module Test::Unit
# @ see http://gist.github.com/316780
- # Used to fix a minor minitest/unit incompatibility in flexmock
- # AssertionFailedError = Class.new(StandardError)
+ # Used to fix a minor minitest/unit incompatibility in flexmock
+ # AssertionFailedError = Class.new(StandardError)
- class TestCase
+ class TestCase
- def self.must(name, &block)
- test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
- defined = instance_method(test_name) rescue false
- raise "#{test_name} is already defined in #{self}" if defined
- if block_given?
- define_method(test_name, &block)
- else
- define_method(test_name) do
- flunk "No implementation provided for #{name}"
- end
- end
- end
+ def self.must(name, &block)
+ test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
+ defined = instance_method(test_name) rescue false
+ raise "#{test_name} is already defined in #{self}" if defined
+ if block_given?
+ define_method(test_name, &block)
+ else
+ define_method(test_name) do
+ flunk "No implementation provided for #{name}"
+ end
+ end
+ end
- end
+ end
end
# @see http://push.cx/2007/fixtures-in-ruby-unit-tests
class Test::Unit::TestCase
- @@fixtures = {}
- def self.fixtures *args
- [args].flatten.each do |fixture|
- self.class_eval do
- # add a method name for this fixture type
- define_method(fixture) do |item|
- # load and cache the YAML
- @@fixtures[fixture] ||= YAML::load_file(File.dirname(__FILE__)+"/fixtures/#{fixture.to_s}.yml")
- @@fixtures[fixture][item.to_s]
- end
- end
- end
- end
+ @@fixtures = {}
+ def self.fixtures *args
+ [args].flatten.each do |fixture|
+ self.class_eval do
+ # add a method name for this fixture type
+ define_method(fixture) do |item|
+ # load and cache the YAML
+ @@fixtures[fixture] ||= YAML::load_file(File.dirname(__FILE__)+"/fixtures/#{fixture.to_s}.yml")
+ @@fixtures[fixture][item.to_s]
+ end
+ end
+ end
+ end
end

0 comments on commit 9886eed

Please sign in to comment.
Something went wrong with that request. Please try again.