descartes 0.3.13 → 0.3.14

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: 0a3bc14f871a16d06a72a43d19022257ad20f83a
4
- data.tar.gz: db9b1e43fc1839133f5d633dd8277292ab5f51b3
3
+ metadata.gz: 9cdcd60c7e41d412cc589426bf4a3f8512c7a5ad
4
+ data.tar.gz: 0ee7fa46d001a6fc57fdfd2abe718e1b4bba45be
5
5
  SHA512:
6
- metadata.gz: 7df8ba572ba08a42e8506b8ddf5959fd7c65e992f93c04ddf8be18093a502e4927d88659844f33506d66122b68ac7acd67c07b6e02382644131ae27fbe490931
7
- data.tar.gz: 8d5e03890c017803f7bb641dc4b52294947584e42fe9772aa10426f8508cce000dd72e9dfc27bf04b52302a4d3eb6fe2d778498d411c432d8f79cc42ca13c975
6
+ metadata.gz: 49ec8e9ea9ff909eaf419166799e11e2eb5bfdae5b64e60a69072161a6e0ad41c4993b38bbd41250d6bb28d3606296fd9e5209162f8fe78ec6f140778a54f15c
7
+ data.tar.gz: 07c58817f94e3c9a6635367ebe444844e12ec61169c4f6ef3503a7657ef57be95122ebbcfb38ea61f18680e700209e5f39804182e89a9fca3a52ae56eee2cfc4
@@ -35,9 +35,11 @@ class Descartes
35
35
 
36
36
  match 'lastsong', method: :last_played_song
37
37
  def last_played_song(m)
38
+ authenticate!
39
+
38
40
  usernick = m.user.nick
39
41
  lastfmnick = get_lastfm_nicks_archive[usernick]
40
- m.reply "Hey #{usernick}, I don't know your Last.fm nick. add it using !lastfmuser add <lastfmnick>" unless lastfmnick
42
+ m.reply "Hey #{usernick}, I don't know your Last.fm nick. add it using '!lastfmuser add <lastfmnick>'." unless lastfmnick
41
43
 
42
44
  user = Rockstar::User.new lastfmnick
43
45
  track = user.recent_tracks.first
@@ -46,7 +48,7 @@ class Descartes
46
48
  if track.now_playing?
47
49
  m.reply "#{lastfmnick} is listening to #{track.name} by #{track.artist} (#{album}) right now!"
48
50
  else
49
- m.reply "the last song #{lastfmnick} listened to is #{track.name} by #{track.artist} (#{album})."
51
+ m.reply "The last song #{lastfmnick} listened to is #{track.name} by #{track.artist} (#{album})."
50
52
  end
51
53
  end
52
54
 
@@ -58,18 +60,18 @@ class Descartes
58
60
  file = File.join File.dirname(__FILE__), 'reply', 'lastfm_nicks.yml'
59
61
  File.open(file, ?w) { |f| f.write YAML.dump(nicks) }
60
62
 
61
- m.reply "Ok, added user #{lastfmnick}"
63
+ m.reply "Ok, added user #{lastfmnick}."
62
64
  end
63
65
 
64
- match 'lastfmuser remove', method: :remove_user
65
- def remove_user(m)
66
+ match /lastfmuser remove (\w{1,15})/, method: :remove_user
67
+ def remove_user(m, lastfmnick)
66
68
  nicks = get_lastfm_nicks_archive
67
- nicks.delete m.user.nick
69
+ nicks.delete lastfmnick
68
70
 
69
71
  file = File.join File.dirname(__FILE__), 'reply', 'lastfm_nicks.yml'
70
72
  File.open(file, ?w) { |f| f.write YAML.dump(nicks) }
71
73
 
72
- m.reply "Ok, removed user #{lastfmnick}"
74
+ m.reply "Ok, removed user #{lastfmnick}."
73
75
  end
74
76
 
75
77
  match /lastfmuser show ([^\b]+)/, method: :show_relations
@@ -80,7 +82,7 @@ class Descartes
80
82
  get_lastfm_nicks_archive.each { |usernick, lastfmnick|
81
83
  if usernick_list.include? usernick
82
84
  found = true
83
- m.reply "#{usernick} is known as #{lastfmnick}"
85
+ m.reply "#{usernick} is known as #{lastfmnick}."
84
86
  end
85
87
  }
86
88
 
@@ -14,6 +14,6 @@
14
14
 
15
15
  class Descartes
16
16
  def self.version
17
- '0.3.13'
17
+ '0.3.14'
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.3.13
4
+ version: 0.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano