mac-say 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/mac/say.rb +1 -2
- data/lib/mac/say/version.rb +1 -1
- data/test/test_mac-say.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cba1ee99ff7b0b0b58234cb6875ca13596166495
|
4
|
+
data.tar.gz: 0e8919d872e49f0a77cfe526274b7a38dda1a632
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68f049d14c698bcb76487c953ab7232ee4f8470984bfc24c8e3c2bbac54adabb15827c42f3e89b8c7a82b91c51cb2e2490ad47bc85dabbb35feb402ff387bd5a
|
7
|
+
data.tar.gz: 619652619a452f1decac984f957482642cd257ef0a29b84b6a2c85bb6e8bce30ee3697bb0fd31ffd5325ded22259ae266f6d02192fcad4d3394c25f7f24e3134
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
> Ruby wrapper around the modern version of the macOS `say` command. Inspired by the @bratta's [mactts](https://github.com/bratta/mactts)
|
8
8
|
>
|
9
|
-
> [![Build Status](https://travis-ci.org/smileart/mac-say.svg?branch=dev)](https://travis-ci.org/smileart/mac-say) [![Coverage Status](https://coveralls.io/repos/github/smileart/mac-say/badge.svg?branch=dev)](https://coveralls.io/github/smileart/mac-say?branch=dev) [![Code Climate](https://codeclimate.com/github/smileart/mac-say/badges/gpa.svg)](https://codeclimate.com/github/smileart/mac-say) [![InchCI Status](https://inch-ci.org/github/smileart/mac-say.svg?branch=dev)](https://inch-ci.org/github/smileart/mac-say)
|
9
|
+
> [![Build Status](https://travis-ci.org/smileart/mac-say.svg?branch=dev)](https://travis-ci.org/smileart/mac-say) [![Coverage Status](https://coveralls.io/repos/github/smileart/mac-say/badge.svg?branch=dev)](https://coveralls.io/github/smileart/mac-say?branch=dev) [![Code Climate](https://codeclimate.com/github/smileart/mac-say/badges/gpa.svg)](https://codeclimate.com/github/smileart/mac-say) [![InchCI Status](https://inch-ci.org/github/smileart/mac-say.svg?branch=dev)](https://inch-ci.org/github/smileart/mac-say) [![mac-say gem](https://img.shields.io/gem/v/mac-say.svg)](https://rubygems.org/gems/mac-say)
|
10
10
|
|
11
11
|
* [Homepage](https://rubygems.org/gems/mac-say)
|
12
12
|
* [Documentation](http://rubydoc.info/gems/mac-say/frames)
|
data/lib/mac/say.rb
CHANGED
@@ -145,6 +145,7 @@ module Mac
|
|
145
145
|
# @raise [UnknownVoiceFeature] if the voice feature isn't supported
|
146
146
|
def voice(feature, value)
|
147
147
|
raise UnknownVoiceFeature, "Voice has no '#{feature}' feature" unless [:name, :language, :country].include?(feature)
|
148
|
+
value = value.to_sym
|
148
149
|
|
149
150
|
condition = feature == :name ? ->(v) { v[feature] == value } : ->(v) { v[:iso_code][feature] == value }
|
150
151
|
found_voices = @voices.find_all(&condition)
|
@@ -273,5 +274,3 @@ module Mac
|
|
273
274
|
end
|
274
275
|
end
|
275
276
|
end
|
276
|
-
|
277
|
-
p Mac::Say.voice(:name, 'fuck')
|
data/lib/mac/say/version.rb
CHANGED
data/test/test_mac-say.rb
CHANGED
@@ -36,6 +36,11 @@ describe 'Mac::Say as a macOS `say` wrapper' do
|
|
36
36
|
voice[:name].must_equal :alex
|
37
37
|
end
|
38
38
|
|
39
|
+
it '.voice must accept String as a value' do
|
40
|
+
voice = Mac::Say.voice(:name, 'alex')
|
41
|
+
voice[:name].must_equal :alex
|
42
|
+
end
|
43
|
+
|
39
44
|
it '.voice must search for a voice by country' do
|
40
45
|
voice = Mac::Say.voice(:country, :scotland)
|
41
46
|
voice[:name].must_equal :fiona
|