Permalink
Browse files

Removing autoload from modules

Changing rails dependency for actionpack dependency
  • Loading branch information...
1 parent 6c3fe21 commit 4065e1d4160244caa7b932baab17baaf3745f2cb @tscolari tscolari committed Dec 20, 2011
Showing with 72 additions and 12 deletions.
  1. +51 −3 .rvmrc
  2. +4 −0 CHANGELOG.rdoc
  3. +2 −0 Gemfile
  4. +3 −2 Gemfile.lock
  5. +4 −0 README.rdoc
  6. +3 −3 lib/mobylette.rb
  7. +2 −2 lib/mobylette/helmet.rb
  8. +1 −1 lib/mobylette/version.rb
  9. +1 −1 mobylette.gemspec
  10. +1 −0 spec/spec_helper.rb
View
54 .rvmrc
@@ -1,7 +1,55 @@
#!/usr/bin/env bash
-if [[ -d "$rvm_path/environments" && -s "$rvm_path/environments/ruby-1.9.3@mobylette" ]] ; then
- \. "$rvm_path/environments/ruby-1.9.3@mobylette"
+# This is an RVM Project .rvmrc file, used to automatically load the ruby
+# development environment upon cd'ing into the directory
+
+# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
+environment_id="ruby-1.9.3-p0@mobylette"
+
+#
+# Uncomment following line if you want options to be set only for given project.
+#
+# PROJECT_JRUBY_OPTS=( --1.9 )
+
+#
+# First we attempt to load the desired environment directly from the environment
+# file. This is very fast and efficient compared to running through the entire
+# CLI and selector. If you want feedback on which environment was used then
+# insert the word 'use' after --create as this triggers verbose mode.
+#
+if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
+ && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
+then
+ \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
+
+ if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
+ then
+ . "${rvm_path:-$HOME/.rvm}/hooks/after_use"
+ fi
else
- rvm --create use "ruby-1.9.3@mobylette"
+ # If the environment file has not yet been created, use the RVM CLI to select.
+ if ! rvm --create "$environment_id"
+ then
+ echo "Failed to create RVM environment '${environment_id}'."
+ return 1
+ fi
fi
+
+#
+# If you use an RVM gemset file to install a list of gems (*.gems), you can have
+# it be automatically loaded. Uncomment the following and adjust the filename if
+# necessary.
+#
+# filename=".gems"
+# if [[ -s "$filename" ]]
+# then
+# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
+# fi
+
+# If you use bundler, this might be useful to you:
+# if command -v bundle && [[ -s Gemfile ]]
+# then
+# bundle install
+# fi
+
+
View
4 CHANGELOG.rdoc
@@ -1,5 +1,9 @@
= Change Log
+== 1.5
+ * Removed rails dependency. Now mobylette depends on actionpack only.
+ * All calls for autoload were removed, as it is deprecated now.
+
== 1.4.2
* Creating a initializer to alias to_mobile => to_html (responders)
View
2 Gemfile
@@ -5,6 +5,8 @@ source "http://rubygems.org"
# development dependencies will be added by default to the :development group.
gemspec
+gem 'rails', "~> 3.0"
+
group :test do
gem 'rspec'
gem 'rspec-rails'
View
5 Gemfile.lock
@@ -1,8 +1,8 @@
PATH
remote: .
specs:
- mobylette (1.4.2)
- rails (~> 3.0)
+ mobylette (1.5.0)
+ actionpack (~> 3.0)
GEM
remote: http://rubygems.org/
@@ -172,6 +172,7 @@ DEPENDENCIES
map
metric_fu
mobylette!
+ rails (~> 3.0)
rspec
rspec-rails
webrat
View
4 README.rdoc
@@ -1,5 +1,7 @@
http://tscolari.github.com/mobylette/mobylette_images/mobylette.jpg
+ Note: At next version (1.6) only ruby >= 1.9 will be supported.
+
= Mobylette http://travis-ci.org/tscolari/mobylette.png
This gem works by adding the 'mobile' format to your rails application. Whenever a request come from a mobile device, if you have your controller mobile enabled, it shall render the view.mobile.erb instead of the view.html.erb (or haml, or whatever).
@@ -96,10 +98,12 @@ Don't drive your mobylette without your Helmet! It's safer to do tests!
For testing, include the Mobylette::Helmet module to your test/test_helpers.rb:
+ require 'mobylette/helmet'
include Mobylette::Helmet
For RSpec: add to your spec/spec_helpers.rb or create a spec/support/mobylette.rb with the following:
+ require 'mobylette/helmet'
RSpec.configure do |config|
config.include Mobylette::Helmet, :type => :controller
end
View
6 lib/mobylette.rb
@@ -2,12 +2,12 @@
# Rails automatic mobile request support
module Mobylette
module Controllers
- autoload "RespondToMobileRequests", "mobylette/controllers/respond_to_mobile_requests"
- autoload "Helpers" , "mobylette/controllers/helpers"
+ require "mobylette/controllers/respond_to_mobile_requests"
+ require "mobylette/controllers/helpers"
end
# TestHelpers
- autoload "Helmet" , "mobylette/helmet"
+ # require "mobylette/helmet"
require 'mobylette/railtie'
end
View
4 lib/mobylette/helmet.rb
@@ -6,8 +6,8 @@ module Mobylette
# documentation about how to make this test wide.
module Helmet
extend ActiveSupport::Concern
- autoload "Helpers", "mobylette/helmet/helpers"
- autoload "Faker" , "mobylette/helmet/faker"
+ require "mobylette/helmet/helpers"
+ require "mobylette/helmet/faker"
# Force the request for the user_agent
#
View
2 lib/mobylette/version.rb
@@ -1,3 +1,3 @@
module Mobylette
- VERSION = "1.4.2"
+ VERSION = "1.5.0"
end
View
2 mobylette.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
s.test_files = Dir["spec/**/*"]
- s.add_dependency "rails", "~> 3.0"
+ s.add_dependency "actionpack", "~> 3.0"
s.add_development_dependency "rspec"
end
View
1 spec/spec_helper.rb
@@ -4,6 +4,7 @@
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require "rails/test_help"
require "rspec/rails"
+require 'mobylette/helmet'
ActionMailer::Base.delivery_method = :test
ActionMailer::Base.perform_deliveries = true

0 comments on commit 4065e1d

Please sign in to comment.