stalkr 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Rakefile +1 -0
  2. data/VERSION +1 -1
  3. data/lib/stalkr.rb +1 -3
  4. data/lib/stalkr/base.rb +4 -4
  5. metadata +30 -14
data/Rakefile CHANGED
@@ -9,6 +9,7 @@ begin
9
9
  gemspec.email = "chetan@pixelcop.net"
10
10
  gemspec.homepage = "http://github.com/chetan/stalkr"
11
11
  gemspec.authors = ["Chetan Sarva"]
12
+ gemspec.add_dependency('curb', '>= 0.7.10')
12
13
  gemspec.add_dependency('scrapi', '= 1.2.0')
13
14
  gemspec.add_dependency('tzinfo', '>= 0.3.15')
14
15
  gemspec.add_dependency('json', '>= 1.4.6')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.5
1
+ 0.9.6
@@ -5,6 +5,7 @@ if RUBY_PLATFORM =~ /darwin/ then
5
5
  Tidy.path = "/usr/lib/libtidy.dylib"
6
6
  end
7
7
 
8
+ require 'curb'
8
9
  require 'scrapi'
9
10
  require 'htmlentities'
10
11
  require 'date'
@@ -21,6 +22,3 @@ require "#{stalkr_dir}/stalkr/usps"
21
22
  require "#{stalkr_dir}/stalkr/fedex"
22
23
  require "#{stalkr_dir}/stalkr/dhl"
23
24
  require "#{stalkr_dir}/stalkr/china_post"
24
-
25
-
26
-
@@ -22,12 +22,12 @@ module Stalkr
22
22
  end
23
23
 
24
24
  def fetchurl(url, data = nil)
25
- url = URI.parse(URI.escape(url))
26
25
  if data.nil? then
27
- # GET request
28
- return Net::HTTP.get_response(url).body
26
+ # GET
27
+ return Curl::Easy.perform(url).body_str
29
28
  else
30
- return Net::HTTP.post_form(url, data).body
29
+ # POST
30
+ return Curl::Easy.http_post(url, data.map{ |k,v| Curl::PostField.content(k, v) }).body_str
31
31
  end
32
32
  end
33
33
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stalkr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 55
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 5
10
- version: 0.9.5
9
+ - 6
10
+ version: 0.9.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chetan Sarva
@@ -15,13 +15,29 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-19 00:00:00 -05:00
18
+ date: 2011-02-20 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: scrapi
22
+ name: curb
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 23
30
+ segments:
31
+ - 0
32
+ - 7
33
+ - 10
34
+ version: 0.7.10
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: scrapi
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
25
41
  none: false
26
42
  requirements:
27
43
  - - "="
@@ -33,11 +49,11 @@ dependencies:
33
49
  - 0
34
50
  version: 1.2.0
35
51
  type: :runtime
36
- version_requirements: *id001
52
+ version_requirements: *id002
37
53
  - !ruby/object:Gem::Dependency
38
54
  name: tzinfo
39
55
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
56
+ requirement: &id003 !ruby/object:Gem::Requirement
41
57
  none: false
42
58
  requirements:
43
59
  - - ">="
@@ -49,11 +65,11 @@ dependencies:
49
65
  - 15
50
66
  version: 0.3.15
51
67
  type: :runtime
52
- version_requirements: *id002
68
+ version_requirements: *id003
53
69
  - !ruby/object:Gem::Dependency
54
70
  name: json
55
71
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
72
+ requirement: &id004 !ruby/object:Gem::Requirement
57
73
  none: false
58
74
  requirements:
59
75
  - - ">="
@@ -65,11 +81,11 @@ dependencies:
65
81
  - 6
66
82
  version: 1.4.6
67
83
  type: :runtime
68
- version_requirements: *id003
84
+ version_requirements: *id004
69
85
  - !ruby/object:Gem::Dependency
70
86
  name: tidy
71
87
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
88
+ requirement: &id005 !ruby/object:Gem::Requirement
73
89
  none: false
74
90
  requirements:
75
91
  - - ">="
@@ -81,11 +97,11 @@ dependencies:
81
97
  - 2
82
98
  version: 1.1.2
83
99
  type: :runtime
84
- version_requirements: *id004
100
+ version_requirements: *id005
85
101
  - !ruby/object:Gem::Dependency
86
102
  name: htmlentities
87
103
  prerelease: false
88
- requirement: &id005 !ruby/object:Gem::Requirement
104
+ requirement: &id006 !ruby/object:Gem::Requirement
89
105
  none: false
90
106
  requirements:
91
107
  - - ">="
@@ -97,7 +113,7 @@ dependencies:
97
113
  - 2
98
114
  version: 4.2.2
99
115
  type: :runtime
100
- version_requirements: *id005
116
+ version_requirements: *id006
101
117
  description: Ruby library for tracking UPS, Fedex and USPS packages.
102
118
  email: chetan@pixelcop.net
103
119
  executables: []