rene-adhearsion 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. data/CHANGELOG +73 -0
  2. data/EVENTS +11 -0
  3. data/LICENSE +456 -0
  4. data/Rakefile +130 -0
  5. data/adhearsion.gemspec +173 -0
  6. data/app_generators/ahn/USAGE +5 -0
  7. data/app_generators/ahn/ahn_generator.rb +96 -0
  8. data/app_generators/ahn/templates/.ahnrc +34 -0
  9. data/app_generators/ahn/templates/README +8 -0
  10. data/app_generators/ahn/templates/Rakefile +25 -0
  11. data/app_generators/ahn/templates/components/ami_remote/ami_remote.rb +15 -0
  12. data/app_generators/ahn/templates/components/disabled/HOW_TO_ENABLE +7 -0
  13. data/app_generators/ahn/templates/components/disabled/restful_rpc/README.markdown +11 -0
  14. data/app_generators/ahn/templates/components/disabled/restful_rpc/example-client.rb +48 -0
  15. data/app_generators/ahn/templates/components/disabled/restful_rpc/restful_rpc.rb +91 -0
  16. data/app_generators/ahn/templates/components/disabled/restful_rpc/restful_rpc.yml +34 -0
  17. data/app_generators/ahn/templates/components/disabled/restful_rpc/spec/restful_rpc_spec.rb +263 -0
  18. data/app_generators/ahn/templates/components/disabled/sandbox/sandbox.rb +104 -0
  19. data/app_generators/ahn/templates/components/disabled/sandbox/sandbox.yml +2 -0
  20. data/app_generators/ahn/templates/components/disabled/stomp_gateway/README.markdown +47 -0
  21. data/app_generators/ahn/templates/components/disabled/stomp_gateway/stomp_gateway.rb +34 -0
  22. data/app_generators/ahn/templates/components/disabled/stomp_gateway/stomp_gateway.yml +12 -0
  23. data/app_generators/ahn/templates/components/disabled/xmpp_gateway/README.markdown +3 -0
  24. data/app_generators/ahn/templates/components/disabled/xmpp_gateway/xmpp_gateway.rb +11 -0
  25. data/app_generators/ahn/templates/components/disabled/xmpp_gateway/xmpp_gateway.yml +0 -0
  26. data/app_generators/ahn/templates/components/simon_game/simon_game.rb +56 -0
  27. data/app_generators/ahn/templates/config/startup.rb +83 -0
  28. data/app_generators/ahn/templates/dialplan.rb +3 -0
  29. data/app_generators/ahn/templates/events.rb +32 -0
  30. data/bin/ahn +28 -0
  31. data/bin/ahnctl +68 -0
  32. data/bin/jahn +42 -0
  33. data/examples/asterisk_manager_interface/standalone.rb +51 -0
  34. data/lib/adhearsion.rb +45 -0
  35. data/lib/adhearsion/cli.rb +228 -0
  36. data/lib/adhearsion/component_manager.rb +272 -0
  37. data/lib/adhearsion/component_manager/component_tester.rb +55 -0
  38. data/lib/adhearsion/component_manager/spec_framework.rb +24 -0
  39. data/lib/adhearsion/events_support.rb +84 -0
  40. data/lib/adhearsion/foundation/all.rb +15 -0
  41. data/lib/adhearsion/foundation/blank_slate.rb +3 -0
  42. data/lib/adhearsion/foundation/custom_daemonizer.rb +45 -0
  43. data/lib/adhearsion/foundation/event_socket.rb +204 -0
  44. data/lib/adhearsion/foundation/future_resource.rb +36 -0
  45. data/lib/adhearsion/foundation/metaprogramming.rb +17 -0
  46. data/lib/adhearsion/foundation/numeric.rb +13 -0
  47. data/lib/adhearsion/foundation/pseudo_guid.rb +10 -0
  48. data/lib/adhearsion/foundation/relationship_properties.rb +42 -0
  49. data/lib/adhearsion/foundation/string.rb +26 -0
  50. data/lib/adhearsion/foundation/synchronized_hash.rb +96 -0
  51. data/lib/adhearsion/foundation/thread_safety.rb +7 -0
  52. data/lib/adhearsion/host_definitions.rb +67 -0
  53. data/lib/adhearsion/initializer.rb +395 -0
  54. data/lib/adhearsion/initializer/asterisk.rb +87 -0
  55. data/lib/adhearsion/initializer/configuration.rb +321 -0
  56. data/lib/adhearsion/initializer/database.rb +60 -0
  57. data/lib/adhearsion/initializer/drb.rb +31 -0
  58. data/lib/adhearsion/initializer/freeswitch.rb +22 -0
  59. data/lib/adhearsion/initializer/ldap.rb +57 -0
  60. data/lib/adhearsion/initializer/rails.rb +41 -0
  61. data/lib/adhearsion/initializer/xmpp.rb +42 -0
  62. data/lib/adhearsion/logging.rb +92 -0
  63. data/lib/adhearsion/tasks.rb +16 -0
  64. data/lib/adhearsion/tasks/database.rb +5 -0
  65. data/lib/adhearsion/tasks/deprecations.rb +59 -0
  66. data/lib/adhearsion/tasks/generating.rb +20 -0
  67. data/lib/adhearsion/tasks/lint.rb +4 -0
  68. data/lib/adhearsion/tasks/testing.rb +37 -0
  69. data/lib/adhearsion/version.rb +33 -0
  70. data/lib/adhearsion/voip/asterisk.rb +4 -0
  71. data/lib/adhearsion/voip/asterisk/agi_server.rb +115 -0
  72. data/lib/adhearsion/voip/asterisk/commands.rb +1510 -0
  73. data/lib/adhearsion/voip/asterisk/config_generators/agents.conf.rb +140 -0
  74. data/lib/adhearsion/voip/asterisk/config_generators/config_generator.rb +101 -0
  75. data/lib/adhearsion/voip/asterisk/config_generators/queues.conf.rb +250 -0
  76. data/lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb +240 -0
  77. data/lib/adhearsion/voip/asterisk/config_manager.rb +71 -0
  78. data/lib/adhearsion/voip/asterisk/manager_interface.rb +705 -0
  79. data/lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb +1680 -0
  80. data/lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb +340 -0
  81. data/lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb +78 -0
  82. data/lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl +87 -0
  83. data/lib/adhearsion/voip/asterisk/special_dial_plan_managers.rb +80 -0
  84. data/lib/adhearsion/voip/asterisk/super_manager.rb +19 -0
  85. data/lib/adhearsion/voip/call.rb +497 -0
  86. data/lib/adhearsion/voip/call_routing.rb +64 -0
  87. data/lib/adhearsion/voip/commands.rb +9 -0
  88. data/lib/adhearsion/voip/constants.rb +39 -0
  89. data/lib/adhearsion/voip/conveniences.rb +18 -0
  90. data/lib/adhearsion/voip/dial_plan.rb +246 -0
  91. data/lib/adhearsion/voip/dsl/dialing_dsl.rb +151 -0
  92. data/lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb +37 -0
  93. data/lib/adhearsion/voip/dsl/dialplan/control_passing_exception.rb +27 -0
  94. data/lib/adhearsion/voip/dsl/dialplan/dispatcher.rb +124 -0
  95. data/lib/adhearsion/voip/dsl/dialplan/parser.rb +69 -0
  96. data/lib/adhearsion/voip/dsl/dialplan/thread_mixin.rb +16 -0
  97. data/lib/adhearsion/voip/dsl/numerical_string.rb +115 -0
  98. data/lib/adhearsion/voip/freeswitch/basic_connection_manager.rb +48 -0
  99. data/lib/adhearsion/voip/freeswitch/event_handler.rb +58 -0
  100. data/lib/adhearsion/voip/freeswitch/freeswitch_dialplan_command_factory.rb +129 -0
  101. data/lib/adhearsion/voip/freeswitch/inbound_connection_manager.rb +38 -0
  102. data/lib/adhearsion/voip/freeswitch/oes_server.rb +195 -0
  103. data/lib/adhearsion/voip/menu_state_machine/calculated_match.rb +80 -0
  104. data/lib/adhearsion/voip/menu_state_machine/matchers.rb +123 -0
  105. data/lib/adhearsion/voip/menu_state_machine/menu_builder.rb +58 -0
  106. data/lib/adhearsion/voip/menu_state_machine/menu_class.rb +149 -0
  107. data/lib/adhearsion/xmpp/connection.rb +61 -0
  108. data/lib/theatre.rb +151 -0
  109. data/lib/theatre/README.markdown +64 -0
  110. data/lib/theatre/callback_definition_loader.rb +84 -0
  111. data/lib/theatre/guid.rb +23 -0
  112. data/lib/theatre/invocation.rb +121 -0
  113. data/lib/theatre/namespace_manager.rb +153 -0
  114. data/lib/theatre/version.rb +2 -0
  115. metadata +241 -0
