perfect_audit 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/perfect_audit.rb +5 -1
- data/lib/perfect_audit/api/repositories.rb +9 -4
- data/lib/perfect_audit/connection.rb +1 -1
- data/lib/perfect_audit/version.rb +1 -1
- data/perfect_audit.gemspec +8 -1
- metadata +31 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceafd6ae46f87c894c14085f871fc4df2e603f7f
|
4
|
+
data.tar.gz: 0ea089df9cda44d885a502a20f7861c008f707d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f246ff012da04684ea4c81f1b89e715f0a15c6f822673cba4f3a9d973867104f0a3492f4148e01f0f2b4f84d0f3f31b8f56d642e5fd127b6188016268593302f
|
7
|
+
data.tar.gz: 126db5d658d7eace2b300694daafef4241aa4126b98af64e1c901a418dc5ebddc500073c71fa28b323e1b5aec13bfa5fa8e5e6d3dde9620658bcd32b07e3a95a
|
data/lib/perfect_audit.rb
CHANGED
@@ -33,7 +33,7 @@ module PerfectAudit
|
|
33
33
|
|
34
34
|
container.register :connection, -> { connection }
|
35
35
|
container.register :response_parser, -> { PerfectAudit::ResponseParser }
|
36
|
-
container.freeze
|
36
|
+
# container.freeze
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -47,6 +47,10 @@ module PerfectAudit
|
|
47
47
|
@@container
|
48
48
|
end
|
49
49
|
|
50
|
+
def self.container=(v)
|
51
|
+
@@container = v
|
52
|
+
end
|
53
|
+
|
50
54
|
def self.configuration
|
51
55
|
@@configuration ||= OpenStruct.new
|
52
56
|
end
|
@@ -6,8 +6,13 @@ module PerfectAudit
|
|
6
6
|
include PerfectAudit::AutoInject[:connection]
|
7
7
|
include PerfectAudit::AutoInject[:response_parser]
|
8
8
|
|
9
|
+
CREATE_PATH = 'book/add'.freeze
|
10
|
+
ALL_PATH = 'books'.freeze
|
11
|
+
FIND_PATH = 'book/info'.freeze
|
12
|
+
DELETE_PATH = 'book/remove'.freeze
|
13
|
+
|
9
14
|
def create(name, public = false)
|
10
|
-
response = connection.post(
|
15
|
+
response = connection.post(CREATE_PATH,
|
11
16
|
json: {
|
12
17
|
name: name.to_s,
|
13
18
|
is_public: public.to_s
|
@@ -18,7 +23,7 @@ module PerfectAudit
|
|
18
23
|
end
|
19
24
|
|
20
25
|
def all
|
21
|
-
response = connection.get(
|
26
|
+
response = connection.get(ALL_PATH)
|
22
27
|
|
23
28
|
response_parser.parse(response.body.to_s).map{ |item|
|
24
29
|
PerfectAudit::Book.new(item)
|
@@ -26,7 +31,7 @@ module PerfectAudit
|
|
26
31
|
end
|
27
32
|
|
28
33
|
def find(id)
|
29
|
-
response = connection.get(
|
34
|
+
response = connection.get(FIND_PATH,
|
30
35
|
params: {
|
31
36
|
pk: id.to_s
|
32
37
|
}
|
@@ -37,7 +42,7 @@ module PerfectAudit
|
|
37
42
|
|
38
43
|
def delete(book_or_id)
|
39
44
|
id = book_or_id.is_a?(PerfectAudit::Book) ? book_or_id.id.to_s : book_or_id.to_s
|
40
|
-
response = connection.post(
|
45
|
+
response = connection.post(DELETE_PATH,
|
41
46
|
json: {
|
42
47
|
book_id: id
|
43
48
|
}
|
data/perfect_audit.gemspec
CHANGED
@@ -28,9 +28,16 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency 'http'
|
29
29
|
spec.add_dependency 'http-form_data'
|
30
30
|
|
31
|
+
|
31
32
|
spec.add_development_dependency 'bundler', "~> 1.11"
|
33
|
+
|
34
|
+
spec.add_development_dependency 'factory_bot'
|
35
|
+
|
36
|
+
spec.add_development_dependency 'pry'
|
37
|
+
|
32
38
|
spec.add_development_dependency 'rake', "~> 10.0"
|
33
39
|
spec.add_development_dependency 'rspec', "~> 3.0"
|
34
40
|
spec.add_development_dependency 'rspec-collection_matchers'
|
35
|
-
|
41
|
+
|
42
|
+
spec.add_development_dependency 'webmock'
|
36
43
|
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.
|
4
|
+
version: 0.1.4
|
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-
|
11
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-auto_inject
|
@@ -94,6 +94,34 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.11'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: factory_bot
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
97
125
|
- !ruby/object:Gem::Dependency
|
98
126
|
name: rake
|
99
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,7 +165,7 @@ dependencies:
|
|
137
165
|
- !ruby/object:Gem::Version
|
138
166
|
version: '0'
|
139
167
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
168
|
+
name: webmock
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
142
170
|
requirements:
|
143
171
|
- - ">="
|