descartes 0.8.4.3 → 0.8.4.6

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: f8e3f8379ed3a6ae8595501765478cad83ba94b8
4
- data.tar.gz: 3711c0bc73dbd7b88f8f34959fa559fb711fdc72
3
+ metadata.gz: bc541ba0901931e76a95d38945d20ccd9ed8e12c
4
+ data.tar.gz: 11f8ce67c552d041b3276f70d98135b0c3b997b6
5
5
  SHA512:
6
- metadata.gz: f85a4d2b2c8f41b52fb4f546d5116ab46057de9aac3f41e730241f696adbf0b5545770d18a76339c546f727604ebeb21f9dcff41a24278fe035aee5c7ba688f9
7
- data.tar.gz: fff5640cf9de4001989c89cef85fdffb2e86f9d2cc5e81f1f431859202a7d3e362bfc98d94c4738ec3ef735037fcaca91958f5cdd5f47fb06e893c9fa9b3fc49
6
+ metadata.gz: 1db9aee1cf767d353022b928013fbc7ca9a1b7e958891a20d9e8cfa45c6a20bb8d1e7680b67353d93d9d9097ee340e5f3d4f58831e1bed7d46f1c997d674b1df
7
+ data.tar.gz: 525396d303548c628c2106e04f26c4875f2806f806a173020891fa090072ecb03d093e1b076e8f3df0bc44c9c8da17dc6e623a6469c615a18c9e00d68765a96b
@@ -19,19 +19,32 @@ class Descartes
19
19
  class Crunchybot
20
20
  include Cinch::Plugin
21
21
 
22
- match /\.cr$/, use_prefix: false, method: :today
22
+ match /^\.cr$/, use_prefix: false, method: :today
23
23
  def today(m)
24
24
  crunchyroll = Crunchyroll.today
25
- not_aired = crunchyroll.reject { |h| h[:aired] }
26
- already_aired = (crunchyroll - not_aired).map { |r| r[:title].colorize }.flatten.join(', ')[0..-2]
25
+
26
+ aired = crunchyroll.select { |h| h[:airs] == :aired }.map { |r| r[:title].colorize }.flatten.join(', ')[0..-2]
27
+ tomorrow = crunchyroll.select { |h| h[:airs] == :tomorrow }
28
+ today = crunchyroll.select { |h| h[:airs] == :today }
27
29
 
28
30
  m.reply "Gli anime di oggi su #{'Crunchyroll'.colorize}:"
29
31
 
30
- not_aired.each { |series|
32
+ today.each { |series|
31
33
  m.reply "#{series[:title].colorize} (tra #{series[:left].to_ita.colorize})"
32
34
  }
35
+
36
+ m.reply '' if today.any?
37
+
38
+ if tomorrow.any?
39
+ m.reply "Domani trasmetterà (per via del fuso):"
40
+ tomorrow.each { |series|
41
+ m.reply "#{series[:title].colorize} (tra #{series[:left].to_ita.colorize})"
42
+ }
43
+ end
44
+
45
+ m.reply '' if tomorrow.any?
33
46
 
34
- m.reply "Sono stati già trasmessi: #{already_aired}."
47
+ m.reply "Sono stati già trasmessi: #{aired}." unless aired.empty?
35
48
  end
36
49
 
37
50
  match /\.cr (.+)/, use_prefix: false, method: :get
@@ -14,6 +14,6 @@
14
14
 
15
15
  class Descartes
16
16
  def self.version
17
- '0.8.4.3'
17
+ '0.8.4.6'
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: descartes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4.3
4
+ version: 0.8.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano