hobostove 0.3.1 → 0.3.2

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: ecaa5839b6d6b36961b1ff7c0cb3fc9027fc29fd
4
- data.tar.gz: 89defa9c478c1f58bc182b3e7c8de1695d6001e2
3
+ metadata.gz: 202739e22e4b0508f6ee61d6ecd51a96cefc2750
4
+ data.tar.gz: 40664656c535e01ccddb69ff3102c0c572eddaa3
5
5
  SHA512:
6
- metadata.gz: 1cab7b6a08d667e0eddc20b3e3ae6ea9d3917580e877a572a07fb1f44964b878df5e8d160267cbb9bc8ea49d25661c1e0159fc4f8c73ac7b0664890d7b1ac6ca
7
- data.tar.gz: 4b54c6cd99624a0be079aa98b40dd359f3143aac8814f91366f5f98d28dbef4351069596eff3f3809d270acfcc41378d4df1580b6beb2eb2f3947bfaa5c7d778
6
+ metadata.gz: c313f34f3dee20164f6c3d344ebec26f8f7fd62114251a8dc603552810d91a8024d776657e880b3e587ed4874eccd9597d8f17ccddb725e8a278a7b73ae67584
7
+ data.tar.gz: 1b173ea78744daabd3f9d3cf811113af6dbfada6add0c020d752755103295654d7de93c78657e0aa35846d1b12bf68bf6a36c0e4ebb7cbb1ea50285893760633
@@ -26,6 +26,7 @@ module Hobostove
26
26
 
27
27
  def send_message(message)
28
28
  connection.post("/room/#{room_id}/speak.json") do |req|
29
+ req.headers["Content-Type"] = "application/json"
29
30
  req.body = {
30
31
  :message => {
31
32
  :type => "TextMessage",
@@ -12,6 +12,8 @@ module Hobostove
12
12
  load_users
13
13
  stream
14
14
  main
15
+ rescue => e
16
+ Hobostove.logger.error(e.inspect)
15
17
  ensure
16
18
  Hobostove.logger.debug("terminated")
17
19
  stop_curses
@@ -61,16 +63,20 @@ module Hobostove
61
63
  def stream
62
64
  Thread.new do
63
65
  loop do
64
- recent = campfire.recent_messages
65
- recent.each do |message|
66
- next if messages.include?(message.id)
67
- messages << message.id
68
- handle_message(message)
66
+ begin
67
+ recent = campfire.recent_messages
68
+ recent.each do |message|
69
+ next if messages.include?(message.id)
70
+ messages << message.id
71
+ handle_message(message)
72
+ end
73
+
74
+ @messages_panel.refresh
75
+
76
+ sleep 1
77
+ rescue => e
78
+ Hobostove.logger.error(e.inspect)
69
79
  end
70
-
71
- @messages_panel.refresh
72
-
73
- sleep 1
74
80
  end
75
81
  end
76
82
  end
@@ -107,6 +113,7 @@ module Hobostove
107
113
  Curses.init_screen
108
114
  Curses.cbreak
109
115
  Curses.noecho
116
+ Curses.curs_set(0)
110
117
 
111
118
  @users_panel = UserPanel.new(Curses.lines, 20, 0, Curses.cols - 20)
112
119
  @messages_panel = Panel.new(Curses.lines - 3, Curses.cols - 20, 0, 0, :nowrap => true)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobostove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Oestrich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-20 00:00:00.000000000 Z
11
+ date: 2014-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '3.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '3.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: fakefs
113
113
  requirement: !ruby/object:Gem::Requirement