hobostove 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hobostove/panel.rb +6 -0
- data/lib/hobostove/user_panel.rb +15 -0
- data/lib/hobostove/window.rb +8 -4
- data/lib/hobostove.rb +1 -0
- metadata +3 -2
data/lib/hobostove/panel.rb
CHANGED
data/lib/hobostove/window.rb
CHANGED
@@ -74,9 +74,13 @@ module Hobostove
|
|
74
74
|
Notify.notify username, message[:body]
|
75
75
|
@messages_panel << "#{username}: #{message[:body]}"
|
76
76
|
when "EnterMessage"
|
77
|
-
|
77
|
+
username = user(message[:user_id])[:name]
|
78
|
+
@messages_panel << "\t#{username} joined"
|
79
|
+
@users_panel.add_user(username)
|
78
80
|
when "LeaveMessage"
|
79
|
-
|
81
|
+
username = user(message[:user_id])[:name]
|
82
|
+
@messages_panel << "\t#{username} left"
|
83
|
+
@users_panel.remove_user(username)
|
80
84
|
end
|
81
85
|
end
|
82
86
|
|
@@ -91,7 +95,7 @@ module Hobostove
|
|
91
95
|
Ncurses.cbreak
|
92
96
|
Ncurses.noecho
|
93
97
|
|
94
|
-
@users_panel =
|
98
|
+
@users_panel = UserPanel.new(Ncurses.LINES, 20, 0, Ncurses.COLS - 20)
|
95
99
|
@messages_panel = Panel.new(Ncurses.LINES - 3, Ncurses.COLS - 20, 0, 0, :nowrap => true)
|
96
100
|
@message_panel = InputPanel.new(3, Ncurses.COLS - 20, Ncurses.LINES - 3, 0)
|
97
101
|
|
@@ -111,7 +115,7 @@ module Hobostove
|
|
111
115
|
def load_users
|
112
116
|
room.users.each do |user|
|
113
117
|
@user_names << user["name"]
|
114
|
-
@users_panel
|
118
|
+
@users_panel.add_user(user["name"])
|
115
119
|
end
|
116
120
|
end
|
117
121
|
|
data/lib/hobostove.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hobostove
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: tinder
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- lib/hobostove/room_picker.rb
|
138
138
|
- lib/hobostove/setup.rb
|
139
139
|
- lib/hobostove/upgrade.rb
|
140
|
+
- lib/hobostove/user_panel.rb
|
140
141
|
- lib/hobostove/window.rb
|
141
142
|
- lib/hobostove.rb
|
142
143
|
- bin/hobostove
|