Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing #28 and making it a gem #35

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ of the request from :html to :mobile.

The master branch of this plugin is Rails 3 compatible.

To use the Rails 3 compatible version of this plugin, please install it like so:
To use the Rails 3 compatible version of this plugin, add it to your Gemfile:

rails plugin install git://github.com/brendanlim/mobile-fu.git
gem 'mobile-fu', :git => 'git://github.com/brendanlim/mobile-fu.git'

== Rails 2 Compatibility

Expand Down
7 changes: 4 additions & 3 deletions lib/mobile_fu.rb → lib/mobile-fu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ module ClassMethods
# has_mobile_fu(true)
# end

def has_mobile_fu(test_mode = false)
def has_mobile_fu(options)
include ActionController::MobileFu::InstanceMethods

if test_mode
if options[:test_mode]
before_filter :force_mobile_format
else
before_filter :set_mobile_format
options.delete(:test_mode)
before_filter :set_mobile_format, options
end

helper_method :is_mobile_device?
Expand Down
17 changes: 17 additions & 0 deletions mobile-fu.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# encoding: UTF-8
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'mobile-fu'
s.version = '0.1'
s.summary = 'Automatically detect mobile requests from mobile devices in your Rails application'
s.required_ruby_version = '>= 1.8.7'

s.author = 'Brendan G. Lim'
s.email = '[email protected]'

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_path = 'lib'
s.requirements << 'none'
end