log-warrior 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 +4 -4
- data/.gitignore +2 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +63 -0
- data/lib/log/warrior/configuration.rb +15 -0
- data/lib/log/warrior/logger.rb +39 -0
- data/lib/log/warrior/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eee7a9375d7f595a529b09e9aabebee543ed5614e6278b4b4fa7ea72a4b5f6a
|
4
|
+
data.tar.gz: 47f73ba99ab9d90f1c30fbe0fa5bef84d70511919ca3917248aa7d95462627b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c4b65df63c7da400feac30bcf2c24ad4517e64543d94b27db3a2f15d38b44e13686f42de3a1ee9a1ec04c3ec41915f1d94cfc4684c30bb5a338f67ae3976098
|
7
|
+
data.tar.gz: 2ffb9a70ae529dc56da280f701926611837bf063769cc5a2c96367880264e6a210e3e7b0caa9a7beb45ce13ce7c26a81c2051f6baf0794ff72abf1d97015e7f8
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.7.3
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
log-warrior (0.1.0)
|
5
|
+
activemodel (~> 6.0.3)
|
6
|
+
mongo (= 2.14.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activemodel (6.0.4)
|
12
|
+
activesupport (= 6.0.4)
|
13
|
+
activesupport (6.0.4)
|
14
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
|
+
i18n (>= 0.7, < 2)
|
16
|
+
minitest (~> 5.1)
|
17
|
+
tzinfo (~> 1.1)
|
18
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
19
|
+
ast (2.4.2)
|
20
|
+
bson (4.12.1)
|
21
|
+
concurrent-ruby (1.1.9)
|
22
|
+
i18n (1.8.10)
|
23
|
+
concurrent-ruby (~> 1.0)
|
24
|
+
minitest (5.14.4)
|
25
|
+
mongo (2.14.0)
|
26
|
+
bson (>= 4.8.2, < 5.0.0)
|
27
|
+
parallel (1.20.1)
|
28
|
+
parser (3.0.1.1)
|
29
|
+
ast (~> 2.4.1)
|
30
|
+
rainbow (3.0.0)
|
31
|
+
rake (13.0.4)
|
32
|
+
regexp_parser (2.1.1)
|
33
|
+
rexml (3.2.5)
|
34
|
+
rubocop (1.18.3)
|
35
|
+
parallel (~> 1.10)
|
36
|
+
parser (>= 3.0.0.0)
|
37
|
+
rainbow (>= 2.2.2, < 4.0)
|
38
|
+
regexp_parser (>= 1.8, < 3.0)
|
39
|
+
rexml
|
40
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
41
|
+
ruby-progressbar (~> 1.7)
|
42
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
43
|
+
rubocop-ast (1.7.0)
|
44
|
+
parser (>= 3.0.1.1)
|
45
|
+
ruby-progressbar (1.11.0)
|
46
|
+
thread_safe (0.3.6)
|
47
|
+
tzinfo (1.2.9)
|
48
|
+
thread_safe (~> 0.1)
|
49
|
+
unicode-display_width (2.0.0)
|
50
|
+
zeitwerk (2.4.2)
|
51
|
+
|
52
|
+
PLATFORMS
|
53
|
+
x86_64-darwin-20
|
54
|
+
|
55
|
+
DEPENDENCIES
|
56
|
+
activemodel (~> 6.0.3)
|
57
|
+
log-warrior!
|
58
|
+
mongo (~> 2.14.0)
|
59
|
+
rake (~> 13.0)
|
60
|
+
rubocop (~> 1.7)
|
61
|
+
|
62
|
+
BUNDLED WITH
|
63
|
+
2.2.21
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "mongo"
|
4
|
+
require "date"
|
5
|
+
|
6
|
+
module Log
|
7
|
+
module Warrior
|
8
|
+
class Logger
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@connection = Mongo::Client.new(@mongodb_host)
|
12
|
+
@collection = @connection[@collection_name]
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.create(log_type: nil, application: nil, url: nil, headers: nil, body: nil, response: nil)
|
16
|
+
res = @collection.insert_one({
|
17
|
+
log_type: log_type,
|
18
|
+
application: application,
|
19
|
+
url: url,
|
20
|
+
headers: headers,
|
21
|
+
body: body,
|
22
|
+
response: response,
|
23
|
+
created_at: DateTime.now,
|
24
|
+
updated_at: DateTime.now
|
25
|
+
})
|
26
|
+
|
27
|
+
res
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.list
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.find_one
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/log/warrior/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log-warrior
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dhian alyusi
|
@@ -47,14 +47,18 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- ".gitignore"
|
49
49
|
- ".rubocop.yml"
|
50
|
+
- ".ruby-version"
|
50
51
|
- CHANGELOG.md
|
51
52
|
- CODE_OF_CONDUCT.md
|
52
53
|
- Gemfile
|
54
|
+
- Gemfile.lock
|
53
55
|
- README.md
|
54
56
|
- Rakefile
|
55
57
|
- bin/console
|
56
58
|
- bin/setup
|
57
59
|
- lib/log/warrior.rb
|
60
|
+
- lib/log/warrior/configuration.rb
|
61
|
+
- lib/log/warrior/logger.rb
|
58
62
|
- lib/log/warrior/version.rb
|
59
63
|
- log-warrior.gemspec
|
60
64
|
homepage: https://gitlab.com/dhianalyusi/log-warrior
|