twitch-bot 5.0.0 → 5.0.4

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
  SHA256:
3
- metadata.gz: 62d03f6a524a016a3c7472f473699677c203961d5c0db80d8345da5a2e48397d
4
- data.tar.gz: c9a11d3c030bf1a9debf6bb66b06a18b80d814347b123dc41f070d4cd5670064
3
+ metadata.gz: 55efafd3be859a555199d458dc121cb0443abbb8dbe1d959427400a98b4cace8
4
+ data.tar.gz: a249684d91df3240acd1e0aa8278050df4da198177cc11212b0c44c612d3d80c
5
5
  SHA512:
6
- metadata.gz: 34fe79b2b493e373bf79665dd001bda15e6c4bc87e6c70ba2a6bb0a34a6190b1800450ffcdfa850f167c29e8ec25a5a1bee2837116a9d1b93313f213b170475e
7
- data.tar.gz: 9cdf0dde5c84e3fac9f5e1a37d8aaddddd284086e900390dac97f384c364a11a138cbad0bd098a96eaf5020a99b749a38149111890c9f798d169b46f77f895f1
6
+ metadata.gz: 06bbeb7d511828bcaf046eb207f4995708f4b663cac42bd1f0e137ee6b0f0f1afc818d83f20dd185c40c37babb3d2d9b3c3dd7ddca9b538cfbd95182fb596ced
7
+ data.tar.gz: 96682183d25a717a54fc44e8f020e1c2a94ad35033d904104044636bc4b3249125ba336a0403ade2a1f4a3949c206641d9d98c9440f0f6e17068fab87c1617d1
@@ -27,27 +27,3 @@ jobs:
27
27
  bundle exec rake test
28
28
  env:
29
29
  REDIS_URL: 'redis://redis:6379'
30
-
31
- release:
32
- if: startsWith(github.ref, 'refs/tags/v')
33
- needs: test
34
- runs-on: ubuntu-latest
35
- steps:
36
- - uses: actions/checkout@v2
37
- - name: Setup
38
- uses: actions/setup-ruby@v1
39
- with:
40
- ruby-version: 2.6.x
41
- - name: Bundle
42
- run: |
43
- gem install bundler
44
- bundle install --jobs 4 --retry 3
45
- - name: Publish to RubyGems
46
- run: |
47
- mkdir -p $HOME/.gem
48
- touch $HOME/.gem/credentials
49
- chmod 0600 $HOME/.gem/credentials
50
- printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
51
- rake release
52
- env:
53
- GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog Twitch::Bot
2
2
 
3
+ ## v5.0.4
4
+
5
+ - [FIX] Handle `nil` values from Redis.
6
+
7
+ ## v5.0.3
8
+
9
+ - [FIX] Remove CI release stage broken by Rubygems OTP.
10
+
11
+ ## v5.0.2
12
+
13
+ - [FIX] `PART` command caused a crash when not in a channel.
14
+
15
+ ## v5.0.1
16
+
17
+ - [FIX] Environment variable `REDIS_URL` now has precedence over configuration
18
+ object values.
19
+
3
20
  ## v5.0.0
4
21
 
5
22
  - [BREAKING] Complex values like arrays and hashes get serialized as JSON before
@@ -9,6 +9,7 @@ module Twitch
9
9
  class Irc
10
10
  def initialize(client:)
11
11
  @client = client
12
+ @channel = nil
12
13
 
13
14
  open_socket
14
15
  end
@@ -29,7 +30,7 @@ module Twitch
29
30
  end
30
31
 
31
32
  def send_message(text)
32
- privmsg = "PRIVMSG ##{channel.name} :#{text}"
33
+ privmsg = "PRIVMSG ##{@channel.name} :#{text}"
33
34
  send_data(privmsg)
34
35
  end
35
36
 
@@ -37,19 +38,19 @@ module Twitch
37
38
  send_data_to_socket(data)
38
39
  end
39
40
 
40
- def join_channel(channel)
41
- @channel = channel
42
- send_data "JOIN ##{channel.name}"
41
+ def join_channel(channel_object)
42
+ @channel = channel_object
43
+ send_data "JOIN ##{@channel.name}"
43
44
  end
44
45
 
45
46
  def part_channel
46
- send_data "PART ##{channel.name}"
47
+ send_data "PART ##{@channel.name}" if @channel
47
48
  @channel = nil
48
49
  end
49
50
 
50
51
  private
51
52
 
52
- attr_reader :socket, :client, :channel
53
+ attr_reader :socket, :client
53
54
 
54
55
  def open_socket
55
56
  @socket = ::TCPSocket.new(
@@ -19,7 +19,7 @@ module Twitch
19
19
 
20
20
  def retrieve(key)
21
21
  value = redis.get(key)
22
- JSON.parse(value)
22
+ value.nil? ? nil : JSON.parse(value)
23
23
  end
24
24
 
25
25
  private
@@ -27,7 +27,7 @@ module Twitch
27
27
  attr_reader :client, :redis
28
28
 
29
29
  def connect_db
30
- url = redis_config_url || ENV["REDIS_URL"]
30
+ url = ENV["REDIS_URL"] || redis_config_url
31
31
  ::Redis.new(url: url)
32
32
  end
33
33
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Twitch
4
4
  module Bot
5
- VERSION = "5.0.0"
5
+ VERSION = "5.0.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitch-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jochen Lillich