Skip to content

Commit

Permalink
use autoload instead of require - fix namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
spaghetticode committed Aug 17, 2012
1 parent efc2eb1 commit 46493b8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Callbacks functionality is implemented using the ActiveSupport::Callbacks module

## Requirements

The master branch now works only with Actionmailer 3.x, if you need to add
The master branch now works only with ActionMailer 3.x, if you need to add
callbacks to older versions please refer to the 0.x release.


Expand Down
2 changes: 1 addition & 1 deletion actionmailer-callbacks.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = 'actionmailer-callbacks'
gem.require_paths = ["lib"]
gem.version = Actionmailer::Callbacks::VERSION
gem.version = ActionMailer::Callbacks::VERSION

gem.add_dependency 'actionmailer', '~> 3.0'
gem.add_dependency 'activesupport'
Expand Down
18 changes: 9 additions & 9 deletions lib/actionmailer-callbacks.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
require 'action_mailer'

# module Actionmailer
# module Callbacks
# end
# end

lib_dir = File.expand_path('..', __FILE__)
require File.join(lib_dir, 'actionmailer-callbacks/version')
require File.join(lib_dir, 'actionmailer-callbacks/callbackable')
require File.join(lib_dir, 'actionmailer-callbacks/extensions')
module ActionMailer
module Callbacks
autoload :Callbackable, 'actionmailer-callbacks/callbackable'
autoload :Extensions, 'actionmailer-callbacks/extensions'
end
end

require File.join(File.expand_path('..', __FILE__), 'actionmailer-callbacks/version')


ActionMailer::Base.extend ActionMailer::Callbacks::Extensions
2 changes: 1 addition & 1 deletion lib/actionmailer-callbacks/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Actionmailer
module ActionMailer
module Callbacks
VERSION = '1.1.0'
end
Expand Down

0 comments on commit 46493b8

Please sign in to comment.