easybill 0.2.20 → 0.2.21

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 341539d5c1dea32f277d36ddf5174abc6d061c03
4
- data.tar.gz: ec3bbe27d4f6dd368d0636cc0bfeb0b46a039cc2
3
+ metadata.gz: c118ec30890f5d76a08a4120796255ba0d7fa245
4
+ data.tar.gz: d4f5e13867771aadfbd1d7aba87a881963ad0176
5
5
  SHA512:
6
- metadata.gz: 1d3b086f73d64012919bec3adaeff7696a43c76d1224411c64a85ff1bdaa4254f1953ffc231928cf012e7d5bb330b9eeb9f34b5aa6fbf62d4968d7d9224f7851
7
- data.tar.gz: 5a100746f1ea807824b346552a3c9a3a5208d89ccd3bcc45c5fbcd7c6f92a3bd4c428ad6a032fe668c333396666cbe1b42eb3d515e8867934ab0b1ba9602548a
6
+ metadata.gz: 8b0fe6177d840fd5b9f4e4635519a9ff624dae9f54086aefb6a4f2abaf978ab0c6cb781ccdf333186143caea74a9ddca43c5faeb26cfedf47c955f0cfedddb18
7
+ data.tar.gz: 3ee4d7075182c1725d426ab53cb6772f01b85e0f123b938b8c0472364773858dd9acb7568539687299b1604c85b531876205af7f8e95330b8f7627529e590754
@@ -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
@@ -1 +1 @@
1
- 2.2.0
1
+ 2.2.1
data/Gemfile CHANGED
@@ -1,3 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rubocop-ci', github: 'ad2games/rubocop-ci'
7
+ end
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
@@ -1 +1,2 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rubocop-ci'
@@ -0,0 +1,3 @@
1
+ test:
2
+ pre:
3
+ - bundle exec rake rubocop
@@ -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 = '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 = ''
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 = `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)/})
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'
@@ -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(body: {
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
@@ -1,6 +1,6 @@
1
1
  module Easybill
2
2
  class Configuration
3
- OPTIONS = [:api_key, :logger].freeze
3
+ OPTIONS = %i(api_key logger).freeze
4
4
 
5
5
  # The API key for your user taken from the easybill website.
6
6
  attr_accessor :api_key
@@ -1,3 +1,3 @@
1
1
  module Easybill
2
- VERSION = '0.2.20'
2
+ VERSION = '0.2.21'
3
3
  end
@@ -9,7 +9,7 @@ describe Easybill::Client do
9
9
  end
10
10
  end
11
11
 
12
- subject(:client) { Easybill::Client.new }
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 = Easybill::Client.new(api_key: 'abc1234')
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: 3, # company
65
+ salutation: 3, # company
66
66
  companyName: 'test company',
67
- street: 'Rosenstrasse 17',
67
+ street: 'Rosenstrasse 17',
68
68
  postboxZipCode: '10178',
69
- city: 'Berlin',
70
- country: 'DE',
71
- taxOptions: 1, # with VAT
69
+ city: 'Berlin',
70
+ country: 'DE',
71
+ taxOptions: 1, # with VAT
72
72
  }
73
73
  end
74
74
 
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Easybill::Configuration do
4
- subject(:config) { Easybill::Configuration.new }
4
+ subject(:config) { described_class.new }
5
5
 
6
6
  describe '#new' do
7
7
  context 'when the EASYBILL_API_KEY environment variable is set' do
@@ -2,13 +2,13 @@ require 'spec_helper'
2
2
 
3
3
  describe Easybill do
4
4
  describe '.configure' do
5
- specify { expect { |b| Easybill.configure(&b) }.to yield_with_args(Easybill.configuration) }
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
- Easybill.configuration = nil
11
- expect(Easybill.configuration).to be_a Easybill::Configuration
10
+ described_class.configuration = nil
11
+ expect(described_class.configuration).to be_a Easybill::Configuration
12
12
  end
13
13
  end
14
14
  end
@@ -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: [:method, :uri, :body] }
57
+ c.default_cassette_options = { match_requests_on: %i(method uri body) }
58
58
 
59
59
  c.ignore_hosts 'codeclimate.com'
60
60
  end
@@ -2,9 +2,8 @@ require 'yaml'
2
2
 
3
3
  module Easybill
4
4
  module Fixture
5
- [:customer, :position, :document].each do |name|
6
- define_method name do |*args|
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.20
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-02-25 00:00:00.000000000 Z
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