talks 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +70 -0
- data/README.md +1 -0
- data/Rakefile +9 -0
- data/lib/talks/version.rb +3 -0
- data/lib/talks.rb +45 -0
- data/talks.gemspec +21 -0
- metadata +53 -0
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
gon (3.0.2)
|
5
|
+
actionpack (>= 2.3.0)
|
6
|
+
json
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionpack (3.2.3)
|
12
|
+
activemodel (= 3.2.3)
|
13
|
+
activesupport (= 3.2.3)
|
14
|
+
builder (~> 3.0.0)
|
15
|
+
erubis (~> 2.7.0)
|
16
|
+
journey (~> 1.0.1)
|
17
|
+
rack (~> 1.4.0)
|
18
|
+
rack-cache (~> 1.2)
|
19
|
+
rack-test (~> 0.6.1)
|
20
|
+
sprockets (~> 2.1.2)
|
21
|
+
activemodel (3.2.3)
|
22
|
+
activesupport (= 3.2.3)
|
23
|
+
builder (~> 3.0.0)
|
24
|
+
activesupport (3.2.3)
|
25
|
+
i18n (~> 0.6)
|
26
|
+
multi_json (~> 1.0)
|
27
|
+
blankslate (2.1.2.4)
|
28
|
+
builder (3.0.0)
|
29
|
+
diff-lcs (1.1.3)
|
30
|
+
erubis (2.7.0)
|
31
|
+
hike (1.2.1)
|
32
|
+
i18n (0.6.0)
|
33
|
+
jbuilder (0.4.0)
|
34
|
+
activesupport (>= 3.0.0)
|
35
|
+
blankslate (>= 2.1.2.4)
|
36
|
+
journey (1.0.3)
|
37
|
+
json (1.7.1)
|
38
|
+
multi_json (1.2.0)
|
39
|
+
rabl (0.6.9)
|
40
|
+
activesupport (>= 2.3.14)
|
41
|
+
multi_json (~> 1.0)
|
42
|
+
rack (1.4.1)
|
43
|
+
rack-cache (1.2)
|
44
|
+
rack (>= 0.4)
|
45
|
+
rack-test (0.6.1)
|
46
|
+
rack (>= 1.0)
|
47
|
+
rake (0.9.2.2)
|
48
|
+
rspec (2.9.0)
|
49
|
+
rspec-core (~> 2.9.0)
|
50
|
+
rspec-expectations (~> 2.9.0)
|
51
|
+
rspec-mocks (~> 2.9.0)
|
52
|
+
rspec-core (2.9.0)
|
53
|
+
rspec-expectations (2.9.1)
|
54
|
+
diff-lcs (~> 1.1.3)
|
55
|
+
rspec-mocks (2.9.0)
|
56
|
+
sprockets (2.1.3)
|
57
|
+
hike (~> 1.2)
|
58
|
+
rack (~> 1.0)
|
59
|
+
tilt (~> 1.1, != 1.3.0)
|
60
|
+
tilt (1.3.3)
|
61
|
+
|
62
|
+
PLATFORMS
|
63
|
+
ruby
|
64
|
+
|
65
|
+
DEPENDENCIES
|
66
|
+
gon!
|
67
|
+
jbuilder
|
68
|
+
rabl
|
69
|
+
rake
|
70
|
+
rspec
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Comming soon
|
data/Rakefile
ADDED
data/lib/talks.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
module Talks
|
2
|
+
class << self
|
3
|
+
|
4
|
+
VOICES = %w(
|
5
|
+
Agnes Albert Alex Bad Bahh Bells Boing Bruce Bubbles Cellos
|
6
|
+
Deranged Fred Good Hysterical Junior Kathy Pipe Princess Ralph
|
7
|
+
Trinoids Vicki Victoria Whisper Zarvox
|
8
|
+
)
|
9
|
+
|
10
|
+
PREFS = {
|
11
|
+
info: 'Bruce',
|
12
|
+
warn: 'Whisper',
|
13
|
+
success: 'Fred',
|
14
|
+
error: 'Trinoids'
|
15
|
+
}
|
16
|
+
|
17
|
+
def voice
|
18
|
+
@voice ||= :info
|
19
|
+
end
|
20
|
+
|
21
|
+
def voice=(voice = :info)
|
22
|
+
@voice ||= voice
|
23
|
+
end
|
24
|
+
|
25
|
+
def say(message, type = voice, options = {})
|
26
|
+
type = type.to_sym
|
27
|
+
say_voice = \
|
28
|
+
if options[:voice] and VOICES.include?(options[:voice].to_downcase)
|
29
|
+
options[:voice]
|
30
|
+
elsif PREFS.keys.include? type
|
31
|
+
PREFS[type]
|
32
|
+
else
|
33
|
+
PREFS[voice]
|
34
|
+
end
|
35
|
+
`say -v #{say_voice} #{message}`
|
36
|
+
end
|
37
|
+
|
38
|
+
PREFS.keys.each do |type|
|
39
|
+
define_method type do |message, options = {}|
|
40
|
+
say(message, type, options)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
data/talks.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "talks/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "talks"
|
7
|
+
s.version = Talks::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ['gazay']
|
10
|
+
s.email = ['alex.gaziev@gmail.com']
|
11
|
+
s.homepage = "https://github.com/gazay/talks"
|
12
|
+
s.summary = %q{Simple gem for `say` function of mac os x}
|
13
|
+
s.description = %q{Simple gem for `say` function of mac os x}
|
14
|
+
|
15
|
+
s.rubyforge_project = "talks"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: talks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- gazay
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-21 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Simple gem for `say` function of mac os x
|
15
|
+
email:
|
16
|
+
- alex.gaziev@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- CHANGELOG.md
|
22
|
+
- Gemfile
|
23
|
+
- Gemfile.lock
|
24
|
+
- README.md
|
25
|
+
- Rakefile
|
26
|
+
- lib/talks.rb
|
27
|
+
- lib/talks/version.rb
|
28
|
+
- talks.gemspec
|
29
|
+
homepage: https://github.com/gazay/talks
|
30
|
+
licenses: []
|
31
|
+
post_install_message:
|
32
|
+
rdoc_options: []
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
requirements: []
|
48
|
+
rubyforge_project: talks
|
49
|
+
rubygems_version: 1.8.24
|
50
|
+
signing_key:
|
51
|
+
specification_version: 3
|
52
|
+
summary: Simple gem for `say` function of mac os x
|
53
|
+
test_files: []
|