Permalink
Browse files

Add dependency on custom_callbacks

  • Loading branch information...
obrie committed Sep 25, 2007
1 parent b410525 commit 26b00deeb1d87f5e1c8e9d1d0e3750b5dcdb9a0a
Showing with 14 additions and 12 deletions.
  1. +2 −0 CHANGELOG
  2. +5 −4 README
  3. +3 −0 Rakefile
  4. +1 −0 lib/has_states.rb
  5. +1 −7 lib/has_states/active_state.rb
  6. +1 −1 test/app_root/config/environment.rb
  7. +1 −0 test/test_helper.rb
View
@@ -1,5 +1,7 @@
*SVN*
+* Add dependency on custom_callbacks
+
*0.0.1* (September 22nd, 2007)
* Move test fixtures out of the test application root directory
View
9 README
@@ -1,6 +1,6 @@
== has_states
-has_states adds support for managing states, events, and transitions within a
++has_states+ adds support for managing states, events, and transitions within a
model.
== Resources
@@ -68,9 +68,10 @@ events for your models. It is cross-platform, written in Java.
== Dependencies
This plugin depends on the presence of the following plugins:
-* class_associations - http://wiki.pluginaweek.org/Class_associations
-* dry_transaction_rollbacks - http://wiki.pluginaweek.org/Dry_transaction_callbacks
-* eval_call - http://wiki.pluginaweek.org/Eval_call
+* class_associations[http://wiki.pluginaweek.org/Class_associations]
+* custom_callbacks[http://wiki.pluginaweek.org/Custom_callbacks]
+* dry_transaction_rollbacks[http://wiki.pluginaweek.org/Dry_transaction_callbacks]
+* eval_call[http://wiki.pluginaweek.org/Eval_call]
This plugin is also plugin+. That means that it contains a slice of an
application, such as models and migrations. To test or use a plugin+, you
View
@@ -38,6 +38,9 @@ spec = Gem::Specification.new do |s|
s.autorequire = 'has_states'
s.has_rdoc = true
s.test_files = Dir['test/unit/**/*_test.rb']
+ s.add_dependency 'class_associations'
+ s.add_dependency 'custom_callbacks'
+ s.add_dependency 'eval_call'
s.author = 'Aaron Pfeifer, Neil Abraham'
s.email = 'info@pluginaweek.org'
View
@@ -1,4 +1,5 @@
require 'class_associations'
+require 'custom_callbacks'
require 'dry_transaction_rollbacks' unless defined?(ActiveRecord::Rollback) # Supported on edge
require 'eval_call'
@@ -92,13 +92,7 @@ def #{name}_count(*args)
def add_callbacks
[:before_enter, :after_enter, :before_exit, :after_exit].each do |type|
callback = "#{type}_#{name}"
- @owner_class.class_eval <<-end_eval
- def self.#{callback}(*callbacks, &block)
- callbacks << block if block_given?
- write_inheritable_array(:#{callback}, callbacks)
- end
- end_eval
-
+ @owner_class.callback(callback)
@owner_class.send(callback, @options[type]) if @options[type]
end
end
@@ -3,7 +3,7 @@
$:.unshift("#{RAILS_ROOT}/../../../../../rails/plugin_dependencies/lib")
begin
require 'plugin_dependencies'
-rescue Exception => ex
+rescue Exception => e
end
Rails::Initializer.run do |config|
View
@@ -1,5 +1,6 @@
# Load local repository plugin paths
$:.unshift("#{File.dirname(__FILE__)}/../../../associations/class_associations/lib")
+$:.unshift("#{File.dirname(__FILE__)}/../../../miscellaneous/custom_callbacks/lib")
$:.unshift("#{File.dirname(__FILE__)}/../../../miscellaneous/dry_transaction_rollbacks/lib")
$:.unshift("#{File.dirname(__FILE__)}/../../../../ruby/object/eval_call/lib")

0 comments on commit 26b00de

Please sign in to comment.