fs_api 1.0.7 → 1.1.0

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: 737cb0adf3eea01f33d3c9d8add3dd65ef7db522
4
- data.tar.gz: 3dc3f9e843cd3bbff5357f7cb6d31275289784f6
3
+ metadata.gz: 1951fad1c62c420713d4abb967d1888961748ea6
4
+ data.tar.gz: 48f5a184ad8cc405a1fd68cda3939850125c6bfc
5
5
  SHA512:
6
- metadata.gz: 32b7ac069457409dee2860bd439c48bdd2f36f693b29f2f34859ed1faba04b9ba307bcc2257fc28051a88f0d55d5d66bedeb6cef064ffb6dfa9584a6b5285ab7
7
- data.tar.gz: 9b418d1ae0870a62c94f6a3ed88673fc821f9fde6e0ec0e323507599b7d0d163374e15c6f2ff2ee968696000998310d3e96ada693f137ebe0d795383ba68f9b3
6
+ metadata.gz: b99dcc61cb0d38f8b2591c70da949ddfe9aada24880e8b30c047ce0e0fe167fc3c1e5fe8fc33c171c937e9398bbe2fd03f7fb90693ecaa26a911414e6fcc6cce
7
+ data.tar.gz: c31c16c5ec4cd3f64cb5ae9ab90fafcbf4d507f7156d2e49f7fc49051d369a40e94d39b4301d3ae3f5a54852a2321bf60f70f84d4455d4812f1ef2e1a330b680
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
+ [![Gem Version](https://badge.fury.io/rb/fs_api.svg)](https://badge.fury.io/rb/fs_api) [![Build Status](https://travis-ci.org/maartenvanvliet/fs_api.svg)](https://travis-ci.org/maartenvanvliet/fs_api)[![Code Climate](https://codeclimate.com/github/maartenvanvliet/fs_api/badges/gpa.svg)](https://codeclimate.com/github/maartenvanvliet/fs_api)
2
+
1
3
  # FsApi
2
- [![Build Status](https://travis-ci.org/maartenvanvliet/fs_api.svg)](https://travis-ci.org/maartenvanvliet/fs_api)
4
+
3
5
  Gem to interface with the [factuursturen.nl](https://www.factuursturen.nl/?a=1552)
4
6
  invoicing API
5
7
 
@@ -8,8 +10,7 @@ floats/integers/booleans ("true", "1" etc.), for the booleans a conversion is
8
10
  in place, for the others there isn't yet.
9
11
 
10
12
  Use the docs at https://www.factuursturen.nl/docs/api_v1.pdf for more information
11
- on the api. Note that there are inconsistencies between the docs and the
12
- implementation.
13
+ on the api. Note that there are inconsistencies between the docs and what the api actually does. E.g. required fields that are not required.
13
14
 
14
15
 
15
16
  ## Installation
@@ -30,9 +31,26 @@ Or install it yourself as:
30
31
 
31
32
  ## Usage
32
33
 
34
+ ### Initialization
35
+
33
36
  ```ruby
34
37
  api_client = FsApi::Client.new(username, api_key)
38
+ ```
39
+
40
+ or
35
41
 
42
+ ```ruby
43
+ FsApi.configure do |config|
44
+ config.api_key = '...'
45
+ config.username = '...'
46
+ end
47
+
48
+ api_client = FsApi.new
49
+ ```
50
+
51
+ ### After initialization
52
+
53
+ ```ruby
36
54
  # Retrieve all products
37
55
  api_client.products.all
38
56
 
@@ -0,0 +1,9 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.libs.push 'spec'
6
+ t.test_files = FileList['spec/**/*_spec.rb']
7
+ end
8
+
9
+ task default: :test
@@ -18,5 +18,6 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ["lib"]
19
19
 
20
20
  spec.add_development_dependency "rspec", "~> 3.2"
21
+ spec.add_development_dependency "rake", "~> 10.0"
21
22
  spec.add_development_dependency "webmock", "~> 1.21"
22
23
  end
@@ -15,4 +15,25 @@ require "fs_api/resource/invoices_payment"
15
15
  require "fs_api/resource/product"
16
16
 
17
17
  module FsApi
18
+ class << self
19
+ attr_accessor :configuration
20
+ end
21
+
22
+ def self.configure
23
+ self.configuration ||= Configuration.new
24
+ yield(configuration)
25
+ end
26
+
27
+ def self.new
28
+ FsApi::Client.new(configuration.username, configuration.api_key)
29
+ end
30
+
31
+ class Configuration
32
+ attr_accessor :username, :api_key
33
+
34
+ def initialize
35
+ @username = nil
36
+ @api_key = nil
37
+ end
38
+ end
18
39
  end
@@ -36,6 +36,10 @@ class FsApi::Resource::Client
36
36
  collecttype
37
37
  tax_type
38
38
  default_category
39
+ email_reminder
40
+ custom_1
41
+ custom_2
42
+ custom_3
39
43
  )
40
44
  has_nillable_attributes %i(
41
45
  biccode
@@ -45,6 +45,7 @@ class FsApi::Resource::Invoice
45
45
  datesaved
46
46
  tax_type
47
47
  tax_shifted
48
+ category
48
49
  )
49
50
 
50
51
  has_datetime_attributes %w(
@@ -1,3 +1,3 @@
1
1
  module FsApi
2
- VERSION = "1.0.7"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fs_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten van Vliet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-25 00:00:00.000000000 Z
11
+ date: 2017-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: webmock
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +66,7 @@ files:
52
66
  - Gemfile
53
67
  - LICENSE.txt
54
68
  - README.md
69
+ - Rakefile
55
70
  - fs_api.gemspec
56
71
  - lib/fs_api.rb
57
72
  - lib/fs_api/client.rb
@@ -99,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
114
  version: '0'
100
115
  requirements: []
101
116
  rubyforge_project:
102
- rubygems_version: 2.2.2
117
+ rubygems_version: 2.5.2
103
118
  signing_key:
104
119
  specification_version: 4
105
120
  summary: Ruby-Api library for factuursturen.nl
@@ -115,4 +130,3 @@ test_files:
115
130
  - spec/support/responses/client.json
116
131
  - spec/support/responses/invoice.json
117
132
  - spec/support/responses/product.json
118
- has_rdoc: