cinch-title 0.0.5 → 0.1.0
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.
- data/VERSION +1 -1
- data/cinch-title.gemspec +2 -2
- data/lib/cinch-title.rb +4 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/cinch-title.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cinch-title}
|
8
|
-
s.version = "0.0
|
8
|
+
s.version = "0.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Victor Bergöö"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-12-05}
|
13
13
|
s.default_executable = %q{cinch-title}
|
14
14
|
s.description = %q{Plugin for the irc-framework Cinch to output HTML-titles}
|
15
15
|
s.email = %q{victor.bergoo@gmail.com}
|
data/lib/cinch-title.rb
CHANGED
@@ -41,7 +41,10 @@ module Cinch
|
|
41
41
|
def parse uri
|
42
42
|
content = Curl::Easy.perform(uri).body_str
|
43
43
|
html = Nokogiri::HTML(content)
|
44
|
-
|
44
|
+
title = html.at("title")
|
45
|
+
|
46
|
+
return "No title" if title.nil?
|
47
|
+
CGI.unescape_html title.text.gsub(/\s+/, ' ')
|
45
48
|
end
|
46
49
|
end
|
47
50
|
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
|
9
|
-
version: 0.0.5
|
9
|
+
version: 0.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Victor Berg\xC3\xB6\xC3\xB6"
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-12-05 00:00:00 +01:00
|
18
18
|
default_executable: cinch-title
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|