descartes 0.7.5 → 0.7.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: 4f7c968f7efbc8bcf21a9cfd1859b5f7751047ec
4
- data.tar.gz: a9afaeb8787d75fe201a14d9c4940a93a5290bc5
3
+ metadata.gz: a36a86990e396c36c4a52701705f388c0a249e91
4
+ data.tar.gz: d31c1fd9bf0bbb647f567f415b264317db92060d
5
5
  SHA512:
6
- metadata.gz: 9b1234426f18c2098c105fec695db90d6eaeb07058631140a21191f7954fae82aaa68b743ec2bd4b0caefbba301d32c58f390396ded7a2e0a88caa0b089670e9
7
- data.tar.gz: 1ce386d647349b11a064c1285c66719af601b6821fce8ecf84786f89874afb4212e21f6540fd26dc42c05f1dd383bd67c3abb9ed7bd7510bd6ca77aaa2477b97
6
+ metadata.gz: 4fe92d70797c6473af7ce6c78334429a2927c3e7d9f09564ee392d186b057beb20f4d6ff93b253a81ed01c2781c5876e827595272a3c76230c592bfd0e0a7f1c
7
+ data.tar.gz: 30957bb4538fd40c361e8597f6ab94b50ca77614ccd1356cd7428d1468ad960192bf65c380ec4bc429a921e11c0cd385fc08fff2dd0da1fe18a434a24fe776c7
@@ -18,16 +18,29 @@ require 'crunchyroll'
18
18
  class Descartes
19
19
  class Crunchybot
20
20
  include Cinch::Plugin
21
- match /\.cr (.+)/, use_prefix: false
22
21
 
23
- def execute(m)
24
- series = Crunchyroll::find m.params[1].split('.cr ')[1]
22
+ match /\.cr$/, use_prefix: false, method: :today
23
+ def today(m)
24
+ crunchyroll = Crunchyroll.today
25
+ not_aired = crunchyroll.reject { |r| r[:left].include? 'days' }
26
+ already_aired = (crunchyroll - not_aired).map { |r| r[:title].colorize }.flatten.join(', ')[0..-2]
27
+
28
+ m.reply "Gli anime di oggi su #{'Crunchyroll'.colorize}:"
29
+
30
+ not_aired.each { |series|
31
+ m.reply "#{series[:title].colorize} (tra #{series[:left].to_ita.colorize})."
32
+ }
33
+
34
+ m.reply "Sono stati già trasmessi: #{already_aired}."
35
+ end
36
+
37
+ match /\.cr (.+)/, use_prefix: false, method: :get
38
+ def get(m)
39
+ series = Crunchyroll.get m.params[1].split('.cr ')[1]
25
40
 
26
41
  if series
27
- # m.reply "#{series[:title].colorize} is a series airing on #{series[:where].colorize} at #{series[:day].colorize} #{series[:hour].colorize}:#{series[:min].colorize} which is in #{series[:left].colorize}."
28
42
  m.reply "#{series[:title].colorize} è una serie trasmessa da #{series[:where].colorize} il #{series[:day].to_ita.colorize} alle #{series[:hour].colorize}:#{series[:min].colorize}, cioè tra #{series[:left].to_ita.colorize}."
29
43
  else
30
- # m.reply 'Anime not found'.colorize
31
44
  m.reply 'Anime non trovato'.colorize
32
45
  end
33
46
  end
@@ -14,6 +14,6 @@
14
14
 
15
15
  class Descartes
16
16
  def self.version
17
- '0.7.5'
17
+ '0.7.6'
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: descartes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-18 00:00:00.000000000 Z
11
+ date: 2014-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cinch