pina 0.2.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb1e813180ba4dfd749dcfb7cb17a029feec42e2
4
- data.tar.gz: 59743e276d44b3ac8a5f64157526cc76654bc0ce
3
+ metadata.gz: 23b08d7071b89683e9435a5a42b8f4f51cb5eccd
4
+ data.tar.gz: e5648493ce1f0a9505d9dc806bbdbe0d4163e4fb
5
5
  SHA512:
6
- metadata.gz: be6635f0d55fdd227f1cb80984825f57e2729f1b16540ad615566e7f6e976b46db274acec07a637514e543be6e405b290f08db47ea5b3dae77dcc333a4581b09
7
- data.tar.gz: 8a3c1acb1e814483bcb77ddaf747935229753a9c99d3197a7bbc99c79c30633079c40c0efe18f7d1156aef1bc37e5fc3c9becee3633988ba1433994535b8cfc1
6
+ metadata.gz: 607bb57906cee481c9cba39cc107a1c1bff8353150434c2187e1eae44a8c93db43e67d052aeb29814f8d8415f80a874e09512936024d27cdef35b7bb503c3e47
7
+ data.tar.gz: 0e7b22d010ec4e5bdc19db8f09c505871a31f18da886009bc6ba56564154316b6763e5de6bfeb9aa58eb25d503b4685cfb4b89021fea0252174c8989cf2e5139
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'irb'
4
+ require 'irb/completion'
5
+
6
+ require 'pina'
7
+ require 'dotenv'
8
+ Dotenv.load
9
+
10
+ Pina.configure do |config|
11
+ config.email = ENV['EMAIL']
12
+ config.tenant = ENV['TENANT']
13
+ config.api_token = ENV['API_TOKEN']
14
+ end
15
+
16
+ IRB.start
@@ -3,6 +3,7 @@ require 'base64'
3
3
  require 'json'
4
4
  require 'typhoeus'
5
5
  require 'virtus'
6
+ require 'uri'
6
7
 
7
8
  require 'pina/contact'
8
9
  require 'pina/sales_invoice'
@@ -20,6 +21,7 @@ require 'pina/models/sales_invoice_list'
20
21
 
21
22
  module Pina
22
23
  class ConfigurationNotSet < StandardError; end
24
+ class ConnectionError < StandardError; end
23
25
 
24
26
  DEFAULT_API_VERSION = :v1
25
27
  DEFAULT_EMAIL = 'dummy@email.com'
@@ -35,6 +35,7 @@ module Pina
35
35
  attribute :constant_symbol
36
36
  attribute :consumption_country_id
37
37
  attribute :created_at
38
+ attribute :currency_id
38
39
  attribute :delivery_note
39
40
  attribute :delivery_note_note
40
41
  attribute :delivery_note_text
@@ -60,6 +60,8 @@ module Pina
60
60
  attr_accessor :body, :status_code
61
61
 
62
62
  def initialize(status_code, body)
63
+ raise Pina::ConnectionError if status_code == 0
64
+
63
65
  @status_code = status_code
64
66
  @body = body
65
67
  end
@@ -1,3 +1,3 @@
1
1
  module Pina
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.1'
3
3
  end
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = 'Fantozzi REST API client'
13
13
  spec.homepage = 'https://github.com/ucetnictvi-on-line/pina'
14
14
  spec.license = 'MIT'
15
+ spec.bindir = 'bin'
15
16
 
16
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
18
  f.match(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Hronek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-08 00:00:00.000000000 Z
11
+ date: 2016-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -195,6 +195,7 @@ files:
195
195
  - LICENSE
196
196
  - README.md
197
197
  - Rakefile
198
+ - bin/console
198
199
  - lib/pina.rb
199
200
  - lib/pina/contact.rb
200
201
  - lib/pina/models/address.rb