descartes 0.8.6.2 → 0.8.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75bfebcdf24ae3c4ab530d5efec57517f55f0acc
4
- data.tar.gz: 668ac6631f05b85703cf2756403c7b032ab97ff9
3
+ metadata.gz: 9982795cfe7710d3a6e391251d2d198e5a156f90
4
+ data.tar.gz: e27b028e30df01fb0784287c5e4b75ab709c74fa
5
5
  SHA512:
6
- metadata.gz: fd60d9ec9795875ed96f87f6342e67ee25c6b0e68d3549157050280ddbd1b20886a9e1913118f2109c1cf031b6dee378bc18b85aa47b002a0fbd324ad9f04f3d
7
- data.tar.gz: 0b351294d480514d70b2c937de1d25aa24d4bbbabe0ad1a1c31632a2d80f5cb471c586eb29052cc8c7af41d4359ee12ec0aa4c484b4fac8ab72ac3b77f4af258
6
+ metadata.gz: 2e9ba2dedea97aa03164599ae367d82a4ffd41d378f81655875a225d7a5c73b3b494ac50f5ac4c110d73310d90a0c26b0294e1c9fee8f9afced879e61a6e084e
7
+ data.tar.gz: 5e6a31ce090a8ecb134ebb89a7a15c1490ca5e5da82b765b56beeb3bc9cf5477ff28646c48bfb7a46fae3da187022fbdd27931c0f0290290f3f4c488afc19ed6
data/bin/descartes CHANGED
@@ -128,8 +128,8 @@ Cinch::Bot.new {
128
128
  m.reply ?`
129
129
  end
130
130
 
131
- on :message, /!m/ do |m|
132
- m.reply
131
+ on :message, /^!m(.*?)/ do |m, sentence|
132
+ m.reply "µ#{sentence}"
133
133
  end
134
134
 
135
135
  on :message, '!version' do |m|
@@ -137,6 +137,10 @@ Cinch::Bot.new {
137
137
  end
138
138
 
139
139
  on :message, '!modules' do |m|
140
- m.reply Descartes.constants.join(', ')
140
+ modules = [].tap do |plugins|
141
+ Descartes.each_module { |path, name| plugins << name }
142
+ end
143
+
144
+ m.reply modules.join(', ')
141
145
  end
142
146
  }.start
@@ -14,14 +14,19 @@
14
14
 
15
15
  class Descartes
16
16
  class << self
17
+ def each_module
18
+ Dir.glob(File.expand_path('../modules/*.rb', __FILE__)).map do |plugin|
19
+ name = File.basename(plugin, '.rb')
20
+ yield plugin, name unless name == 'VERSION'
21
+ end
22
+ end
23
+
17
24
  def load(options = {})
18
25
  $options = options
19
26
  $options[:exclude] ||= []
20
27
 
21
28
  puts 'Importing modules..'
22
- Dir.glob(File.expand_path('../modules/*.rb', __FILE__)).each do |plugin|
23
- name = plugin.split(?/).last.split(?.).first.downcase
24
-
29
+ each_module do |plugin, name|
25
30
  if $options[:exclude].include?(name)
26
31
  puts "- Skipping #{name}..."
27
32
  else
@@ -31,11 +36,12 @@ class Descartes
31
36
  end
32
37
  end
33
38
 
34
- plugins = Descartes.constants.map do |p|
35
- "Descartes::#{p}".split('::').inject(Object) { |o, c| o.const_get c }
39
+ [].tap do |plugins|
40
+ Descartes.constants.map do |name|
41
+ plugin = "Descartes::#{name}".split('::').inject(Object) { |o, c| o.const_get c }
42
+ plugins << plugin if plugin.is_a?(Class) && plugin.include?(Cinch::Plugin)
43
+ end
36
44
  end
37
-
38
- plugins.select { |plugin| plugin.is_a?(Class) && plugin.include?(Cinch::Plugin) }
39
45
  end
40
46
  end
41
47
  end
@@ -19,7 +19,7 @@ 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
25
 
@@ -47,7 +47,7 @@ class Descartes
47
47
  m.reply "Sono stati già trasmessi: #{aired}." unless aired.empty?
48
48
  end
49
49
 
50
- match /^\.cr (.+)$/, use_prefix: false, method: :get
50
+ match /^\.cr (.+)$/, use_prefix: false, method: :get
51
51
  def get(m)
52
52
  series = Crunchyroll.get m.params[1].split('.cr ')[1]
53
53
 
@@ -13,5 +13,5 @@
13
13
  ##
14
14
 
15
15
  class Descartes
16
- VERSION ||= '0.8.6.2'
16
+ VERSION ||= '0.8.7'
17
17
  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.8.6.2
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-24 00:00:00.000000000 Z
11
+ date: 2015-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cinch
@@ -156,20 +156,6 @@ dependencies:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0.8'
159
- - !ruby/object:Gem::Dependency
160
- name: arnaldo
161
- requirement: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - "~>"
164
- - !ruby/object:Gem::Version
165
- version: '0.1'
166
- type: :runtime
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - "~>"
171
- - !ruby/object:Gem::Version
172
- version: '0.1'
173
159
  description: A serious modular ruby IRC bot.
174
160
  email: webmaster@giovannicapuano.net
175
161
  executables:
@@ -180,7 +166,6 @@ files:
180
166
  - bin/descartes
181
167
  - lib/descartes.rb
182
168
  - lib/descartes/descartes.rb
183
- - lib/descartes/modules/arnaldo.rb
184
169
  - lib/descartes/modules/azzone.rb
185
170
  - lib/descartes/modules/crunchyroll.rb
186
171
  - lib/descartes/modules/currency.rb
@@ -1,25 +0,0 @@
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
- require 'arnaldo'
15
-
16
- class Descartes
17
- class Arnaldo
18
- include Cinch::Plugin
19
-
20
- match 'proverb'
21
- def execute(m)
22
- m.reply "“#{::Arnaldo.get}”".colorize
23
- end
24
- end
25
- end