saasu 0.0.1
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/Gemfile +11 -0
- data/LICENSE +20 -0
- data/README.md +34 -0
- data/Rakefile +40 -0
- data/VERSION +1 -0
- data/lib/saasu/base.rb +174 -0
- data/lib/saasu/invoice.rb +42 -0
- data/lib/saasu.rb +10 -0
- data/saasu.gemspec +68 -0
- data/spec/base_spec.rb +56 -0
- data/spec/mocks/invoice.xml +25 -0
- data/spec/mocks/invoice_item.xml +33 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +3 -0
- metadata +170 -0
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Kieran Johnson
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# Saasu
|
2
|
+
|
3
|
+
This gem provide a ruby wrapper to the Saasu api.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
gem install saasu
|
8
|
+
|
9
|
+
## Getting Started
|
10
|
+
|
11
|
+
Usage is currently limited to fetching invoices.
|
12
|
+
|
13
|
+
Firstly setup the library with your api\_key and file\_uid
|
14
|
+
|
15
|
+
Saasu::Base.api_key = key
|
16
|
+
Saasu::Base.file_uid = uid
|
17
|
+
|
18
|
+
To fetch all invoices
|
19
|
+
|
20
|
+
invoices = Saasu::Invoice.all
|
21
|
+
|
22
|
+
You can pass in any conditions as a hash. The keys should be in snake case.
|
23
|
+
|
24
|
+
invoices = Saasu::Invoice.all(:transaction_type => "s", :paid_status => "Unpaid")
|
25
|
+
|
26
|
+
For a complete list of supported options see the [Saasu API Reference](http://help.saasu.com/api/http-get/)
|
27
|
+
|
28
|
+
To fetch a single invoice by its uid
|
29
|
+
|
30
|
+
invoice = Saasu::Invoice.find(uid)
|
31
|
+
|
32
|
+
## Copyright
|
33
|
+
|
34
|
+
Copyright (c) 2011 Kieran Johnson. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "saasu"
|
18
|
+
gem.summary = "Ruby wrapper for the Saasu api"
|
19
|
+
gem.description = "Ruby wrapper for the Saasu api"
|
20
|
+
gem.email = "hello@invisiblelines.com"
|
21
|
+
gem.homepage = "http://github.com/kieranj/saasu"
|
22
|
+
gem.authors = ["Kieran Johnson"]
|
23
|
+
# dependencies defined in Gemfile
|
24
|
+
end
|
25
|
+
Jeweler::RubygemsDotOrgTasks.new
|
26
|
+
|
27
|
+
require 'rspec/core'
|
28
|
+
require 'rspec/core/rake_task'
|
29
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
30
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
31
|
+
end
|
32
|
+
|
33
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
34
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
35
|
+
end
|
36
|
+
|
37
|
+
task :default => :spec
|
38
|
+
|
39
|
+
require 'yard'
|
40
|
+
YARD::Rake::YardocTask.new
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
data/lib/saasu/base.rb
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
module Saasu
|
2
|
+
|
3
|
+
class Base
|
4
|
+
|
5
|
+
ENDPOINT = "https://secure.saasu.com/webservices/rest/r1"
|
6
|
+
|
7
|
+
def initialize(xml)
|
8
|
+
klass = self.class.name.split("::")[1].downcase
|
9
|
+
xml.children.each do |child|
|
10
|
+
if !child.text?
|
11
|
+
child.attributes.each do |attr|
|
12
|
+
send("#{attr[1].name.underscore.sub(/#{klass}_/, "")}=", attr[1].text)
|
13
|
+
end
|
14
|
+
|
15
|
+
send("#{child.name.underscore.sub(/#{klass}_/, "")}=", child.children.first.text) unless child.children.first.nil?
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class << self
|
21
|
+
|
22
|
+
# @param [String] the API key
|
23
|
+
#
|
24
|
+
def api_key=(key)
|
25
|
+
@@api_key = key
|
26
|
+
end
|
27
|
+
|
28
|
+
# Return the API key
|
29
|
+
#
|
30
|
+
def api_key
|
31
|
+
@@api_key
|
32
|
+
end
|
33
|
+
|
34
|
+
# @param [Integer] the file_uid
|
35
|
+
#
|
36
|
+
def file_uid=(uid)
|
37
|
+
@@file_uid = uid
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns the file_uid
|
41
|
+
#
|
42
|
+
def file_uid
|
43
|
+
@@file_uid
|
44
|
+
end
|
45
|
+
|
46
|
+
# Returns all resources matching the supplied conditions
|
47
|
+
# @param [Hash] conditions for the request
|
48
|
+
#
|
49
|
+
def all(options = {})
|
50
|
+
response = get(options)
|
51
|
+
xml = Nokogiri::XML(response).css("#{defaults[:collection_name]}")
|
52
|
+
|
53
|
+
collection = xml.inject([]) do |result, item|
|
54
|
+
result << new(item)
|
55
|
+
result
|
56
|
+
end
|
57
|
+
collection
|
58
|
+
end
|
59
|
+
|
60
|
+
# Finds a specific resource by its uid
|
61
|
+
# @param [Integer] the uid
|
62
|
+
#
|
63
|
+
def find(uid)
|
64
|
+
response = get({:uid => uid}, false)
|
65
|
+
xml = Nokogiri::XML(response).css("#{defaults[:resource_name]}")
|
66
|
+
new(xml.first)
|
67
|
+
end
|
68
|
+
|
69
|
+
# Allows defaults for the object to be set.
|
70
|
+
# Generally the class name will be suitable and options will not need to be provided
|
71
|
+
# @param [Hash] options to override the default settings
|
72
|
+
#
|
73
|
+
def defaults(options = {})
|
74
|
+
default_options.merge!(options)
|
75
|
+
end
|
76
|
+
|
77
|
+
protected
|
78
|
+
|
79
|
+
# Default options for the class
|
80
|
+
#
|
81
|
+
def default_options
|
82
|
+
defaults = {}
|
83
|
+
defaults[:resource_name] = name.split("::").last.downcase
|
84
|
+
defaults[:collection_name] = name.split("::").last.downcase + "ListItem"
|
85
|
+
defaults
|
86
|
+
end
|
87
|
+
|
88
|
+
# Defines the fields for a resource and any transformations
|
89
|
+
# @param [Hash] key/value pair of field name and object type
|
90
|
+
#
|
91
|
+
def fields(fields = {})
|
92
|
+
fields.each do |k,v|
|
93
|
+
define_accessor(k.underscore, v)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def define_accessor(field, type)
|
98
|
+
m = field.sub(/#{defaults[:resource_name]}_/, "")
|
99
|
+
case type
|
100
|
+
when :decimal
|
101
|
+
class_eval <<-END
|
102
|
+
def #{m}=(v)
|
103
|
+
@#{m} = v.to_f
|
104
|
+
end
|
105
|
+
END
|
106
|
+
when :date
|
107
|
+
class_eval <<-END
|
108
|
+
def #{m}=(v)
|
109
|
+
@#{m} = Date.parse(v)
|
110
|
+
end
|
111
|
+
END
|
112
|
+
when :integer
|
113
|
+
class_eval <<-END
|
114
|
+
def #{m}=(v)
|
115
|
+
@#{m} = v.to_i
|
116
|
+
end
|
117
|
+
END
|
118
|
+
when :boolean
|
119
|
+
class_eval <<-END
|
120
|
+
def #{m}=(v)
|
121
|
+
@#{m} = (v.match(/true/i) ? true : false)
|
122
|
+
end
|
123
|
+
END
|
124
|
+
when :array
|
125
|
+
class_eval <<-END
|
126
|
+
def #{m}=(v)
|
127
|
+
@#{m} = v.split(",")
|
128
|
+
end
|
129
|
+
END
|
130
|
+
else
|
131
|
+
class_eval <<-END
|
132
|
+
def #{m}=(v)
|
133
|
+
@#{m} = v
|
134
|
+
end
|
135
|
+
END
|
136
|
+
end
|
137
|
+
|
138
|
+
class_eval <<-END
|
139
|
+
def #{m}
|
140
|
+
@#{m}
|
141
|
+
end
|
142
|
+
END
|
143
|
+
end
|
144
|
+
|
145
|
+
# Makes the request to saasu
|
146
|
+
# @param [Hash] options for the request
|
147
|
+
# @param [Boolean] toggles searching between collection and a singular resource
|
148
|
+
#
|
149
|
+
def get(options = {}, all = true)
|
150
|
+
uri = URI.parse(request_path(options, all))
|
151
|
+
puts request_path(options, all)
|
152
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
153
|
+
http.use_ssl = true
|
154
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
155
|
+
response = http.request(Net::HTTP::Get.new(uri.request_uri))
|
156
|
+
puts response.body
|
157
|
+
(options[:format] && options[:format] == "pdf") ? response.body : response.body
|
158
|
+
end
|
159
|
+
|
160
|
+
def query_string(options = {})
|
161
|
+
options = { :wsaccesskey => api_key, :fileuid => file_uid }.merge!(options)
|
162
|
+
options.map { |k,v| "#{k.to_s.gsub(/_/, "")}=#{v}"}.join("&")
|
163
|
+
end
|
164
|
+
|
165
|
+
def request_path(options = {}, all = true)
|
166
|
+
path = (all == true ? defaults[:collection_name].sub(/Item/, "") : defaults[:resource_name])
|
167
|
+
ENDPOINT + "/#{path}?#{query_string(options)}"
|
168
|
+
end
|
169
|
+
|
170
|
+
end
|
171
|
+
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Saasu
|
2
|
+
|
3
|
+
class Invoice < Base
|
4
|
+
|
5
|
+
fields "uid" => :integer,
|
6
|
+
"lastUpdatedUid" => :string,
|
7
|
+
"transactionType" => :string,
|
8
|
+
"date" => :date,
|
9
|
+
"dueOrExpiryDate" => :date,
|
10
|
+
"utcFirstCreated" => :date,
|
11
|
+
"utcLastModified" => :date,
|
12
|
+
"summary" => :string,
|
13
|
+
"invoiceNumber" => :string,
|
14
|
+
"purchaseOrderNumber" => :string,
|
15
|
+
"dueDate" => :date,
|
16
|
+
"ccy" => :string,
|
17
|
+
"autoPopulateFxRate" => :boolean,
|
18
|
+
"fcToBcFxRate" => :decimal,
|
19
|
+
"paymentCount" => :integer,
|
20
|
+
"totalAmountInclTax" => :decimal,
|
21
|
+
"amountOwed" => :decimal,
|
22
|
+
"paidStatus" => :string,
|
23
|
+
"requiresFollowUp" => :boolean,
|
24
|
+
"isSent" => :boolean,
|
25
|
+
"layout" => :string,
|
26
|
+
"status" => :string,
|
27
|
+
"typeUid" => :string,
|
28
|
+
"contactUid" => :integer,
|
29
|
+
"contactGivenName" => :string,
|
30
|
+
"contactFamilyName" => :string,
|
31
|
+
"contactOrganisationName" => :string,
|
32
|
+
"shipToContactUid" => :string,
|
33
|
+
"shipToContactFirstname" => :string,
|
34
|
+
"shipToContactLastName" => :string,
|
35
|
+
"shipToContactOrganisation" => :string,
|
36
|
+
"tags" => :array,
|
37
|
+
"totalAmountPaid" => :decimal,
|
38
|
+
"invoiceItems" => :array
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
data/lib/saasu.rb
ADDED
data/saasu.gemspec
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{saasu}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Kieran Johnson"]
|
12
|
+
s.date = %q{2011-08-24}
|
13
|
+
s.description = %q{Ruby wrapper for the Saasu api}
|
14
|
+
s.email = %q{hello@invisiblelines.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.md"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
"Gemfile",
|
21
|
+
"LICENSE",
|
22
|
+
"README.md",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"lib/saasu.rb",
|
26
|
+
"lib/saasu/base.rb",
|
27
|
+
"lib/saasu/invoice.rb",
|
28
|
+
"saasu.gemspec",
|
29
|
+
"spec/base_spec.rb",
|
30
|
+
"spec/mocks/invoice.xml",
|
31
|
+
"spec/mocks/invoice_item.xml",
|
32
|
+
"spec/spec.opts",
|
33
|
+
"spec/spec_helper.rb"
|
34
|
+
]
|
35
|
+
s.homepage = %q{http://github.com/kieranj/saasu}
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = %q{1.3.7}
|
38
|
+
s.summary = %q{Ruby wrapper for the Saasu api}
|
39
|
+
|
40
|
+
if s.respond_to? :specification_version then
|
41
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
42
|
+
s.specification_version = 3
|
43
|
+
|
44
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
45
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
46
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 2.3.2"])
|
47
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
48
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
49
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
50
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
51
|
+
else
|
52
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
53
|
+
s.add_dependency(%q<activesupport>, [">= 2.3.2"])
|
54
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
55
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
56
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
57
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
58
|
+
end
|
59
|
+
else
|
60
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
61
|
+
s.add_dependency(%q<activesupport>, [">= 2.3.2"])
|
62
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
63
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
64
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
65
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
data/spec/base_spec.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Saasu::Base" do
|
4
|
+
|
5
|
+
it "should set the default option for collection_name" do
|
6
|
+
Saasu::Invoice.defaults[:collection_name].should eql("invoiceListItem")
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should set the default option for resource_name" do
|
10
|
+
Saasu::Invoice.defaults[:resource_name].should eql("invoice")
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "fields" do
|
14
|
+
|
15
|
+
before do
|
16
|
+
file = open(File.join(File.dirname(__FILE__), "mocks", "invoice_item.xml"))
|
17
|
+
xml = Nokogiri::XML(file).css("invoiceListItem")
|
18
|
+
@invoice = Saasu::Invoice.new(xml)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should define accessors for all fields listed" do
|
22
|
+
@invoice.methods.should include("uid=")
|
23
|
+
@invoice.methods.should include("uid")
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should cast any field listed as a decimal to a float" do
|
27
|
+
@invoice.amount_owed.should be_an_instance_of(Float)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should cast any field listed as a date to a date" do
|
31
|
+
@invoice.date.should be_an_instance_of(Date)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should cast any field listed as a integer to a integer" do
|
35
|
+
@invoice.uid.should be_an_instance_of(Fixnum)
|
36
|
+
end
|
37
|
+
|
38
|
+
describe "boolean fields" do
|
39
|
+
|
40
|
+
it "should cast any field listed as a boolean, with a value of true as true" do
|
41
|
+
@invoice.is_sent.should eql(true)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should cast any field listed as a boolean, with a value of false as false" do
|
45
|
+
@invoice.requires_follow_up.should eql(false)
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should cast any field listed as a array to a array" do
|
51
|
+
@invoice.tags.should be_an_instance_of(Array)
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<invoiceResponse>
|
3
|
+
<invoice uid="5335574" lastUpdatedUid="AAAAAAM//Ic=">
|
4
|
+
<utcFirstCreated>2011-02-21T10:05:40</utcFirstCreated>
|
5
|
+
<utcLastModified>2011-02-22T09:20:01</utcLastModified>
|
6
|
+
<transactionType>S</transactionType>
|
7
|
+
<date>2011-02-21</date>
|
8
|
+
<contactUid>1098116</contactUid>
|
9
|
+
<ccy>GBP</ccy>
|
10
|
+
<autoPopulateFxRate>false</autoPopulateFxRate>
|
11
|
+
<fcToBcFxRate>1.0000000000</fcToBcFxRate>
|
12
|
+
<requiresFollowUp>false</requiresFollowUp>
|
13
|
+
<layout>S</layout>
|
14
|
+
<status>I</status>
|
15
|
+
<invoiceNumber>2</invoiceNumber>
|
16
|
+
<invoiceItems>
|
17
|
+
<serviceInvoiceItem>
|
18
|
+
<description>ghfj</description>
|
19
|
+
<accountUid>10</accountUid>
|
20
|
+
<totalAmountInclTax>100.0000</totalAmountInclTax>
|
21
|
+
</serviceInvoiceItem>
|
22
|
+
</invoiceItems>
|
23
|
+
<isSent>false</isSent>
|
24
|
+
</invoice>
|
25
|
+
</invoiceResponse>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<invoiceListItem>
|
2
|
+
<invoiceUid>5335574</invoiceUid>
|
3
|
+
<lastUpdatedUid>AAAAAAM//Ic=</lastUpdatedUid>
|
4
|
+
<ccy>GBP</ccy>
|
5
|
+
<autoPopulateFXRate>false</autoPopulateFXRate>
|
6
|
+
<fcToBcFxRate>1.0000000000</fcToBcFxRate>
|
7
|
+
<transactionType>S</transactionType>
|
8
|
+
<invoiceDate>2011-02-21</invoiceDate>
|
9
|
+
<utcFirstCreated>2011-02-21T10:05:40</utcFirstCreated>
|
10
|
+
<utcLastModified>2011-02-22T09:20:01</utcLastModified>
|
11
|
+
<summary/>
|
12
|
+
<invoiceNumber>2</invoiceNumber>
|
13
|
+
<purchaseOrderNumber/>
|
14
|
+
<dueDate/>
|
15
|
+
<totalAmountInclTax>100.0000</totalAmountInclTax>
|
16
|
+
<paymentCount>0</paymentCount>
|
17
|
+
<totalAmountPaid>0.0000</totalAmountPaid>
|
18
|
+
<amountOwed>100.0000</amountOwed>
|
19
|
+
<paidStatus>Unpaid</paidStatus>
|
20
|
+
<requiresFollowUp>False</requiresFollowUp>
|
21
|
+
<isSent>True</isSent>
|
22
|
+
<invoiceLayout>S</invoiceLayout>
|
23
|
+
<invoiceStatus>I</invoiceStatus>
|
24
|
+
<contactUid>1098116</contactUid>
|
25
|
+
<contactGivenName>tom</contactGivenName>
|
26
|
+
<contactFamilyName>jones</contactFamilyName>
|
27
|
+
<contactOrganisationName/>
|
28
|
+
<shipToContactUid/>
|
29
|
+
<shipToContactGivenName/>
|
30
|
+
<shipToContactLastName/>
|
31
|
+
<shipToContactOrganisation/>
|
32
|
+
<tags>urgent,important</tags>
|
33
|
+
</invoiceListItem>
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: saasu
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Kieran Johnson
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-08-24 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
name: nokogiri
|
25
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
31
|
+
segments:
|
32
|
+
- 0
|
33
|
+
version: "0"
|
34
|
+
requirement: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
name: activesupport
|
39
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 7
|
45
|
+
segments:
|
46
|
+
- 2
|
47
|
+
- 3
|
48
|
+
- 2
|
49
|
+
version: 2.3.2
|
50
|
+
requirement: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
type: :development
|
53
|
+
prerelease: false
|
54
|
+
name: bundler
|
55
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ~>
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 23
|
61
|
+
segments:
|
62
|
+
- 1
|
63
|
+
- 0
|
64
|
+
- 0
|
65
|
+
version: 1.0.0
|
66
|
+
requirement: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
name: jeweler
|
71
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 7
|
77
|
+
segments:
|
78
|
+
- 1
|
79
|
+
- 6
|
80
|
+
- 4
|
81
|
+
version: 1.6.4
|
82
|
+
requirement: *id004
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
type: :development
|
85
|
+
prerelease: false
|
86
|
+
name: rspec
|
87
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 3
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
version: "0"
|
96
|
+
requirement: *id005
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
type: :development
|
99
|
+
prerelease: false
|
100
|
+
name: yard
|
101
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
hash: 3
|
107
|
+
segments:
|
108
|
+
- 0
|
109
|
+
version: "0"
|
110
|
+
requirement: *id006
|
111
|
+
description: Ruby wrapper for the Saasu api
|
112
|
+
email: hello@invisiblelines.com
|
113
|
+
executables: []
|
114
|
+
|
115
|
+
extensions: []
|
116
|
+
|
117
|
+
extra_rdoc_files:
|
118
|
+
- LICENSE
|
119
|
+
- README.md
|
120
|
+
files:
|
121
|
+
- Gemfile
|
122
|
+
- LICENSE
|
123
|
+
- README.md
|
124
|
+
- Rakefile
|
125
|
+
- VERSION
|
126
|
+
- lib/saasu.rb
|
127
|
+
- lib/saasu/base.rb
|
128
|
+
- lib/saasu/invoice.rb
|
129
|
+
- saasu.gemspec
|
130
|
+
- spec/base_spec.rb
|
131
|
+
- spec/mocks/invoice.xml
|
132
|
+
- spec/mocks/invoice_item.xml
|
133
|
+
- spec/spec.opts
|
134
|
+
- spec/spec_helper.rb
|
135
|
+
has_rdoc: true
|
136
|
+
homepage: http://github.com/kieranj/saasu
|
137
|
+
licenses: []
|
138
|
+
|
139
|
+
post_install_message:
|
140
|
+
rdoc_options: []
|
141
|
+
|
142
|
+
require_paths:
|
143
|
+
- lib
|
144
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
hash: 3
|
150
|
+
segments:
|
151
|
+
- 0
|
152
|
+
version: "0"
|
153
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
hash: 3
|
159
|
+
segments:
|
160
|
+
- 0
|
161
|
+
version: "0"
|
162
|
+
requirements: []
|
163
|
+
|
164
|
+
rubyforge_project:
|
165
|
+
rubygems_version: 1.3.7
|
166
|
+
signing_key:
|
167
|
+
specification_version: 3
|
168
|
+
summary: Ruby wrapper for the Saasu api
|
169
|
+
test_files: []
|
170
|
+
|