<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/theatre.rb</filename>
    </added>
    <added>
      <filename>lib/theatre/README.markdown</filename>
    </added>
    <added>
      <filename>lib/theatre/callback_definition_loader.rb</filename>
    </added>
    <added>
      <filename>lib/theatre/guid.rb</filename>
    </added>
    <added>
      <filename>lib/theatre/invocation.rb</filename>
    </added>
    <added>
      <filename>lib/theatre/namespace_manager.rb</filename>
    </added>
    <added>
      <filename>lib/theatre/version.rb</filename>
    </added>
    <added>
      <filename>theatre-spec/dsl_examples/dynamic_stomp.rb</filename>
    </added>
    <added>
      <filename>theatre-spec/dsl_examples/simple_before_call.rb</filename>
    </added>
    <added>
      <filename>theatre-spec/dsl_spec.rb</filename>
    </added>
    <added>
      <filename>theatre-spec/invocation_spec.rb</filename>
    </added>
    <added>
      <filename>theatre-spec/namespace_spec.rb</filename>
    </added>
    <added>
      <filename>theatre-spec/spec_helper.rb</filename>
    </added>
    <added>
      <filename>theatre-spec/spec_helper_spec.rb</filename>
    </added>
    <added>
      <filename>theatre-spec/theatre_class_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,6 @@
 Notes from before 0.8.0:
+ - (NOTE: This is obviously not a comprehensive list of pre-0.8.0 work. 0.8.0 was a complete rewrite of the previous version)
  - Adding a deprecation warning about Fixnum#digit and Fixnum#digits
  - Removed the AMI class and replaced it with the ManagerInterface class.
  - The old AMI high-level instance methods are available in the new ManagerInterface class, but a deprecation warning will be logged each time they're used. When the SuperManager class is implemented, they'll be removed entirely.
+ - Moved Theatre into Adhearsion's lib folder.
\ No newline at end of file</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,35 @@
 # -*- ruby -*-
 ENV['RUBY_FLAGS'] = &quot;-I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}&quot;
 
-require 'rake/gempackagetask'
 require 'rubygems'
+require 'rake/gempackagetask'
+
+begin
+  require 'spec/rake/spectask'
+rescue LoadError
+  abort &quot;You must install RSpec: sudo gem install rspec&quot;
+end
+
+begin
+  require 'yard'
+  YARD::Rake::YardocTask.new do |t|
+    t.files = ['lib/**/*.rb'] + %w[README.markdown TODO.markdown LICENSE]
+  end
+rescue LoadError
+  STDERR.puts &quot;\nCould not require() YARD! Install with 'gem install yard' to get the 'yardoc' task\n\n&quot;
+end
 
 require 'lib/adhearsion/version'
 
-TestGlob    = ['spec/**/test_*.rb']
-GEMSPEC     = eval File.read(&quot;adhearsion.gemspec&quot;)
-RAGEL_FILES = %w[lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb]
+AHN_TESTS     = ['spec/**/test_*.rb']
+GEMSPEC       = eval File.read(&quot;adhearsion.gemspec&quot;)
+RAGEL_FILES   = %w[lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb]
+THEATRE_TESTS = 'theatre-spec/**/*_spec.rb'
 
 begin
   require 'rcov/rcovtask'
   Rcov::RcovTask.new do |t|
-    t.test_files = Dir[*TestGlob]
+    t.test_files = Dir[*AHN_TESTS]
     t.output_dir = 'coverage'
     t.verbose = true
     t.rcov_opts.concat %w[--sort coverage --sort-reverse -x gems -x /var --no-validator-links]
@@ -31,7 +47,7 @@ Rake::GemPackageTask.new(GEMSPEC).define
 
 desc &quot;Run the unit tests for Adhearsion&quot;
 task :spec do
-  Dir[*TestGlob].each do |file|
+  Dir[*AHN_TESTS].each do |file|
     load file
   end
 end
@@ -65,6 +81,11 @@ task :visualize_ragel =&gt; :check_ragel_version do
   end
 end
 
