perfect_audit 0.1.2 → 0.1.3

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: 2529da36d15dc0c3943b94b9dc2dffd825765305
4
- data.tar.gz: feb4ae1227244ce9df8625e6c11d71cd9a7dd7e9
3
+ metadata.gz: 111bdad0b9fe1a76b57ecc26d7c9778628064960
4
+ data.tar.gz: b6273d579bcfc43723db18a543ef16cbcacc9506
5
5
  SHA512:
6
- metadata.gz: dd730dd75337f209414e082a3acc13d4c6c7d4d7c45862c1e5386ad2465701e41ebde561faf8d119b44195d86d16c4629680d6391975bfabe5ad218cf9dafd50
7
- data.tar.gz: aa2e89de8e741dcf2c24d6505b5fa8334119fbd8123a9074196996a1d1418c301cd2712f86f52e55239be4c8180bced9ec15820d7f889c76fadc768e1ade75ba
6
+ metadata.gz: 99b1e74b8bd4766eb821a3ea4afc10f42a37c6e91af251b9b3ae246f65438cf213b0f06c14f1be7718c49a7523ddf204479951791d52c37f2a43d0c595324982
7
+ data.tar.gz: c7c7cdb9211bdaeadf245c461051a06f4aa1501a5541857d8637a323d0413e8386e3fcff0200da3ab5dccfee7d2fec204e0e7377ffeb8ca2c24994bff3422b7b
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.4.2
3
+ - 2.4
4
+ - 2.5
4
5
  before_install: gem install bundler -v 1.11.2
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # PerfectAudit
2
2
 
3
+ [![Build Status](https://travis-ci.org/igor-alexandrov/perfect_audit.svg?branch=master)](https://travis-ci.org/igor-alexandrov/perfect_audit)
4
+
3
5
  Perfect Audit API wrapper.
4
6
 
5
7
  [https://www.perfectaudit.com/api_docs](https://www.perfectaudit.com/api_docs)
@@ -1,3 +1,3 @@
1
1
  module PerfectAudit
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
data/lib/perfect_audit.rb CHANGED
@@ -9,14 +9,9 @@ module PerfectAudit
9
9
 
10
10
  class << self
11
11
  def configure
12
- configuration = Hash.new
13
12
  yield configuration
14
13
 
15
- connection = PerfectAudit::Connection.new(configuration)
16
-
17
- container.register :connection, -> { connection }
18
- container.register :response_parser, -> { PerfectAudit::ResponseParser }
19
- container.freeze
14
+ register!
20
15
  end
21
16
 
22
17
  def books
@@ -27,8 +22,18 @@ module PerfectAudit
27
22
  PerfectAudit::DocumentsRepository.new
28
23
  end
29
24
 
30
- def transactions
31
- PerfectAudit::TransactionsRepository.new
25
+ # def transactions
26
+ # PerfectAudit::TransactionsRepository.new
27
+ # end
28
+
29
+ # private
30
+
31
+ def register!
32
+ connection = PerfectAudit::Connection.new(configuration.to_h)
33
+
34
+ container.register :connection, -> { connection }
35
+ container.register :response_parser, -> { PerfectAudit::ResponseParser }
36
+ container.freeze
32
37
  end
33
38
  end
34
39
 
@@ -41,6 +46,10 @@ module PerfectAudit
41
46
  def self.container
42
47
  @@container
43
48
  end
49
+
50
+ def self.configuration
51
+ @@configuration ||= OpenStruct.new
52
+ end
44
53
  end
45
54
 
46
55
  require 'perfect_audit/api/repositories'
@@ -31,5 +31,6 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency 'bundler', "~> 1.11"
32
32
  spec.add_development_dependency 'rake', "~> 10.0"
33
33
  spec.add_development_dependency 'rspec', "~> 3.0"
34
+ spec.add_development_dependency 'rspec-collection_matchers'
34
35
  spec.add_development_dependency 'pry'
35
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perfect_audit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Alexandrov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-20 00:00:00.000000000 Z
11
+ date: 2018-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-auto_inject
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '3.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec-collection_matchers
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: pry
127
141
  requirement: !ruby/object:Gem::Requirement