adhearsion 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/.gitignore +10 -0
  2. data/CHANGELOG +8 -0
  3. data/README.markdown +33 -0
  4. data/Rakefile +28 -68
  5. data/adhearsion.gemspec +19 -133
  6. data/app_generators/ahn/templates/Gemfile +0 -4
  7. data/app_generators/ahn/templates/components/disabled/restful_rpc/spec/restful_rpc_spec.rb +4 -16
  8. data/lib/adhearsion/cli.rb +17 -0
  9. data/lib/adhearsion/component_manager/component_tester.rb +1 -3
  10. data/lib/adhearsion/component_manager/spec_framework.rb +4 -10
  11. data/lib/adhearsion/foundation/object.rb +10 -0
  12. data/lib/adhearsion/version.rb +1 -1
  13. data/spec/ahn_command_spec.rb +284 -0
  14. data/spec/component_manager_spec.rb +292 -0
  15. data/spec/constants_spec.rb +8 -0
  16. data/spec/drb_spec.rb +65 -0
  17. data/spec/fixtures/dialplan.rb +3 -0
  18. data/spec/foundation/event_socket_spec.rb +168 -0
  19. data/spec/host_definitions_spec.rb +79 -0
  20. data/spec/initialization_spec.rb +163 -0
  21. data/spec/initializer/configuration_spec.rb +270 -0
  22. data/spec/initializer/loading_spec.rb +149 -0
  23. data/spec/initializer/paths_spec.rb +74 -0
  24. data/spec/logging_spec.rb +86 -0
  25. data/spec/relationship_properties_spec.rb +54 -0
  26. data/spec/silence.rb +10 -0
  27. data/spec/spec_helper.rb +101 -0
  28. data/spec/voip/asterisk/agi_server_spec.rb +473 -0
  29. data/spec/voip/asterisk/ami/ami_spec.rb +549 -0
  30. data/spec/voip/asterisk/ami/lexer/ami_fixtures.yml +30 -0
  31. data/spec/voip/asterisk/ami/lexer/lexer_story +291 -0
  32. data/spec/voip/asterisk/ami/lexer/lexer_story.rb +241 -0
  33. data/spec/voip/asterisk/ami/lexer/story_helper.rb +124 -0
  34. data/spec/voip/asterisk/ami/old_tests.rb +204 -0
  35. data/spec/voip/asterisk/ami/super_manager/super_manager_story +25 -0
  36. data/spec/voip/asterisk/ami/super_manager/super_manager_story.rb +15 -0
  37. data/spec/voip/asterisk/ami/super_manager/super_manager_story_helper.rb +5 -0
  38. data/spec/voip/asterisk/commands_spec.rb +2179 -0
  39. data/spec/voip/asterisk/config_file_generators/agents_spec.rb +251 -0
  40. data/spec/voip/asterisk/config_file_generators/queues_spec.rb +323 -0
  41. data/spec/voip/asterisk/config_file_generators/voicemail_spec.rb +306 -0
  42. data/spec/voip/asterisk/config_manager_spec.rb +127 -0
  43. data/spec/voip/asterisk/menu_command/calculated_match_spec.rb +109 -0
  44. data/spec/voip/asterisk/menu_command/matchers_spec.rb +97 -0
  45. data/spec/voip/call_routing_spec.rb +125 -0
  46. data/spec/voip/dialplan_manager_spec.rb +468 -0
  47. data/spec/voip/dsl/dialing_dsl_spec.rb +270 -0
  48. data/spec/voip/dsl/dispatcher_spec.rb +82 -0
  49. data/spec/voip/dsl/dispatcher_spec_helper.rb +45 -0
  50. data/spec/voip/dsl/parser_spec.rb +69 -0
  51. data/spec/voip/freeswitch/basic_connection_manager_spec.rb +39 -0
  52. data/spec/voip/freeswitch/inbound_connection_manager_spec.rb +39 -0
  53. data/spec/voip/freeswitch/oes_server_spec.rb +9 -0
  54. data/spec/voip/numerical_string_spec.rb +61 -0
  55. data/spec/voip/phone_number_spec.rb +45 -0
  56. data/theatre-spec/dsl_examples/dynamic_stomp.rb +7 -0
  57. data/theatre-spec/dsl_examples/simple_before_call.rb +7 -0
  58. data/theatre-spec/dsl_spec.rb +43 -0
  59. data/theatre-spec/invocation_spec.rb +167 -0
  60. data/theatre-spec/namespace_spec.rb +125 -0
  61. data/theatre-spec/spec_helper.rb +37 -0
  62. data/theatre-spec/spec_helper_spec.rb +28 -0
  63. data/theatre-spec/theatre_class_spec.rb +150 -0
  64. metadata +171 -34
@@ -0,0 +1,10 @@
1
+ .DS_Store
2
+ pkg
3
+ *~
4
+ .*.sw?
5
+ .yardoc
6
+ nbproject
7
+ vendor
8
+ Gemfile.lock
9
+ .bundle
10
+ .rvmrc
data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ 1.0.2
2
+ - Fix rcov Rake task
3
+ - Add Ben Langfeld as an author (Thanks, Ben!)
4
+ - Add "rake" as a runtime dependency
5
+ - Remove usage of BEGIN blocks (for Rubinius; CS)
6
+ - Improve component testing generators
7
+
1
8
  1.0.1
2
9
  NOTE for Ruby 1.9 users: The behavior of Ruby 1.9 and case statements has changed
3
10
  in a way that renders NumericalString objects incompatible with
@@ -29,6 +36,7 @@
29
36
  - New components now include RubyGems skeleton files
30
37
  - Fix support for setting Caller ID name on AGI dial() command
31
38
  - Generate new apps with Bundler support, including auto-requiring of all gems
39
+ - Update component testing framework to RSpec 2.x and mock with rspec
32
40
 
33
41
  1.0.0
34
42
  - Fall back to using Asterisk's context if the AGI URI context is not found
@@ -0,0 +1,33 @@
1
+ Adhearsion
2
+ ==========
3
+
4
+ Adhearsion is an open-source voice application development framework. Adhearsion users write applications atop the framework with Ruby and **call into their code**.
5
+
6
+ Adhearsion rests above a lower-level telephony platform, namely [Asterisk](http://asterisk.org), and provides a framework for integrating with various resources, such as SQL, LDAP and XMPP (Jabber).
7
+
8
+ Adhearsion has...
9
+
10
+ * An elegant dialplan system for writing the code which controls a live phone call
11
+ * A sophisticated Asterisk Manager Interface library with a lexer written in [Ragel](http://www.complang.org/ragel).
12
+ * An events subsystem which maintains a Thread-pool for executing your namespaced callbacks. (supports AMI events too!)
13
+ * A very useful component architecture with which you may write Adhearsion plugins and share them with the world via RubyGems.
14
+ * JRuby compatibility for running atop the Java Virtual Machine and using virtually any Java library.
15
+ * Ability to re-use existing Ruby on Rails database models with ActiveRecord/ActiveLDAP
16
+ * Easy interactive communication via XMPP instant messages using the Blather library
17
+ * Good regression test coverage
18
+
19
+ Use the public Adhearsion sandbox!
20
+ ==================================
21
+
22
+ Don't want to screw with setting up a telephony system? You can test your Adhearsion applications using our public sandbox!
23
+
24
+ Visit [http://adhearsion.com/getting_started](http://adhearsion.com/getting_started) for more information!
25
+
26
+ Yes, in minutes you can be controlling your cell phone for free! :)
27
+
28
+ Documentation
29
+ =============
30
+
31
+ Visit [Adhearsion's website](http://adhearsion.com) for code examples and more information about the project. Also checkout the [Adhearsion wiki on Github](http://github.com/adhearsion/adhearsion/wiki) for community documentation.
32
+
33
+ If you're having trouble, you may want to try asking your question on the IRC channel (#adhearsion on irc.freenode.net), [mailing list](http://groups.google.com/group/adhearsion) or, if you've found a bug, report it on the [bug tracker](http://adhearsion.lighthouseapp.com/projects/5871-adhearsion/overview).
data/Rakefile CHANGED
@@ -1,11 +1,14 @@
1
1
  # -*- ruby -*-
2
- ENV['RUBY_FLAGS'] = "-I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}"
2
+ ENV['RUBY_FLAGS'] = "-I#{%w(lib ext bin spec).join(File::PATH_SEPARATOR)}"
3
3
 
4
4
  require 'rubygems'
5
5
  require 'bundler'
6
6
  Bundler::GemHelper.install_tasks
7
- require 'rake/testtask'
8
7
  require 'date'
8
+ require 'adhearsion/version'
9
+
10
+ task :default => :spec
11
+ task :gem => :build
9
12
 
10
13
  begin
11
14
  gem 'rspec', '>= 2.3.0'
@@ -14,59 +17,41 @@ rescue LoadError
14
17
  abort "You must install RSpec: sudo gem install rspec"
15
18
  end
16
19
 
17
- begin
18
- require 'yard'
19
- YARD::Rake::YardocTask.new do |t|
20
- t.files = ['lib/**/*.rb'] + %w[README.markdown TODO.markdown LICENSE]
21
- end
22
- rescue LoadError
23
- STDERR.puts "\nCould not require() YARD! Install with 'gem install yard' to get the 'yardoc' task\n\n"
20
+ RSpec::Core::RakeTask.new do |t|
24
21
  end
25
22
 
26
- require 'adhearsion/version'
27
-
28
- AHN_TESTS = ['spec/**/test_*.rb']
29
- #AHN_TESTS = ['spec/test_ahn_command.rb']
30
- GEMSPEC = eval File.read("adhearsion.gemspec")
31
- RAGEL_FILES = %w[lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb]
32
- THEATRE_TESTS = 'theatre-spec/**/*_spec.rb'
23
+ desc "Run all RSpecs for Theatre"
24
+ RSpec::Core::RakeTask.new(:theatre_specs) do |t|
25
+ t.pattern = 'theatre-spec/**/*_spec.rb'
26
+ end
33
27
 
34
28
  begin
35
29
  require 'rcov/rcovtask'
36
30
  Rcov::RcovTask.new do |t|
37
- t.test_files = Dir[*AHN_TESTS]
38
- t.output_dir = 'coverage'
39
- t.verbose = true
40
- t.rcov_opts.concat %w[--sort coverage --sort-reverse -x gems -x /var --no-validator-links]
31
+ t.libs << "spec"
32
+ t.test_files = Dir['spec/**/*_spec.rb']
33
+ t.output_dir = 'coverage'
34
+ t.verbose = true
35
+ t.rcov_opts.concat %w[--sort coverage --sort-reverse -x gems -x /var]
41
36
  end
42
37
  rescue LoadError
43
38
  STDERR.puts "Could not load rcov tasks -- rcov does not appear to be installed. Continuing anyway."
44
39
  end
45
40
 
46
- task :gem => :build
47
-
48
- # YARD::Rake::YardocTask.new do |t|
49
- # t.files = ['lib/**/*.rb'] # optional
50
- # # t.options = ['--any', '--extra', '--opts'] # optional
51
- # end
52
-
53
- #Rake::TestTask.new('spec') do |t|
54
- # t.libs << File.dirname(__FILE__)
55
- # t.verbose = true
56
- # t.pattern = AHN_TESTS
57
- #end
58
-
59
- RSpec::Core::RakeTask.new(:spec) do |t|
60
- t.pattern = AHN_TESTS
41
+ begin
42
+ require 'yard'
43
+ YARD::Rake::YardocTask.new do |t|
44
+ t.files = ['lib/**/*.rb'] + %w[README.markdown TODO.markdown LICENSE]
45
+ end
46
+ rescue LoadError
47
+ STDERR.puts "\nCould not require() YARD! Install with 'gem install yard' to get the 'yardoc' task\n\n"
61
48
  end
62
49
 
63
- task :default => :spec
64
-
65
50
  desc "Check Ragel version"
66
51
  task :check_ragel_version do
67
- ragel_version_match = `ragel --version`.match(/(\d)\.(\d)+/)
52
+ ragel_version_match = `ragel --version`.match /(\d)\.(\d)+/
68
53
  abort "Could not get Ragel version! Is it installed? You must have at least version 6.3" unless ragel_version_match
69
- big, small = ragel_version_match.captures.map { |n| n.to_i }
54
+ big, small = ragel_version_match.captures.map &:to_i
70
55
  if big < 6 || (big == 6 && small < 3)
71
56
  abort "Please upgrade Ragel! You're on version #{ragel_version_match[0]} and must be on 6.3 or later"
72
57
  end
@@ -78,10 +63,12 @@ task :check_ragel_version do
78
63
  end
79
64
  end
80
65
 
66
+ RAGEL_FILES = %w[lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb]
67
+
81
68
  desc "Used to regenerate the AMI source code files. Note: requires Ragel 6.3 or later be installed on your system"
82
69
  task :ragel => :check_ragel_version do
83
70
  RAGEL_FILES.each do |ragel_file|
84
- ruby_file = ragel_file.sub(".rl.rb", ".rb")
71
+ ruby_file = ragel_file.sub ".rl.rb", ".rb"
85
72
  puts `ragel -n -R #{ragel_file} -o #{ruby_file} 2>&1`
86
73
  raise "Failed generating code from Ragel file #{ragel_file}" if $?.to_i.nonzero?
87
74
  end
@@ -97,37 +84,10 @@ task :visualize_ragel => :check_ragel_version do
97
84
  end
98
85
  end
99
86
 
100
- desc "Run all RSpecs for Theatre"
101
- RSpec::Core::RakeTask.new(:theatre_specs) do |t|
102
- t.pattern = FileList[THEATRE_TESTS]
103
- end
104
-
105
- desc "Compares Adhearsion's files with those listed in adhearsion.gemspec"
106
- task :check_gemspec_files do
107
- files_from_gemspec = ADHEARSION_FILES
108
- files_from_filesystem = Dir.glob(File.dirname(__FILE__) + "/**/*").map do |filename|
109
- filename[0...Dir.pwd.length] == Dir.pwd ? filename[(Dir.pwd.length+1)..-1] : filename
110
- end
111
- files_from_filesystem.reject! { |f| File.directory? f }
112
-
113
- puts
114
- puts 'Pipe this command to "grep -v \'spec/\' | grep -v test" to ignore test files'
115
- puts
116
- puts '##########################################'
117
- puts '## Files on filesystem not in the gemspec:'
118
- puts '##########################################'
119
- puts((files_from_filesystem - files_from_gemspec).map { |f| " " + f })
120
-
121
- puts '##########################################'
122
- puts '## Files in gemspec not in the filesystem:'
123
- puts '##########################################'
124
- puts((files_from_gemspec - files_from_filesystem).map { |f| " " + f })
125
- end
126
-
127
87
  desc "Test that the .gemspec file executes"
128
88
  task :debug_gem do
129
89
  require 'rubygems/specification'
130
- gemspec = File.read('adhearsion.gemspec')
90
+ gemspec = File.read 'adhearsion.gemspec'
131
91
  spec = nil
132
92
  Thread.new { spec = eval("$SAFE = 3\n#{gemspec}") }.join
133
93
  puts "SUCCESS: Gemspec runs at the $SAFE level 3."
@@ -3,143 +3,25 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
  require "adhearsion/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
- s.name = "adhearsion"
7
- s.version = Adhearsion::VERSION::STRING
8
-
9
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
- s.authors = ["Jay Phillips", "Jason Goecke", "Ben Klang"]
11
-
12
- s.date = Date.today.to_s
6
+ s.name = "adhearsion"
7
+ s.version = Adhearsion::VERSION::STRING
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Jay Phillips", "Jason Goecke", "Ben Klang", "Ben Langfeld"]
10
+ s.email = "dev&Adhearsion.com"
11
+ s.homepage = "http://adhearsion.com"
12
+ s.summary = "Adhearsion, open-source telephony development framework"
13
13
  s.description = "Adhearsion is an open-source telephony development framework"
14
- s.email = "dev&Adhearsion.com"
15
- s.executables = ["ahn", "ahnctl", "jahn"]
14
+ s.date = Date.today.to_s
16
15
 
17
- s.files = %w{
18
- adhearsion.gemspec
19
- app_generators/ahn/ahn_generator.rb
20
- app_generators/ahn/templates/.ahnrc
21
- app_generators/ahn/templates/components/ami_remote/ami_remote.rb
22
- app_generators/ahn/templates/components/disabled/HOW_TO_ENABLE
23
- app_generators/ahn/templates/components/disabled/stomp_gateway/stomp_gateway.yml
24
- app_generators/ahn/templates/components/disabled/stomp_gateway/README.markdown
25
- app_generators/ahn/templates/components/disabled/stomp_gateway/stomp_gateway.rb
26
- app_generators/ahn/templates/components/disabled/sandbox/sandbox.rb
27
- app_generators/ahn/templates/components/disabled/sandbox/sandbox.yml
28
- app_generators/ahn/templates/components/disabled/restful_rpc/restful_rpc.yml
29
- app_generators/ahn/templates/components/disabled/restful_rpc/example-client.rb
30
- app_generators/ahn/templates/components/disabled/restful_rpc/README.markdown
31
- app_generators/ahn/templates/components/disabled/restful_rpc/restful_rpc.rb
32
- app_generators/ahn/templates/components/disabled/restful_rpc/spec/restful_rpc_spec.rb
33
- app_generators/ahn/templates/components/disabled/xmpp_gateway/xmpp_gateway.rb
34
- app_generators/ahn/templates/components/disabled/xmpp_gateway/xmpp_gateway.yml
35
- app_generators/ahn/templates/components/disabled/xmpp_gateway/README.markdown
36
- app_generators/ahn/templates/components/simon_game/simon_game.rb
37
- app_generators/ahn/templates/config/startup.rb
38
- app_generators/ahn/templates/dialplan.rb
39
- app_generators/ahn/templates/events.rb
40
- app_generators/ahn/templates/Rakefile
41
- app_generators/ahn/templates/Gemfile
42
- app_generators/ahn/templates/README
43
- app_generators/ahn/USAGE
44
- bin/ahn
45
- bin/ahnctl
46
- bin/jahn
47
- CHANGELOG
48
- EVENTS
49
- examples/asterisk_manager_interface/standalone.rb
50
- lib/adhearsion.rb
51
- lib/adhearsion/cli.rb
52
- lib/adhearsion/component_manager.rb
53
- lib/adhearsion/component_manager/component_tester.rb
54
- lib/adhearsion/component_manager/spec_framework.rb
55
- lib/adhearsion/events_support.rb
56
- lib/adhearsion/foundation/all.rb
57
- lib/adhearsion/foundation/blank_slate.rb
58
- lib/adhearsion/foundation/custom_daemonizer.rb
59
- lib/adhearsion/foundation/event_socket.rb
60
- lib/adhearsion/foundation/future_resource.rb
61
- lib/adhearsion/foundation/metaprogramming.rb
62
- lib/adhearsion/foundation/numeric.rb
63
- lib/adhearsion/foundation/pseudo_guid.rb
64
- lib/adhearsion/foundation/relationship_properties.rb
65
- lib/adhearsion/foundation/string.rb
66
- lib/adhearsion/foundation/synchronized_hash.rb
67
- lib/adhearsion/foundation/thread_safety.rb
68
- lib/adhearsion/host_definitions.rb
69
- lib/adhearsion/initializer.rb
70
- lib/adhearsion/initializer/asterisk.rb
71
- lib/adhearsion/initializer/configuration.rb
72
- lib/adhearsion/initializer/database.rb
73
- lib/adhearsion/initializer/ldap.rb
74
- lib/adhearsion/initializer/drb.rb
75
- lib/adhearsion/initializer/freeswitch.rb
76
- lib/adhearsion/initializer/rails.rb
77
- lib/adhearsion/initializer/xmpp.rb
78
- lib/adhearsion/logging.rb
79
- lib/adhearsion/tasks.rb
80
- lib/adhearsion/tasks/components.rb
81
- lib/adhearsion/tasks/database.rb
82
- lib/adhearsion/tasks/deprecations.rb
83
- lib/adhearsion/tasks/generating.rb
84
- lib/adhearsion/tasks/lint.rb
85
- lib/adhearsion/tasks/testing.rb
86
- lib/adhearsion/version.rb
87
- lib/adhearsion/voip/asterisk.rb
88
- lib/adhearsion/voip/asterisk/agi_server.rb
89
- lib/adhearsion/voip/asterisk/commands.rb
90
- lib/adhearsion/voip/asterisk/config_generators/agents.conf.rb
91
- lib/adhearsion/voip/asterisk/config_generators/config_generator.rb
92
- lib/adhearsion/voip/asterisk/config_generators/queues.conf.rb
93
- lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb
94
- lib/adhearsion/voip/asterisk/config_manager.rb
95
- lib/adhearsion/voip/asterisk/manager_interface.rb
96
- lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb
97
- lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb
98
- lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb
99
- lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl
100
- lib/adhearsion/voip/asterisk/special_dial_plan_managers.rb
101
- lib/adhearsion/voip/asterisk/super_manager.rb
102
- lib/adhearsion/voip/call.rb
103
- lib/adhearsion/voip/call_routing.rb
104
- lib/adhearsion/voip/commands.rb
105
- lib/adhearsion/voip/constants.rb
106
- lib/adhearsion/voip/conveniences.rb
107
- lib/adhearsion/voip/dial_plan.rb
108
- lib/adhearsion/voip/dsl/dialing_dsl.rb
109
- lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
110
- lib/adhearsion/voip/dsl/dialplan/control_passing_exception.rb
111
- lib/adhearsion/voip/dsl/dialplan/dispatcher.rb
112
- lib/adhearsion/voip/dsl/dialplan/parser.rb
113
- lib/adhearsion/voip/dsl/dialplan/thread_mixin.rb
114
- lib/adhearsion/voip/dsl/numerical_string.rb
115
- lib/adhearsion/voip/freeswitch/basic_connection_manager.rb
116
- lib/adhearsion/voip/freeswitch/event_handler.rb
117
- lib/adhearsion/voip/freeswitch/freeswitch_dialplan_command_factory.rb
118
- lib/adhearsion/voip/freeswitch/inbound_connection_manager.rb
119
- lib/adhearsion/voip/freeswitch/oes_server.rb
120
- lib/adhearsion/voip/menu_state_machine/calculated_match.rb
121
- lib/adhearsion/voip/menu_state_machine/matchers.rb
122
- lib/adhearsion/voip/menu_state_machine/menu_builder.rb
123
- lib/adhearsion/voip/menu_state_machine/menu_class.rb
124
- lib/adhearsion/xmpp/connection.rb
125
- lib/theatre.rb
126
- lib/theatre/callback_definition_loader.rb
127
- lib/theatre/guid.rb
128
- lib/theatre/invocation.rb
129
- lib/theatre/namespace_manager.rb
130
- lib/theatre/README.markdown
131
- lib/theatre/version.rb
132
- LICENSE
133
- Rakefile
134
- Gemfile
135
- }
16
+ s.rubyforge_project = "adhearsion"
17
+ s.rubygems_version = "1.2.0"
18
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
136
19
 
137
- s.has_rdoc = true
138
- s.homepage = "http://adhearsion.com"
20
+ s.files = `git ls-files`.split("\n")
21
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
139
23
  s.require_paths = ["lib"]
140
- s.rubyforge_project = "adhearsion"
141
- s.rubygems_version = "1.2.0"
142
- s.summary = "Adhearsion, open-source telephony development framework"
24
+ s.has_rdoc = true
143
25
 
144
26
  if s.respond_to? :specification_version then
145
27
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
@@ -155,20 +37,24 @@ Gem::Specification.new do |s|
155
37
  # on the safe side.
156
38
  s.add_runtime_dependency("i18n")
157
39
  s.add_runtime_dependency("rubigen", [">= 1.5.6"])
40
+ s.add_runtime_dependency("rake")
158
41
 
159
42
  # Development dependencies
160
43
  s.add_development_dependency('rubigen', [">= 1.5.6"])
161
44
  s.add_development_dependency('rspec', [">= 2.4.0"])
162
45
  s.add_development_dependency('flexmock')
163
46
  s.add_development_dependency('activerecord')
47
+ s.add_development_dependency('rake')
164
48
  else
165
49
  s.add_dependency("bundler", [">= 1.0.10"])
166
50
  s.add_dependency("log4r", [">= 1.0.5"])
167
51
  s.add_dependency("activesupport", [">= 2.1.0"])
52
+ s.add_dependency("rake")
168
53
  end
169
54
  else
170
55
  s.add_dependency("bundler", [">= 1.0.10"])
171
56
  s.add_dependency("log4r", [">= 1.0.5"])
172
57
  s.add_dependency("activesupport", [">= 2.1.0"])
58
+ s.add_dependency("rake")
173
59
  end
174
60
  end
@@ -1,7 +1,3 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "rake"
4
- gem "rubigen", ">= 1.0.6"
5
- gem "log4r", ">= 1.0.5"
6
- gem "activesupport", ">= 2.1.0"
7
3
  gem "adhearsion", ">= 1.0.1"
@@ -1,17 +1,7 @@
1
- unless defined? Adhearsion
2
- if File.exists? File.dirname(__FILE__) + "/../../../adhearsion/lib/adhearsion.rb"
3
- # If you wish to freeze a copy of Adhearsion to this app, simply place a copy of Adhearsion
4
- # into a folder named "adhearsion" within this app's main directory.
5
- require File.dirname(__FILE__) + "/../../../adhearsion/lib/adhearsion.rb"
6
- elsif File.exists? File.dirname(__FILE__) + "/../../../../../../lib/adhearsion.rb"
7
- # This file may be ran from the within the Adhearsion framework code (before a project has been generated)
8
- require File.dirname(__FILE__) + "/../../../../../../lib/adhearsion.rb"
9
- else
10
- require 'rubygems'
11
- gem 'adhearsion', '>= 0.7.999'
12
- require 'adhearsion'
13
- end
14
- end
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ Bundler.setup
4
+ Bundler.require
15
5
 
16
6
  require 'adhearsion/component_manager/spec_framework'
17
7
 
@@ -47,8 +37,6 @@ RESTFUL_RPC = ComponentTester.new("restful_rpc", File.dirname(__FILE__) + "/../.
47
37
  # "SERVER_PROTOCOL" => "HTTP/1.1",
48
38
  # "SERVER_SOFTWARE" => "WEBrick/1.3.1 (Ruby/1.8.6/2008-03-03)"}
49
39
 
50
-
51
-
52
40
  describe "The VALID_IP_ADDRESS regular expression" do
53
41
 
54
42
  it "should match only valid IP addresses" do
@@ -169,6 +169,23 @@ Gem::Specification.new do |s|
169
169
  end
170
170
  RUBY
171
171
  end
172
+
173
+ # Component example spec
174
+ Dir.mkdir File.join(new_component_dir, "spec")
175
+ fn = File.join("spec", "#{component_name}_spec.rb")
176
+ puts "- #{fn}: Example component spec"
177
+ File.open(File.join(new_component_dir, fn), "w") do |file|
178
+ file.puts <<-RUBY
179
+ require 'rubygems'
180
+ require 'bundler'
181
+ Bundler.setup
182
+ Bundler.require
183
+
184
+ require 'adhearsion/component_manager/spec_framework'
185
+
186
+ component_name.upcase = ComponentTester.new("#{component_name}", File.dirname(__FILE__) + "/../..")
187
+ RUBY
188
+ end
172
189
  puts "Created blank component '#{component_name}' at #{new_component_dir}"
173
190
  else
174
191
  raise CommandHandler::UnknownCommand.new("Provided too many arguments to 'create'")