diff --git a/README.rdoc b/README.rdoc index 3084fdf..729eaa0 100644 --- a/README.rdoc +++ b/README.rdoc @@ -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 diff --git a/lib/mobile_fu.rb b/lib/mobile-fu.rb similarity index 95% rename from lib/mobile_fu.rb rename to lib/mobile-fu.rb index 70c6163..dc8d5ec 100644 --- a/lib/mobile_fu.rb +++ b/lib/mobile-fu.rb @@ -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? diff --git a/mobile-fu.gemspec b/mobile-fu.gemspec new file mode 100644 index 0000000..a6e4f17 --- /dev/null +++ b/mobile-fu.gemspec @@ -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 = 'brendangl@gmail.com' + + 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 +