muzang-plugins 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/muzang-plugins/muzang-rubygems.rb +9 -5
- data/lib/muzang-plugins/version.rb +1 -1
- data/spec/rubygems_spec.rb +12 -0
- metadata +9 -10
- data/lib/muzang-plugins/muzang-say.rb +0 -12
@@ -39,6 +39,7 @@ class RubyGems
|
|
39
39
|
@new_gem = false
|
40
40
|
rescue Exception
|
41
41
|
connection.msg(message.channel, "Niepoprawna nazwa gema")
|
42
|
+
@store.transaction{@store[:gems].delete(@current_gem)}
|
42
43
|
end
|
43
44
|
}
|
44
45
|
else
|
@@ -53,12 +54,15 @@ class RubyGems
|
|
53
54
|
http = EventMachine::HttpRequest.new("http://rubygems.org/api/v1/gems/#{gem[:name]}.json").get
|
54
55
|
http.callback {
|
55
56
|
iter.next
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
@store
|
57
|
+
begin
|
58
|
+
current_gem = JSON.parse(http.response)
|
59
|
+
if Gem::Version.new(gem[:version]) < Gem::Version.new(current_gem["version"])
|
60
|
+
@store.transaction do
|
61
|
+
@store[:gems][gem[:name]][:version] = current_gem["version"]
|
62
|
+
end
|
63
|
+
connection.msg(message.channel, "Nowa wersja #{gem[:name]} (#{current_gem["version"]})")
|
60
64
|
end
|
61
|
-
|
65
|
+
rescue
|
62
66
|
end
|
63
67
|
}
|
64
68
|
end
|
data/spec/rubygems_spec.rb
CHANGED
@@ -56,6 +56,18 @@ describe "RubyGems" do
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
+
it "should remove gem from storage" do
|
60
|
+
@message.message = "watch! acts-as-messageable2"
|
61
|
+
EM.run do
|
62
|
+
@rubygems.call(@connection, @message)
|
63
|
+
eventually(true) do
|
64
|
+
@rubygems.store.transaction do
|
65
|
+
@rubygems.store[:gems]["acts-as-messageable2"] == nil
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
59
71
|
it "should notice about new version of gem" do
|
60
72
|
@message.message = ""
|
61
73
|
@message.command = :join
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muzang-plugins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-11-20 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: em-http-request
|
16
|
-
requirement: &
|
16
|
+
requirement: &70039033906260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70039033906260
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: muzang
|
27
|
-
requirement: &
|
27
|
+
requirement: &70039033905340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70039033905340
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: em-ventually
|
38
|
-
requirement: &
|
38
|
+
requirement: &70039033904440 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.1.2
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70039033904440
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
requirement: &
|
49
|
+
requirement: &70039033903200 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: 2.6.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70039033903200
|
58
58
|
description: Plugins for Muzang IRC bot
|
59
59
|
email:
|
60
60
|
- piotr.nielacny@gmail.com
|
@@ -217,7 +217,6 @@ files:
|
|
217
217
|
- lib/muzang-plugins/muzang-plusone.rb
|
218
218
|
- lib/muzang-plugins/muzang-reddit.rb
|
219
219
|
- lib/muzang-plugins/muzang-rubygems.rb
|
220
|
-
- lib/muzang-plugins/muzang-say.rb
|
221
220
|
- lib/muzang-plugins/version.rb
|
222
221
|
- muzang-plugins.gemspec
|
223
222
|
- spec/livereload_spec.rb
|