adhearsion-i18n 0.0.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +18 -0
- data/CHANGELOG.md +5 -0
- data/adhearsion-i18n.gemspec +1 -1
- data/lib/adhearsion-i18n/call_controller_methods.rb +1 -7
- data/lib/adhearsion-i18n/plugin.rb +1 -1
- data/lib/adhearsion-i18n/version.rb +1 -1
- data/spec/call_controller_methods_spec.rb +4 -4
- data/spec/spec_helper.rb +2 -2
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79005968c66bcf1ef587307ebaae06be42972c67
|
4
|
+
data.tar.gz: da2fb5366e88060c16d4fbc09afc5df4556d9637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e710dc85d9c4ba4ad5acb647143486be7760f3f8740ecafefce9e81eb5de03c1303b91c9a69f62b8e602238f13407b1f8c84f37d9f21d552e49567982488c92b
|
7
|
+
data.tar.gz: 6ad98758e99d7c6a11d9281f61721ab1a449ffc4d8da3511dc45bbbb49d972c72db0d06d2ce0751cdc35ed54635fa19bbfa2e7b53264385c168ba28ad1b811d8
|
data/.travis.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 1.9.3
|
4
|
+
- 2.0.0
|
5
|
+
- 2.1.0
|
6
|
+
- jruby
|
7
|
+
- rbx-2.1.1
|
8
|
+
- ruby-head
|
9
|
+
jdk:
|
10
|
+
- openjdk7 # for jruby
|
11
|
+
before_script: export JRUBY_OPTS="--server -J-Xss1024k -J-Xmx652m -J-XX:+UseConcMarkSweepGC"
|
12
|
+
matrix:
|
13
|
+
allow_failures:
|
14
|
+
- rvm: rbx-2.1.1
|
15
|
+
- rvm: ruby-head
|
16
|
+
env: RAILS_ENV=development AHN_ENV=development
|
17
|
+
notifications:
|
18
|
+
irc: "irc.freenode.org#adhearsion"
|
data/CHANGELOG.md
CHANGED
data/adhearsion-i18n.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
|
24
24
|
s.add_runtime_dependency 'activesupport', [">= 3.0.0", "< 5.0.0"]
|
25
25
|
s.add_runtime_dependency 'adhearsion', ["~> 2.5"]
|
26
|
-
s.add_runtime_dependency 'i18n', ["~> 0.6"]
|
26
|
+
s.add_runtime_dependency 'i18n', ["~> 0.6.0"]
|
27
27
|
|
28
28
|
s.add_development_dependency 'rspec', ["~> 2.11"]
|
29
29
|
end
|
@@ -13,7 +13,7 @@ module AdhearsionI18n::CallControllerMethods
|
|
13
13
|
end
|
14
14
|
|
15
15
|
unless prompt.empty?
|
16
|
-
prompt = "#{config
|
16
|
+
prompt = "#{Adhearsion.config.i18n.audio_path}/#{this_locale}/#{prompt}"
|
17
17
|
end
|
18
18
|
|
19
19
|
RubySpeech::SSML.draw language: this_locale do
|
@@ -32,10 +32,4 @@ module AdhearsionI18n::CallControllerMethods
|
|
32
32
|
def locale=(l)
|
33
33
|
call[:locale] = l
|
34
34
|
end
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
def config
|
39
|
-
Adhearsion.config.i18n
|
40
|
-
end
|
41
35
|
end
|
@@ -17,7 +17,7 @@ class AdhearsionI18n::Plugin < Adhearsion::Plugin
|
|
17
17
|
locale_path ["#{Adhearsion.root}/config/locales"], transform: Proc.new { |v| v.split ':' }, desc: <<-__
|
18
18
|
List of directories from which to load locale data, colon-delimited
|
19
19
|
__
|
20
|
-
audio_path "
|
20
|
+
audio_path "file://#{Adhearsion.root}/audio", desc: <<-__
|
21
21
|
Base path from which audio files can be found. May be a filesystem path or some other URL (like HTTP)
|
22
22
|
__
|
23
23
|
end
|
@@ -12,12 +12,12 @@ describe AdhearsionI18n::CallControllerMethods do
|
|
12
12
|
|
13
13
|
before :all do
|
14
14
|
Adhearsion.config.i18n['locale_path'] = ["#{File.dirname(__FILE__)}/fixtures/locale"]
|
15
|
+
Adhearsion::Plugin.init_plugins
|
15
16
|
end
|
16
17
|
|
17
18
|
before do
|
18
19
|
I18n.default_locale = :en
|
19
20
|
double call, write_command: true, id: call_id
|
20
|
-
Adhearsion::Plugin.init_plugins
|
21
21
|
end
|
22
22
|
|
23
23
|
describe 'getting and setting the locale' do
|
@@ -50,7 +50,7 @@ describe AdhearsionI18n::CallControllerMethods do
|
|
50
50
|
it 'should generate proper SSML with both audio and text fallback translations' do
|
51
51
|
ssml = controller.t :have_many_cats
|
52
52
|
ssml.should == RubySpeech::SSML.draw(language: 'en') do
|
53
|
-
audio src: "
|
53
|
+
audio src: "file:///audio/en/have_many_cats.wav" do
|
54
54
|
string 'I have quite a few cats'
|
55
55
|
end
|
56
56
|
end
|
@@ -59,7 +59,7 @@ describe AdhearsionI18n::CallControllerMethods do
|
|
59
59
|
it 'should generate proper SSML with only audio (no fallback text) translations' do
|
60
60
|
ssml = controller.t :my_shirt_is_white
|
61
61
|
ssml.should == RubySpeech::SSML.draw(language: 'en') do
|
62
|
-
audio src: "
|
62
|
+
audio src: "file:///audio/en/my_shirt_is_white.wav" do
|
63
63
|
string ''
|
64
64
|
end
|
65
65
|
end
|
@@ -75,7 +75,7 @@ describe AdhearsionI18n::CallControllerMethods do
|
|
75
75
|
it 'should generate a path to the audio prompt based on the requested locale' do
|
76
76
|
ssml = controller.t :my_shirt_is_white, locale: 'it'
|
77
77
|
ssml.should == RubySpeech::SSML.draw(language: 'it') do
|
78
|
-
audio src: "
|
78
|
+
audio src: "file:///audio/it/la_mia_camicia_e_bianca.wav" do
|
79
79
|
string ''
|
80
80
|
end
|
81
81
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,12 +4,12 @@ require 'adhearsion'
|
|
4
4
|
require 'adhearsion-i18n'
|
5
5
|
|
6
6
|
RSpec.configure do |config|
|
7
|
-
config.
|
7
|
+
config.color = true
|
8
8
|
config.tty = true
|
9
9
|
|
10
10
|
config.mock_with :rspec
|
11
11
|
config.filter_run :focus => true
|
12
12
|
config.run_all_when_everything_filtered = true
|
13
13
|
|
14
|
-
config.
|
14
|
+
config.backtrace_exclusion_patterns = [/rspec/]
|
15
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adhearsion-i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Klang
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -51,14 +51,14 @@ dependencies:
|
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.6.0
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.6.0
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rspec
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,6 +81,7 @@ extensions: []
|
|
81
81
|
extra_rdoc_files: []
|
82
82
|
files:
|
83
83
|
- ".gitignore"
|
84
|
+
- ".travis.yml"
|
84
85
|
- CHANGELOG.md
|
85
86
|
- Gemfile
|
86
87
|
- LICENSE
|
@@ -115,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
116
|
version: '0'
|
116
117
|
requirements: []
|
117
118
|
rubyforge_project:
|
118
|
-
rubygems_version: 2.
|
119
|
+
rubygems_version: 2.4.5
|
119
120
|
signing_key:
|
120
121
|
specification_version: 4
|
121
122
|
summary: Internationalization helpers for Adhearsion applications
|
@@ -124,3 +125,4 @@ test_files:
|
|
124
125
|
- spec/fixtures/locale/en.yml
|
125
126
|
- spec/fixtures/locale/it.yml
|
126
127
|
- spec/spec_helper.rb
|
128
|
+
has_rdoc:
|