Skip to content

Commit

Permalink
Merge branch 'release/2.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed Feb 3, 2014
2 parents ee0add5 + 829180e commit affc3ba
Show file tree
Hide file tree
Showing 61 changed files with 2,263 additions and 571 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
@@ -1,14 +1,14 @@
language: ruby
rvm:
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.0
- jruby-19mode
- rbx-19mode
- rbx-2.1.1
- ruby-head
matrix:
allow_failures:
- rvm: rbx-19mode
- rvm: rbx-2.1.1
- rvm: ruby-head
env: ARUBA_TIMEOUT=120 RAILS_ENV=development AHN_ENV=development
notifications:
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,34 @@
# [develop](https://github.com/adhearsion/adhearsion)

# [2.5.0](https://github.com/adhearsion/adhearsion/compare/v2.4.0...v2.5.0) - [2014-02-03](https://rubygems.org/gems/adhearsion/versions/2.5.0)
* **Change: Ruby 1.9.2 is no longer supported**
* Change: Set default call post-hangup lifetime to one second for better out of the box performance.
* Feature: Allow stopping all components executed by a controller when passing from it (`#hard_pass`) or at will (`#stop_all_components`)
* Feature: Generated plugins include a .gitignore file
* Feature: Detect something like "1234#" as characters instead of text
* Feature: Add `--empty` switch to app generator for power users. Generates an app with less fluff.
* Feature: Default generated applications with config appropriate for [Telephony Dev Box](http://github.com/mojolingo/Telephony-Dev-Box)
* Feature: Allow preventing automatic call hangup after controller completion. Set `Call#auto_hangup = false` prior to controller termination.
* Feature: Allow specifying a pre-join callback to #dial
* Feature: Allow specifying ringback to `#dial` as either a list or a proc
* Feature: Allow passing `:join_options` parameter to `#dial` to specify the kind of join to perform.
* Feature: Allow passing `:join_target` parameter to `#dial` to specify who to join to (eg a mixer).
* Feature: Generated apps now encourage storing most app code in `app/`, which is in the load path. Nothing in this directory is auto-loaded, but can be easily required without messy relative paths.
* Feature: Routes and event handlers are now split out of main config file for readability. They may be retained in the main config file for existing apps.
* Feature: Add `Call#end_code`, which specifies the platform code for the call end event.
* Feature: Allow XMPP messages to be sent via Punchblock
* Bugfix: Don't block shutdown waiting for the console to terminate
* Bugfix: Ensure that splitting a dial rejoined to an alternative target (eg a mixer) or merged with another dial can still be split properly.
* Bugfix: Ensure that hungup calls don't prevent dial splits/merges.
* Bugfix: Ensure that merged dials which are split and rejoined all get rejoined to the mixer.
* Bugfix: Ensure that `Call#peers` are correctly maintained - this was broken by Rayo moving to full call URIs in joined/unjoined events
* Bugfix: Ensure that failure to dial a call kills the actor
* Bugfix: Adhearsion call actors should do recursion detection on #inspect
* Bugfix: Fix controller block context on JRuby
* Bugfix: Require only Bundler groups appropriate to application environment
* Bugfix: Call event handlers now cannot crash the call, and no longer stop on return value
* Bugfix: Call controllers are gracefully terminated when a command is attempted against a dead call

# [2.4.0](https://github.com/adhearsion/adhearsion/compare/v2.3.5...v2.4.0) - [2013-08-29](https://rubygems.org/gems/adhearsion/versions/2.4.0)
* Deprecation: Ruby 1.9.2 support is deprecated and will be dropped in a future version of Adhearsion
* Deprecation: Some media options from Punchblock config are now overriden by other core config, and will eventually be removed.
Expand Down
2 changes: 0 additions & 2 deletions Gemfile
@@ -1,5 +1,3 @@
source 'https://rubygems.org'

gemspec

gem 'activesupport', '~> 3.0' if RUBY_VERSION == "1.9.2"
4 changes: 2 additions & 2 deletions Guardfile
@@ -1,15 +1,15 @@
ENV['SKIP_RCOV'] = 'true'

group 'rspec' do
guard 'rspec', :cli => '--format documentation' do
guard 'rspec', cmd: 'bundle exec rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec/" }
end
end

group 'cucumber' do
guard 'cucumber', :cli => '--profile guard' do
guard 'cucumber', :cli => '--profile guard', all_on_start: false do
watch(%r{^features/.+\.feature$})
watch(%r{^features/support/.+$}) { 'features' }
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
Expand Down
9 changes: 3 additions & 6 deletions README.markdown
Expand Up @@ -23,18 +23,15 @@ Adhearsion rests above a lower-level telephony platform, for example [Asterisk](

## Requirements

* Ruby 1.9.2+ or JRuby 1.7.0+
* Ruby 1.9.3+ or JRuby 1.7.0+
* [ruby_speech dependencies](https://github.com/benlangfeld/ruby_speech#dependencies)
* A VoIP platform:
* Asterisk 1.8+
* FreeSWITCH
* A Rayo server (Prism 11+ with rayo-server, or FreeSWITCH with mod_rayo)
* An interest in building cool new things

\* Support for Ruby 1.9.2 is deprecated, and requires locking your application to ActiveSupport 3.x as follows:

```ruby
gem 'active_support', '~> 3.0'
```
**Ruby 1.9.2 is no longer supported by Adhearsion or the Ruby core team. You should upgrade to Ruby 1.9.3 or Ruby 2 as a matter of urgency in order to continue receiving security fixes.**

## Install

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -29,7 +29,7 @@ end
begin
require 'yard'
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb'] + %w[README.markdown TODO.markdown LICENSE]
t.files = ['lib/**/*.rb']
end
rescue LoadError
STDERR.puts "\nCould not require() YARD! Install with 'gem install yard' to get the 'yardoc' task\n\n"
Expand Down
9 changes: 7 additions & 2 deletions adhearsion.gemspec
Expand Up @@ -12,6 +12,10 @@ Gem::Specification.new do |s|
s.summary = "Adhearsion, open-source telephony development framework"
s.description = "Adhearsion is an open-source telephony development framework"

s.license = 'MIT'

s.required_ruby_version = '>= 1.9.3'

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
Expand All @@ -25,11 +29,11 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'deep_merge'
s.add_runtime_dependency 'ffi', ["~> 1.0"]
s.add_runtime_dependency 'girl_friday'
s.add_runtime_dependency 'has-guarded-handlers', ["~> 1.5"]
s.add_runtime_dependency 'has-guarded-handlers', ["~> 1.6"]
s.add_runtime_dependency 'jruby-openssl' if RUBY_PLATFORM == 'java'
s.add_runtime_dependency 'logging', ["~> 1.8"]
s.add_runtime_dependency 'pry'
s.add_runtime_dependency 'punchblock', ["~> 2.0"]
s.add_runtime_dependency 'punchblock', ["~> 2.3"]
s.add_runtime_dependency 'rake'
s.add_runtime_dependency 'ruby_speech', ["~> 2.0"]
s.add_runtime_dependency 'thor', "~> 0.18.0"
Expand All @@ -43,6 +47,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'simplecov'
s.add_development_dependency 'simplecov-rcov'
s.add_development_dependency 'yard'
s.add_development_dependency 'guard-yard'
s.add_development_dependency 'coveralls'
s.add_development_dependency 'timecop'
end
49 changes: 0 additions & 49 deletions features/app_generator.feature

This file was deleted.

92 changes: 85 additions & 7 deletions features/cli_create.feature
Expand Up @@ -3,18 +3,96 @@ Feature: Adhearsion Ahn CLI (Create)
I want the ahn command to allow creating an app
So that I can write an Adhearsion app

Scenario: Command create with correct arguments
Scenario: Generate application with valid layout
When I run `ahn create path/somewhere`
And I cd to "path/somewhere"
Then the following files should exist:
| Gemfile |
| README.md |
| Rakefile |
Then the following directories should exist:
| app/call_controllers |
| lib |
| config |
| script |
| spec |
| spec/call_controllers |
| spec/support |

And the following files should exist:
| .gitignore |
| .rspec |
| app/call_controllers/simon_game.rb |
| config/adhearsion.rb |
| config/environment.rb |
| config/events.rb |
| config/routes.rb |
| Gemfile |
| script/ahn |
| spec/spec_helper.rb |
| spec/call_controllers/simon_game_spec.rb |
| README.md |
| Rakefile |
| Procfile |

And the file "config/adhearsion.rb" should contain each of these content parts:
"""
Adhearsion.config
logging.level
config.punchblock
"""
And the file "config/events.rb" should contain each of these content parts:
"""
Adhearsion::Events.draw do
"""
And the file "config/routes.rb" should contain each of these content parts:
"""
Adhearsion.router
"""
And the file "README.md" should contain each of these content parts:
"""
Start your new app with
AGI(agi
"""
And the file "Rakefile" should contain "adhearsion/tasks"
And the file "Gemfile" should contain each of these content parts:
"""
source 'https://rubygems.org
gem 'adhearsion-asr'
"""
And the file "app/call_controllers/simon_game.rb" should contain "class SimonGame"
And the file "script/ahn" should contain "require 'adhearsion'"

Scenario: Generate application --empty
When I run `ahn create path/somewhere --empty`
And I cd to "path/somewhere"
Then the following directories should exist:
| app/call_controllers |
| lib |
| config |
| script |
| spec |
| spec/call_controllers |
| spec/support |

And the following files should exist:
| .gitignore |
| .rspec |
| config/adhearsion.rb |
| config/environment.rb |
| config/events.rb |
| config/routes.rb |
| Gemfile |
| script/ahn |
| spec/spec_helper.rb |
And the file "config/adhearsion.rb" should contain "Adhearsion.router"
Then the exit status should be 0
| README.md |
| Rakefile |
| Procfile |

And the following files should not exist:
| app/call_controllers/simon_game.rb |
| spec/call_controllers/simon_game_spec.rb |

And the file "config/events.rb" should not contain each of these content parts:
"""
# Register global handlers for events
"""

Scenario: Running create with no arguments
When I run `ahn create`
Expand Down
4 changes: 4 additions & 0 deletions features/plugin_generator.feature
Expand Up @@ -11,6 +11,7 @@ Feature: Adhearsion plugin generator
| test_plugin/lib/test_plugin |
| test_plugin/spec |
And the following files should exist:
| test_plugin/.gitignore |
| test_plugin/test_plugin.gemspec |
| test_plugin/Rakefile |
| test_plugin/README.md |
Expand All @@ -21,6 +22,7 @@ Feature: Adhearsion plugin generator
| test_plugin/lib/test_plugin/controller_methods.rb |
| test_plugin/spec/spec_helper.rb |
| test_plugin/spec/test_plugin/controller_methods_spec.rb |
And the file "test_plugin/.gitignore" should contain "Gemfile.lock"
And the file "test_plugin/test_plugin.gemspec" should contain "test_plugin/version"
And the file "test_plugin/README.md" should contain "TestPlugin"
And the file "test_plugin/lib/test_plugin.rb" should contain each of these content parts:
Expand Down Expand Up @@ -62,6 +64,7 @@ Feature: Adhearsion plugin generator
| test_plugin/lib/test_plugin |
| test_plugin/spec |
And the following files should exist:
| test_plugin/.gitignore |
| test_plugin/test_plugin.gemspec |
| test_plugin/Rakefile |
| test_plugin/README.md |
Expand All @@ -72,6 +75,7 @@ Feature: Adhearsion plugin generator
| test_plugin/lib/test_plugin/controller_methods.rb |
| test_plugin/spec/spec_helper.rb |
| test_plugin/spec/test_plugin/controller_methods_spec.rb |
And the file "test_plugin/.gitignore" should contain "Gemfile.lock"
And the file "test_plugin/test_plugin.gemspec" should contain "test_plugin/version"
And the file "test_plugin/README.md" should contain "TestPlugin"
And the file "test_plugin/lib/test_plugin.rb" should contain each of these content parts:
Expand Down
9 changes: 8 additions & 1 deletion features/step_definitions/app_generator_steps.rb
@@ -1,8 +1,15 @@
# encoding: utf-8

Then /^the file "([^"]*)" should contain each of these content parts:$/ do |file, content_parts|
parts = content_parts.split
parts = content_parts.split("\n")
parts.each do |p|
steps %Q{Then the file "#{file}" should contain "#{p}"}
end
end

Then /^the file "([^"]*)" should not contain each of these content parts:$/ do |file, content_parts|
parts = content_parts.split("\n")
parts.each do |p|
steps %Q{Then the file "#{file}" should not contain "#{p}"}
end
end
9 changes: 6 additions & 3 deletions lib/adhearsion.rb
@@ -1,6 +1,6 @@
# encoding: utf-8

