lecter 0.1.3 β 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.all-contributorsrc +26 -0
- data/.circleci/config.yml +86 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +16 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +25 -0
- data/CHANGELOG.md +20 -0
- data/CONTRIBUTING.md +35 -0
- data/Gemfile +3 -2
- data/Gemfile.lock +37 -69
- data/LICENSE.txt +1 -1
- data/README.md +160 -35
- data/Rakefile +5 -3
- data/app/controllers/lecter/diagnosis_controller.rb +40 -54
- data/app/views/layouts/lecter.html.erb +258 -0
- data/app/views/lecter/diagnosis/new.html.erb +61 -0
- data/app/views/lecter/diagnosis/show.html.erb +54 -0
- data/bin/console +1 -0
- data/bin/rails +16 -0
- data/config/locales/en.yml +16 -0
- data/config/locales/ru.yml +16 -0
- data/config/routes.rb +7 -0
- data/lecter.gemspec +9 -5
- data/lib/lecter/engine.rb +7 -0
- data/lib/lecter/formatter_headers.rb +26 -0
- data/lib/lecter/formatter_payload.rb +35 -0
- data/lib/lecter/html_generator.rb +66 -0
- data/lib/lecter/html_row.rb +42 -0
- data/lib/lecter/rack.rb +32 -31
- data/lib/lecter/railtie.rb +9 -0
- data/lib/lecter/requester.rb +63 -0
- data/lib/lecter/trace_point.rb +30 -0
- data/lib/lecter/version.rb +3 -1
- data/lib/lecter.rb +15 -12
- metadata +50 -23
- data/.idea/encodings.xml +0 -6
- data/.idea/lecter.iml +0 -52
- data/.idea/misc.xml +0 -7
- data/.idea/modules.xml +0 -8
- data/.idea/workspace.xml +0 -857
- data/.travis.yml +0 -7
- data/app/assets/javascripts/highlight.pack.js +0 -2
- data/app/assets/stylesheets/railscasts.css +0 -106
- data/app/views/lecter/diagnosis/new.erb +0 -18
- data/app/views/lecter/diagnosis/show.slim +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f10f155ae276bf6f3bb064246f793c91f151f16d83ecf7fe3213bbc9a33ed5aa
|
4
|
+
data.tar.gz: 9ca14c7801beefbb80a9be1447a31965a6bb6616c50229628ca59dbe558da880
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f348dbdc4bee445dad4617e1f5a5f5964f5988adb168152c276c1a1424136dadab462aad32958cbae60dfaf22d9c215b419498e025a447283681224f89f6d38f
|
7
|
+
data.tar.gz: b16518ed4592c57b6168e13c0c3701cbbd6d8ece67f43e14d2312f6a69a3f9b1f8e4484f4e3aba2fe1376e10ec6cfa995c54e1069ab3da15af71da3152dcc488
|
data/.all-contributorsrc
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"files": [
|
3
|
+
"README.md"
|
4
|
+
],
|
5
|
+
"imageSize": 100,
|
6
|
+
"commit": false,
|
7
|
+
"contributors": [
|
8
|
+
{
|
9
|
+
"login": "pineapplethief",
|
10
|
+
"name": "Aleksey Glukhov",
|
11
|
+
"avatar_url": "https://avatars1.githubusercontent.com/u/4012690?v=4",
|
12
|
+
"profile": "https://github.com/pineapplethief",
|
13
|
+
"contributions": [
|
14
|
+
"code",
|
15
|
+
"doc",
|
16
|
+
"maintenance"
|
17
|
+
]
|
18
|
+
}
|
19
|
+
],
|
20
|
+
"contributorsPerLine": 7,
|
21
|
+
"projectName": "lecter",
|
22
|
+
"projectOwner": "Neodelf",
|
23
|
+
"repoType": "github",
|
24
|
+
"repoHost": "https://github.com",
|
25
|
+
"skipCi": true
|
26
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
version: 2
|
2
|
+
jobs:
|
3
|
+
build:
|
4
|
+
working_directory: ~/bikeindex/bike_index
|
5
|
+
environment:
|
6
|
+
COVERAGE: true
|
7
|
+
docker:
|
8
|
+
- image: circleci/ruby:2.6.3
|
9
|
+
steps:
|
10
|
+
- checkout
|
11
|
+
- restore_cache:
|
12
|
+
keys:
|
13
|
+
# This branch if available
|
14
|
+
- v2-dep-{{ .Branch }}-
|
15
|
+
# Default branch if not
|
16
|
+
- v2-dep-master-
|
17
|
+
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
|
18
|
+
- v2-dep-
|
19
|
+
- run:
|
20
|
+
name: Install Bundler
|
21
|
+
command: gem install bundler -v 2.1.2
|
22
|
+
- run:
|
23
|
+
name: Bundle Gems
|
24
|
+
command: bundle install --path=vendor/bundle --jobs=4 --retry=3
|
25
|
+
- run:
|
26
|
+
name: Rubocop
|
27
|
+
command: bundle exec rubocop
|
28
|
+
- run:
|
29
|
+
name: Install Code Climate Test Reporter
|
30
|
+
command: |
|
31
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
32
|
+
chmod +x ./cc-test-reporter
|
33
|
+
- save_cache:
|
34
|
+
key: v2-dep-{{ .Branch }}-{{ epoch }}
|
35
|
+
paths:
|
36
|
+
- ./vendor/bundle
|
37
|
+
- ~/.bundle
|
38
|
+
- run:
|
39
|
+
name: Run tests
|
40
|
+
command: |
|
41
|
+
./cc-test-reporter before-build
|
42
|
+
TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
|
43
|
+
bundle exec rspec --profile 10 \
|
44
|
+
--color \
|
45
|
+
--order random \
|
46
|
+
--format progress \
|
47
|
+
-- ${TESTFILES}
|
48
|
+
- run:
|
49
|
+
name: Code Climate Test Coverage
|
50
|
+
command: |
|
51
|
+
./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
|
52
|
+
- persist_to_workspace:
|
53
|
+
root: coverage
|
54
|
+
paths:
|
55
|
+
- codeclimate.*.json
|
56
|
+
|
57
|
+
upload-coverage:
|
58
|
+
docker:
|
59
|
+
- image: circleci/ruby:2.6.3
|
60
|
+
environment:
|
61
|
+
CC_TEST_REPORTER_ID: 9ef6750a0b374973f31c70ccf4bc6be1a4c93b0f2d3537d16e77450ef01f7813
|
62
|
+
working_directory: ~/bikeindex/bike_index
|
63
|
+
|
64
|
+
steps:
|
65
|
+
- attach_workspace:
|
66
|
+
at: ~/bikeindex/bike_index
|
67
|
+
- run:
|
68
|
+
name: Install Code Climate Test Reporter
|
69
|
+
command: |
|
70
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
71
|
+
chmod +x ./cc-test-reporter
|
72
|
+
- run:
|
73
|
+
name: Upload Test Reporter To Codeclimate
|
74
|
+
command: |
|
75
|
+
./cc-test-reporter sum-coverage codeclimate.*.json --output codeclimate.total.json
|
76
|
+
./cc-test-reporter upload-coverage --input codeclimate.total.json
|
77
|
+
|
78
|
+
workflows:
|
79
|
+
version: 2
|
80
|
+
|
81
|
+
commit:
|
82
|
+
jobs:
|
83
|
+
- build
|
84
|
+
- upload-coverage:
|
85
|
+
requires:
|
86
|
+
- build
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Report an issue with Lecter you've found.
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Describe the bug**
|
11
|
+
A clear and concise description of what the bug is.
|
12
|
+
|
13
|
+
**Actual behavior**
|
14
|
+
Steps to reproduce the behavior:
|
15
|
+
1. Go to '...'
|
16
|
+
2. Click on '....'
|
17
|
+
3. Scroll down to '....'
|
18
|
+
4. See an error
|
19
|
+
|
20
|
+
**Expected behavior**
|
21
|
+
A clear and concise description of what you expected to happen.
|
22
|
+
|
23
|
+
**Screenshots**
|
24
|
+
If applicable, add screenshots to help explain your problem, please.
|
25
|
+
|
26
|
+
**Additional context**
|
27
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest new Lecter features or improvements to existing features.
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
+
|
13
|
+
**Describe the solution you'd like**
|
14
|
+
A clear and concise description of what you want to happen.
|
15
|
+
|
16
|
+
**Describe alternatives you've considered**
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
+
|
19
|
+
**Additional context**
|
20
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
**Replace this text with a summary of the changes in your PR.
|
2
|
+
The more detailed you are, the better.**
|
3
|
+
|
4
|
+
-----------------
|
5
|
+
|
6
|
+
Before submitting the PR make sure the following are checked:
|
7
|
+
|
8
|
+
* [ ] The PR relates to *only* one subject with a clear title and description in grammatically correct, complete sentences.
|
9
|
+
* [ ] Wrote [good commit messages][1].
|
10
|
+
* [ ] Commit message starts with `[Fix #issue-number]` (if the related issue exists).
|
11
|
+
* [ ] Feature branch is up-to-date with `master` (if not - rebase it).
|
12
|
+
* [ ] Squashed related commits together.
|
13
|
+
* [ ] Added tests.
|
14
|
+
* [ ] Ran `bundle exec rake default`. It executes all tests and runs RuboCop on its own code.
|
15
|
+
|
16
|
+
[1]: https://chris.beams.io/posts/git-commit/
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- 'lib/lecter/html_generator.rb'
|
4
|
+
- 'lib/lecter/rack.rb'
|
5
|
+
- 'lib/lecter/trace_point.rb'
|
6
|
+
- 'vendor/**/*'
|
7
|
+
Documentation:
|
8
|
+
Enabled: false
|
9
|
+
Layout/LineLength:
|
10
|
+
Max: 100
|
11
|
+
Lint/RaiseException:
|
12
|
+
Enabled: true
|
13
|
+
Lint/StructNewOverride:
|
14
|
+
Enabled: true
|
15
|
+
Style/HashEachMethods:
|
16
|
+
Enabled: true
|
17
|
+
Style/HashTransformKeys:
|
18
|
+
Enabled: true
|
19
|
+
Style/HashTransformValues:
|
20
|
+
Enabled: true
|
21
|
+
Metrics/BlockLength:
|
22
|
+
ExcludedMethods: ['describe', 'context']
|
23
|
+
Layout/ArrayAlignment:
|
24
|
+
EnforcedStyle: with_fixed_indentation
|
25
|
+
IndentationWidth: 2
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Change log
|
2
|
+
|
3
|
+
## master (unreleased)
|
4
|
+
|
5
|
+
### New features
|
6
|
+
### Bug fixes
|
7
|
+
### Changes
|
8
|
+
|
9
|
+
## 0.2.0 (2022-02-15)
|
10
|
+
|
11
|
+
### New features
|
12
|
+
|
13
|
+
* [issue#74](https://github.com/Neodelf/lecter/pull/79): Add the headers parameters in the form ([@neodelf][])
|
14
|
+
|
15
|
+
### Changes
|
16
|
+
|
17
|
+
* [PR](https://github.com/Neodelf/lecter/pull/69): Set the simplecov gem version to 0.17.1 ([@neodelf][])
|
18
|
+
* [commit](https://github.com/Neodelf/lecter/commit/73e0ed69cf8e1773abed9e9b735e0742aa63dade): Update makeup. ([@neodelf][])
|
19
|
+
|
20
|
+
[@neodelf]: https://github.com/neodelf
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
If you discover issues, have ideas for improvements or new features,
|
4
|
+
please report them to the [issue tracker][1] of the repository or
|
5
|
+
submit a pull request. Please, try to follow these guidelines when you
|
6
|
+
do so.
|
7
|
+
|
8
|
+
## Issue reporting
|
9
|
+
|
10
|
+
* Check that the issue has not already been reported.
|
11
|
+
* Check that the issue has not already been fixed in the latest code
|
12
|
+
(a.k.a. `master`).
|
13
|
+
* Be clear, concise and precise in your description of the problem.
|
14
|
+
* Open an issue with a descriptive title and a summary in grammatically correct,
|
15
|
+
complete sentences.
|
16
|
+
|
17
|
+
* Include any relevant code to the issue summary.
|
18
|
+
|
19
|
+
## Pull requests
|
20
|
+
|
21
|
+
* Read [how to properly contribute to open source projects on GitHub][1].
|
22
|
+
* Fork the project.
|
23
|
+
* Use a topic/feature branch to easily amend a pull request later, if necessary.
|
24
|
+
* Write [good commit messages][2].
|
25
|
+
* Use the same coding conventions as the rest of the project.
|
26
|
+
* Commit and push until you are happy with your contribution.
|
27
|
+
* If your change has a corresponding open GitHub issue, prefix the commit message with `[Fix #github-issue-number]`.
|
28
|
+
* Make sure to add tests for it. This is important so I don't break it
|
29
|
+
in a future version unintentionally.
|
30
|
+
* Open a [pull request][3] that relates to *only* one subject with a clear title
|
31
|
+
and description in grammatically correct, complete sentences.
|
32
|
+
|
33
|
+
[1]: https://www.gun.io/blog/how-to-github-fork-branch-and-pull-request
|
34
|
+
[2]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
35
|
+
[3]: https://help.github.com/articles/about-pull-requests
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,73 +1,38 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lecter (0.
|
4
|
+
lecter (0.2.0)
|
5
5
|
rest-client
|
6
|
-
|
6
|
+
simplecov (= 0.17.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
|
12
|
-
actionview (= 5.2.3)
|
13
|
-
activesupport (= 5.2.3)
|
14
|
-
rack (~> 2.0)
|
15
|
-
rack-test (>= 0.6.3)
|
16
|
-
rails-dom-testing (~> 2.0)
|
17
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
18
|
-
actionview (5.2.3)
|
19
|
-
activesupport (= 5.2.3)
|
20
|
-
builder (~> 3.1)
|
21
|
-
erubi (~> 1.4)
|
22
|
-
rails-dom-testing (~> 2.0)
|
23
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
24
|
-
activesupport (5.2.3)
|
25
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
26
|
-
i18n (>= 0.7, < 2)
|
27
|
-
minitest (~> 5.1)
|
28
|
-
tzinfo (~> 1.1)
|
29
|
-
builder (3.2.3)
|
30
|
-
concurrent-ruby (1.1.5)
|
31
|
-
crass (1.0.4)
|
11
|
+
ast (2.4.0)
|
32
12
|
diff-lcs (1.3)
|
13
|
+
docile (1.4.0)
|
33
14
|
domain_name (0.5.20190701)
|
34
15
|
unf (>= 0.0.5, < 1.0.0)
|
35
|
-
|
36
|
-
http-cookie (1.0.
|
16
|
+
http-accept (1.7.0)
|
17
|
+
http-cookie (1.0.4)
|
37
18
|
domain_name (~> 0.5)
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
crass (~> 1.0.2)
|
42
|
-
nokogiri (>= 1.5.9)
|
43
|
-
method_source (0.9.2)
|
44
|
-
mime-types (3.2.2)
|
19
|
+
jaro_winkler (1.5.4)
|
20
|
+
json (2.3.0)
|
21
|
+
mime-types (3.4.1)
|
45
22
|
mime-types-data (~> 3.2015)
|
46
|
-
mime-types-data (3.
|
47
|
-
mini_portile2 (2.4.0)
|
48
|
-
minitest (5.11.3)
|
23
|
+
mime-types-data (3.2022.0105)
|
49
24
|
netrc (0.11.0)
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
nokogiri (>= 1.6)
|
58
|
-
rails-html-sanitizer (1.0.4)
|
59
|
-
loofah (~> 2.2, >= 2.2.2)
|
60
|
-
railties (5.2.3)
|
61
|
-
actionpack (= 5.2.3)
|
62
|
-
activesupport (= 5.2.3)
|
63
|
-
method_source
|
64
|
-
rake (>= 0.8.7)
|
65
|
-
thor (>= 0.19.0, < 2.0)
|
66
|
-
rake (10.5.0)
|
67
|
-
rest-client (2.0.2)
|
25
|
+
parallel (1.19.1)
|
26
|
+
parser (2.7.1.0)
|
27
|
+
ast (~> 2.4.0)
|
28
|
+
rainbow (3.0.0)
|
29
|
+
rake (13.0.1)
|
30
|
+
rest-client (2.1.0)
|
31
|
+
http-accept (>= 1.7.0, < 2.0)
|
68
32
|
http-cookie (>= 1.0.2, < 2.0)
|
69
33
|
mime-types (>= 1.16, < 4.0)
|
70
34
|
netrc (~> 0.8)
|
35
|
+
rexml (3.2.5)
|
71
36
|
rspec (3.8.0)
|
72
37
|
rspec-core (~> 3.8.0)
|
73
38
|
rspec-expectations (~> 3.8.0)
|
@@ -81,22 +46,24 @@ GEM
|
|
81
46
|
diff-lcs (>= 1.2.0, < 2.0)
|
82
47
|
rspec-support (~> 3.8.0)
|
83
48
|
rspec-support (3.8.2)
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
49
|
+
rubocop (0.81.0)
|
50
|
+
jaro_winkler (~> 1.5.1)
|
51
|
+
parallel (~> 1.10)
|
52
|
+
parser (>= 2.7.0.1)
|
53
|
+
rainbow (>= 2.2.2, < 4.0)
|
54
|
+
rexml
|
55
|
+
ruby-progressbar (~> 1.7)
|
56
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
57
|
+
ruby-progressbar (1.10.1)
|
58
|
+
simplecov (0.17.1)
|
59
|
+
docile (~> 1.1)
|
60
|
+
json (>= 1.8, < 3)
|
61
|
+
simplecov-html (~> 0.10.0)
|
62
|
+
simplecov-html (0.10.2)
|
97
63
|
unf (0.1.4)
|
98
64
|
unf_ext
|
99
|
-
unf_ext (0.0.
|
65
|
+
unf_ext (0.0.8)
|
66
|
+
unicode-display_width (1.7.0)
|
100
67
|
|
101
68
|
PLATFORMS
|
102
69
|
ruby
|
@@ -104,8 +71,9 @@ PLATFORMS
|
|
104
71
|
DEPENDENCIES
|
105
72
|
bundler (~> 2.0)
|
106
73
|
lecter!
|
107
|
-
rake (~>
|
74
|
+
rake (~> 13.0)
|
108
75
|
rspec (~> 3.0)
|
76
|
+
rubocop
|
109
77
|
|
110
78
|
BUNDLED WITH
|
111
|
-
2.
|
79
|
+
2.1.2
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,54 +1,179 @@
|
|
1
|
-
|
1
|
+
<div align="center">
|
2
|
+
<img src="https://github.com/Neodelf/staff/blob/master/lecter_web_with_text.png?raw=true" alt="Lecter Logo" width="866px"/>
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
4
|
+
<h1 color="#98793a">Lecter shows an executed code by a URL request. <br/>
|
5
|
+
Debug an unknown code in SECONDS!
|
6
|
+
</h1>
|
6
7
|
|
7
|
-
|
8
|
+
[![Gem Version][0]][1]
|
9
|
+
[![Ruby Style Guide][15]][16]
|
10
|
+
[![CircleCI][2]][3]
|
11
|
+
[![Test Coverage][12]][13]
|
12
|
+
[![Maintainability][10]][11]
|
13
|
+
[](#contributors-)
|
14
|
+
</div>
|
8
15
|
|
9
|
-
|
16
|
+
> Quid pro quo. I tell you things, you tell me things. Not about this case, though. About yourself. <br/>
|
17
|
+
> -- Hannibal Lecter / The Silence of the Lambs
|
10
18
|
|
11
|
-
|
12
|
-
gem 'lecter'
|
13
|
-
```
|
19
|
+
----------
|
14
20
|
|
15
|
-
|
21
|
+
## Table of contents
|
22
|
+
* [:rotating_light: Problems](#rotating_light-problems)
|
23
|
+
* [:rocket: Solutions](#rocket-solutions)
|
24
|
+
* [:bangbang: Requirements](#bangbang-requirements)
|
25
|
+
* [:hammer_and_wrench: Installation](#hammer_and_wrench-installation)
|
26
|
+
* [:joystick: Usage](#joystick-usage)
|
27
|
+
* [:man_technologist: Examples](#man_technologist-examples)
|
28
|
+
* [:heart: Sponsors](#card_file_box-license)
|
29
|
+
* [:desktop_computer: Contributing & Contributors](#desktop_computer-contributing--contributors)
|
30
|
+
* [:card_file_box: License](#card_file_box-license)
|
16
31
|
|
17
|
-
|
32
|
+
## :rotating_light: Problems
|
33
|
+
1. Developers **don't know** how their app works.
|
34
|
+
2. Reading code is a **long** process.
|
35
|
+
3. Memorizing many lines of code is **difficult**.
|
18
36
|
|
19
|
-
|
37
|
+
## :rocket: Solutions
|
38
|
+
1. The main purpose of this gem is **to help developers understand which code is executed** by a request.<br>
|
20
39
|
|
21
|
-
|
40
|
+
2. Gem's purpose could be compared to visiting a doctor:
|
41
|
+
You give the symptoms of your disease and **receive a diagnosis**.<br>
|
42
|
+
You give the parameters of a request and **receive executable code**.
|
22
43
|
|
23
|
-
|
44
|
+
3. You don't have to work with debuggers, read and remember many lines of code.<br>
|
45
|
+
Just **give & receive**!
|
24
46
|
|
47
|
+
## :bangbang: Requirements
|
48
|
+
Please **use a multithreading server** such as a [puma][4] server with more than `1` worker.<br>
|
49
|
+
For more information about how to tune a puma server, please visit this [link][5].
|
25
50
|
|
26
|
-
|
27
|
-
|
28
|
-
|
51
|
+
## :hammer_and_wrench: Installation
|
52
|
+
Installing is a **very simple** process.
|
53
|
+
|
54
|
+
1. **Add** the gem to your Gemfile:
|
29
55
|
|
30
56
|
```ruby
|
31
|
-
|
32
|
-
|
57
|
+
group :development do
|
58
|
+
gem 'lecter', github: 'neodelf/lecter'
|
33
59
|
end
|
34
60
|
```
|
35
61
|
|
36
|
-
|
37
|
-
|
38
|
-
`endpoint` - route like `blogs` without slash at the first char
|
39
|
-
|
40
|
-
`method` - `get` or `post`
|
41
|
-
|
42
|
-
`params` - parameters which will be handled on request. If you use `get` method please add your parameters to `endpoint` (i.e. `blogs?author_name=Andrey`)
|
43
|
-
|
44
|
-
## Contributing
|
45
|
-
|
46
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/neodelf/lecter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
62
|
+
2. **Execute** in a terminal in your app's directory:
|
47
63
|
|
48
|
-
|
49
|
-
|
50
|
-
|
64
|
+
```zsh
|
65
|
+
bundle install
|
66
|
+
```
|
51
67
|
|
52
|
-
|
68
|
+
3. **Add** routes to your `config/routes.rb`:
|
69
|
+
```ruby
|
70
|
+
mount Lecter::Engine => '/lecter' if Rails.env.development?
|
71
|
+
```
|
53
72
|
|
54
|
-
|
73
|
+
## :joystick: Usage
|
74
|
+
Follow **two** simple steps:
|
75
|
+
|
76
|
+
1. **Go** to `/lecter`
|
77
|
+
|
78
|
+
2. **Fill in** the form fields with request parameters:
|
79
|
+
|
80
|
+
`HTTP method` - request's method<br>
|
81
|
+
`Endpoint` - use absolute route like `localhost:3000/blogs`<br>
|
82
|
+
`Headers` - request's headers
|
83
|
+
`Body(raw)` - request's parameters
|
84
|
+
|
85
|
+
## :man_technologist: Examples
|
86
|
+
Here is an example with a **POST** request:
|
87
|
+
|
88
|
+
1. **Go** to `localhost:3000/lecter`
|
89
|
+
|
90
|
+
2. **Fill** in the form with:
|
91
|
+
|
92
|
+
`HTTP method` - `POST`<br>
|
93
|
+
`Endpoint` - `localhost:3000/posts`<br>
|
94
|
+
`Headers` - `content_type=text/html,accept=*/*`<br>
|
95
|
+
`Body(raw)` - `"post"=>{"title"=>"New title", "description"=>"Desciption"}`
|
96
|
+
|
97
|
+
<img src="https://raw.githubusercontent.com/Neodelf/staff/master/lecter_post_headers.png" alt="lecter example post form" title="Example Lecter POST request form" />
|
98
|
+
|
99
|
+
3. **Submit** the form
|
100
|
+
4. **Review** the result
|
101
|
+
|
102
|
+
<img src="https://raw.githubusercontent.com/Neodelf/staff/master/lecter-post-result.png" alt="lecter post form result" title="Example Lecter POST request result" />
|
103
|
+
|
104
|
+
## :heart: Sponsors
|
105
|
+
[<img width="200" src="https://github.com/Neodelf/staff/blob/master/evrone-sponsored-logo.png?raw=true" alt="Evrone Logo"/>][14]
|
106
|
+
|
107
|
+
## :desktop_computer: Contributing & Contributors
|
108
|
+
1. Bug reports and pull requests **are welcome**.
|
109
|
+
2. There are many issues as a proposal to improve this library. If you have any ideas, please **feel free** to write your thoughts in a [new issue][7].
|
110
|
+
3. Choose **what you like** to fix or improve on the [issues list][8]. You can ask any questions in the comments.
|
111
|
+
4. :bangbang: **Mention of each contributor** will be on the README file.
|
112
|
+
|
113
|
+
**Thanks** goes to these wonderful people:
|
114
|
+
|
115
|
+
<!-- prettier-ignore-start -->
|
116
|
+
<!-- markdownlint-disable -->
|
117
|
+
<table>
|
118
|
+
<tr>
|
119
|
+
<td align="center">
|
120
|
+
<a href="https://github.com/pineapplethief">
|
121
|
+
<img src="https://avatars1.githubusercontent.com/u/4012690?v=4" width="100px;" alt=""/>
|
122
|
+
<br />
|
123
|
+
<sub><b>Aleksey Glukhov</b></sub>
|
124
|
+
</a>
|
125
|
+
<br />
|
126
|
+
<a href="https://github.com/Neodelf/lecter/commits?author=pineapplethief" title="Code">π»</a>
|
127
|
+
<a href="https://github.com/Neodelf/lecter/commits?author=pineapplethief" title="Documentation">π</a>
|
128
|
+
</td>
|
129
|
+
<td align="center">
|
130
|
+
<a href="https://github.com/atayl16">
|
131
|
+
<img src="https://avatars.githubusercontent.com/u/24377351?v=4" width="100px;" alt=""/>
|
132
|
+
<br />
|
133
|
+
<sub><b>Alisha Taylor</b></sub>
|
134
|
+
</a>
|
135
|
+
<br />
|
136
|
+
<a href="https://github.com/Neodelf/lecter/commits?author=atayl16" title="Documentation">π</a>
|
137
|
+
</td>
|
138
|
+
<td align="center">
|
139
|
+
<a href="https://github.com/gambala">
|
140
|
+
<img src="https://avatars.githubusercontent.com/u/2563426?v=4" width="100px;" alt=""/>
|
141
|
+
<br />
|
142
|
+
<sub><b>Vitaliy Emeliyantsev</b></sub>
|
143
|
+
</a>
|
144
|
+
<br />
|
145
|
+
<a href="https://github.com/Neodelf/lecter/commits?author=gambala" title="Documentation">π</a>
|
146
|
+
</td>
|
147
|
+
<td align="center">
|
148
|
+
<a href="https://github.com/oskaror">
|
149
|
+
<img src="https://avatars.githubusercontent.com/u/12644040?v=4" width="100px;" alt=""/>
|
150
|
+
<br />
|
151
|
+
<sub><b>Oskar Janusz</b></sub>
|
152
|
+
</a>
|
153
|
+
<br />
|
154
|
+
<a href="https://github.com/Neodelf/lecter/commits?author=oskaror" title="Code">π»</a>
|
155
|
+
</td>
|
156
|
+
</tr>
|
157
|
+
</table>
|
158
|
+
<!-- markdownlint-enable -->
|
159
|
+
<!-- prettier-ignore-end -->
|
160
|
+
|
161
|
+
## :card_file_box: License
|
162
|
+
The gem is available as open source under the terms of the [MIT License][9].
|
163
|
+
|
164
|
+
[0]: https://badge.fury.io/rb/lecter.svg
|
165
|
+
[1]: https://badge.fury.io/rb/lecter
|
166
|
+
[2]: https://circleci.com/gh/Neodelf/lecter.svg?style=shield
|
167
|
+
[3]: https://circleci.com/gh/neodelf/lecter
|
168
|
+
[4]: https://github.com/puma/puma
|
169
|
+
[5]: https://github.com/puma/puma#clustered-mode
|
170
|
+
[7]: https://github.com/Neodelf/lecter/issues/new
|
171
|
+
[8]: https://github.com/Neodelf/lecter/issues
|
172
|
+
[9]: https://opensource.org/licenses/MIT
|
173
|
+
[10]: https://api.codeclimate.com/v1/badges/45d57f439d66990490f1/maintainability
|
174
|
+
[11]: https://codeclimate.com/github/Neodelf/lecter/maintainability
|
175
|
+
[12]: https://api.codeclimate.com/v1/badges/45d57f439d66990490f1/test_coverage
|
176
|
+
[13]: https://codeclimate.com/github/Neodelf/lecter/test_coverage
|
177
|
+
[14]: https://evrone.com
|
178
|
+
[15]: https://img.shields.io/badge/code_style-rubocop-brightgreen.svg
|
179
|
+
[16]: https://rubystyle.guide
|
data/Rakefile
CHANGED