sendregning 0.1.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -21
- data/.rubocop.yml +23 -0
- data/.rubocop_todo.yml +0 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +93 -0
- data/README.md +49 -0
- data/lib/sendregning.rb +15 -8
- data/lib/sendregning/client.rb +73 -104
- data/lib/sendregning/invoice.rb +96 -145
- data/lib/sendregning/invoice_parser.rb +47 -0
- data/lib/sendregning/invoice_serializer.rb +59 -0
- data/lib/sendregning/line.rb +42 -57
- data/lib/sendregning/line_serializer.rb +16 -0
- data/lib/sendregning/version.rb +5 -0
- data/lib/sendregning/xml_serializer.rb +36 -0
- data/sendregning.gemspec +22 -56
- metadata +88 -101
- data/.document +0 -5
- data/README.rdoc +0 -47
- data/Rakefile +0 -56
- data/VERSION +0 -1
- data/test/helper.rb +0 -10
- data/test/test_sendregning.rb +0 -7
data/.document
DELETED
data/README.rdoc
DELETED
@@ -1,47 +0,0 @@
|
|
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
|
-
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
DELETED
@@ -1,56 +0,0 @@
|
|
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
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.1.1
|
data/test/helper.rb
DELETED