kirby 4.2.1 → 4.2.2

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.
Files changed (9) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG +2 -0
  3. data/README +5 -5
  4. data/Rakefile +16 -0
  5. data/bin/kirby +0 -0
  6. data/kirby.gemspec +25 -33
  7. data/lib/kirby.rb +30 -10
  8. metadata +23 -9
  9. metadata.gz.sig +0 -0
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ v4.2.2. Fix Delicious integration.
3
+
2
4
  v4.2.1. Small fix for tryruby compatibility.
3
5
 
4
6
  v4.2. Add channel logging; clean up options handling; fix docs.
data/README CHANGED
@@ -9,7 +9,7 @@ Copyright 2007, 2008 Cloudburst, LLC. Licensed under the AFL 3. See the included
9
9
 
10
10
  The public certificate for the gem is here[http://rubyforge.org/frs/download.php/25331/evan_weaver-original-public_cert.pem].
11
11
 
12
- If you like this software, please {make a donation}[http://blog.evanweaver.com/donate/], or {recommend Evan}[http://www.workingwithrails.com/person/7739-evan-weaver] at Working with Rails.
12
+ If you use this software, please {make a donation}[http://blog.evanweaver.com/donate/], or {recommend Evan}[http://www.workingwithrails.com/person/7739-evan-weaver] at Working with Rails.
13
13
 
14
14
  == Features
15
15
 
@@ -35,10 +35,10 @@ To start a basic Kirby from the command line:
35
35
  Logs and repository histories get saved to the working directory.
36
36
 
37
37
  Available post-parameters are:
38
- <tt>--daemon</tt>:: Daemonize.
39
- <tt>--silent</tt>:: Never speak, even for errors.
40
- <tt>--log</tt>:: Log channel chatter to a file.
41
- <tt>--debug</tt>:: Debug mode.
38
+ <tt>----daemon</tt>:: Daemonize.
39
+ <tt>----silent</tt>:: Never speak, even for errors.
40
+ <tt>----log</tt>:: Log channel chatter to a file.
41
+ <tt>----debug</tt>:: Debug mode.
42
42
 
43
43
  See the Kirby class for in-channel commands.
44
44
 
@@ -0,0 +1,16 @@
1
+
2
+ require 'rubygems'
3
+ require 'echoe'
4
+
5
+ Echoe.new("kirby", `cat CHANGELOG`[/^v([\d\.]+)\. /, 1]) do |p|
6
+ p.name = "kirby"
7
+ p.rubyforge_name = "fauna"
8
+ p.description = p.summary = "A super-clean IRC bot with sandboxed Ruby evaluation, svn watching, and link-logging to del.icio.us."
9
+ p.url = "http://blog.evanweaver.com/files/doc/fauna/kirby/"
10
+ p.docs_host = "blog.evanweaver.com:~/www/bax/public/files/doc/"
11
+ p.changes = `cat CHANGELOG`[/^v([\d\.]+\. .*)/, 1]
12
+
13
+ p.extra_deps = ["hpricot", "daemons"]
14
+ p.rdoc_pattern = /bin|lib|README|CHANGELOG|LICENSE/
15
+ p.require_signed = true
16
+ end
data/bin/kirby CHANGED
File without changes
@@ -1,48 +1,40 @@
1
-
2
- # Gem::Specification for Kirby-4.2.1
3
- # Originally generated by Echoe
1
+ # -*- encoding: utf-8 -*-
4
2
 
5
3
  Gem::Specification.new do |s|
6
4
  s.name = %q{kirby}
7
- s.version = "4.2.1"
8
-
9
- s.specification_version = 2 if s.respond_to? :specification_version=
5
+ s.version = "4.2.2"
10
6
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
12
8
  s.authors = [""]
13
- s.date = %q{2008-01-30}
9
+ s.cert_chain = ["/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem"]
10
+ s.date = %q{2009-11-18}
14
11
  s.default_executable = %q{kirby}
15
12
  s.description = %q{A super-clean IRC bot with sandboxed Ruby evaluation, svn watching, and link-logging to del.icio.us.}
16
13
  s.email = %q{}
17
14
  s.executables = ["kirby"]
18
- s.files = ["lib/kirby.rb", "bin/kirby", "README", "LICENSE", "CHANGELOG", "kirby.gemspec"]
19
- s.has_rdoc = true
15
+ s.extra_rdoc_files = ["lib/kirby.rb", "bin/kirby", "README", "LICENSE", "CHANGELOG"]
16
+ s.files = ["lib/kirby.rb", "bin/kirby", "README", "LICENSE", "CHANGELOG", "kirby.gemspec", "Rakefile"]
20
17
  s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/kirby/}
18
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Kirby", "--main", "README"]
21
19
  s.require_paths = ["lib"]
22
20
  s.rubyforge_project = %q{fauna}
23
- s.rubygems_version = %q{1.0.1}
21
+ s.rubygems_version = %q{1.3.5}
22
+ s.signing_key = %q{/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-private_key.pem}
24
23
  s.summary = %q{A super-clean IRC bot with sandboxed Ruby evaluation, svn watching, and link-logging to del.icio.us.}
25
24
 
26
- s.add_dependency(%q<hpricot>, [">= 0"])
27
- s.add_dependency(%q<daemons>, [">= 0"])
28
- end
25
+ if s.respond_to? :specification_version then
26
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
27
+ s.specification_version = 3
29
28
 
30
-
31
- # # Original Rakefile source (requires the Echoe gem):
32
- #
33
- #
34
- # require 'rubygems'
35
- # require 'echoe'
36
- #
37
- # Echoe.new("kirby", `cat CHANGELOG`[/^v([\d\.]+)\. /, 1]) do |p|
38
- # p.name = "kirby"
39
- # p.rubyforge_name = "fauna"
40
- # p.description = p.summary = "A super-clean IRC bot with sandboxed Ruby evaluation, svn watching, and link-logging to del.icio.us."
41
- # p.url = "http://blog.evanweaver.com/files/doc/fauna/kirby/"
42
- # p.docs_host = "blog.evanweaver.com:~/www/bax/public/files/doc/"
43
- # p.changes = `cat CHANGELOG`[/^v([\d\.]+\. .*)/, 1]
44
- #
45
- # p.extra_deps = ["hpricot", "daemons"]
46
- # p.rdoc_pattern = /bin|lib|README|CHANGELOG|LICENSE/
47
- # p.require_signed = true
48
- # end
29
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
30
+ s.add_runtime_dependency(%q<hpricot>, [">= 0"])
31
+ s.add_runtime_dependency(%q<daemons>, [">= 0"])
32
+ else
33
+ s.add_dependency(%q<hpricot>, [">= 0"])
34
+ s.add_dependency(%q<daemons>, [">= 0"])
35
+ end
36
+ else
37
+ s.add_dependency(%q<hpricot>, [">= 0"])
38
+ s.add_dependency(%q<daemons>, [">= 0"])
39
+ end
40
+ end
@@ -1,4 +1,4 @@
1
- %w[open3 daemons socket singleton open-uri cgi pathname hpricot yaml net/https].map{|s| require s}
1
+ %w[open3 daemons socket singleton open-uri cgi pathname hpricot yaml net/https timeout].map{|s| require s}
2
2
 
3
3
  =begin rdoc
4
4
  In-channel commands:
@@ -88,7 +88,7 @@ class Kirby
88
88
  when /^reset_irb/ then reset_irb
89
89
  when /^add_svn (.+?)(\s|\r|\n|$)/ then @svns[$1] = 0 and say @svns.inspect
90
90
  when /^add_atom (.+?)(\s|\r|\n|$)/ then @atoms[$1] = '' and say @atoms.inspect
91
- when /(http:\/\/.*?)(\s|\r|\n|$)/ then post($1) if config[:delicious_pass]
91
+ when /(http(s|):\/\/.*?)(\s|\r|\n|$)/ then post($1) if config[:delicious_pass]
92
92
  end
93
93
  end
94
94
  end
@@ -168,23 +168,43 @@ class Kirby
168
168
  File.open(config[:atoms], 'w') {|f| f.puts YAML.dump(@atoms)}
169
169
  end
170
170
 
171
- # Post a url to the del.icio.us account.
171
+ # Post a url to the del.i cio.us account.
172
172
  def post url
173
- puts "POST: #{url}" if config[:debug]
174
- query = {:url => url,
175
- :description => (((Hpricot(open(url))/:title).first.innerHTML or url) rescue url),
176
- :tags => (Hpricot(open("http://del.icio.us/url/check?url=#{CGI.escape(url)}"))/'.alphacloud'/:a).map{|s| s.innerHTML}.join(" "),
177
- :replace => 'yes' }
178
- begin
173
+ Timeout.timeout(60) do
174
+ puts "POST: #{url}" if config[:debug]
175
+
176
+ tags = (Hpricot(open("http://del.icio.us/url/check?url=#{CGI.escape(url)}"))/
177
+ '#top-tags'/'li')[0..10].map do |li|
178
+ (li/'span').innerHTML[/(.*?)<em/, 1]
179
+ end.join(" ")
180
+ puts "POST-TAGS: #{tags}" if config[:debug]
181
+
182
+ description = begin
183
+ Timeout.timeout(5) do
184
+ (((Hpricot(open(url))/:title).first.innerHTML or url) rescue url)
185
+ end
186
+ rescue Timeout::Error
187
+ puts "POST: URL timeout" if config[:debug]
188
+ url
189
+ end
190
+
191
+ query = { :url => url, :description => description, :tags => tags, :replace => 'yes' }
192
+
179
193
  http = Net::HTTP.new('api.del.icio.us', 443)
180
194
  http.use_ssl = true
195
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
181
196
  response = http.start do |http|
182
- req = Net::HTTP::Get.new('/v1/posts/add?' + query.map{|k,v| "#{k}=#{CGI.escape(v)}"}.join('&'))
197
+ post_url = '/v1/posts/add?' + query.map {|k,v| "#{k}=#{CGI.escape(v)}"}.join('&')
198
+ puts "POST: post url #{post_url}" if config[:debug]
199
+ req = Net::HTTP::Get.new(post_url, {"User-Agent" => "Kirby"})
183
200
  req.basic_auth config[:delicious_user], config[:delicious_pass]
184
201
  http.request(req)
185
202
  end.body
203
+
186
204
  puts "POST: #{response.inspect}" if config[:debug]
187
205
  end
206
+ rescue Exception => e
207
+ puts "POST: #{e.inspect}" if config[:debug]
188
208
  end
189
209
 
190
210
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kirby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ""
@@ -30,11 +30,12 @@ cert_chain:
30
30
  yZ0=
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2008-01-30 00:00:00 -05:00
33
+ date: 2009-11-18 00:00:00 -08:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hpricot
38
+ type: :runtime
38
39
  version_requirement:
39
40
  version_requirements: !ruby/object:Gem::Requirement
40
41
  requirements:
@@ -44,6 +45,7 @@ dependencies:
44
45
  version:
45
46
  - !ruby/object:Gem::Dependency
46
47
  name: daemons
48
+ type: :runtime
47
49
  version_requirement:
48
50
  version_requirements: !ruby/object:Gem::Requirement
49
51
  requirements:
@@ -57,8 +59,12 @@ executables:
57
59
  - kirby
58
60
  extensions: []
59
61
 
60
- extra_rdoc_files: []
61
-
62
+ extra_rdoc_files:
63
+ - lib/kirby.rb
64
+ - bin/kirby
65
+ - README
66
+ - LICENSE
67
+ - CHANGELOG
62
68
  files:
63
69
  - lib/kirby.rb
64
70
  - bin/kirby
@@ -66,11 +72,19 @@ files:
66
72
  - LICENSE
67
73
  - CHANGELOG
68
74
  - kirby.gemspec
75
+ - Rakefile
69
76
  has_rdoc: true
70
77
  homepage: http://blog.evanweaver.com/files/doc/fauna/kirby/
71
- post_install_message:
72
- rdoc_options: []
78
+ licenses: []
73
79
 
80
+ post_install_message:
81
+ rdoc_options:
82
+ - --line-numbers
83
+ - --inline-source
84
+ - --title
85
+ - Kirby
86
+ - --main
87
+ - README
74
88
  require_paths:
75
89
  - lib
76
90
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -83,14 +97,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
97
  requirements:
84
98
  - - ">="
85
99
  - !ruby/object:Gem::Version
86
- version: "0"
100
+ version: "1.2"
87
101
  version:
88
102
  requirements: []
89
103
 
90
104
  rubyforge_project: fauna
91
- rubygems_version: 1.0.1
105
+ rubygems_version: 1.3.5
92
106
  signing_key:
93
- specification_version: 2
107
+ specification_version: 3
94
108
  summary: A super-clean IRC bot with sandboxed Ruby evaluation, svn watching, and link-logging to del.icio.us.
95
109
  test_files: []
96
110
 
metadata.gz.sig CHANGED
Binary file