woot 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/lib/woot.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'scrapi'
2
+ require 'tweetstream'
3
+
1
4
  class Woot
2
5
  DOMAIN = 'woot.com'
3
6
  WOOT_OFF = 'woot-off'
@@ -13,7 +16,7 @@ class Woot
13
16
 
14
17
  def self.scrape(subdomain = :www)
15
18
  selectors = self.selectors(subdomain)
16
- ::Scraper.define do
19
+ Scraper.define do
17
20
  result *(selectors.inject([]) do |array, (pattern, results)|
18
21
  process_first pattern, results
19
22
  array += results.keys
@@ -43,14 +46,14 @@ class Woot
43
46
  end
44
47
 
45
48
  def self.stream(twitter_username, twitter_password)
46
- ::TweetStream::Client.new(twitter_username, twitter_password).follow(*TWITTER_IDS.values) do |status|
49
+ TweetStream::Client.new(twitter_username, twitter_password).follow(*TWITTER_IDS.values) do |status|
47
50
  subdomain = TWITTER_IDS.index(status.user.id)
48
51
  subdomain = $1 if subdomain == WOOT_OFF && subdomain =~ /https?:\/\/([^\.]+)\.#{DOMAIN}/
49
- yield Woot.scrape(subdomain) unless subdomain.nil?
52
+ yield scrape(subdomain) unless subdomain.nil?
50
53
  end
51
54
  end
52
55
 
53
56
  def self.stop
54
- ::TweetStream::Client.stop
57
+ TweetStream::Client.stop
55
58
  end
56
59
  end
data/test/test_helper.rb CHANGED
@@ -1,14 +1,13 @@
1
1
  require 'rubygems'
2
2
  require 'test/unit'
3
3
  require 'shoulda'
4
- require 'scrapi'
5
- require 'tweetstream'
6
- Tidy.path = ENV['TIDY_PATH'] if ENV['TIDY_PATH']
7
4
 
8
5
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
9
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
10
7
  require 'woot'
11
8
 
9
+ Tidy.path = ENV['TIDY_PATH'] if ENV['TIDY_PATH']
10
+
12
11
  class Test::Unit::TestCase
13
12
 
14
13
  def self.attributes
data/woot.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{woot}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sean Huber"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Huber