inko 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. data/lib/inko.rb +6 -5
  2. data/lib/inko/version.rb +1 -1
  3. metadata +1 -1
@@ -4,6 +4,7 @@ require "inko/version"
4
4
  require 'inko/config'
5
5
 
6
6
  require 'user_stream'
7
+ require 'shellwords'
7
8
 
8
9
  module Inko extend self
9
10
 
@@ -15,6 +16,8 @@ module Inko extend self
15
16
  # _,!
16
17
  # cf http://d.hatena.ne.jp/nacookan/20081220/1229745342
17
18
  def pronunciationize status
19
+ status.user.screen_name = status.user.screen_name.gsub(/_/, ' ').gsub(/([a-zA-Z]+|[0-9]+)/){$1 + ' '}.gsub(/@/,'@. ')
20
+ status.text = Shellwords::escape status.text.split(/\n/).join(" ")
18
21
  status
19
22
  end
20
23
 
@@ -31,15 +34,13 @@ module Inko extend self
31
34
  raise e
32
35
  end
33
36
 
34
- client = UserStream::client
35
-
36
- client.user do |status|
37
+ UserStream::client.user do |status|
37
38
  unless filter? status
38
39
  status = pronunciationize status
39
40
  # puts "#{status.user.screen_name}: "
40
41
  # puts status.text
41
- `say -v #{Config::VoiceActor} #{status.user.screen_name.gsub(/_/, '. ').gsub(/([a-zA-Z]+|[0-9]+)/)do $1 + ' ' end} さんのツイート}`
42
- `say -v #{Config::VoiceActor} #{status.text.split(/\n/).join " "}`
42
+ `say -v #{Config::VoiceActor} #{status.user.screen_name} さんのツイート}`
43
+ `say -v #{Config::VoiceActor} #{status.text}`
43
44
  end
44
45
  end
45
46
  end
@@ -1,3 +1,3 @@
1
1
  module Inko
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: