twterm 1.1.1 → 1.1.2

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: 706e593e4edcad70bc6c85a508a87bb3b0b6f627
4
- data.tar.gz: 5103de0dc3e61d085910facd228e7901feec04bd
3
+ metadata.gz: d92d1f55e93e2f6fb5d71f3133d935b8d1c132e9
4
+ data.tar.gz: 81b97cdd4250a385683d057284f1caa9ff82e0a4
5
5
  SHA512:
6
- metadata.gz: b154db08ac62478501dbad44c8330f6abb79a30514ded5432400b36221934a7c89e740b4180471c9334d04c2638bada78fec70a0c4490a570c8db6ad9f99e2de
7
- data.tar.gz: e383c7167af2a394cc2ea7f0930c581c6e3afae5c630b7311791e2dcff8438b45f2999fda09e586f71324c3d35d48b567252a3fa9960abb63172d465faea585e
6
+ metadata.gz: c5cde2ee23d353814cfb4dfe4020cf358cf07cd0a66e84b068095b8bda3a2e6691df6d5f6f72a14b1236500bb9a2d863f806954e384b74832ef9d2a1fc4b269f
7
+ data.tar.gz: 43de8ee9da066f047a59a255562667c947c5869731f3948c6c4a4820ea8ff316bee58bf24b47c5d1846905524d3e05a36f777012c0ba383256dab93de11b7151
data/lib/twterm/app.rb CHANGED
@@ -7,7 +7,7 @@ module Twterm
7
7
  def initialize
8
8
  Dir.mkdir(DATA_DIR, 0700) unless File.directory?(DATA_DIR)
9
9
 
10
- Auth.authenticate_user(config) if config[:screen_name].nil?
10
+ Auth.authenticate_user(config) if config[:user_id].nil?
11
11
 
12
12
  Screen.instance
13
13
  FilterQueryWindow.instance
data/lib/twterm/auth.rb CHANGED
@@ -20,7 +20,7 @@ module Twterm
20
20
  config[:access_token] = access_token.token
21
21
  config[:access_token_secret] = access_token.secret
22
22
  config[:screen_name] = access_token.params[:screen_name]
23
- config[:user_id] = access_token.params[:user_id]
23
+ config[:user_id] = access_token.params[:user_id].to_i
24
24
  end
25
25
 
26
26
  module_function :authenticate_user
data/lib/twterm/config.rb CHANGED
@@ -6,8 +6,9 @@ module Twterm
6
6
 
7
7
  def []=(key, value)
8
8
  return if config[key] == value
9
- save_config_to_file
9
+
10
10
  config[key] = value
11
+ save_config_to_file
11
12
  end
12
13
 
13
14
  private
@@ -30,7 +30,7 @@ module Twterm
30
30
  'Tweets' => {
31
31
  '[c]' => 'Conversation',
32
32
  '[D]' => 'Delete',
33
- '[F]' => 'Add to favorite',
33
+ '[L]' => 'Like',
34
34
  '[n]' => 'New tweet',
35
35
  '[o]' => 'Open URLs',
36
36
  '[r]' => 'Reply',
@@ -98,7 +98,7 @@ module Twterm
98
98
  show_conversation
99
99
  when ?D
100
100
  destroy_status
101
- when ?F
101
+ when ?F, ?L
102
102
  favorite
103
103
  when ?o
104
104
  open_link
@@ -188,7 +188,7 @@ module Twterm
188
188
  end
189
189
 
190
190
  if status.favorited?
191
- window.with_color(:black, :yellow) do
191
+ window.with_color(:black, :red) do
192
192
  window.addch(' ')
193
193
  end
194
194
 
@@ -203,8 +203,8 @@ module Twterm
203
203
  end
204
204
 
205
205
  if status.favorite_count > 0
206
- window.with_color(:yellow) do
207
- window.addstr("#{status.favorite_count}fav#{status.favorite_count > 1 ? 's' : ''}")
206
+ window.with_color(:red) do
207
+ window.addstr("#{status.favorite_count}like#{status.favorite_count > 1 ? 's' : ''}")
208
208
  end
209
209
  window.addch(' ')
210
210
  end
@@ -37,7 +37,7 @@ module Twterm
37
37
  end
38
38
 
39
39
  def title
40
- @user.nil? ? 'Loading...' : "@#{@user.screen_name} favorites"
40
+ @user.nil? ? 'Loading...' : "@#{@user.screen_name} likes"
41
41
  end
42
42
  end
43
43
  end
@@ -42,7 +42,7 @@ module Twterm
42
42
  open_timeline_tab
43
43
  show_friends
44
44
  show_followers
45
- show_favorites
45
+ show_likes
46
46
  )
47
47
  items << :open_website unless user.website.nil?
48
48
  items << :toggle_follow unless myself?
@@ -57,7 +57,7 @@ module Twterm
57
57
 
58
58
  case key
59
59
  when ?F
60
- follow
60
+ follow unless myself?
61
61
  when 10
62
62
  perform_selected_action
63
63
  when ?t
@@ -154,8 +154,8 @@ module Twterm
154
154
  open_timeline_tab
155
155
  when :open_website
156
156
  open_website
157
- when :show_favorites
158
- show_favorites
157
+ when :show_likes
158
+ show_likes
159
159
  when :show_followers
160
160
  show_followers
161
161
  when :show_friends
@@ -175,7 +175,7 @@ module Twterm
175
175
  end
176
176
  end
177
177
 
178
- def show_favorites
178
+ def show_likes
179
179
  tab = Tab::Statuses::Favorites.new(user_id)
180
180
  TabManager.instance.add_and_show(tab)
181
181
  end
@@ -293,8 +293,8 @@ module Twterm
293
293
  window.addstr("[ ] Open website (#{user.website})")
294
294
  window.setpos(current_line, 6)
295
295
  window.bold { window.addch(?W) }
296
- when :show_favorites
297
- window.addstr(" #{user.favorites_count.format} favorites")
296
+ when :show_likes
297
+ window.addstr(" #{user.favorites_count.format} likes")
298
298
  when :show_followers
299
299
  window.addstr(" #{user.followers_count.format} followers")
300
300
  when :show_friends
@@ -1,3 +1,3 @@
1
1
  module Twterm
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twterm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Kameoka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-11 00:00:00.000000000 Z
11
+ date: 2015-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses