turntabler 0.1.2 → 0.1.3

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.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # master
2
2
 
3
+ ## 0.1.3 / 2012-12-25
4
+
5
+ * Fix references from Message#text to Message#content in examples
6
+
3
7
  ## 0.1.2 / 2012-12-01
4
8
 
5
9
  * Fix song searches being allowed when the user isn't in a room
data/README.md CHANGED
@@ -103,7 +103,7 @@ Turntabler.run do
103
103
  end
104
104
 
105
105
  client.on :user_spoke do |message|
106
- if message.text =~ /bop/
106
+ if message.content =~ /bop/
107
107
  client.room.current_song.vote # => true
108
108
  end
109
109
  end
@@ -17,7 +17,7 @@ GEM
17
17
  faye-websocket (0.4.6)
18
18
  eventmachine (>= 0.12.0)
19
19
  http_parser.rb (0.5.3)
20
- turntabler (0.1.2)
20
+ turntabler (0.1.3)
21
21
  em-http-request
22
22
  em-synchrony
23
23
  faye-websocket
data/examples/bop.rb CHANGED
@@ -8,7 +8,7 @@ ROOM = ENV['ROOM'] # 'xxxxxxxxxxxxxxxxxxxxxxxx'
8
8
 
9
9
  TT.run(EMAIL, PASSWORD, :room => ROOM) do
10
10
  on :user_spoke do |message|
11
- if message.text =~ /bop/
11
+ if message.content =~ /bop/
12
12
  client.room.current_song.vote
13
13
  end
14
14
  end
data/examples/bopcount.rb CHANGED
@@ -10,7 +10,7 @@ bops_count = 0
10
10
 
11
11
  TT.run(EMAIL, PASSWORD, :room => ROOM) do
12
12
  on :user_spoke do |message|
13
- bops_count += 1 if message.text =~ /bop/
13
+ bops_count += 1 if message.content =~ /bop/
14
14
  room.current_song.vote if bops_count == 2
15
15
  end
16
16
 
data/examples/chat_bot.rb CHANGED
@@ -9,7 +9,7 @@ ROOM = ENV['ROOM'] # 'xxxxxxxxxxxxxxxxxxxxxxxx'
9
9
  TT.run(EMAIL, PASSWORD, :room => ROOM) do
10
10
  on :user_spoke do |message|
11
11
  # Respond to "/hello" command
12
- if (message.text =~ /^\/hello$/)
12
+ if (message.content =~ /^\/hello$/)
13
13
  client.user.say("Hey! How are you @#{message.sender.name}?")
14
14
  end
15
15
  end
data/examples/modlist.rb CHANGED
@@ -12,7 +12,7 @@ moderator_ids = ['xxxxxxxxxxxxxxxxxxxxxxxx', 'xxxxxxxxxxxxxxxxxxxxxxxx']
12
12
  TT.run(EMAIL, PASSWORD, :room => ROOM) do
13
13
  on :user_spoke do |message|
14
14
  # Response to "/mod" command
15
- if moderator_ids.include?(message.sender.id) && message.text =~ /^\/mod$/
15
+ if moderator_ids.include?(message.sender.id) && message.content =~ /^\/mod$/
16
16
  user.say("Yo #{message.sender.name}, it looks like you are a bot moderator!")
17
17
  end
18
18
  end
data/examples/switch.rb CHANGED
@@ -13,7 +13,7 @@ TT.run(EMAIL, PASSWORD, :room => ROOM) do
13
13
  on :user_spoke do |message|
14
14
  if is_on
15
15
  # The bot is on
16
- case message.text
16
+ case message.content
17
17
  when /^\/status$/
18
18
  user.say 'The bot is currently turned on.'
19
19
  when /^\/off$/
@@ -26,7 +26,7 @@ TT.run(EMAIL, PASSWORD, :room => ROOM) do
26
26
  end
27
27
  else
28
28
  # The bot is off
29
- case message.text
29
+ case message.content
30
30
  when /^\/status$/
31
31
  user.say 'The bot is currently turned on.'
32
32
  when /^\/on$/
@@ -349,14 +349,14 @@ module Turntabler
349
349
 
350
350
  # Braodcasts a message in the chat.
351
351
  #
352
- # @param [String] text The text to send to the chat
352
+ # @param [String] content The text to send to the chat
353
353
  # @return [true]
354
354
  # @raise [Turntabler::Error] if the command fails
355
355
  # @example
356
356
  # room.say("What's up guys?") # => true
357
- def say(text)
357
+ def say(content)
358
358
  enter
359
- api('room.speak', :text => text)
359
+ api('room.speak', :text => content)
360
360
  true
361
361
  end
362
362
 
@@ -133,6 +133,7 @@ module Turntabler
133
133
 
134
134
  # Sends a private message to this user.
135
135
  #
136
+ # @param [String] content The text of the message
136
137
  # @return [true]
137
138
  # @raise [Turntabler::Error] if the command fails
138
139
  # @example
@@ -3,7 +3,7 @@ module Turntabler
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- PATCH = 2
6
+ PATCH = 3
7
7
  STRING = [MAJOR, MINOR, PATCH].join(".")
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turntabler
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aaron Pfeifer
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-12-01 00:00:00 Z
18
+ date: 2012-12-25 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: em-synchrony