panpainter-featherdust 0.0.3 → 0.0.4

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/README.txt CHANGED
@@ -1,7 +1,5 @@
1
1
  = Featherdust
2
2
 
3
- * http://rubyforge.org/projects/uwruby
4
- * http://uwruby.rubyforge.org/featherdust/
5
3
  * http://featherdust.panpainter.com
6
4
  * http://github.com/panpainter/featherdust/tree/master
7
5
  * http://panpainter.lighthouseapp.com/projects/21671/home
@@ -17,7 +15,7 @@ If you have questions (or suggestions), please feel free to shoot them off to mi
17
15
  == FEATURES/PROBLEMS:
18
16
 
19
17
  * Takes in a username and an integer and returns a list of Twitter updates.
20
- * KNOWN BUG: Currently, the response is ... well, really minimal. Like, not at all. Just sayin'.
18
+ * Has several display options: plain text, html, and relative and static time outputs
21
19
 
22
20
  == SYNOPSIS:
23
21
 
@@ -31,11 +29,14 @@ If you have questions (or suggestions), please feel free to shoot them off to mi
31
29
  == REQUIREMENTS:
32
30
 
33
31
  * nokogiri
32
+ * duration
34
33
  * net/http
34
+ * time
35
35
 
36
36
  == INSTALL:
37
37
 
38
- * gem install featherdust
38
+ * gem sources -a http://gems.github.com (only ever needs to be run once)
39
+ * gem install panpainter-featherdust
39
40
 
40
41
  == LICENSE:
41
42
 
data/Rakefile CHANGED
@@ -9,6 +9,7 @@ Hoe.new('featherdust', Featherdust::VERSION) do |p|
9
9
  p.developer('Michael Tierney', 'mike@panpainter.com')
10
10
 
11
11
  p.extra_deps << ['nokogiri', '~> 1.0.0']
12
+ p.extra_deps << ['duration', '~> 0.1.0']
12
13
  end
13
14
 
14
15
  # vim: syntax=Ruby
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "featherdust"
3
- s.version = "0.0.3"
4
- s.date = "2008-12-19"
3
+ s.version = "0.0.4"
4
+ s.date = "2009-01-05"
5
5
  s.summary = "Featherdust is a simple Twitter gem that grabs and parses data via the Twitter API."
6
6
  s.email = "mike@panpainter.com"
7
7
  s.homepage = "http://github.com/panpainter/featherdust"
@@ -4,6 +4,7 @@ require 'rubygems'
4
4
  require 'nokogiri'
5
5
  require 'net/http'
6
6
  require 'time'
7
+ require 'duration'
7
8
 
8
9
  class Featherdust
9
10
  VERSION = '0.0.3'
@@ -16,6 +17,7 @@ class Featherdust
16
17
  @username = a
17
18
  elsif a.class == Hash
18
19
  @plain_text = a[:display] if a[:display] = "plain"
20
+ @static_time = a[:time] if a[:time] = "static"
19
21
  elsif a.class == Fixnum
20
22
  @num_posts = a
21
23
  else
@@ -81,10 +83,12 @@ class Featherdust
81
83
  end
82
84
 
83
85
  def pretty_time(date)
84
- human_date = Date.parse(date)
85
- pretty_date = human_date.strftime("%A, %b %d")
86
- human_time = Time.parse(date)
87
- pretty_date += human_time.strftime(" at %I:%M %p")
86
+ unless @static_time
87
+ parsed_date = Time.parse(date)
88
+ pretty_date += human_time.strftime("%A, %b %d at %I:%M %p")
89
+ else
90
+ parsed_date = Date.parse(date)
91
+ pretty_date = Duration.new(Time.now - parsed_date)
88
92
  end
89
93
 
90
94
  def urlize(string)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panpainter-featherdust
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Tierney
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-19 00:00:00 -08:00
12
+ date: 2009-01-05 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency