flumtter 5.2.1 → 5.4.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 172a58ccba1cebebba54f06578778897391e2655
|
4
|
+
data.tar.gz: 1978786bb8795ffad698c95201283478de4059f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aaa57eff2459a530a89cd8eaa66a73881cdf313a0242565c20d789f4a54ab4635450f0651949773c113c51b95321e605a427ddea3492d0a330c23151246dc39
|
7
|
+
data.tar.gz: abca932b6739cb8f7c3442f338dd02d49466b81ea891a7a790fa3aaf8de873a2c0e5c0c7827f95c3db36c3ac32e1f390c9be0838a6988918405ace16d83345f8
|
@@ -24,6 +24,10 @@ module Flumtter
|
|
24
24
|
@@account_list
|
25
25
|
end
|
26
26
|
|
27
|
+
def list_to_s
|
28
|
+
@@account_list.map.with_index{|a,i|"#{i}: #{a.screen_name}"}.join("\n")
|
29
|
+
end
|
30
|
+
|
27
31
|
def select(options={})
|
28
32
|
if options[:id]
|
29
33
|
@@account_list[options[:id]]
|
@@ -37,7 +41,7 @@ module Flumtter
|
|
37
41
|
Please input your account number.
|
38
42
|
Input 'regist' if you want to regist new account.
|
39
43
|
|
40
|
-
#{
|
44
|
+
#{list_to_s}
|
41
45
|
EOF
|
42
46
|
dialog.command(/^regist$/, "account registration"){|m|regist}
|
43
47
|
dialog.command(/^([#{@@account_list.size.times.to_a.join(",")}])$/, "account index"){|m|@@account_list[m[1].to_i]}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Flumtter
|
2
|
+
class Cli
|
3
|
+
class Command
|
4
|
+
def initialize(blk, args)
|
5
|
+
@blk = blk
|
6
|
+
@args = args
|
7
|
+
end
|
8
|
+
|
9
|
+
def run(twitter)
|
10
|
+
@blk.call(twitter, @args)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
@@events = []
|
15
|
+
class << self
|
16
|
+
def add(*args, &blk)
|
17
|
+
Initializer.add_opt do |opt, options|
|
18
|
+
opt.on(*args){|v|options[args.first] = v}
|
19
|
+
end
|
20
|
+
Initializer.run(args.first) do |v, options|
|
21
|
+
@@events << Command.new(blk, v)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def run(client)
|
26
|
+
unless @@events.empty?
|
27
|
+
@@events.map{|event|event.run(client)}
|
28
|
+
exit
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Flumtter
|
2
|
+
plugin do
|
3
|
+
Cli.add("--tweet VALUES", "new tweet") do |twitter, args|
|
4
|
+
twitter.rest.update(args)
|
5
|
+
end
|
6
|
+
Cli.add("--tweet_with_image=V,V", Array, "new tweet with image") do |twitter, (tweet, file)|
|
7
|
+
begin
|
8
|
+
twitter.rest.update_with_media(tweet, open(file))
|
9
|
+
rescue Twitter::Error::Forbidden => e
|
10
|
+
if e.message == "Error creating status."
|
11
|
+
STDERR.puts "This file is not supported."
|
12
|
+
else
|
13
|
+
raise e
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
add_opt do |opt, options|
|
18
|
+
opt.on('-l', '--list', 'user list') do
|
19
|
+
puts AccountSelector.list_to_s
|
20
|
+
exit
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/flumtter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flumtter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- flum1025
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -132,6 +132,7 @@ files:
|
|
132
132
|
- lib/flumtter/app/.flumtter/plugins/.gitkeep
|
133
133
|
- lib/flumtter/app/.flumtter/setting/setting.rb
|
134
134
|
- lib/flumtter/app/core/account_selector.rb
|
135
|
+
- lib/flumtter/app/core/cli.rb
|
135
136
|
- lib/flumtter/app/core/client.rb
|
136
137
|
- lib/flumtter/app/core/command.rb
|
137
138
|
- lib/flumtter/app/core/command/dm.rb
|
@@ -163,6 +164,7 @@ files:
|
|
163
164
|
- lib/flumtter/app/core/windows/tweetbase.rb
|
164
165
|
- lib/flumtter/app/core/windows/userbase.rb
|
165
166
|
- lib/flumtter/app/main.rb
|
167
|
+
- lib/flumtter/app/plugins/cli.rb
|
166
168
|
- lib/flumtter/app/plugins/commands.rb
|
167
169
|
- lib/flumtter/app/plugins/commands/account_changer.rb
|
168
170
|
- lib/flumtter/app/plugins/commands/change_profile.rb
|