mac-say 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: befe01288b8556115593d963428671229af0a2e0
4
- data.tar.gz: 715ed2147a05a67de7c05012c1b4009d909ed0af
3
+ metadata.gz: cba1ee99ff7b0b0b58234cb6875ca13596166495
4
+ data.tar.gz: 0e8919d872e49f0a77cfe526274b7a38dda1a632
5
5
  SHA512:
6
- metadata.gz: 9d48e9271ac17bc24a068c2ce63121a3f9bd2be092c5d3002d63400e2cfc5f24f26c6f6817c24b5b37a823665043fd3e9edeb33cd91712b63bba85b67d02ac59
7
- data.tar.gz: 916ea15be74ff4d22c461c25117ae8240556bc4d9a09a58c667c0d6469b136621cbc889c123e11b50d1c8eaa9eb88e0f8916fc8ff36ac54f6142543e0d1c0e1d
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)
@@ -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')
@@ -6,6 +6,6 @@ module Mac
6
6
  # Allows to use simple TTS on Mac right from Ruby scripts
7
7
  class Say
8
8
  # mac-say version
9
- VERSION = '0.1.0'
9
+ VERSION = '0.1.1'
10
10
  end
11
11
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mac-say
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serge Bedzhyk