housefire 0.0.2 → 0.0.3

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 (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/housefire.rb +25 -21
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/lib/housefire.rb CHANGED
@@ -51,33 +51,37 @@ class Housefire
51
51
 
52
52
  # parse out events into things we recognize (changeset, ticket, etc.)
53
53
  doc.css("entry").each do |entry|
54
- id = entry.css("id")[0].content.split("Event/")[1].to_i
54
+ begin
55
+ id = entry.css("id")[0].content.split("Event/")[1].to_i
55
56
 
56
- # DON'T notify the same event more than once
57
- if !recent_items.key?(id)
58
- e = {}
59
- e[:id] = id
57
+ # DON'T notify the same event more than once
58
+ if !recent_items.key?(id)
59
+ e = {}
60
+ e[:id] = id
60
61
 
61
- # DON'T notify changesets, github already does that
62
- title = entry.css("title")[0].content
63
- if !title.include?("[Changeset] ")
64
- e[:title] = title
65
- e[:content] = Sanitize.clean(entry.css("content")[0].content)
66
- e[:author] = entry.css("author name")[0].content
67
- e[:link] = entry.css("link")[0].attributes["href"].content
68
- e[:date] = entry.css("published")[0].content
62
+ # DON'T notify changesets, github already does that
63
+ title = entry.css("title")[0].content
64
+ if !title.include?("[Changeset] ")
65
+ e[:title] = title
66
+ e[:content] = Sanitize.clean(entry.css("content")[0].content)
67
+ e[:author] = entry.css("author name")[0].content
68
+ e[:link] = entry.css("link")[0].attributes["href"].content
69
+ e[:date] = entry.css("published")[0].content
69
70
 
70
- message = "#{e[:author]}: #{e[:title]} -- #{e[:content]}".gsub(/[^[:print:]]/, '').gsub(/&/,'&')
71
- puts message
72
- puts "\n\n\n"
73
- @room.speak(message)
71
+ message = "#{e[:author]}: #{e[:title]} -- #{e[:content]}".gsub(/[^[:print:]]/, '').gsub(/&/,'&')
72
+ puts message
73
+ puts "\n\n\n"
74
+ @room.speak(message)
75
+ end
76
+ # recent_items = recent_items.sort.last 10
77
+ recent_items[id] = e
78
+ save_db(@conf['lhcache'], recent_items)
74
79
  end
75
- # recent_items = recent_items.sort.last 10
76
- recent_items[id] = e
77
- save_db(@conf['lhcache'], recent_items)
80
+ rescue Exception => e
81
+ puts e.message
82
+ puts e.backtrace.inspect
78
83
  end
79
84
  end
80
-
81
85
  end
82
86
 
83
87
  def save_db(file, object)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - David Grandinetti
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-26 00:00:00 +01:00
17
+ date: 2010-05-04 00:00:00 +01:00
18
18
  default_executable: housefire
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency