fakturan_nu 1.0.1 → 1.0.2

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: bb9d1638af2349a26125ce41a43cdcd176c9c49b
4
- data.tar.gz: 84d469e7d0c44d3cac4a38dfda966275b7efd8d1
3
+ metadata.gz: 1ab202040f38b9432b6b261c32a0aa67f89d38d2
4
+ data.tar.gz: 4fea1eda6ee8ecd18f6e34a1d2fd8c44f83896b0
5
5
  SHA512:
6
- metadata.gz: cc1cfd64e2e9d34e17897abf430f65623341447bd5801d0fbff3efdb1bc93582b234219e714e292db05ea922996cc635f7a9c2dd957f18a4edc345f980ce3060
7
- data.tar.gz: 6850b0e9310bc6df2ef5843908e089e3c30c7b93638fea2b101216d9776a98f9dc0063430de1aa7ca65c7a33081f8ec9c42a94db65a0fb97a076b95465939ef5
6
+ metadata.gz: 65be8dbc83508e8944cf56db81c757e96e241c65097834949858f9a612b54d3920bb719823043d7ca9f2f120366aee3662ed594a5e5a981e2f3e1de62d3fe079
7
+ data.tar.gz: c6863d2a83780936fa5886ddde654cfa31de7a6866c7865d1a043de9dcc2f2fb4f7b2f06aaa3ff087618395876665fefba9c07553804a7f8343a0539442a71d2
data/README.md CHANGED
@@ -18,6 +18,10 @@ Then create an initializer in app/initializers called ``` fakturan_nu.rb ``` (
18
18
  ```ruby
19
19
  Fakturan.setup 'your api username here', 'your api key/password here'
20
20
  Fakturan.use_sandbox = true # Should be true during development/testing and false in production.
21
+
22
+ # Prints request+response logs to STDOUT for easier debugging. Defaults to true for sandbox.
23
+ # Fakturan.debug_log = false
24
+
21
25
  ```
22
26
 
23
27
  If you're not using Rails, just ``` require 'fakturan_nu'``` and run setup wherever you like.
@@ -125,3 +129,6 @@ rescue Fakturan::Error => error
125
129
  end
126
130
  ```
127
131
 
132
+ ## Debugging / logging
133
+
134
+ In order to get a print out of full request+response bodies, put ```Fakturan.debug_log = true``` in your setup. The value of ```debug_log``` is set to ```true``` in sandbox mode, and ```false``` otherwise and will be updated whenever ```use_sandbox``` updates. So in order to get logging in production mode, you will have to set ```debug_log``` to ```true``` manually.
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'fakturan_nu'
4
- s.version = '1.0.1'
5
- s.date = '2014-12-17'
4
+ s.version = '1.0.2'
5
+ s.date = '2015-04-13'
6
6
  s.summary = 'A ruby client for the Fakturan.nu - API'
7
7
  s.description = 'A ruby client for the Fakturan.nu - API. Fakturan.nu is a webbapp for billing.'
8
8
  s.authors = ['Jonathan Bourque Olivegren']
9
9
  s.email = 'jonathan@imagineit.se'
10
10
  s.files = `git ls-files`.split("\n") # http://www.codinginthecrease.com/news_article/show/350843?referrer_id=948927
11
- s.homepage = 'http://rubygems.org/gems/fakturan_nu'
11
+ s.homepage = 'https://github.com/imagine-it/fakturan-nu-gem'
12
12
  s.license = 'MIT'
13
13
 
14
14
  s.add_dependency 'spyke', '~> 1.8', '>= 1.8.7'
@@ -21,7 +21,7 @@ module Fakturan
21
21
  @use_sandbox = false
22
22
  @api_version = 2
23
23
 
24
- mattr_accessor :wire_dump
24
+ mattr_accessor :debug_log
25
25
 
26
26
  def self.setup username = nil, pass = nil
27
27
  #self.parse_json_times = true
@@ -63,7 +63,7 @@ module Fakturan
63
63
  end
64
64
 
65
65
  def self.use_sandbox=(true_or_false)
66
- @use_sandbox = self.wire_dump = true_or_false
66
+ @use_sandbox = self.debug_log = true_or_false
67
67
  rebuild_url
68
68
  end
69
69
 
@@ -20,7 +20,7 @@ module Fakturan
20
20
  #ErrorStatuses = 400...600
21
21
 
22
22
  def call(env)
23
- if Fakturan.wire_dump
23
+ if Fakturan.debug_log
24
24
  info "#{env.method} #{env.url.to_s}"
25
25
  debug('request') { dump_headers env.request_headers }
26
26
  debug('request') { dump_body(env[:body]) } if env[:body] && log_body?(:request)
@@ -29,7 +29,7 @@ module Fakturan
29
29
  end
30
30
 
31
31
  def on_complete(env)
32
- if Fakturan.wire_dump
32
+ if Fakturan.debug_log
33
33
  info('Status') { env.status.to_s }
34
34
  #debug('response') { dump_headers env.response_headers }
35
35
  debug('response') { dump_body env[:body] } if env[:body] && log_body?(:response)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fakturan_nu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Bourque Olivegren
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-17 00:00:00.000000000 Z
11
+ date: 2015-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spyke
@@ -205,7 +205,7 @@ files:
205
205
  - test/models_test.rb
206
206
  - test/test_helper.rb
207
207
  - test/vcr_cassettes/models.yml
208
- homepage: http://rubygems.org/gems/fakturan_nu
208
+ homepage: https://github.com/imagine-it/fakturan-nu-gem
209
209
  licenses:
210
210
  - MIT
211
211
  metadata: {}