tw 1.0.8 → 1.0.9

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: d381d040e07a69aa39774e9311314782263fed42
4
- data.tar.gz: d4843e64b3a981463cdebaab7e983feb61c32a96
3
+ metadata.gz: e64555308b2e89caac6aa6d6687d6e568b9ac1ec
4
+ data.tar.gz: cd7a952db9243a38e6a254feb8551fe196cbe390
5
5
  SHA512:
6
- metadata.gz: a86083ad147a5d71dcc3c1bf95fc7e56ce4c7061e0d99dcc1cc186003e04b4b235421a7a8214bc587f999751c93d5ed70cdd053ff22b5404f9ba5117449833d3
7
- data.tar.gz: 3a739f4ef049d86d6e6221f54faf0ee61ad23e1d564f0b32e762213f6184157b2f89e67857aa7f1065a6844497b7a13c11700aaab267010b03b1b94dd4e4dcda
6
+ metadata.gz: 5580dbeb7ffe25a0325b671ad5472b8a6d23c8d47ad5a75e41cd5e29f50e469510e5e6d26049991fdca1dc33d145c1946d03a90abb0fa3fc2a891814428f5abb
7
+ data.tar.gz: 2b1d2cb9653e3b4883c9af48f013dc1173cf6f1b10ff062e712ec44b82b7af75acd6c60793cb1f840caeb7d46c18b6ead04b03b129bf3bd9639447a73b646c9e
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 1.0.9 2014-05-14
2
+
3
+ * merge multiple lines from STDIN into one tweet
4
+
1
5
  === 1.0.8 2014-01-28
2
6
 
3
7
  * fix for rainbow gem v2.0.x
data/README.md CHANGED
@@ -44,9 +44,14 @@ Reply/Fav/RT
44
44
 
45
45
  % tw @shokai --id
46
46
  % tw "@shokai wow!!" --id=334749349588377601
47
+ % tw --id=334749349588377601
47
48
  % tw --fav=334749349588377601
48
49
  % tw --rt=334749349588377601
49
50
 
51
+ Delete
52
+
53
+ % tw --del=334749349588377601
54
+
50
55
  Switch Accounts
51
56
 
52
57
  % tw --user:add
data/lib/tw/app/cmds.rb CHANGED
@@ -122,22 +122,20 @@ module Tw::App
122
122
 
123
123
  cmd :pipe do |v, opts|
124
124
  auth
125
- while line = STDIN.gets do
126
- line.split(/(.{140})/u).select{|m|m.size>0}.each do |message|
127
- begin
128
- if opts.has_param? 'dm:to'
129
- puts to = opts['dm:to']
130
- client.direct_message_create to, message
131
- else
132
- tweet_opts = {}
133
- tweet_opts[:in_reply_to_status_id] = opts[:status_id] if opts.has_param? :status_id
134
- client.tweet message, tweet_opts
135
- end
136
- rescue => e
137
- STDERR.puts e.message
125
+ lines = STDIN.readlines.join
126
+ lines.split(/(.{140})/u).select{|m|m.size>0}.each do |message|
127
+ begin
128
+ if opts.has_param? 'dm:to'
129
+ puts to = opts['dm:to']
130
+ client.direct_message_create to, message
131
+ else
132
+ tweet_opts = {}
133
+ tweet_opts[:in_reply_to_status_id] = opts[:status_id] if opts.has_param? :status_id
134
+ client.tweet message, tweet_opts
138
135
  end
136
+ rescue => e
137
+ STDERR.puts e.message
139
138
  end
140
- sleep 1
141
139
  end
142
140
  on_exit
143
141
  end
data/lib/tw/app/main.rb CHANGED
@@ -98,7 +98,7 @@ module Tw::App
98
98
  STDERR.puts " tw --stream:filter=ruby,java"
99
99
  STDERR.puts " tw --dm:to=username \"hello!\""
100
100
  STDERR.puts "id tw @shokai --id"
101
- STDERR.puts " tw @shokai --id=334749349588377601"
101
+ STDERR.puts " tw --id=334749349588377601"
102
102
  STDERR.puts 'reply tw "@shokai wow!!" --id=334749349588377601'
103
103
  STDERR.puts " tw --fav=334749349588377601"
104
104
  STDERR.puts " tw --rt=334749349588377601"
data/lib/tw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tw
2
- VERSION = '1.0.8'
2
+ VERSION = '1.0.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tw
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-28 00:00:00.000000000 Z
11
+ date: 2014-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: twitter