gsay 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (8) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE +22 -0
  4. data/README.md +9 -0
  5. data/Rakefile +2 -0
  6. data/bin/gsay +25 -0
  7. data/gsay.gemspec +14 -0
  8. metadata +54 -0
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in gsay.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Nick Quaranto
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,9 @@
1
+ # Gsay
2
+
3
+ SPEAK LIKE A ROBOT!
4
+
5
+ ## Installation
6
+
7
+ brew install mpg123
8
+ gem install gsay
9
+ gsay "Speak like a robot"
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'tempfile'
4
+ require 'open-uri'
5
+
6
+ words = ARGV.first.scan(/\w+/).map(&:downcase)
7
+
8
+ begin
9
+ sounds = words.map { |word| Tempfile.new(word) }
10
+
11
+ words.each_with_index do |word, index|
12
+ @word = word
13
+ url = "https://ssl.gstatic.com/dictionary/static/sounds/de/0/#{word}.mp3"
14
+ sounds[index].write(open(url).read)
15
+ end
16
+
17
+ `mpg123 -q #{sounds.map(&:path).join(" ")}`
18
+ rescue OpenURI::HTTPError
19
+ abort "Couldn't gsay '#{@word}' :("
20
+ ensure
21
+ sounds.each do |sound|
22
+ sound.close
23
+ sound.unlink
24
+ end
25
+ end
@@ -0,0 +1,14 @@
1
+ Gem::Specification.new do |gem|
2
+ gem.authors = ["Nick Quaranto"]
3
+ gem.email = ["nick@quaran.to"]
4
+ gem.summary = gem.description = %q{Say things like a fancy Google bot.}
5
+ gem.homepage = "https://github.com/qrush/gsay"
6
+
7
+ gem.files = `git ls-files`.split($\)
8
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
9
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
10
+ gem.name = "gsay"
11
+ gem.require_paths = ["lib"]
12
+
13
+ gem.version = "1.0.0"
14
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gsay
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Nick Quaranto
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-09-06 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Say things like a fancy Google bot.
15
+ email:
16
+ - nick@quaran.to
17
+ executables:
18
+ - gsay
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - .gitignore
23
+ - Gemfile
24
+ - LICENSE
25
+ - README.md
26
+ - Rakefile
27
+ - bin/gsay
28
+ - gsay.gemspec
29
+ homepage: https://github.com/qrush/gsay
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:
49
+ rubygems_version: 1.8.23
50
+ signing_key:
51
+ specification_version: 3
52
+ summary: Say things like a fancy Google bot.
53
+ test_files: []
54
+ has_rdoc: