easybill 0.2.20 → 0.2.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +29 -0
- data/.ruby-version +1 -1
- data/Gemfile +4 -0
- data/README.md +4 -0
- data/Rakefile +1 -0
- data/circle.yml +3 -0
- data/easybill.gemspec +10 -10
- data/lib/easybill/client.rb +4 -6
- data/lib/easybill/configuration.rb +1 -1
- data/lib/easybill/version.rb +1 -1
- data/spec/easybill/client_spec.rb +7 -7
- data/spec/easybill/configuration_spec.rb +1 -1
- data/spec/easybill_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -1
- data/spec/support/fixture.rb +2 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c118ec30890f5d76a08a4120796255ba0d7fa245
|
4
|
+
data.tar.gz: d4f5e13867771aadfbd1d7aba87a881963ad0176
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b0fe6177d840fd5b9f4e4635519a9ff624dae9f54086aefb6a4f2abaf978ab0c6cb781ccdf333186143caea74a9ddca43c5faeb26cfedf47c955f0cfedddb18
|
7
|
+
data.tar.gz: 3ee4d7075182c1725d426ab53cb6772f01b85e0f123b938b8c0472364773858dd9acb7568539687299b1604c85b531876205af7f8e95330b8f7627529e590754
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
+
# on 2015-04-27 16:05:46 +0200 using RuboCop version 0.30.1.
|
3
|
+
# The point is for the user to remove these configuration records
|
4
|
+
# one by one as the offenses are removed from the code base.
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
7
|
+
|
8
|
+
# Offense count: 3
|
9
|
+
Metrics/AbcSize:
|
10
|
+
Max: 22
|
11
|
+
|
12
|
+
# Offense count: 1
|
13
|
+
# Configuration parameters: CountComments.
|
14
|
+
Metrics/ClassLength:
|
15
|
+
Max: 103
|
16
|
+
|
17
|
+
# Offense count: 2
|
18
|
+
Metrics/CyclomaticComplexity:
|
19
|
+
Max: 7
|
20
|
+
|
21
|
+
# Offense count: 21
|
22
|
+
# Configuration parameters: AllowURI, URISchemes.
|
23
|
+
Metrics/LineLength:
|
24
|
+
Max: 197
|
25
|
+
|
26
|
+
# Offense count: 2
|
27
|
+
# Configuration parameters: CountComments.
|
28
|
+
Metrics/MethodLength:
|
29
|
+
Max: 23
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.1
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Easybill
|
2
2
|
|
3
|
+
[![Circle CI](https://circleci.com/gh/ad2games/easybill.svg?style=svg)](https://circleci.com/gh/ad2games/easybill)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/ad2games/easybill/badges/gpa.svg)](https://codeclimate.com/github/ad2games/easybill)
|
5
|
+
[![Test Coverage](https://codeclimate.com/github/ad2games/easybill/badges/coverage.svg)](https://codeclimate.com/github/ad2games/easybill/coverage)
|
6
|
+
|
3
7
|
A wrapper for the [Easybill](http://easybill.de) online invoice service.
|
4
8
|
Create invoices, manage customer information and their payments using
|
5
9
|
the SOAP API.
|
data/Rakefile
CHANGED
data/circle.yml
ADDED
data/easybill.gemspec
CHANGED
@@ -4,17 +4,17 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'easybill/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
|
-
gem.name
|
8
|
-
gem.version
|
9
|
-
gem.authors
|
10
|
-
gem.email
|
11
|
-
gem.description
|
12
|
-
gem.summary
|
13
|
-
gem.homepage
|
7
|
+
gem.name = 'easybill'
|
8
|
+
gem.version = Easybill::VERSION
|
9
|
+
gem.authors = ['ad2games GmbH']
|
10
|
+
gem.email = ['developers@ad2games.com']
|
11
|
+
gem.description = 'Create invoices with Easybill'
|
12
|
+
gem.summary = 'A client library to the SOAP API of Easybill.de'
|
13
|
+
gem.homepage = ''
|
14
14
|
|
15
|
-
gem.files
|
16
|
-
gem.executables
|
17
|
-
gem.test_files
|
15
|
+
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ['lib']
|
19
19
|
|
20
20
|
gem.add_runtime_dependency 'sekken'
|
data/lib/easybill/client.rb
CHANGED
@@ -17,7 +17,7 @@ module Easybill
|
|
17
17
|
find_documents_by_document_number: { op_name: 'findDocumentsByDocumentNumber', result_type: 'document' },
|
18
18
|
get_document_pdf: { op_name: 'getDocumentPDF', result_type: 'document' },
|
19
19
|
create_dunning: { op_name: 'createDunning', result_type: 'document' },
|
20
|
-
get_document_sent: { op_name: 'getDocumentSent', result_type: 'document' }
|
20
|
+
get_document_sent: { op_name: 'getDocumentSent', result_type: 'document' }
|
21
21
|
}
|
22
22
|
|
23
23
|
def initialize(options = {})
|
@@ -73,9 +73,9 @@ module Easybill
|
|
73
73
|
# Work around issue on Easybill's side.
|
74
74
|
faultstring = response.body[:fault][:faultstring].to_s
|
75
75
|
if faultstring.start_with?('Call to undefined method StandardDocumentStorno::')
|
76
|
-
return OpenStruct.new(
|
77
|
-
get_document_payments_response: { payed: false, to_pay: '0' }
|
78
|
-
|
76
|
+
return OpenStruct.new(
|
77
|
+
body: { get_document_payments_response: { payed: false, to_pay: '0' } }
|
78
|
+
)
|
79
79
|
end
|
80
80
|
|
81
81
|
fail Easybill::Error, response.body[:fault][:faultstring]
|
@@ -121,8 +121,6 @@ module Easybill
|
|
121
121
|
Easybill::Document.new(result)
|
122
122
|
when 'payment'
|
123
123
|
Easybill::Payment.new(result)
|
124
|
-
else
|
125
|
-
nil
|
126
124
|
end
|
127
125
|
end
|
128
126
|
end
|
data/lib/easybill/version.rb
CHANGED
@@ -9,7 +9,7 @@ describe Easybill::Client do
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
subject(:client) {
|
12
|
+
subject(:client) { described_class.new }
|
13
13
|
|
14
14
|
describe '.new' do
|
15
15
|
it 'uses Easybill.configuration as default' do
|
@@ -18,7 +18,7 @@ describe Easybill::Client do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'accepts an api key on initialization' do
|
21
|
-
client =
|
21
|
+
client = described_class.new(api_key: 'abc1234')
|
22
22
|
expect(client.instance_variable_get(:@options)[:api_key]).to eq('abc1234')
|
23
23
|
end
|
24
24
|
end
|
@@ -62,13 +62,13 @@ describe Easybill::Client do
|
|
62
62
|
|
63
63
|
let(:good_params) do
|
64
64
|
{
|
65
|
-
salutation:
|
65
|
+
salutation: 3, # company
|
66
66
|
companyName: 'test company',
|
67
|
-
street:
|
67
|
+
street: 'Rosenstrasse 17',
|
68
68
|
postboxZipCode: '10178',
|
69
|
-
city:
|
70
|
-
country:
|
71
|
-
taxOptions:
|
69
|
+
city: 'Berlin',
|
70
|
+
country: 'DE',
|
71
|
+
taxOptions: 1, # with VAT
|
72
72
|
}
|
73
73
|
end
|
74
74
|
|
data/spec/easybill_spec.rb
CHANGED
@@ -2,13 +2,13 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Easybill do
|
4
4
|
describe '.configure' do
|
5
|
-
specify { expect { |b|
|
5
|
+
specify { expect { |b| described_class.configure(&b) }.to yield_with_args(described_class.configuration) }
|
6
6
|
end
|
7
7
|
|
8
8
|
describe '.configuration' do
|
9
9
|
it 'gives a new configuration by default' do
|
10
|
-
|
11
|
-
expect(
|
10
|
+
described_class.configuration = nil
|
11
|
+
expect(described_class.configuration).to be_a Easybill::Configuration
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -54,7 +54,7 @@ VCR.configure do |c|
|
|
54
54
|
c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
|
55
55
|
c.hook_into :webmock
|
56
56
|
c.filter_sensitive_data('easybill-api-key') { Easybill.configuration.api_key }
|
57
|
-
c.default_cassette_options = { match_requests_on:
|
57
|
+
c.default_cassette_options = { match_requests_on: %i(method uri body) }
|
58
58
|
|
59
59
|
c.ignore_hosts 'codeclimate.com'
|
60
60
|
end
|
data/spec/support/fixture.rb
CHANGED
@@ -2,9 +2,8 @@ require 'yaml'
|
|
2
2
|
|
3
3
|
module Easybill
|
4
4
|
module Fixture
|
5
|
-
|
6
|
-
define_method name do
|
7
|
-
key, _ = args
|
5
|
+
%i(customer position document).each do |name|
|
6
|
+
define_method name do |key, *_args|
|
8
7
|
key.nil? ? data[name] : data[name][key.to_sym]
|
9
8
|
end
|
10
9
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easybill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ad2games GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sekken
|
@@ -159,11 +159,13 @@ extra_rdoc_files: []
|
|
159
159
|
files:
|
160
160
|
- ".gitignore"
|
161
161
|
- ".rspec"
|
162
|
+
- ".rubocop_todo.yml"
|
162
163
|
- ".ruby-version"
|
163
164
|
- Gemfile
|
164
165
|
- LICENSE.txt
|
165
166
|
- README.md
|
166
167
|
- Rakefile
|
168
|
+
- circle.yml
|
167
169
|
- easybill.gemspec
|
168
170
|
- lib/easybill.rb
|
169
171
|
- lib/easybill/client.rb
|