abort "ERROR: You are running Adhearsion on an unsupported version of Ruby (Ruby #{RUBY_VERSION} #{RUBY_RELEASE_DATE})! Please upgrade to at least Ruby v1.9.2, JRuby 1.7.0 or Rubinius 2.0." if RUBY_VERSION < "1.9.2"
abort "ERROR: You are running Adhearsion on an unsupported version of Ruby (Ruby #{RUBY_VERSION} #{RUBY_RELEASE_DATE})! Please upgrade to at least Ruby v1.9.3, JRuby 1.7.0 or Rubinius 2.0." if RUBY_VERSION < "1.9.3"

%w{
active_support/all
Expand Down Expand Up @@ -71,8 +71,7 @@ def deprecated(new_method)

def initialize_config
_config = Configuration.new
env = ENV['AHN_ENV'] || ENV['RAILS_ENV']
env = env.to_sym if env.respond_to? :to_sym
env = environment.to_sym if environment.respond_to? :to_sym
unless _config.valid_environment? env
puts "You tried to initialize with an invalid environment name #{env}. Valid values are #{_config.valid_environments}."
env = nil
Expand All @@ -81,6 +80,10 @@ def initialize_config
_config
end

def environment
ENV['AHN_ENV'] || ENV['RAILS_ENV'] || :development
end

def environments
config.valid_environments
end
Expand Down

0 comments on commit affc3ba

Please sign in to comment.