reevoo 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +3 -0
- data/Rakefile +8 -0
- data/lib/reevoo.rb +18 -0
- data/lib/reevoo/version.rb +3 -0
- data/reevoo.gemspec +25 -0
- data/spec/client_spec.rb +18 -0
- data/spec/spec_helper.rb +3 -0
- metadata +139 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
data/lib/reevoo.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'crack'
|
3
|
+
require 'hashie'
|
4
|
+
|
5
|
+
module Reevoo
|
6
|
+
class Client
|
7
|
+
def initialize(trkref, password)
|
8
|
+
@connection = Faraday::Connection.new "http://#{trkref}:#{password}@api.reevoo.com/#{trkref}/"
|
9
|
+
end
|
10
|
+
|
11
|
+
def products
|
12
|
+
resp = @connection.get 'product_review_summary.xml'
|
13
|
+
hash = Crack::XML.parse(resp.body)
|
14
|
+
mash = Hashie::Mash.new(hash)
|
15
|
+
products = mash.first[1].first[1]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/reevoo.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "reevoo/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "reevoo"
|
7
|
+
s.version = Reevoo::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Andrew Nesbitt"]
|
10
|
+
s.email = ["andrewnez@gmail.com"]
|
11
|
+
s.homepage = "http://github.com/andrew/reevoo"
|
12
|
+
s.summary = %q{Reevoo API wrapper}
|
13
|
+
s.description = %q{Ruby wrapper around the Reevoo XML API}
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
|
20
|
+
s.add_dependency(%q<faraday>, ["~> 0.5.7"])
|
21
|
+
s.add_dependency(%q<crack>, ["~> 0.1.8"])
|
22
|
+
s.add_dependency(%q<hashie>, ["~> 1.0.0"])
|
23
|
+
|
24
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
|
25
|
+
end
|
data/spec/client_spec.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe Reevoo::Client do
|
3
|
+
it "should be setup with a trkref and password"
|
4
|
+
|
5
|
+
describe 'products' do
|
6
|
+
it 'should return an array of products' do
|
7
|
+
client = Reevoo::Client.new('jcg', 'Cojewpid8')
|
8
|
+
client.products.should be_true
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# before(:each) do
|
14
|
+
# FakeWeb.register_uri(:any, "https://deploytracking.heroku.com/deploys", :body => "response for any HTTP method")
|
15
|
+
# end
|
16
|
+
# it "should post to deploytracking.com" do
|
17
|
+
# DeployTracking.notify('api_key', {}).should be_true
|
18
|
+
# end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: reevoo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Andrew Nesbitt
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-04-05 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: faraday
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 5
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 5
|
33
|
+
- 7
|
34
|
+
version: 0.5.7
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: crack
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 11
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
- 1
|
49
|
+
- 8
|
50
|
+
version: 0.1.8
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: hashie
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 23
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 0
|
65
|
+
- 0
|
66
|
+
version: 1.0.0
|
67
|
+
type: :runtime
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 27
|
78
|
+
segments:
|
79
|
+
- 2
|
80
|
+
- 5
|
81
|
+
- 0
|
82
|
+
version: 2.5.0
|
83
|
+
type: :development
|
84
|
+
version_requirements: *id004
|
85
|
+
description: Ruby wrapper around the Reevoo XML API
|
86
|
+
email:
|
87
|
+
- andrewnez@gmail.com
|
88
|
+
executables: []
|
89
|
+
|
90
|
+
extensions: []
|
91
|
+
|
92
|
+
extra_rdoc_files: []
|
93
|
+
|
94
|
+
files:
|
95
|
+
- .gitignore
|
96
|
+
- Gemfile
|
97
|
+
- Rakefile
|
98
|
+
- lib/reevoo.rb
|
99
|
+
- lib/reevoo/version.rb
|
100
|
+
- reevoo.gemspec
|
101
|
+
- spec/client_spec.rb
|
102
|
+
- spec/spec_helper.rb
|
103
|
+
has_rdoc: true
|
104
|
+
homepage: http://github.com/andrew/reevoo
|
105
|
+
licenses: []
|
106
|
+
|
107
|
+
post_install_message:
|
108
|
+
rdoc_options: []
|
109
|
+
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
hash: 3
|
118
|
+
segments:
|
119
|
+
- 0
|
120
|
+
version: "0"
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
hash: 3
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
version: "0"
|
130
|
+
requirements: []
|
131
|
+
|
132
|
+
rubyforge_project:
|
133
|
+
rubygems_version: 1.6.2
|
134
|
+
signing_key:
|
135
|
+
specification_version: 3
|
136
|
+
summary: Reevoo API wrapper
|
137
|
+
test_files:
|
138
|
+
- spec/client_spec.rb
|
139
|
+
- spec/spec_helper.rb
|