+desc &quot;Run all RSpecs for Theatre&quot;
+Spec::Rake::SpecTask.new(&quot;theatre_specs&quot;) do |t|
+  t.spec_files = FileList[THEATRE_TESTS]
+end
+
 desc &quot;Compares Adhearsion's files with those listed in adhearsion.gemspec&quot;
 task :check_gemspec_files do
   </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -3,9 +3,11 @@ ADHEARSION_FILES = %w{
   app_generators/ahn/ahn_generator.rb
   app_generators/ahn/templates/.ahnrc
   app_generators/ahn/templates/components/simon_game/simon_game.rb
-  app_generators/ahn/templates/components/stomp_gateway/config.yml
-  app_generators/ahn/templates/components/stomp_gateway/README.markdown
-  app_generators/ahn/templates/components/stomp_gateway/stomp_gateway.rb
+  app_generators/ahn/templates/components/ami_remote/ami_remote.rb
+  app_generators/ahn/templates/components/disabled/HOW_TO_ENABLE
+  app_generators/ahn/templates/components/disabled/stomp_gateway/config.yml
+  app_generators/ahn/templates/components/disabled/stomp_gateway/README.markdown
+  app_generators/ahn/templates/components/disabled/stomp_gateway/stomp_gateway.rb
   app_generators/ahn/templates/config/startup.rb
   app_generators/ahn/templates/dialplan.rb
   app_generators/ahn/templates/events.rb
@@ -15,7 +17,15 @@ ADHEARSION_FILES = %w{
   bin/ahn
   bin/ahnctl
   bin/jahn
+  examples/asterisk_manager_interface/standalone.rb
   EVENTS
+  lib/theatre/dsl/callback_definition_loader.rb
+  lib/theatre/guid.rb
+  lib/theatre/invocation.rb
+  lib/theatre/namespace_manager.rb
+  lib/theatre/README.markdown
+  lib/theatre/version.rb
+  lib/theatre.rb
   lib/adhearsion.rb
   lib/adhearsion/cli.rb
   lib/adhearsion/component_manager.rb</diff>
      <filename>adhearsion.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -75,7 +75,11 @@ module Adhearsion
         
         scopes.each do |scope|
           methods = @scopes[scope]
-          object.extend methods
+          if object.kind_of?(Module)
+            object.send :include, methods
+          else
+            object.extend methods
+          end
         end
         object
       end</diff>
      <filename>lib/adhearsion/component_manager.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,13 @@
 begin
-  require 'theatre'
+  gem 'theatre'
 rescue LoadError
-  abort &lt;&lt;-ERROR
-Could not load the &quot;theare&quot; gem.
-
-As of Oct. 16th, 2008, Adhearsion depends on this gem (which Jay Phillips wrote) to handle
-the new events sub-system of Adhearsion. You can get it from two places:
-
-Rubyforge: sudo gem install theatre
-Github (latest): sudo gem install jicksta-theatre --source http://gems.github.com
-  ERROR
+  # Good. It should not be installed. Let's require it from the lib/ directory.
+  require 'theatre'
+else
+  abort &lt;&lt;-MESSAGE
+It seems you have the &quot;theatre&quot; gem installed. As of Dec. 7th, 2008 Theatre has been rolled into Adhearsion and will be
+distributed with it.
+  MESSAGE
 end
 
 module Adhearsion</diff>
      <filename>lib/adhearsion/events_support.rb</filename>
    </modified>
    <modified>
      <diff>@@ -330,9 +330,10 @@ Adhearsion will abort until you fix this. Sorry for the incovenience.
     def init_components_subsystem
       @components_directory = File.expand_path &quot;components&quot;
       if File.directory? @components_directory
-        Components.component_manager = Adhearsion::Components::ComponentManager.new @components_directory
+        Components.component_manager = Components::ComponentManager.new @components_directory
         Kernel.send(:const_set, :COMPONENTS, Components.component_manager.lazy_config_loader)
         Components.component_manager.globalize_global_scope!
+        Components.component_manager.extend_object_with(Theatre::CallbackDefinitionLoader, :events)
       else
         ahn_log.warn &quot;No components directory found. Not initializing any components.&quot;
       end</diff>
      <filename>lib/adhearsion/initializer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + &quot;/test_helper&quot;
 
-context &quot;Ruby-level requirements of components&quot; do
+context &quot;Adhearsion's component system&quot; do
   
   include ComponentManagerTestHelper
   
@@ -257,68 +257,4 @@ BEGIN {
       @component_manager.extend_object_with(Object.new, scope)
     end
   end
-}
-
-# BEGIN {
-#   module CallContextComponentTestHelpers
-#     def new_componenet_class_named(component_name)
-#       component_namespace = Adhearsion::Components::ComponentModule.new('passed in component does not matter here')
-#       Adhearsion::Components::Component.prepare_component_class(component_namespace, component_name)
-#       component_namespace.const_get(component_name)
-#     end
-#   end
-# }
-# 
-# 
-# context &quot;Referencing a component class in a dial plan context&quot; do
-#   include CallContextComponentTestHelpers
-#   
-#   test &quot;the component module constant should be available in the scope of a call context&quot; do
-#     sample_component_class = new_componenet_class_named 'SampleComponent2'
-#     sample_component_class.add_call_context
-# 
-#     loader = load_dial_plan(&lt;&lt;-DIAL_PLAN)
-#       some_context {
-#         SampleComponent2
-#       }
-#     DIAL_PLAN
-#     
-#     flexmock(Adhearsion::DialPlan::Loader).should_receive(:load_dialplans).and_return(loader)
-#     tested_call = Adhearsion::Call.new(nil, :context =&gt; :some_context)
-#     Adhearsion::Configuration.configure
-#     Adhearsion::AHN_CONFIG.ahnrc = {&quot;paths&quot; =&gt; {&quot;dialplan&quot; =&gt; &quot;dialplan.rb&quot;}}
-#     flexmock(Adhearsion::AHN_CONFIG).should_receive(:automatically_answer_incoming_calls).once.and_return false
-#     the_following_code {
-#       handle(tested_call)
-#     }.should.not.raise
-#   end
-#   
-#   test &quot;the call context is injected into any instances of the component class&quot; do
-#     sample_component_class = new_componenet_class_named('SampleComponent3')
-#     sample_component_class.add_call_context :as =&gt; :call_context_variable_name
-# 
-#     loader = load_dial_plan(&lt;&lt;-DIAL_PLAN)
-#       some_context {
-#         new_sample_component3.call_context_variable_name
-#       }
-#     DIAL_PLAN
-#     
-#     flexmock(Adhearsion::DialPlan::Loader).should_receive(:load_dialplans).and_return(loader)
-#     sample_call = Adhearsion::Call.new(nil, :context =&gt; :some_context)
-#     Adhearsion::Configuration.configure
-#     Adhearsion::AHN_CONFIG.ahnrc = {&quot;paths&quot; =&gt; {&quot;dialplan&quot; =&gt; &quot;dialplan.rb&quot;}}
-#     flexmock(Adhearsion::AHN_CONFIG).should_receive(:automatically_answer_incoming_calls).once.and_return false
-#     the_following_code {
-#       handle(sample_call)
-#     }.should.not.raise
-#   end
-#   
-#   private
-#     def load_dial_plan(dial_plan_as_string)
-#       Adhearsion::DialPlan::Loader.load(dial_plan_as_string)
-#     end
-#     
-#     def handle(call)
-#       Adhearsion::DialPlan::Manager.handle(call)
-#     end
-# end
+}
\ No newline at end of file</diff>
      <filename>spec/test_component_manager.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>spec/old_component_manager_test.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>bb141f5f96f17deb65f6ad2de075aa48db81bcc5</id>
    </parent>
  </parents>
  <author>
    <name>Jay Phillips</name>
    <email>jicksta+git@gmail.com</email>
  </author>
  <url>http://github.com/jicksta/adhearsion/commit/9f4164cbe114358df4de358e9d5701a3397c35c6</url>
  <id>9f4164cbe114358df4de358e9d5701a3397c35c6</id>
  <committed-date>2008-12-07T14:13:17-08:00</committed-date>
  <authored-date>2008-12-07T14:13:17-08:00</authored-date>
  <message>Moved Theatre to permanently reside within Adhearsion's lib folder. Breaking it into two gems was impractical. Adhearsion will now abort if it sees the &quot;theatre&quot; gem installed and require you to uninstall it. Also: the methods_for(:events) component feature works now.</message>
  <tree>1795cfb5e2acea8462fccbae4a77736860b425e4</tree>
  <committer>
    <name>Jay Phillips</name>
    <email>jicksta+git@gmail.com</email>
  </committer>
</commit>
