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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67ab8d434daf030219e08463bbc02614677997ca3dc8ce78586efb18bb6ec888
4
- data.tar.gz: cc73fea56cfadb4b60a0b37622048d58431a4f6b365d1b49908b33c2aed9369d
3
+ metadata.gz: 5be97141afe82c489f92ba482acabf3032a95bb12f3a4984f2cfb539cc7e11f9
4
+ data.tar.gz: 1ca4495e2d5a8abdfbb9c45e206bfb69ec4ae456768324704c7e8b1aa7ad2a32
5
5
  SHA512:
6
- metadata.gz: 75484a92e3991eaf67a0f19158fb5e2dcfbabb3af287c4240ab79993e0ebe8d1ba10a5f63e2ca74243213a9fc8d0e7e9e7467e3e96084fb3b8e7f4fa30d157ec
7
- data.tar.gz: 2c5ea50161d365acada8357a075135b8080c0e947f6c3ae8560f442423d28bcdd06bdc3726a0c9d761bfc2e4bcf23620fbd98300e75cd3d13e88c10bb1da44de
6
+ metadata.gz: cf45dbf7fc0593cac52d38452d14615bc74a94ffd44fb6968d1300ac344d8a39f7be4489372526ccab67faeca0e469fe467edb77393d95d8fe8133f75d26fb96
7
+ data.tar.gz: d404e9deb4098b2dd7816ce3f584c94efbcc68127794598adcbc56baee3eab560e6021ff90e7c07976110b339d5646b906a259f0c6a34ee510a8168576020b1e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.0.3 2019-11-23
2
+
3
+ Added `Thin`, new print output ([kirillshevch](https://github.com/kirillshevch/flow_trace/pull/2))
4
+
1
5
  # v0.0.2 2019-11-16
2
6
 
3
7
  Critical fix ([kirillshevch](https://github.com/kirillshevch/flow_trace/pull/1))
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
@@ -4,6 +4,10 @@
4
4
  # first when searching the load path
5
5
  $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
6
6
 
7
+ require 'thin'
7
8
  require 'flow_trace/server'
9
+ Thin::Logging.silent = true
10
+
11
+ p "FlowTrace waiting for requests..."
8
12
 
9
13
  FlowTrace::Server.run!
data/flow_trace.gemspec CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ['lib']
28
28
 
29
29
  spec.add_dependency 'http'
30
+ spec.add_dependency 'thin'
30
31
  spec.add_dependency 'sinatra'
31
32
  spec.add_dependency 'dry-configurable'
32
33
 
@@ -1,10 +1,25 @@
1
- require 'sinatra'
2
- require 'byebug'
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
- p params
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
@@ -1,3 +1,3 @@
1
1
  module FlowTrace
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
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 Error < StandardError; end
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.2
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-16 00:00:00.000000000 Z
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