jobly 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jobly/api.rb +1 -1
- data/lib/jobly/job.rb +13 -0
- data/lib/jobly/log.rb +11 -3
- data/lib/jobly/module_functions.rb +1 -1
- data/lib/jobly/refinements/to_slug.rb +9 -0
- data/lib/jobly/sidekiq.rb +1 -1
- data/lib/jobly/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ee66973f52902d8ddc90c2b2d6547d05b8dcef25f3639754ce3fb41006b618e
|
4
|
+
data.tar.gz: 07b1a0d259b813db4e7f5ccd36e9f5759ed97c9460f05e49a2a726216a5ed8c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dcbb539e7cafc9ebf44d58b8fe07e8df36d8e4209f431f26051e6db780c79df98ec3b099f66439597d84b0b3a987bcd33670c5f5962afe33545d615ca1ad461
|
7
|
+
data.tar.gz: 44a0d0305abd84288abef22a631cce2927f0df1b2daefa494da0192a6476deaaf35e338019a2d7a7e97fe48f0f806e4dff65f17bf8764abf89cb271d99499f83
|
data/lib/jobly/api.rb
CHANGED
data/lib/jobly/job.rb
CHANGED
@@ -6,6 +6,7 @@ module Jobly
|
|
6
6
|
include JobExtensions::Actions
|
7
7
|
include JobExtensions::Solo
|
8
8
|
using KeywordArgs
|
9
|
+
using ToSlug
|
9
10
|
|
10
11
|
sidekiq_options retry: 5, backtrace: 5
|
11
12
|
attr_reader :params
|
@@ -43,6 +44,18 @@ module Jobly
|
|
43
44
|
raise NotImplementedError
|
44
45
|
end
|
45
46
|
|
47
|
+
def logger
|
48
|
+
@logger ||= logger!
|
49
|
+
end
|
50
|
+
|
51
|
+
def logger!
|
52
|
+
if !Jobly.log or !Jobly.log.include? "%s"
|
53
|
+
Sidekiq.logger
|
54
|
+
else
|
55
|
+
Log.new Jobly.log, self.class.name.to_slug
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
46
59
|
private
|
47
60
|
|
48
61
|
def run_before_filter
|
data/lib/jobly/log.rb
CHANGED
@@ -3,15 +3,23 @@ require 'uri'
|
|
3
3
|
|
4
4
|
module Jobly
|
5
5
|
module Log
|
6
|
-
def self.new(target = nil)
|
6
|
+
def self.new(target = nil, tag = nil)
|
7
7
|
if !target or target.to_sym == :stdout or target == STDOUT
|
8
8
|
return Logger.new STDOUT
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
target %= tag if tag and target.include? "%s"
|
12
|
+
|
13
|
+
if target.start_with? 'syslog://'
|
14
|
+
remote_syslog_logger target
|
15
|
+
else
|
16
|
+
Logger.new target
|
13
17
|
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
14
21
|
|
22
|
+
def self.remote_syslog_logger(target)
|
15
23
|
uri = URI target
|
16
24
|
RemoteSyslogLogger.new (uri.host || 'localhost'), (uri.port || 514),
|
17
25
|
local_hostname: uri.user, program: uri.password
|
data/lib/jobly/sidekiq.rb
CHANGED
data/lib/jobly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jobly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mister_bin
|
@@ -210,6 +210,7 @@ files:
|
|
210
210
|
- lib/jobly/refinements/argument_converters.rb
|
211
211
|
- lib/jobly/refinements/convert_to_typed.rb
|
212
212
|
- lib/jobly/refinements/keyword_args.rb
|
213
|
+
- lib/jobly/refinements/to_slug.rb
|
213
214
|
- lib/jobly/server.rb
|
214
215
|
- lib/jobly/sidekiq.rb
|
215
216
|
- lib/jobly/version.rb
|