facy 1.2.17 → 1.2.18

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c794408aac354132adb75183be2b7e48a78acdde
4
- data.tar.gz: d5f2478fa645fb31f4d65fe9e2aec60a4fa25208
3
+ metadata.gz: 997a93bd05e46a4e52c1bf688d2ac3fadb55f0b1
4
+ data.tar.gz: aae337daa7899a9c26b8fc54965033982aefcac7
5
5
  SHA512:
6
- metadata.gz: 5a8dc32b4ae3d5ab003e0b097219ef1973fd2eddeaaf72c6c57ddcec82a34555a3563acea356fb079db7cd84ab5d3fd9cba32b6bc171acc62a32faa11741275f
7
- data.tar.gz: 707843ae6f59b93dd94f86023ebfcde3069df81cfee2d9b9e42d0c4c29744ce5fea72067937c900613eb86b440dce8ace9d0451109cfed952b9bee8d8b777f17
6
+ metadata.gz: b673a63c6e5ce6e183564c68f0be66166df1ccb5a136969efec52e7367b9d811aebd341e77d09100eb1c4e7ace0b18fba5955303d42fdb14548530ae377f9d4f
7
+ data.tar.gz: ddc6e3829359dc821a8a4da22a43ce4de02c661bb458c5f3f7d48c902bc10f62504e801d838f9f76fa7a8848b35f0992182b54af6fb4722ee28d63b4a9af1bbf
@@ -1,40 +1,38 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- facy (1.2.11)
4
+ facy (1.2.17)
5
5
  activesupport (~> 4.0)
6
6
  bundler (~> 1.5)
7
7
  eventmachine (~> 1.0)
8
8
  koala (~> 1.10)
9
9
  launchy (~> 2.4)
10
- rmagick (~> 2.13)
11
10
 
12
11
  GEM
13
12
  remote: https://rubygems.org/
14
13
  specs:
15
- activesupport (4.1.5)
16
- i18n (~> 0.6, >= 0.6.9)
14
+ activesupport (4.2.3)
15
+ i18n (~> 0.7)
17
16
  json (~> 1.7, >= 1.7.7)
18
17
  minitest (~> 5.1)
19
- thread_safe (~> 0.1)
18
+ thread_safe (~> 0.3, >= 0.3.4)
20
19
  tzinfo (~> 1.1)
21
20
  addressable (2.3.6)
22
- eventmachine (1.0.3)
21
+ eventmachine (1.0.4)
23
22
  faraday (0.9.0)
24
23
  multipart-post (>= 1.2, < 3)
25
- i18n (0.6.11)
26
- json (1.8.1)
27
- koala (1.10.0)
24
+ i18n (0.7.0)
25
+ json (1.8.3)
26
+ koala (1.10.1)
28
27
  addressable
29
28
  faraday
30
29
  multi_json
31
30
  launchy (2.4.2)
32
31
  addressable (~> 2.3)
33
- minitest (5.4.0)
32
+ minitest (5.7.0)
34
33
  multi_json (1.10.1)
35
34
  multipart-post (2.0.0)
36
- rmagick (2.13.3)
37
- thread_safe (0.3.4)
35
+ thread_safe (0.3.5)
38
36
  tzinfo (1.2.2)
39
37
  thread_safe (~> 0.1)
40
38
 
@@ -51,10 +51,10 @@ module Facy
51
51
  init do
52
52
  commands.clear
53
53
  command :post do |text|
54
- async {
55
- ret = facebook_post(text)
54
+ async {
55
+ ret = facebook_post(text)
56
56
  instant_output(Item.new(
57
- info: :info,
57
+ info: :info,
58
58
  content: "post '#{text}' has been posted to your wall")
59
59
  ) if ret["id"]
60
60
  }
@@ -65,15 +65,15 @@ module Facy
65
65
  post_code = "$#{post_code}"
66
66
  item = post_code_reverse_map[post_code]
67
67
  post_id = item.id if item.is_a?(Item)
68
- async {
69
- ret = facebook_like(post_id)
68
+ async {
69
+ ret = facebook_like(post_id)
70
70
  instant_output(Item.new(info: :info, content: "like success")) if ret
71
71
  }
72
72
  end
73
73
  help :like, 'like a post', ':like [code]'
74
74
 
75
- command :exit do
76
- stop_process
75
+ command :exit do
76
+ stop_process
77
77
  end
78
78
  help :exit, 'quit facy', ":exit"
79
79
 
@@ -95,7 +95,7 @@ module Facy
95
95
  content = content.split(" ")
96
96
  post_code = "$#{content.first}"
97
97
  comment = content.tap{|c|c.shift}.join(' ')
98
-
98
+
99
99
  item = post_code_reverse_map[post_code]
100
100
  post_id = item.id if item.is_a?(Item)
101
101
 
@@ -122,14 +122,14 @@ module Facy
122
122
  item = post_code_reverse_map[post_code]
123
123
 
124
124
  print JSON.pretty_generate(item.raw)
125
- puts ""
125
+ puts ""
126
126
  end
127
127
  help :view_raw, "view raw json output of a post", ":view_raw [post_code]"
128
128
  aliasing :view_raw, :vr
129
129
 
130
130
  command :view_img do |post_code|
131
131
  rmagick = false
132
- begin
132
+ begin
133
133
  rmagick = true if require "Rmagick"
134
134
  rescue
135
135
  end
@@ -137,7 +137,7 @@ module Facy
137
137
  if config[:enable_img_view] && rmagick
138
138
  post_code = "$#{post_code}"
139
139
  item = post_code_reverse_map[post_code]
140
-
140
+
141
141
  if item.data.picture
142
142
  view_img(item.data.picture)
143
143
  else
@@ -176,14 +176,14 @@ module Facy
176
176
  end
177
177
  help :view_likes, "view likes detail from a post", ":view_likes [code]"
178
178
  aliasing :view_likes, :vl
179
-
179
+
180
180
  command :dump_log do
181
181
  if config[:debug_log]
182
182
  dump_log
183
183
  instant_output(Item.new(info: :info, content: "dump log success to #{log_file}"))
184
184
  else
185
185
  instant_output(Item.new(
186
- info: :info,
186
+ info: :info,
187
187
  content: "you need to start $facy -debug option to enable log"
188
188
  ))
189
189
  end
@@ -211,7 +211,7 @@ module Facy
211
211
  help :commands, "list all available commands", ":commands"
212
212
 
213
213
  command :clear_cache do
214
- sync {
214
+ sync {
215
215
  printed_item.clear
216
216
  #TODO clear also code table
217
217
  }
@@ -220,7 +220,7 @@ module Facy
220
220
  aliasing :clear_cache, :cc
221
221
 
222
222
  command :mailbox do |target|
223
- if target
223
+ if target
224
224
  targets = target.split(" ").map(&:to_i)
225
225
  raise Exception.new("need two parameters") if targets.size != 2
226
226
  threadnum, messagenum = targets
@@ -229,7 +229,7 @@ module Facy
229
229
  else
230
230
  async {
231
231
  mails = facebook_mailbox
232
- mails.each {|m| mailbox_cache << m} if mails && !mails.empty?
232
+ mails.each {|m| mailbox_cache << m} if mails && !mails.empty?
233
233
  instant_output(Item.new(info: :mails))
234
234
  }
235
235
  end
@@ -237,7 +237,7 @@ module Facy
237
237
  help :mailbox, "read mailbox", ":mailbox [mail number]"
238
238
  aliasing :mailbox, :m
239
239
 
240
- completion_proc = proc {|s|
240
+ completion_proc = proc {|s|
241
241
  commands
242
242
  .map{|c|c[:pattern]}
243
243
  .map{|c|":#{c.to_s}"}
@@ -64,11 +64,11 @@ module Facy
64
64
  end
65
65
 
66
66
  def start(options={})
67
- _init
67
+ _init
68
68
 
69
69
  EM.run do
70
70
  Thread.start do
71
- while buf = Readline.readline(config[:prompt], true)
71
+ while buf = Readline.readline(config[:prompt], true)
72
72
  execute(buf.strip)
73
73
  end
74
74
  end
@@ -78,10 +78,10 @@ module Facy
78
78
  facebook_stream_fetch
79
79
  end
80
80
  end
81
-
81
+
82
82
  Thread.start do
83
83
  EM.add_periodic_timer(config[:output_interval]) do
84
- periodic_output
84
+ periodic_output
85
85
  end
86
86
  end
87
87
 
@@ -113,7 +113,7 @@ module Facy
113
113
  def stop_process
114
114
  puts "\nfacy going to stop..."
115
115
  Thread.new {
116
- EventMachine.stop
116
+ EventMachine.stop
117
117
  }.join
118
118
  end
119
119
  end
@@ -7,7 +7,7 @@ module Facy
7
7
  ERROR = 1
8
8
  SUSPENDED = 2
9
9
  end
10
-
10
+
11
11
  def facebook_me
12
12
  @graph.api("/me?fields=id,name")
13
13
  rescue Koala::Facebook::ServerError
@@ -71,7 +71,7 @@ module Facy
71
71
  end
72
72
 
73
73
  def facebook_set_seen(notification_id)
74
- @graph.put_connections("#{notification_id}", "unread=false")
74
+ @graph.put_connections("#{notification_id}", "unread=false")
75
75
  rescue Koala::Facebook::ServerError => e
76
76
  retry_wait
77
77
  rescue Koala::Facebook::APIError => e
@@ -104,7 +104,9 @@ module Facy
104
104
  end
105
105
 
106
106
  def expired_session
107
- FileUtils.rm(session_file)
107
+ if File.exists?(session_file)
108
+ FileUtils.rm(session_file)
109
+ end
108
110
  instant_output(Item.new(info: :info, content: "Please restart facy to obtain new access token!"))
109
111
  stop_process
110
112
  end
@@ -120,11 +122,11 @@ module Facy
120
122
  @graph = Koala::Facebook::API.new(token)
121
123
  log(:info, "login ok at facebook module: #{@graph}")
122
124
  end
123
- end
125
+ end
124
126
 
125
127
  extend Facebook
126
-
128
+
127
129
  init do
128
- login
130
+ login
129
131
  end
130
132
  end
@@ -1,3 +1,3 @@
1
1
  module Facy
2
- VERSION = "1.2.17"
2
+ VERSION = "1.2.18"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.17
4
+ version: 1.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - dxhuy1988
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-08 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -137,3 +137,4 @@ signing_key:
137
137
  specification_version: 4
138
138
  summary: 'facy: terminal client for facebook'
139
139
  test_files: []
140
+ has_rdoc: