flow_trace 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 50ebe544f55d1350e9003e1a928d0d8c30caf47d92c266d8e305601fba78be4c
4
+ data.tar.gz: 199afc61f1924e28b91a4b55780ed0d8b4f360660fefffca17fb465525f996a6
5
+ SHA512:
6
+ metadata.gz: a0605fbe71a8019118a8566665569c729d5141aed5fbf362cae1235491b4e41a470ba6d1f6c68f346403b5b4b0178e7ea6b3e28580737ea598a436dc194f4835
7
+ data.tar.gz: d75dcab402c01420f9fc91c2d9a09d1b290e1d10c6976ebbfae1cef0889abd252fc8ae6c14f85699544920b22a1dc943cae269d5ffb7f464499341f059b3a944
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ .byebug_history
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,21 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+ DisplayStyleGuide: true
4
+ StyleGuideCopsOnly: true
5
+ TargetRubyVersion: 2.6
6
+
7
+ Metrics/LineLength:
8
+ Max: 120
9
+
10
+ Documentation:
11
+ Enabled: false
12
+
13
+ FrozenStringLiteralComment:
14
+ Enabled: false
15
+
16
+ Style/FileName:
17
+ Enabled: false
18
+
19
+ Metrics/ModuleLength:
20
+ Exclude:
21
+ - spec/**/*_spec.rb
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # v0.0.1 2019-11-15
2
+
3
+ Initial release (Proof of Concept). ([kirillshevch](https://github.com/kirillshevch/flow_trace/pull/1))
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in flow_trace.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,94 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ flow_trace (0.0.1)
5
+ dry-configurable
6
+ http
7
+ sinatra
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ addressable (2.7.0)
13
+ public_suffix (>= 2.0.2, < 5.0)
14
+ ast (2.4.0)
15
+ byebug (11.0.1)
16
+ concurrent-ruby (1.1.5)
17
+ diff-lcs (1.3)
18
+ domain_name (0.5.20190701)
19
+ unf (>= 0.0.5, < 1.0.0)
20
+ dry-configurable (0.9.0)
21
+ concurrent-ruby (~> 1.0)
22
+ dry-core (~> 0.4, >= 0.4.7)
23
+ dry-core (0.4.9)
24
+ concurrent-ruby (~> 1.0)
25
+ ffi (1.11.2)
26
+ ffi-compiler (1.0.1)
27
+ ffi (>= 1.0.0)
28
+ rake
29
+ http (4.2.0)
30
+ addressable (~> 2.3)
31
+ http-cookie (~> 1.0)
32
+ http-form_data (~> 2.0)
33
+ http-parser (~> 1.2.0)
34
+ http-cookie (1.0.3)
35
+ domain_name (~> 0.5)
36
+ http-form_data (2.1.1)
37
+ http-parser (1.2.1)
38
+ ffi-compiler (>= 1.0, < 2.0)
39
+ jaro_winkler (1.5.4)
40
+ mustermann (1.0.3)
41
+ parallel (1.19.0)
42
+ parser (2.6.5.0)
43
+ ast (~> 2.4.0)
44
+ public_suffix (4.0.1)
45
+ rack (2.0.7)
46
+ rack-protection (2.0.7)
47
+ rack
48
+ rainbow (3.0.0)
49
+ rake (10.5.0)
50
+ rspec (3.9.0)
51
+ rspec-core (~> 3.9.0)
52
+ rspec-expectations (~> 3.9.0)
53
+ rspec-mocks (~> 3.9.0)
54
+ rspec-core (3.9.0)
55
+ rspec-support (~> 3.9.0)
56
+ rspec-expectations (3.9.0)
57
+ diff-lcs (>= 1.2.0, < 2.0)
58
+ rspec-support (~> 3.9.0)
59
+ rspec-mocks (3.9.0)
60
+ diff-lcs (>= 1.2.0, < 2.0)
61
+ rspec-support (~> 3.9.0)
62
+ rspec-support (3.9.0)
63
+ rubocop (0.76.0)
64
+ jaro_winkler (~> 1.5.1)
65
+ parallel (~> 1.10)
66
+ parser (>= 2.6)
67
+ rainbow (>= 2.2.2, < 4.0)
68
+ ruby-progressbar (~> 1.7)
69
+ unicode-display_width (>= 1.4.0, < 1.7)
70
+ ruby-progressbar (1.10.1)
71
+ sinatra (2.0.7)
72
+ mustermann (~> 1.0)
73
+ rack (~> 2.0)
74
+ rack-protection (= 2.0.7)
75
+ tilt (~> 2.0)
76
+ tilt (2.0.10)
77
+ unf (0.1.4)
78
+ unf_ext
79
+ unf_ext (0.0.7.6)
80
+ unicode-display_width (1.6.0)
81
+
82
+ PLATFORMS
83
+ ruby
84
+
85
+ DEPENDENCIES
86
+ bundler (~> 2.0)
87
+ byebug
88
+ flow_trace!
89
+ rake (~> 10.0)
90
+ rspec (~> 3.0)
91
+ rubocop
92
+
93
+ BUNDLED WITH
94
+ 2.0.2
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Kirill Shevchenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # FlowTrace
2
+
3
+ Brand new remote app inspecting tool. Declare feature steps and receive params, stack trace and whatever you want.
4
+
5
+ * Look into what happens on you *staging* environments
6
+ * Doesn't have payloads for tests, debugging, bug fix? Get data during reproducing feature flow.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile and then execute `bundle install`:
11
+
12
+ ```ruby
13
+ gem 'flow_trace'
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ 1. Configuration
19
+
20
+ Use `https` proxy (for example `ngrok`) to local `4567` port.
21
+
22
+ `config/initializers/flow_trace.rb`
23
+ ```ruby
24
+ FlowTrace::Settings.configure do |config|
25
+ config.proxy_url = 'http://0000000.ngrok.io'
26
+ end
27
+ ```
28
+
29
+ 2. Declare remote flow
30
+
31
+ ```ruby
32
+ FlowTrace::Step.call(:flow_name, :step_name, {})
33
+ ```
34
+
35
+ 3. Start receive messages (locally)
36
+
37
+ ```
38
+ bundle exec flow_trace
39
+ ```
40
+
41
+ ## Use case
42
+
43
+ How to use this? For example declare step by step your To-Do tasks create flow:
44
+
45
+ ```ruby
46
+ class TasksController < ApplicationController
47
+ def create
48
+ FlowTrace::Step.call(:todo_create, :controller_receive, params)
49
+
50
+ result = TaskCreator.call(current_user, params).success?
51
+ if result.success?
52
+
53
+ else
54
+
55
+ end
56
+ end
57
+ end
58
+ ```
59
+
60
+ ```ruby
61
+ class TaskCreator
62
+
63
+ end
64
+ ```
65
+
66
+ ## Contributing
67
+
68
+ Bug reports and pull requests are welcome on GitHub at https://github.com/kirillshevch/flow_trace.
69
+
70
+ ## License
71
+
72
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/bin/flow_trace ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Always look in the lib directory of this gem
4
+ # first when searching the load path
5
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
6
+
7
+ require 'flow_trace/server'
8
+
9
+ FlowTrace::Server.run!
@@ -0,0 +1,38 @@
1
+ lib = File.expand_path('lib', __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'flow_trace/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'flow_trace'
7
+ spec.version = FlowTrace::VERSION
8
+ spec.authors = ['Kirill Shevchenko']
9
+ spec.email = ['hello@kirillshevch.com']
10
+
11
+ spec.summary = 'Brand new remote app inspecting tool'
12
+ spec.description = spec.summary
13
+ spec.homepage = 'https://github.com/kirillshevch/flow_trace'
14
+ spec.license = 'MIT'
15
+
16
+ spec.metadata['homepage_uri'] = spec.homepage
17
+ spec.metadata['source_code_uri'] = 'https://github.com/kirillshevch/flow_trace'
18
+ spec.metadata['changelog_uri'] = 'https://github.com/kirillshevch/flow_trace/blob/master/CHANGELOG.md'
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
23
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ end
25
+ spec.bindir = 'bin'
26
+ spec.executables = 'flow_trace'
27
+ spec.require_paths = ['lib']
28
+
29
+ spec.add_dependency 'http'
30
+ spec.add_dependency 'sinatra'
31
+ spec.add_dependency 'dry-configurable'
32
+
33
+ spec.add_development_dependency 'bundler', '~> 2.0'
34
+ spec.add_development_dependency 'rake', '~> 10.0'
35
+ spec.add_development_dependency 'rspec', '~> 3.0'
36
+ spec.add_development_dependency 'rubocop'
37
+ spec.add_development_dependency 'byebug'
38
+ end
data/lib/flow_trace.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'http'
2
+ require 'flow_trace/version'
3
+ require 'flow_trace/settings'
4
+ require 'flow_trace/step'
5
+
6
+ module FlowTrace
7
+ class Error < StandardError; end
8
+ end
@@ -0,0 +1,10 @@
1
+ require 'sinatra'
2
+ require 'byebug'
3
+
4
+ module FlowTrace
5
+ class Server < ::Sinatra::Base
6
+ post '/' do
7
+ p params
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ module FlowTrace
2
+ class Settings
3
+ extend ::Dry::Configurable
4
+
5
+ setting :proxy_url, 'http://localhost:4567'
6
+ end
7
+ end
@@ -0,0 +1,29 @@
1
+ module FlowTrace
2
+ class Step
3
+ attr_reader :flow, :step, :options
4
+
5
+ def self.call(*args)
6
+ new(*args).call
7
+ end
8
+
9
+ def initialize(flow, step, **options)
10
+ @flow = flow
11
+ @step = step
12
+ @options = options
13
+ end
14
+
15
+ def call
16
+ HTTP.post(FlowTrace::Settings.config.proxy_url, json: payload)
17
+ end
18
+
19
+ private
20
+
21
+ def payload
22
+ {
23
+ flow: flow,
24
+ step: step,
25
+ options: options
26
+ }
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,3 @@
1
+ module FlowTrace
2
+ VERSION = '0.0.1'
3
+ end
metadata ADDED
@@ -0,0 +1,175 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flow_trace
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kirill Shevchenko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-11-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: http
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sinatra
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'
41
+ - !ruby/object:Gem::Dependency
42
+ name: dry-configurable
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
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: byebug
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'
125
+ description: Brand new remote app inspecting tool
126
+ email:
127
+ - hello@kirillshevch.com
128
+ executables:
129
+ - flow_trace
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - ".gitignore"
134
+ - ".rspec"
135
+ - ".rubocop.yml"
136
+ - CHANGELOG.md
137
+ - Gemfile
138
+ - Gemfile.lock
139
+ - LICENSE.txt
140
+ - README.md
141
+ - Rakefile
142
+ - bin/flow_trace
143
+ - flow_trace.gemspec
144
+ - lib/flow_trace.rb
145
+ - lib/flow_trace/server.rb
146
+ - lib/flow_trace/settings.rb
147
+ - lib/flow_trace/step.rb
148
+ - lib/flow_trace/version.rb
149
+ homepage: https://github.com/kirillshevch/flow_trace
150
+ licenses:
151
+ - MIT
152
+ metadata:
153
+ homepage_uri: https://github.com/kirillshevch/flow_trace
154
+ source_code_uri: https://github.com/kirillshevch/flow_trace
155
+ changelog_uri: https://github.com/kirillshevch/flow_trace/blob/master/CHANGELOG.md
156
+ post_install_message:
157
+ rdoc_options: []
158
+ require_paths:
159
+ - lib
160
+ required_ruby_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ required_rubygems_version: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ requirements: []
171
+ rubygems_version: 3.0.3
172
+ signing_key:
173
+ specification_version: 4
174
+ summary: Brand new remote app inspecting tool
175
+ test_files: []