sendregning 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +47 -0
- data/Rakefile +56 -0
- data/VERSION +1 -0
- data/lib/sendregning.rb +13 -0
- data/lib/sendregning/client.rb +118 -0
- data/lib/sendregning/invoice.rb +144 -0
- data/lib/sendregning/line.rb +59 -0
- data/sendregning.gemspec +63 -0
- data/test/helper.rb +10 -0
- data/test/test_sendregning.rb +7 -0
- metadata +128 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Inge Jørgensen
|
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.rdoc
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
= Sendregning
|
2
|
+
|
3
|
+
Ruby client for the SendRegning Web Service.
|
4
|
+
|
5
|
+
== Getting started
|
6
|
+
|
7
|
+
Install with RubyGems:
|
8
|
+
|
9
|
+
$ gem install sendregning
|
10
|
+
|
11
|
+
Now start sending invoices:
|
12
|
+
|
13
|
+
# Create a new client
|
14
|
+
client = Sendregning::Client.new('my@email.com', 'myawesomepassword')
|
15
|
+
|
16
|
+
# Start a new email invoice
|
17
|
+
invoice = client.new_invoice(
|
18
|
+
:name => 'My Client',
|
19
|
+
:zip => '0123',
|
20
|
+
:city => 'Oslo',
|
21
|
+
:shipment => :email,
|
22
|
+
:emailaddresses => 'my@email.com'
|
23
|
+
)
|
24
|
+
|
25
|
+
# Add an item
|
26
|
+
invoice.add_line :qty => 1, :desc => 'Bananaphone', :unitPrice => '500,00'
|
27
|
+
|
28
|
+
# Send it away!
|
29
|
+
invoice.send!
|
30
|
+
|
31
|
+
# Get the invoice number for future reference
|
32
|
+
id = invoice.invoiceNo
|
33
|
+
|
34
|
+
Now, let's check how we're doing
|
35
|
+
|
36
|
+
invoice = client.find_invoice(id)
|
37
|
+
invoice.paid? # => true
|
38
|
+
|
39
|
+
Pass :test => true to the constructor to use the test API
|
40
|
+
|
41
|
+
# Create a new client
|
42
|
+
client = Sendregning::Client.new('my@email.com', 'myawesomepassword', :test => true)
|
43
|
+
|
44
|
+
|
45
|
+
== Copyright
|
46
|
+
|
47
|
+
Copyright (c) 2010 Inge Jørgensen. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "sendregning"
|
8
|
+
gem.summary = "Ruby client for the SendRegning Web Service"
|
9
|
+
gem.description = "Ruby client for the SendRegning Web Service"
|
10
|
+
gem.email = "inge@manualdesign.no"
|
11
|
+
gem.homepage = "http://github.com/elektronaut/sendregning"
|
12
|
+
gem.authors = ["Inge Jørgensen"]
|
13
|
+
gem.add_dependency "httparty", ">= 0.6.1"
|
14
|
+
gem.add_dependency "builder", ">= 2.1.2"
|
15
|
+
gem.add_dependency "multipart-post", ">= 1.0.1"
|
16
|
+
#gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
17
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
|
+
end
|
19
|
+
Jeweler::GemcutterTasks.new
|
20
|
+
rescue LoadError
|
21
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
22
|
+
end
|
23
|
+
|
24
|
+
require 'rake/testtask'
|
25
|
+
Rake::TestTask.new(:test) do |test|
|
26
|
+
test.libs << 'lib' << 'test'
|
27
|
+
test.pattern = 'test/**/test_*.rb'
|
28
|
+
test.verbose = true
|
29
|
+
end
|
30
|
+
|
31
|
+
begin
|
32
|
+
require 'rcov/rcovtask'
|
33
|
+
Rcov::RcovTask.new do |test|
|
34
|
+
test.libs << 'test'
|
35
|
+
test.pattern = 'test/**/test_*.rb'
|
36
|
+
test.verbose = true
|
37
|
+
end
|
38
|
+
rescue LoadError
|
39
|
+
task :rcov do
|
40
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
task :test => :check_dependencies
|
45
|
+
|
46
|
+
task :default => :test
|
47
|
+
|
48
|
+
require 'rake/rdoctask'
|
49
|
+
Rake::RDocTask.new do |rdoc|
|
50
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
51
|
+
|
52
|
+
rdoc.rdoc_dir = 'rdoc'
|
53
|
+
rdoc.title = "sendregning #{version}"
|
54
|
+
rdoc.rdoc_files.include('README*')
|
55
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
56
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/lib/sendregning.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'builder'
|
3
|
+
require 'net/http/post/multipart'
|
4
|
+
require 'httparty'
|
5
|
+
|
6
|
+
dir = Pathname(__FILE__).dirname.expand_path
|
7
|
+
|
8
|
+
require dir + 'sendregning/client'
|
9
|
+
require dir + 'sendregning/invoice'
|
10
|
+
require dir + 'sendregning/line'
|
11
|
+
|
12
|
+
module Sendregning
|
13
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module Sendregning
|
4
|
+
|
5
|
+
# Client for the SendRegning Web Services.
|
6
|
+
#
|
7
|
+
# Usage example:
|
8
|
+
#
|
9
|
+
# client = SendRegning::Client.new(my_username, my_password)
|
10
|
+
|
11
|
+
class Client
|
12
|
+
include HTTParty
|
13
|
+
|
14
|
+
base_uri 'https://www.sendregning.no'
|
15
|
+
format :xml
|
16
|
+
|
17
|
+
def initialize(username, password, options={})
|
18
|
+
@auth = {:username => username, :password => password}
|
19
|
+
@test = true if options[:test]
|
20
|
+
end
|
21
|
+
|
22
|
+
public
|
23
|
+
|
24
|
+
# Performs a GET request
|
25
|
+
def get(query={})
|
26
|
+
self.class.get('/ws/butler.do', query_options(query))
|
27
|
+
end
|
28
|
+
|
29
|
+
# Performs a POST request
|
30
|
+
def post(query=nil)
|
31
|
+
self.class.post('/ws/butler.do', query_options(query))
|
32
|
+
end
|
33
|
+
|
34
|
+
# Performs a POST request with an XML payload
|
35
|
+
def post_xml(xml, body={})
|
36
|
+
# Prepare the request
|
37
|
+
url = URI.parse("#{self.class.base_uri}/ws/butler.do")
|
38
|
+
body[:xml] = UploadIO.new(StringIO.new(xml), 'text/xml', 'request.xml')
|
39
|
+
body[:test] = true if @test
|
40
|
+
request = Net::HTTP::Post::Multipart.new(url.path, body)
|
41
|
+
request.basic_auth @auth[:username], @auth[:password]
|
42
|
+
|
43
|
+
# Perform request
|
44
|
+
http = Net::HTTP.new(url.host, url.port)
|
45
|
+
http.use_ssl = true
|
46
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
47
|
+
res = http.start{|http| http.request(request)}
|
48
|
+
|
49
|
+
# Parse the response
|
50
|
+
response = Response.new(res, self.class.parser.call(res.body, :xml))
|
51
|
+
end
|
52
|
+
|
53
|
+
# Returns a list of recipients
|
54
|
+
def recipients
|
55
|
+
response = get(:action => 'select', :type => 'recipient')
|
56
|
+
response['recipients']['recipient']
|
57
|
+
end
|
58
|
+
|
59
|
+
# Instances a new invoice
|
60
|
+
def new_invoice(attributes={})
|
61
|
+
Sendregning::Invoice.new(attributes.merge({:client => self}))
|
62
|
+
end
|
63
|
+
|
64
|
+
# Sends an invoice
|
65
|
+
def send_invoice(invoice)
|
66
|
+
response = post_xml(invoice.to_xml, {:action => 'send', :type => 'invoice'})
|
67
|
+
parse_invoice(response['invoices']['invoice'], invoice)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Finds an invoice by invoice number
|
71
|
+
def find_invoice(invoice_id)
|
72
|
+
builder = Builder::XmlMarkup.new(:indent=>2)
|
73
|
+
builder.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
|
74
|
+
request_xml = builder.select do |select|
|
75
|
+
select.invoiceNumbers do |numbers|
|
76
|
+
numbers.invoiceNumber invoice_id
|
77
|
+
end
|
78
|
+
end
|
79
|
+
response = post_xml(request_xml, {:action => 'select', :type => 'invoice'})
|
80
|
+
parse_invoice(response['invoices']['invoice']) rescue nil
|
81
|
+
end
|
82
|
+
|
83
|
+
|
84
|
+
protected
|
85
|
+
|
86
|
+
def flatten_xml_hash(hash)
|
87
|
+
new_hash = {}
|
88
|
+
hash.each do |key, value|
|
89
|
+
new_hash[key] = "#{value}"
|
90
|
+
end
|
91
|
+
new_hash
|
92
|
+
end
|
93
|
+
|
94
|
+
def parse_invoice(response, invoice=Sendregning::Invoice.new)
|
95
|
+
attributes = response.dup
|
96
|
+
if attributes['optional']
|
97
|
+
attributes = attributes.merge(attributes['optional'])
|
98
|
+
attributes.delete('optional')
|
99
|
+
end
|
100
|
+
if attributes['shipment']
|
101
|
+
attributes = attributes.merge(attributes['shipment'])
|
102
|
+
attributes.delete('shipment')
|
103
|
+
end
|
104
|
+
lines = attributes['lines']['line']; attributes.delete('lines')
|
105
|
+
|
106
|
+
invoice.update(flatten_xml_hash(attributes))
|
107
|
+
invoice.lines = lines.map{|l| Sendregning::Line.new(flatten_xml_hash(l))}
|
108
|
+
invoice
|
109
|
+
end
|
110
|
+
|
111
|
+
# Prepares options for a request
|
112
|
+
def query_options(query={})
|
113
|
+
query[:test] = 'true' if @test
|
114
|
+
{:basic_auth => @auth, :query => query}
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,144 @@
|
|
1
|
+
module Sendregning
|
2
|
+
|
3
|
+
class Invoice
|
4
|
+
|
5
|
+
OPTIONAL_ATTRIBUTES = [
|
6
|
+
# Request
|
7
|
+
:invoiceType, :creditedId, :orderNo, :invoiceDate, :orderNo,
|
8
|
+
:invoiceDate, :dueDate, :orderDate, :recipientNo, :address1, :address2,
|
9
|
+
:country, :email, :ourRef, :yourRef, :comment, :invoiceText, :printDunningInfo,
|
10
|
+
:itemTaxInclude,
|
11
|
+
|
12
|
+
# Response
|
13
|
+
:tax, :dueDate, :dunningFee, :invoiceNo, :total, :accountNo, :orgNrSuffix, :kid, :orgNo, :interestRate, :state
|
14
|
+
]
|
15
|
+
|
16
|
+
SHIPMENT_ATTRIBUTES = [
|
17
|
+
:shipment, :emailaddresses, :copyaddresses
|
18
|
+
]
|
19
|
+
|
20
|
+
SHIPMENT_MODES = {
|
21
|
+
:paper => 'PAPER',
|
22
|
+
:email => 'EMAIL',
|
23
|
+
:paper_and_email => 'PAPER_AND_EMAIL'
|
24
|
+
}
|
25
|
+
|
26
|
+
attr_accessor :client
|
27
|
+
attr_accessor :name, :zip, :city
|
28
|
+
attr_accessor :optional, :shipment
|
29
|
+
attr_accessor :lines
|
30
|
+
|
31
|
+
def initialize(attributes={})
|
32
|
+
self.update(attributes)
|
33
|
+
@lines = []
|
34
|
+
end
|
35
|
+
|
36
|
+
def update(attributes={})
|
37
|
+
@client = attributes[:client] if attributes[:client]
|
38
|
+
@name = attributes[:name] if attributes[:name]
|
39
|
+
@zip = attributes[:zip] if attributes[:zip]
|
40
|
+
@city = attributes[:city] if attributes[:city]
|
41
|
+
self.optional = attributes
|
42
|
+
self.shipment = attributes
|
43
|
+
end
|
44
|
+
|
45
|
+
def add_line(line)
|
46
|
+
line = Sendregning::Line.new(line) unless line.kind_of?(Sendregning::Line)
|
47
|
+
@lines << line
|
48
|
+
line
|
49
|
+
end
|
50
|
+
|
51
|
+
# Sends an invoice
|
52
|
+
def send!
|
53
|
+
self.client.send_invoice(self)
|
54
|
+
end
|
55
|
+
|
56
|
+
def paid?
|
57
|
+
state == 'paid'
|
58
|
+
end
|
59
|
+
|
60
|
+
# Renders invoice to XML
|
61
|
+
def to_xml(options={})
|
62
|
+
if options[:builder]
|
63
|
+
xml = options[:builder]
|
64
|
+
else
|
65
|
+
xml = Builder::XmlMarkup.new(:indent=>2)
|
66
|
+
xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
|
67
|
+
end
|
68
|
+
xml.invoices do |invoices|
|
69
|
+
invoices.invoice do |invoice|
|
70
|
+
invoice.name @name
|
71
|
+
invoice.zip @zip
|
72
|
+
invoice.city @city
|
73
|
+
|
74
|
+
# Lines
|
75
|
+
if @lines.length > 0
|
76
|
+
invoice.lines do |line_builder|
|
77
|
+
@lines.each{|l| l.to_xml(:builder => line_builder)}
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Optional attributes
|
82
|
+
if @optional.length > 0
|
83
|
+
invoice.optional do |optional|
|
84
|
+
@optional.each do |key, value|
|
85
|
+
key = key.to_sym
|
86
|
+
optional.tag! key, value
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
# Shipment attributes
|
92
|
+
if @shipment.length > 0
|
93
|
+
invoice.shipment do |shipment|
|
94
|
+
shipment_mode = (@shipment[:shipment] || :paper).to_sym
|
95
|
+
raise 'Invalid shipment mode!' unless SHIPMENT_MODES.keys.include?(shipment_mode)
|
96
|
+
shipment_mode = SHIPMENT_MODES[shipment_mode]
|
97
|
+
|
98
|
+
shipment.text! shipment_mode
|
99
|
+
@shipment.each do |key, values|
|
100
|
+
key = key.to_sym
|
101
|
+
unless key == :shipment
|
102
|
+
values = [values] unless values.kind_of?(Enumerable)
|
103
|
+
shipment.tag! key do |emails|
|
104
|
+
values.each{|v| emails.email v}
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
protected
|
115
|
+
|
116
|
+
def optional=(attributes)
|
117
|
+
@optional ||= {}
|
118
|
+
attributes.each do |key, value|
|
119
|
+
@optional[key.to_sym] = value if OPTIONAL_ATTRIBUTES.include?(key.to_sym)
|
120
|
+
end
|
121
|
+
@optional
|
122
|
+
end
|
123
|
+
|
124
|
+
def shipment=(attributes)
|
125
|
+
@shipment ||= {}
|
126
|
+
attributes.each do |key, value|
|
127
|
+
@shipment[key.to_sym] = value if SHIPMENT_ATTRIBUTES.include?(key.to_sym)
|
128
|
+
end
|
129
|
+
@shipment
|
130
|
+
end
|
131
|
+
|
132
|
+
def method_missing(method, *args)
|
133
|
+
if OPTIONAL_ATTRIBUTES.include?(method)
|
134
|
+
@optional[method]
|
135
|
+
elsif SHIPPING_ATTRIBUTES.include?(method)
|
136
|
+
@shipping[method]
|
137
|
+
else
|
138
|
+
super
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
end
|
143
|
+
|
144
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Sendregning
|
2
|
+
|
3
|
+
class Line
|
4
|
+
|
5
|
+
# Quantity, as decimal. Example: '7,5'
|
6
|
+
attr_accessor :qty
|
7
|
+
|
8
|
+
# Product code. String, max length: 9
|
9
|
+
attr_accessor :prodCode
|
10
|
+
|
11
|
+
# Description. String, max length: 75
|
12
|
+
attr_accessor :desc
|
13
|
+
|
14
|
+
# Price per unit in decimal. Example: '250,00'
|
15
|
+
attr_accessor :unitPrice
|
16
|
+
|
17
|
+
# Discount in percentage as decimal. Optional, defaults to 0
|
18
|
+
attr_accessor :discount
|
19
|
+
|
20
|
+
# Tax rate. Valid rates are: '0', '8', '13' and '25'. Default: '25'
|
21
|
+
attr_accessor :tax
|
22
|
+
|
23
|
+
attr_accessor :itemNo, :lineTaxAmount, :lineTotal
|
24
|
+
|
25
|
+
def initialize(new_attributes={})
|
26
|
+
self.attributes = new_attributes
|
27
|
+
end
|
28
|
+
|
29
|
+
# Renders line to XML
|
30
|
+
def to_xml(options={})
|
31
|
+
if options[:builder]
|
32
|
+
xml = options[:builder]
|
33
|
+
else
|
34
|
+
xml = Builder::XmlMarkup.new(:indent=>2)
|
35
|
+
xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
|
36
|
+
end
|
37
|
+
xml.line do |line|
|
38
|
+
line.qty self.qty if @qty
|
39
|
+
line.prodCode self.prodCode if @prodCode
|
40
|
+
line.desc self.desc if @desc
|
41
|
+
line.unitPrice self.unitPrice if @unitPrice
|
42
|
+
line.discount self.discount if @discount
|
43
|
+
line.tax self.tax if @tax
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
protected
|
48
|
+
|
49
|
+
def attributes=(attributes={})
|
50
|
+
attributes.each do |key, value|
|
51
|
+
set_method = "#{key.to_s}=".to_sym
|
52
|
+
self.send(set_method, value) if self.respond_to?(set_method)
|
53
|
+
end
|
54
|
+
attributes
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
data/sendregning.gemspec
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{sendregning}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Inge J\303\270rgensen"]
|
12
|
+
s.date = %q{2010-10-20}
|
13
|
+
s.description = %q{Ruby client for the SendRegning Web Service}
|
14
|
+
s.email = %q{inge@manualdesign.no}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/sendregning.rb",
|
27
|
+
"lib/sendregning/client.rb",
|
28
|
+
"lib/sendregning/invoice.rb",
|
29
|
+
"lib/sendregning/line.rb",
|
30
|
+
"sendregning.gemspec",
|
31
|
+
"test/helper.rb",
|
32
|
+
"test/test_sendregning.rb"
|
33
|
+
]
|
34
|
+
s.homepage = %q{http://github.com/elektronaut/sendregning}
|
35
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = %q{1.3.7}
|
38
|
+
s.summary = %q{Ruby client for the SendRegning Web Service}
|
39
|
+
s.test_files = [
|
40
|
+
"test/helper.rb",
|
41
|
+
"test/test_sendregning.rb"
|
42
|
+
]
|
43
|
+
|
44
|
+
if s.respond_to? :specification_version then
|
45
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
46
|
+
s.specification_version = 3
|
47
|
+
|
48
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
49
|
+
s.add_runtime_dependency(%q<httparty>, [">= 0.6.1"])
|
50
|
+
s.add_runtime_dependency(%q<builder>, [">= 2.1.2"])
|
51
|
+
s.add_runtime_dependency(%q<multipart-post>, [">= 1.0.1"])
|
52
|
+
else
|
53
|
+
s.add_dependency(%q<httparty>, [">= 0.6.1"])
|
54
|
+
s.add_dependency(%q<builder>, [">= 2.1.2"])
|
55
|
+
s.add_dependency(%q<multipart-post>, [">= 1.0.1"])
|
56
|
+
end
|
57
|
+
else
|
58
|
+
s.add_dependency(%q<httparty>, [">= 0.6.1"])
|
59
|
+
s.add_dependency(%q<builder>, [">= 2.1.2"])
|
60
|
+
s.add_dependency(%q<multipart-post>, [">= 1.0.1"])
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
data/test/helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sendregning
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- "Inge J\xC3\xB8rgensen"
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-10-20 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: httparty
|
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
|
+
- 6
|
33
|
+
- 1
|
34
|
+
version: 0.6.1
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: builder
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 15
|
46
|
+
segments:
|
47
|
+
- 2
|
48
|
+
- 1
|
49
|
+
- 2
|
50
|
+
version: 2.1.2
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: multipart-post
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 21
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 0
|
65
|
+
- 1
|
66
|
+
version: 1.0.1
|
67
|
+
type: :runtime
|
68
|
+
version_requirements: *id003
|
69
|
+
description: Ruby client for the SendRegning Web Service
|
70
|
+
email: inge@manualdesign.no
|
71
|
+
executables: []
|
72
|
+
|
73
|
+
extensions: []
|
74
|
+
|
75
|
+
extra_rdoc_files:
|
76
|
+
- LICENSE
|
77
|
+
- README.rdoc
|
78
|
+
files:
|
79
|
+
- .document
|
80
|
+
- .gitignore
|
81
|
+
- LICENSE
|
82
|
+
- README.rdoc
|
83
|
+
- Rakefile
|
84
|
+
- VERSION
|
85
|
+
- lib/sendregning.rb
|
86
|
+
- lib/sendregning/client.rb
|
87
|
+
- lib/sendregning/invoice.rb
|
88
|
+
- lib/sendregning/line.rb
|
89
|
+
- sendregning.gemspec
|
90
|
+
- test/helper.rb
|
91
|
+
- test/test_sendregning.rb
|
92
|
+
has_rdoc: true
|
93
|
+
homepage: http://github.com/elektronaut/sendregning
|
94
|
+
licenses: []
|
95
|
+
|
96
|
+
post_install_message:
|
97
|
+
rdoc_options:
|
98
|
+
- --charset=UTF-8
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !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
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
hash: 3
|
116
|
+
segments:
|
117
|
+
- 0
|
118
|
+
version: "0"
|
119
|
+
requirements: []
|
120
|
+
|
121
|
+
rubyforge_project:
|
122
|
+
rubygems_version: 1.3.7
|
123
|
+
signing_key:
|
124
|
+
specification_version: 3
|
125
|
+
summary: Ruby client for the SendRegning Web Service
|
126
|
+
test_files:
|
127
|
+
- test/helper.rb
|
128
|
+
- test/test_sendregning.rb
|