descartes 0.3.1 → 0.3.3

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: a7665c9d7e36cf14dd567eaa9117a6a9dabe1ad9
4
- data.tar.gz: c368d12f517d0f7f73bc36b87cd5a6b557769e41
3
+ metadata.gz: 301615292920003d732defd63cb9228af2a11183
4
+ data.tar.gz: 058863b9b98c73b713d5e8de084947888266ac70
5
5
  SHA512:
6
- metadata.gz: 6cd7203fd36410896c14e9db9dbff0b3c8d24feb925ab440ad7087da94423ea5e4c2b6e6e9c8106dca9b4d25b2a9df5ad8af65f135d8fa68fb99de23e563593b
7
- data.tar.gz: fafd1f3323c558e82f2785fc85e59c45cac0f970164c00ad471942a072d82693ed9bea26a1f53ac32c559b56e7c3a9bd79fbed6f23bafed7f2d62bb27a01df6b
6
+ metadata.gz: da19ed1933fc604ae075864ec61e6b25353069d862b1ded475ef137f8ad78fe87abe1a1fb854e38de8a02a18728aaca095369e1d25a2cc82c1e7907e66b52ba9
7
+ data.tar.gz: ff09d40c16f7ff72398a6ec23cdd4f1de6b84f7272e0ab78d0e5c05fb32182056aa186597f8f9d6999e08758737b2563ecefb6c732f5532ebb34d325b9ee09f3
@@ -0,0 +1,34 @@
1
+ ##
2
+ # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
3
+ # Version 2, December 2004
4
+ #
5
+ # Everyone is permitted to copy and distribute verbatim or modified
6
+ # copies of this license document, and changing it is allowed as long
7
+ # as the name is changed.
8
+ #
9
+ # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
10
+ # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
11
+ #
12
+ # 0. You just DO WHAT THE FUCK YOU WANT TO.
13
+ ##
14
+
15
+ require 'crunchyroll'
16
+
17
+ class Descartes
18
+ class Crunchybot
19
+ include Cinch::Plugin
20
+ match /\.cr (.+)/, :use_prefix => false
21
+
22
+ def execute(m)
23
+ series = Crunchyroll::find m.params[1].split('.cr ')[1]
24
+
25
+ if series
26
+ # m.reply "#{Format(:red, series[:title])} is a series airing on #{Format(:red, series[:where])} at #{Format(:red, series[:day])} #{Format(:red, series[:hour])}:#{Format(:red, series[:min])} which is in #{Format(:red, series[:left])}."
27
+ m.reply "#{Format(:red, series[:title])} è una serie trasmessa da #{Format(:red, series[:where])} il #{Format(:red, series[:day].to_ita)} alle #{Format(:red, series[:hour])}:#{Format(:red, series[:min])}, cioè tra #{Format(:red, series[:left].to_ita)}."
28
+ else
29
+ # m.reply Format(:red, 'Anime not found')
30
+ m.reply Format(:red, 'Anime non trovato')
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,14 @@
1
+ class String
2
+ def to_ita
3
+ day_eng = [ 'Sundays', 'Mondays', 'Tuesdays', 'Wednesdays', 'Thursdays', 'Fridays', 'Saturdays' ]
4
+ day_ita = [ 'Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato' ]
5
+ tim_eng = [ 'days', 'hours', 'minutes', 'seconds' ]
6
+ tim_ita = [ 'giorni', 'ore', 'minuti', 'secondi' ]
7
+
8
+ self.tap { |s|
9
+ 0.upto(6) { |i| s.gsub! day_eng[i], day_ita[i] }
10
+ 0.upto(3) { |i| s.gsub! tim_eng[i], tim_ita[i] }
11
+ s.gsub! 'and', 'e'
12
+ }
13
+ end
14
+ end
@@ -14,6 +14,6 @@
14
14
 
15
15
  class Descartes
16
16
  def self.version
17
- '0.3.1'
17
+ '0.3.3'
18
18
  end
19
19
  end
data/lib/descartes.rb CHANGED
@@ -14,5 +14,6 @@
14
14
 
15
15
  require 'cinch'
16
16
  require 'cinch/plugins/login'
17
+ require 'descartes/utils'
17
18
  require 'descartes/descartes'
18
19
  require 'descartes/version'
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.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: crunchyroll
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: A serious modular ruby IRC bot.
56
70
  email: webmaster@giovannicapuano.net
57
71
  executables:
@@ -60,6 +74,7 @@ extensions: []
60
74
  extra_rdoc_files: []
61
75
  files:
62
76
  - lib/descartes/descartes.rb
77
+ - lib/descartes/modules/crunchyroll.rb
63
78
  - lib/descartes/modules/currency.rb
64
79
  - lib/descartes/modules/google.rb
65
80
  - lib/descartes/modules/hi.rb
@@ -68,6 +83,7 @@ files:
68
83
  - lib/descartes/modules/shinbo.rb
69
84
  - lib/descartes/modules/trec.rb
70
85
  - lib/descartes/modules/url.rb
86
+ - lib/descartes/utils.rb
71
87
  - lib/descartes/version.rb
72
88
  - lib/descartes.rb
73
89
  - bin/descartes