flow_trace 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +7 -0
- data/README.md +0 -25
- data/bin/flow_trace +4 -0
- data/flow_trace.gemspec +1 -0
- data/lib/flow_trace/server.rb +18 -3
- data/lib/flow_trace/version.rb +1 -1
- data/lib/flow_trace.rb +18 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5be97141afe82c489f92ba482acabf3032a95bb12f3a4984f2cfb539cc7e11f9
|
4
|
+
data.tar.gz: 1ca4495e2d5a8abdfbb9c45e206bfb69ec4ae456768324704c7e8b1aa7ad2a32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf45dbf7fc0593cac52d38452d14615bc74a94ffd44fb6968d1300ac344d8a39f7be4489372526ccab67faeca0e469fe467edb77393d95d8fe8133f75d26fb96
|
7
|
+
data.tar.gz: d404e9deb4098b2dd7816ce3f584c94efbcc68127794598adcbc56baee3eab560e6021ff90e7c07976110b339d5646b906a259f0c6a34ee510a8168576020b1e
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -5,6 +5,7 @@ PATH
|
|
5
5
|
dry-configurable
|
6
6
|
http
|
7
7
|
sinatra
|
8
|
+
thin
|
8
9
|
|
9
10
|
GEM
|
10
11
|
remote: https://rubygems.org/
|
@@ -14,6 +15,7 @@ GEM
|
|
14
15
|
ast (2.4.0)
|
15
16
|
byebug (11.0.1)
|
16
17
|
concurrent-ruby (1.1.5)
|
18
|
+
daemons (1.3.1)
|
17
19
|
diff-lcs (1.3)
|
18
20
|
domain_name (0.5.20190701)
|
19
21
|
unf (>= 0.0.5, < 1.0.0)
|
@@ -22,6 +24,7 @@ GEM
|
|
22
24
|
dry-core (~> 0.4, >= 0.4.7)
|
23
25
|
dry-core (0.4.9)
|
24
26
|
concurrent-ruby (~> 1.0)
|
27
|
+
eventmachine (1.2.7)
|
25
28
|
ffi (1.11.2)
|
26
29
|
ffi-compiler (1.0.1)
|
27
30
|
ffi (>= 1.0.0)
|
@@ -73,6 +76,10 @@ GEM
|
|
73
76
|
rack (~> 2.0)
|
74
77
|
rack-protection (= 2.0.7)
|
75
78
|
tilt (~> 2.0)
|
79
|
+
thin (1.7.2)
|
80
|
+
daemons (~> 1.0, >= 1.0.9)
|
81
|
+
eventmachine (~> 1.0, >= 1.0.4)
|
82
|
+
rack (>= 1, < 3)
|
76
83
|
tilt (2.0.10)
|
77
84
|
unf (0.1.4)
|
78
85
|
unf_ext
|
data/README.md
CHANGED
@@ -40,31 +40,6 @@ FlowTrace::Step.call(:flow_name, :step_name, {})
|
|
40
40
|
bundle exec flow_trace
|
41
41
|
```
|
42
42
|
|
43
|
-
## Use case
|
44
|
-
|
45
|
-
How to use this? For example declare step by step your To-Do tasks create flow:
|
46
|
-
|
47
|
-
```ruby
|
48
|
-
class TasksController < ApplicationController
|
49
|
-
def create
|
50
|
-
FlowTrace::Step.call(:todo_create, :controller_receive, params)
|
51
|
-
|
52
|
-
result = TaskCreator.call(current_user, params).success?
|
53
|
-
if result.success?
|
54
|
-
|
55
|
-
else
|
56
|
-
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
```
|
61
|
-
|
62
|
-
```ruby
|
63
|
-
class TaskCreator
|
64
|
-
|
65
|
-
end
|
66
|
-
```
|
67
|
-
|
68
43
|
## Contributing
|
69
44
|
|
70
45
|
Bug reports and pull requests are welcome on GitHub at https://github.com/kirillshevch/flow_trace.
|
data/bin/flow_trace
CHANGED
data/flow_trace.gemspec
CHANGED
data/lib/flow_trace/server.rb
CHANGED
@@ -1,10 +1,25 @@
|
|
1
|
-
require 'sinatra'
|
2
|
-
require '
|
1
|
+
require 'sinatra/base'
|
2
|
+
require 'flow_trace'
|
3
3
|
|
4
4
|
module FlowTrace
|
5
5
|
class Server < ::Sinatra::Base
|
6
|
+
attr_reader :data
|
7
|
+
|
8
|
+
enable :quiet
|
9
|
+
set :server, :thin
|
10
|
+
|
6
11
|
post '/' do
|
7
|
-
|
12
|
+
FlowTrace.logger.info "\n"
|
13
|
+
FlowTrace.logger.info 'Flow: ' + data['flow']
|
14
|
+
FlowTrace.logger.info 'Step: ' + data['step']
|
15
|
+
|
16
|
+
FlowTrace.logger.info data['options']
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def data
|
22
|
+
@data ||= JSON.parse(request.body.read)
|
8
23
|
end
|
9
24
|
end
|
10
25
|
end
|
data/lib/flow_trace/version.rb
CHANGED
data/lib/flow_trace.rb
CHANGED
@@ -1,8 +1,25 @@
|
|
1
1
|
require 'http'
|
2
|
+
require 'json'
|
3
|
+
require 'dry-configurable'
|
2
4
|
require 'flow_trace/version'
|
3
5
|
require 'flow_trace/settings'
|
4
6
|
require 'flow_trace/step'
|
7
|
+
require 'logger'
|
5
8
|
|
6
9
|
module FlowTrace
|
7
|
-
class
|
10
|
+
class << self
|
11
|
+
attr_writer :logger
|
12
|
+
|
13
|
+
def logger
|
14
|
+
@logger ||= Logger.new($stdout).tap do |log|
|
15
|
+
log.progname = self.name
|
16
|
+
end
|
17
|
+
|
18
|
+
@logger.formatter = proc do |severity, datetime, progname, msg|
|
19
|
+
"#{msg}\n"
|
20
|
+
end
|
21
|
+
|
22
|
+
@logger
|
23
|
+
end
|
24
|
+
end
|
8
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flow_trace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Shevchenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: thin
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: sinatra
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|