skype 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2eced28795b2a77a42df86107d84682ef5d8380b
4
- data.tar.gz: a451d065c2e3f5b13ae653afe33781b85bd4064a
3
+ metadata.gz: 7abc203b8c8e00b1338cb47e58297b1382e560fe
4
+ data.tar.gz: 523913048ed2032061443f685ce0d8e340173f62
5
5
  SHA512:
6
- metadata.gz: 9531c430f248eff98199bd17f948dbe95a35769dc564b029e40dba90e64514986ebfebe4132486c68549b56b6649cec9c1d763e9a32908bc8ff8872b20d46a18
7
- data.tar.gz: 9b1a8bff9f6dcc04c07ef8ebda9257ca43654e060ee9e9e712adff4c8f98b99f3e35a18441d563acc35907079c24e57d12881114f84e1d368b70f48f65fb2907
6
+ metadata.gz: 6a0d3056586e3409170cd6b5cc2185db45090ff4a88708b856a74c4613ad1d6e0cf506aec97a37e1a75af1603b52deddce7e9190fe884bdf2061492daa5225ca
7
+ data.tar.gz: 7b291a9d5cca6a21285f1db28a7414d0ebd97139df4408f554f5ebc83bf3f41857bb6db37ed8d3351c434e3392c842d35f24f5905de14033ff96545a0c0e25a4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- skype (0.1.4)
4
+ skype (0.1.5)
5
5
  tmp_cache
6
6
 
7
7
  GEM
@@ -1,3 +1,7 @@
1
+ === 0.1.5 2013-06-30
2
+
3
+ * add skype-chat command
4
+
1
5
  === 0.1.4 2013-06-30
2
6
 
3
7
  * bugfix of chat wrapper
data/README.md CHANGED
@@ -18,10 +18,12 @@ Installation
18
18
  for Mac
19
19
 
20
20
  % gem install skype
21
+ % skype-chat
21
22
 
22
23
  for Linux
23
24
 
24
25
  % gem install skype ruby-dbus
26
+ % skype-chat
25
27
 
26
28
  Gemfile
27
29
  ```ruby
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # -*- coding: utf-8 -*-
3
2
  require 'rubygems'
4
3
  $:.unshift File.expand_path '../lib', File.dirname(__FILE__)
5
4
  require 'skype'
@@ -34,5 +33,6 @@ end
34
33
 
35
34
  loop do
36
35
  line = STDIN.gets.strip
36
+ next if line.empty?
37
37
  chat.post line
38
38
  end
@@ -3,7 +3,7 @@ require "kconv"
3
3
  require "tmp_cache"
4
4
 
5
5
  require "skype/version"
6
- require "skype/register"
6
+ require "skype/filter"
7
7
  require case RUBY_PLATFORM
8
8
  when /darwin/
9
9
  "skype/platforms/mac"
@@ -6,4 +6,14 @@ module Skype
6
6
  raise ArgumentError, "block not given" unless block_given?
7
7
  @@filters[pattern] = block
8
8
  end
9
+
10
+ def self.filter_response(response_string)
11
+ @@filters.each do |filter, block|
12
+ next unless response_string =~ filter
13
+ response_string = block.call(response_string)
14
+ break
15
+ end
16
+ response_string
17
+ end
18
+
9
19
  end
@@ -18,12 +18,6 @@ module Skype
18
18
  end
19
19
 
20
20
  def self.exec(command)
21
- res = (@@connection||=Connection.new).invoke command
22
- @@filters.each do |filter, block|
23
- next unless res =~ filter
24
- res = block.call(res)
25
- break
26
- end
27
- res
21
+ filter_response (@@connection||=Connection.new).invoke command
28
22
  end
29
23
  end
@@ -3,13 +3,7 @@ module Skype
3
3
  script = %Q{tell application "Skype"
4
4
  send command "#{Utils.escape command}" script name "#{self.config[:app_name]}"
5
5
  end tell}
6
- res = `unset LD_LIBRARY_PATH; unset DYLD_LIBRARY_PATH; /usr/bin/osascript -e '#{script}'`.strip
7
- @@filters.each do |filter, block|
8
- next unless res =~ filter
9
- res = block.call(res)
10
- break
11
- end
12
- res
6
+ filter_response `unset LD_LIBRARY_PATH; unset DYLD_LIBRARY_PATH; /usr/bin/osascript -e '#{script}'`.strip
13
7
  end
14
8
 
15
9
  module Utils
@@ -1,3 +1,3 @@
1
1
  module Skype
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skype
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto
@@ -69,7 +69,8 @@ dependencies:
69
69
  description: Skype Desktop API Ruby wrapper for Mac/Linux.
70
70
  email:
71
71
  - hashimoto@shokai.org
72
- executables: []
72
+ executables:
73
+ - skype-chat
73
74
  extensions: []
74
75
  extra_rdoc_files: []
75
76
  files:
@@ -80,15 +81,15 @@ files:
80
81
  - LICENSE.txt
81
82
  - README.md
82
83
  - Rakefile
84
+ - bin/skype-chat
83
85
  - lib/skype.rb
86
+ - lib/skype/filter.rb
84
87
  - lib/skype/main.rb
85
88
  - lib/skype/platforms/linux.rb
86
89
  - lib/skype/platforms/mac.rb
87
- - lib/skype/register.rb
88
90
  - lib/skype/version.rb
89
91
  - lib/skype/wrappers/chat.rb
90
92
  - samples/call.rb
91
- - samples/chat.rb
92
93
  - samples/send_message.rb
93
94
  - skype.gemspec
94
95
  - test/test_chat.rb