data/Rakefile ADDED
@@ -0,0 +1,130 @@
1
+ # -*- ruby -*-
2
+ ENV['RUBY_FLAGS'] = "-I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}"
3
+
4
+ require 'rubygems'
5
+ require 'rake/gempackagetask'
6
+ require 'rake/testtask'
7
+ require 'date'
8
+
9
+ begin
10
+ gem 'rspec', '<2.0.0'
11
+ require 'spec/rake/spectask'
12
+ rescue LoadError
13
+ abort "You must install RSpec 1.3: sudo gem install rspec -v'<2.0.0'"
14
+ end
15
+
16
+ begin
17
+ require 'yard'
18
+ YARD::Rake::YardocTask.new do |t|
19
+ t.files = ['lib/**/*.rb'] + %w[README.markdown TODO.markdown LICENSE]
20
+ end
21
+ rescue LoadError
22
+ STDERR.puts "\nCould not require() YARD! Install with 'gem install yard' to get the 'yardoc' task\n\n"
23
+ end
24
+
25
+ require 'lib/adhearsion/version'
26
+
27
+ AHN_TESTS = ['spec/**/test_*.rb']
28
+ GEMSPEC = eval File.read("adhearsion.gemspec")
29
+ RAGEL_FILES = %w[lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb]
30
+ THEATRE_TESTS = 'theatre-spec/**/*_spec.rb'
31
+
32
+ begin
33
+ require 'rcov/rcovtask'
34
+ Rcov::RcovTask.new do |t|
35
+ t.test_files = Dir[*AHN_TESTS]
36
+ t.output_dir = 'coverage'
37
+ t.verbose = true
38
+ t.rcov_opts.concat %w[--sort coverage --sort-reverse -x gems -x /var --no-validator-links]
39
+ end
40
+ rescue LoadError
41
+ STDERR.puts "Could not load rcov tasks -- rcov does not appear to be installed. Continuing anyway."
42
+ end
43
+
44
+ Rake::GemPackageTask.new(GEMSPEC).define
45
+
46
+ # YARD::Rake::YardocTask.new do |t|
47
+ # t.files = ['lib/**/*.rb'] # optional
48
+ # # t.options = ['--any', '--extra', '--opts'] # optional
49
+ # end
50
+
51
+ Rake::TestTask.new('spec') do |t|
52
+ t.verbose = true
53
+ t.pattern = AHN_TESTS
54
+ end
55
+
56
+ task :default => :spec
57
+
58
+ desc "Check Ragel version"
59
+ task :check_ragel_version do
60
+ ragel_version_match = `ragel --version`.match(/(\d)\.(\d)+/)
61
+ abort "Could not get Ragel version! Is it installed? You must have at least version 6.3" unless ragel_version_match
62
+ big, small = ragel_version_match.captures.map { |n| n.to_i }
63
+ if big < 6 || (big == 6 && small < 3)
64
+ abort "Please upgrade Ragel! You're on version #{ragel_version_match[0]} and must be on 6.3 or later"
65
+ end
66
+ end
67
+
68
+ desc "Used to regenerate the AMI source code files. Note: requires Ragel 6.3 or later be installed on your system"
69
+ task :ragel => :check_ragel_version do
70
+ RAGEL_FILES.each do |ragel_file|
71
+ ruby_file = ragel_file.sub(".rl.rb", ".rb")
72
+ puts `ragel -n -R #{ragel_file} -o #{ruby_file} 2>&1`
73
+ raise "Failed generating code from Ragel file #{ragel_file}" if $?.to_i.nonzero?
74
+ end
75
+ end
76
+
77
+ desc "Generates a GraphVis document showing the Ragel state machine"
78
+ task :visualize_ragel => :check_ragel_version do
79
+ RAGEL_FILES.each do |ragel_file|
80
+ base_name = File.basename ragel_file, ".rl.rb"
81
+ puts "ragel -V #{ragel_file} -o #{base_name}.dot 2>&1"
82
+ puts `ragel -V #{ragel_file} -o #{base_name}.dot 2>&1`
83
+ raise "Failed generating code from Ragel file #{ragel_file}" if $?.to_i.nonzero?
84
+ end
85
+ end
86
+
87
+ desc "Run all RSpecs for Theatre"
88
+ Spec::Rake::SpecTask.new("theatre_specs") do |t|
89
+ t.spec_files = FileList[THEATRE_TESTS]
90
+ end
91
+
92
+ desc "Compares Adhearsion's files with those listed in adhearsion.gemspec"
93
+ task :check_gemspec_files do
94
+
95
+ files_from_gemspec = ADHEARSION_FILES
96
+ files_from_filesystem = Dir.glob(File.dirname(__FILE__) + "/**/*").map do |filename|
97
+ filename[0...Dir.pwd.length] == Dir.pwd ? filename[(Dir.pwd.length+1)..-1] : filename
98
+ end
99
+ files_from_filesystem.reject! { |f| File.directory? f }
100
+
101
+ puts
102
+ puts 'Pipe this command to "grep -v \'spec/\' | grep -v test" to ignore test files'
103
+ puts
104
+ puts '##########################################'
105
+ puts '## Files on filesystem not in the gemspec:'
106
+ puts '##########################################'
107
+ puts((files_from_filesystem - files_from_gemspec).map { |f| " " + f })
108
+
109
+
110
+ puts '##########################################'
111
+ puts '## Files in gemspec not in the filesystem:'
112
+ puts '##########################################'
113
+ puts((files_from_gemspec - files_from_filesystem).map { |f| " " + f })
114
+ end
115
+
116
+ desc "Test that the .gemspec file executes"
117
+ task :debug_gem do
118
+ require 'rubygems/specification'
119
+ gemspec = File.read('adhearsion.gemspec')
120
+ spec = nil
121
+ Thread.new { spec = eval("$SAFE = 3\n#{gemspec}") }.join
122
+ puts "SUCCESS: Gemspec runs at the $SAFE level 3."
123
+ end
124
+
125
+ desc 'Install the package as a gem.'
126
+ task :install_gem => [:clobber_package, :package] do
127
+ windows = /djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM
128
+ gem = Dir['pkg/*.gem'].first
129
+ sh "#{'sudo ' unless windows}gem install --local #{gem}"
130
+ end
@@ -0,0 +1,173 @@
1
+ ADHEARSION_FILES = %w{
2
+ adhearsion.gemspec
3
+ app_generators/ahn/ahn_generator.rb
4
+ app_generators/ahn/templates/.ahnrc
5
+ app_generators/ahn/templates/components/ami_remote/ami_remote.rb
6
+ app_generators/ahn/templates/components/disabled/HOW_TO_ENABLE
7
+ app_generators/ahn/templates/components/disabled/stomp_gateway/stomp_gateway.yml
8
+ app_generators/ahn/templates/components/disabled/stomp_gateway/README.markdown
9
+ app_generators/ahn/templates/components/disabled/stomp_gateway/stomp_gateway.rb
10
+ app_generators/ahn/templates/components/disabled/sandbox/sandbox.rb
11
+ app_generators/ahn/templates/components/disabled/sandbox/sandbox.yml
12
+ app_generators/ahn/templates/components/disabled/restful_rpc/restful_rpc.yml
13
+ app_generators/ahn/templates/components/disabled/restful_rpc/example-client.rb
14
+ app_generators/ahn/templates/components/disabled/restful_rpc/README.markdown
15
+ app_generators/ahn/templates/components/disabled/restful_rpc/restful_rpc.rb
16
+ app_generators/ahn/templates/components/disabled/restful_rpc/spec/restful_rpc_spec.rb
17
+ app_generators/ahn/templates/components/disabled/xmpp_gateway/xmpp_gateway.rb
18
+ app_generators/ahn/templates/components/disabled/xmpp_gateway/xmpp_gateway.yml
19
+ app_generators/ahn/templates/components/disabled/xmpp_gateway/README.markdown
20
+ app_generators/ahn/templates/components/simon_game/simon_game.rb
21
+ app_generators/ahn/templates/config/startup.rb
22
+ app_generators/ahn/templates/dialplan.rb
23
+ app_generators/ahn/templates/events.rb
24
+ app_generators/ahn/templates/Rakefile
25
+ app_generators/ahn/templates/README
26
+ app_generators/ahn/USAGE
27
+ bin/ahn
28
+ bin/ahnctl
29
+ bin/jahn
30
+ CHANGELOG
31
+ EVENTS
32
+ examples/asterisk_manager_interface/standalone.rb
33
+ lib/adhearsion.rb
34
+ lib/adhearsion/cli.rb
35
+ lib/adhearsion/component_manager.rb
36
+ lib/adhearsion/component_manager/component_tester.rb
37
+ lib/adhearsion/component_manager/spec_framework.rb
38
+ lib/adhearsion/events_support.rb
39
+ lib/adhearsion/foundation/all.rb
40
+ lib/adhearsion/foundation/blank_slate.rb
41
+ lib/adhearsion/foundation/custom_daemonizer.rb
42
+ lib/adhearsion/foundation/event_socket.rb
43
+ lib/adhearsion/foundation/future_resource.rb
44
+ lib/adhearsion/foundation/metaprogramming.rb
45
+ lib/adhearsion/foundation/numeric.rb
46
+ lib/adhearsion/foundation/pseudo_guid.rb
47
+ lib/adhearsion/foundation/relationship_properties.rb
48
+ lib/adhearsion/foundation/string.rb
49
+ lib/adhearsion/foundation/synchronized_hash.rb
50
+ lib/adhearsion/foundation/thread_safety.rb
51
+ lib/adhearsion/host_definitions.rb
52
+ lib/adhearsion/initializer.rb
53
+ lib/adhearsion/initializer/asterisk.rb
54
+ lib/adhearsion/initializer/configuration.rb
55
+ lib/adhearsion/initializer/database.rb
56
+ lib/adhearsion/initializer/ldap.rb
57
+ lib/adhearsion/initializer/drb.rb
58
+ lib/adhearsion/initializer/freeswitch.rb
59
+ lib/adhearsion/initializer/rails.rb
60
+ lib/adhearsion/initializer/xmpp.rb
61
+ lib/adhearsion/logging.rb
62
+ lib/adhearsion/tasks.rb
63
+ lib/adhearsion/tasks/database.rb
64
+ lib/adhearsion/tasks/deprecations.rb
65
+ lib/adhearsion/tasks/generating.rb
66
+ lib/adhearsion/tasks/lint.rb
67
+ lib/adhearsion/tasks/testing.rb
68
+ lib/adhearsion/version.rb
69
+ lib/adhearsion/voip/asterisk.rb
70
+ lib/adhearsion/voip/asterisk/agi_server.rb
71
+ lib/adhearsion/voip/asterisk/commands.rb
72
+ lib/adhearsion/voip/asterisk/config_generators/agents.conf.rb
73
+ lib/adhearsion/voip/asterisk/config_generators/config_generator.rb
74
+ lib/adhearsion/voip/asterisk/config_generators/queues.conf.rb
75
+ lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb
76
+ lib/adhearsion/voip/asterisk/config_manager.rb
77
+ lib/adhearsion/voip/asterisk/manager_interface.rb
78
+ lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb
79
+ lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb
80
+ lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb
81
+ lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl
82
+ lib/adhearsion/voip/asterisk/special_dial_plan_managers.rb
83
+ lib/adhearsion/voip/asterisk/super_manager.rb
84
+ lib/adhearsion/voip/call.rb
85
+ lib/adhearsion/voip/call_routing.rb
86
+ lib/adhearsion/voip/commands.rb
87
+ lib/adhearsion/voip/constants.rb
88
+ lib/adhearsion/voip/conveniences.rb
89
+ lib/adhearsion/voip/dial_plan.rb
90
+ lib/adhearsion/voip/dsl/dialing_dsl.rb
91
+ lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
92
+ lib/adhearsion/voip/dsl/dialplan/control_passing_exception.rb
93
+ lib/adhearsion/voip/dsl/dialplan/dispatcher.rb
94
+ lib/adhearsion/voip/dsl/dialplan/parser.rb
95
+ lib/adhearsion/voip/dsl/dialplan/thread_mixin.rb
96
+ lib/adhearsion/voip/dsl/numerical_string.rb
97
+ lib/adhearsion/voip/freeswitch/basic_connection_manager.rb
98
+ lib/adhearsion/voip/freeswitch/event_handler.rb
99
+ lib/adhearsion/voip/freeswitch/freeswitch_dialplan_command_factory.rb
100
+ lib/adhearsion/voip/freeswitch/inbound_connection_manager.rb
101
+ lib/adhearsion/voip/freeswitch/oes_server.rb
102
+ lib/adhearsion/voip/menu_state_machine/calculated_match.rb
103
+ lib/adhearsion/voip/menu_state_machine/matchers.rb
104
+ lib/adhearsion/voip/menu_state_machine/menu_builder.rb
105
+ lib/adhearsion/voip/menu_state_machine/menu_class.rb
106
+ lib/adhearsion/xmpp/connection.rb
107
+ lib/theatre.rb
108
+ lib/theatre/callback_definition_loader.rb
109
+ lib/theatre/guid.rb
110
+ lib/theatre/invocation.rb
111
+ lib/theatre/namespace_manager.rb
112
+ lib/theatre/README.markdown
113
+ lib/theatre/version.rb
114
+ LICENSE
115
+ Rakefile
116
+ }
117
+
118
+ Gem::Specification.new do |s|
119
+ s.name = "rene-adhearsion"
120
+ s.version = "0.8.6"
121
+
122
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
123
+ s.authors = ["Jay Phillips", "Jason Goecke", "Ben Klang"]
124
+
125
+ s.date = Date.today.to_s
126
+ s.description = "Adhearsion is an open-source telephony development framework"
127
+ s.email = "dev&Adhearsion.com"
128
+ s.executables = ["ahn", "ahnctl", "jahn"]
129
+
130
+ s.files = ADHEARSION_FILES
131
+
132
+ s.has_rdoc = true
133
+ s.homepage = "http://adhearsion.com"
134
+ s.require_paths = ["lib"]
135
+ s.rubyforge_project = "adhearsion"
136
+ s.rubygems_version = "1.2.0"
137
+ s.summary = "Adhearsion, open-source telephony development framework"
138
+ s.post_install_message =<<-EOM
139
+ *******************************************************************
140
+ * NOTE: You must manually install the "rubigen" gem to create *
141
+ * new Adhearsion applications. *
142
+ * *
143
+ * The Rubigen package is no longer automatically installed due to *
144
+ * dependency conflicts with ActiveSupport 3.0. *
145
+ * Users of existing Adhearsion applications can safely ignore *
146
+ * this message. *
147
+ *******************************************************************
148
+ EOM
149
+
150
+ if s.respond_to? :specification_version then
151
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
152
+ s.specification_version = 2
153
+
154
+ if current_version >= 3 then
155
+ # Runtime dependencies
156
+ s.add_runtime_dependency("log4r", [">= 1.0.5"])
157
+ s.add_runtime_dependency("activesupport", [">= 2.1.0"])
158
+
159
+ # Development dependencies
160
+ s.add_development_dependency('rubigen', [">= 1.0.6"])
161
+ s.add_development_dependency('rspec', ["< 2.0.0"])
162
+ s.add_development_dependency('test-unit')
163
+ s.add_development_dependency('flexmock')
164
+ s.add_development_dependency('active_record')
165
+ else
166
+ s.add_dependency("log4r", [">= 1.0.5"])
167
+ s.add_dependency("activesupport", [">= 2.1.0"])
168
+ end
169
+ else
170
+ s.add_dependency("log4r", [">= 1.0.5"])
171
+ s.add_dependency("activesupport", [">= 2.1.0"])
172
+ end
173
+ end
@@ -0,0 +1,5 @@
1
+ Description:
2
+
3
+
4
+ Usage:
5
+
@@ -0,0 +1,96 @@
1
+ class AhnGenerator < RubiGen::Base
2
+
3
+ DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
4
+ Config::CONFIG['ruby_install_name'])
5
+
6
+ default_options :author => nil
7
+
8
+ attr_reader :name, :component
9
+
10
+ def initialize(runtime_args, runtime_options = {})
11
+ super
12
+ usage if args.empty?
13
+ @destination_root = File.expand_path(args.shift)
14
+ @name = base_name
15
+ @component = 'simon_game'
16
+ extract_options
17
+ end
18
+
19
+ def manifest
20
+ record do |m|
21
+ # Ensure appropriate folder(s) exists
22
+ m.directory ''
23
+ BASEDIRS.each { |path| m.directory path }
24
+
25
+ m.file *[".ahnrc"]*2
26
+
27
+ m.file *["components/simon_game/simon_game.rb"]*2
28
+ m.file *["components/ami_remote/ami_remote.rb"]*2
29
+
30
+ m.file *["components/disabled/xmpp_gateway/xmpp_gateway.rb"]*2
31
+ m.file *["components/disabled/xmpp_gateway/xmpp_gateway.yml"]*2
32
+ m.file *["components/disabled/xmpp_gateway/README.markdown"]*2
33
+
34
+ m.file *["components/disabled/stomp_gateway/stomp_gateway.rb"]*2
35
+ m.file *["components/disabled/stomp_gateway/stomp_gateway.yml"]*2
36
+ m.file *["components/disabled/stomp_gateway/README.markdown"]*2
37
+
38
+ m.file *["components/disabled/restful_rpc/restful_rpc.rb"]*2
39
+ m.file *["components/disabled/restful_rpc/restful_rpc.yml"]*2
40
+ m.file *["components/disabled/restful_rpc/README.markdown"]*2
41
+ m.file *["components/disabled/restful_rpc/example-client.rb"]*2
42
+ m.file *["components/disabled/restful_rpc/spec/restful_rpc_spec.rb"]*2
43
+
44
+ m.file *["components/disabled/sandbox/sandbox.yml"]*2
45
+ m.file *["components/disabled/sandbox/sandbox.rb"]*2
46
+
47
+ m.file *["config/startup.rb"]*2
48
+ m.file *["dialplan.rb"]*2
49
+ m.file *["events.rb"]*2
50
+ m.file *["README"]*2
51
+ m.file *["Rakefile"]*2
52
+
53
+ # m.dependency "install_rubigen_scripts", [destination_root, 'ahn', 'adhearsion', 'test_spec'],
54
+ # :shebang => options[:shebang], :collision => :force
55
+ end
56
+ end
57
+
58
+ protected
59
+ def banner
60
+ <<-EOS
61
+ Creates a ...
62
+
63
+ USAGE: #{spec.name} name"
64
+ EOS
65
+ end
66
+
67
+ def add_options!(opts)
68
+ opts.separator ''
69
+ opts.separator 'Options:'
70
+ # For each option below, place the default
71
+ # at the top of the file next to "default_options"
72
+ # opts.on("-a", "--author=\"Your Name\"", String,
73
+ # "Some comment about this option",
74
+ # "Default: none") { |options[:author]| }
75
+ opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
76
+ end
77
+
78
+ def extract_options
79
+ # for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
80
+ # Templates can access these value via the attr_reader-generated methods, but not the
81
+ # raw instance variable value.
82
+ # @author = options[:author]
83
+ end
84
+
85
+ # Installation skeleton. Intermediate directories are automatically
86
+ # created so don't sweat their absence here.
87
+ BASEDIRS = %w(
88
+ components/simon_game
89
+ components/disabled/stomp_gateway
90
+ components/disabled/xmpp_gateway
91
+ components/disabled/sandbox
92
+ components/ami_remote
93
+ components/disabled/restful_rpc/spec
94
+ config
95
+ )
96
+ end
@@ -0,0 +1,34 @@
1
+ # Adhearsion Runtime Configuration.
2
+
3
+ # You can use the "gems" section to force Adhearsion to load a particular version of a gem.
4
+ # This is useful when a component require()s a gem, but you don't want it to use the latest one installed on the system.
5
+ # For example, if a component require()s activerecord, sucking in the latest on the system, and then you enable a Rails app
6
+ # which wants a particular version of activerecord, RubyGems will raise an error saying "you cannot activate two versions of
7
+ # the same gem". Note: specifying the version, source and require names is optional, but you must include a : after the gem name to make it a YAML key/value pair (with a nil value).
8
+ gems:
9
+ # twitter:
10
+ # hpricot:
11
+ # rack:
12
+ # # require() one library when initializing:
13
+ # require: rack
14
+ # memcache-client:
15
+ # version >= 1.5.2
16
+ # require:
17
+ # # require() an Array of libraries when initializing:
18
+ # - memcache
19
+ # - memcache_util
20
+ # activerecord:
21
+ # version: >= 2.1.0
22
+ # aasm:
23
+ # source: http://gems.github.com
24
+
25
+ paths:
26
+
27
+ # All paths are relative to this file's directory
28
+ init: config/startup.rb
29
+
30
+ dialplan: dialplan.rb
31
+
32
+ events: events.rb
33
+
34
+ models: models/*.rb
@@ -0,0 +1,8 @@
1
+ Start your new app with "ahn start /path/to/your/app"
2
+
3
+ If you wish to use Adhearsion to control Asterisk's dialplan,
4
+ change the contexts you wish to be affected in your
5
+ /etc/asterisk/extensions.conf file to the following:
6
+
7
+ [your_context_name]
8
+ exten => _X.,1,AGI(agi://1.2.3.4) ; This IP here