Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Adhearsion 3 #2

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ahnsay.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {spec}/*`.split("\n")
s.require_paths = ["lib"]

s.add_runtime_dependency %q<adhearsion>, ["~> 2.1"]
s.add_runtime_dependency %q<adhearsion>, ["~> 3.0.0.rc1"]
s.add_runtime_dependency %q<activesupport>, [">= 3.0.10"]

s.add_development_dependency %q<bundler>, ["~> 1.0"]
Expand Down
4 changes: 2 additions & 2 deletions lib/ahnsay.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ def sound_path(name)
# Massages the file path depending on platform
#
def multi_path(path)
path = path.chomp(File.extname(path)) if Adhearsion.config.punchblock.platform == :asterisk
path = "file://" + path if Adhearsion.config.punchblock.platform == :xmpp
path = path.chomp(File.extname(path)) if Adhearsion.config.core.type == :asterisk
path = "file://" + path if Adhearsion.config.core.type == :xmpp
path
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/ahnsay/controller_methods_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestController < Adhearsion::CallController
end

before :each do
Adhearsion.stub_chain("config.punchblock.platform").and_return(:foo)
Adhearsion.stub_chain("config.core.type").and_return(:foo)
Adhearsion.stub_chain("config.ahnsay.sounds_dir").and_return("sounds")
end

Expand Down
10 changes: 5 additions & 5 deletions spec/ahnsay_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

describe "sounds_for_time" do
before :each do
Adhearsion.stub_chain("config.punchblock.platform").and_return(:foo)
Adhearsion.stub_chain("config.core.type").and_return(:foo)
Adhearsion.stub_chain("config.ahnsay.sounds_dir").and_return("sounds")
end
let(:time) { Time.new(2012, 11, 10, 4, 15, 22) }
Expand All @@ -30,7 +30,7 @@

describe "sounds_for_digits" do
before :each do
Adhearsion.stub_chain("config.punchblock.platform").and_return(:foo)
Adhearsion.stub_chain("config.core.type").and_return(:foo)
Adhearsion.stub_chain("config.ahnsay.sounds_dir").and_return("sounds")
end
let(:number) { "4041" }
Expand All @@ -42,7 +42,7 @@

context "TTS support methods" do
before :each do
Adhearsion.stub_chain("config.punchblock.platform").and_return(:foo)
Adhearsion.stub_chain("config.core.type").and_return(:foo)
Adhearsion.stub_chain("config.ahnsay.sounds_dir").and_return("sounds")
end
describe "#file_for_day" do
Expand Down Expand Up @@ -186,7 +186,7 @@
describe "#sound_path" do
let(:sound_file) { "beep.ul" }
it "returns the proper path" do
Adhearsion.stub_chain("config.punchblock.platform").and_return(:foo)
Adhearsion.stub_chain("config.core.type").and_return(:foo)
Adhearsion.stub_chain("config.ahnsay.sounds_dir").and_return("sounds")
subject.sound_path(sound_file).should == File.join(Adhearsion.config.ahnsay.sounds_dir, sound_file)
end
Expand All @@ -195,7 +195,7 @@
describe "#multi_path" do
let(:path) { "/my/sounds/hello.wav" }
before :each do
Adhearsion.stub_chain("config.punchblock.platform").and_return(platform)
Adhearsion.stub_chain("config.core.type").and_return(platform)
end
context "on Asterisk" do
let(:platform) { :asterisk }
Expand Down