gnome-campfire-notifications 0.2.0 → 0.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d33fe5784330094fa6c7215853d6e091feb0c558
|
4
|
+
data.tar.gz: a15cbac7f01f7d9a1544aa473f77f90fc888349e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29400a304330ed93b83940927ca1581f82e1ea4fd7deb56647ddec2da20addeb81712b4306fc391a30d42c1aa854e4da26219e766d26abe1e644008b3c53604e
|
7
|
+
data.tar.gz: ba8c7e1a0bb1bb7cd0052e82b0207bc89e7a8fa90d6f1d7cbca488d5ac57fbc304ee66b4a75c89348ed0a76131bdd4324dca1901e9850ca85c0bfdaa7c3e8978
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "gnome-campfire-notifications"
|
3
|
-
s.version = "0.2.
|
3
|
+
s.version = "0.2.1"
|
4
4
|
s.summary = "GNOME desktop notifications for Campfire."
|
5
5
|
s.description = "A Ruby script that issues GNOME desktop notifications when something is said in your Campfire chatroom."
|
6
6
|
s.authors = ["Michael Nelson"]
|
@@ -31,7 +31,7 @@ class GnomeCampfireNotifications
|
|
31
31
|
username = get_username(item["user_id"].to_i)
|
32
32
|
|
33
33
|
if should_send?(username, item["body"])
|
34
|
-
system("notify-send --hint=int:transient:1 -u low#{icon} \"#{username}\" \"#{
|
34
|
+
system("notify-send --hint=int:transient:1 -u low#{icon} \"#{username}\" \"#{escape_for_bash(item["body"])}\"")
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -115,7 +115,7 @@ class GnomeCampfireNotifications
|
|
115
115
|
"#{@config[:subdomain]}.campfirenow.com"
|
116
116
|
end
|
117
117
|
|
118
|
-
def
|
119
|
-
string.gsub(/"/, '
|
118
|
+
def escape_for_bash(string)
|
119
|
+
string.gsub(/("|`)/, '\\\\\\1')
|
120
120
|
end
|
121
121
|
end
|
@@ -31,10 +31,10 @@ describe GnomeCampfireNotifications do
|
|
31
31
|
it "returns true" do
|
32
32
|
gcn = GnomeCampfireNotifications.new
|
33
33
|
gcn.load_dummy_config
|
34
|
-
input = {"user_id" => '1', "body" => 'quote"s quote\'s'}
|
35
34
|
|
36
35
|
gcn.stub(:get_username, 'Fred') do
|
37
|
-
assert_equal true, gcn.send_notification(
|
36
|
+
assert_equal true, gcn.send_notification({"user_id" => '1', "body" => 'quote"s quote\'s'})
|
37
|
+
assert_equal true, gcn.send_notification({"user_id" => '1', "body" => 'back `ticks`'})
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gnome-campfire-notifications
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Nelson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: twitter-stream
|