lecter 0.1.6 → 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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.all-contributorsrc +26 -0
  3. data/.circleci/config.yml +86 -0
  4. data/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. data/.github/PULL_REQUEST_TEMPLATE.md +16 -0
  7. data/.gitignore +1 -0
  8. data/.rubocop.yml +25 -0
  9. data/CHANGELOG.md +20 -0
  10. data/CONTRIBUTING.md +35 -0
  11. data/Gemfile +3 -2
  12. data/Gemfile.lock +37 -69
  13. data/LICENSE.txt +1 -1
  14. data/README.md +162 -54
  15. data/Rakefile +5 -3
  16. data/app/controllers/lecter/diagnosis_controller.rb +28 -49
  17. data/app/views/layouts/lecter.html.erb +258 -0
  18. data/app/views/lecter/diagnosis/new.html.erb +61 -0
  19. data/app/views/lecter/diagnosis/show.html.erb +54 -0
  20. data/bin/console +1 -0
  21. data/bin/rails +2 -0
  22. data/config/locales/en.yml +4 -3
  23. data/config/locales/ru.yml +4 -3
  24. data/config/routes.rb +5 -1
  25. data/lecter.gemspec +9 -5
  26. data/lib/lecter/engine.rb +2 -0
  27. data/lib/lecter/formatter_headers.rb +26 -0
  28. data/lib/lecter/formatter_payload.rb +35 -0
  29. data/lib/lecter/html_generator.rb +66 -0
  30. data/lib/lecter/html_row.rb +42 -0
  31. data/lib/lecter/rack.rb +30 -36
  32. data/lib/lecter/railtie.rb +9 -0
  33. data/lib/lecter/requester.rb +63 -0
  34. data/lib/lecter/trace_point.rb +30 -0
  35. data/lib/lecter/version.rb +3 -1
  36. data/lib/lecter.rb +15 -11
  37. metadata +45 -19
  38. data/.travis.yml +0 -7
  39. data/app/assets/javascripts/lecter.js +0 -2
  40. data/app/assets/stylesheets/lecter.css +0 -261
  41. data/app/views/layouts/lecter.slim +0 -14
  42. data/app/views/lecter/diagnosis/new.erb +0 -20
  43. data/app/views/lecter/diagnosis/show.slim +0 -52
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af36eb3acc445fcb8eb1c1ba1a2c31f98d526b983ef28976b0c2586917f11323
4
- data.tar.gz: 52919c26f7ad0a7319b2f87927f22ac0b6cea9c18a078e3f77cca65641f3d205
3
+ metadata.gz: f10f155ae276bf6f3bb064246f793c91f151f16d83ecf7fe3213bbc9a33ed5aa
4
+ data.tar.gz: 9ca14c7801beefbb80a9be1447a31965a6bb6616c50229628ca59dbe558da880
5
5
  SHA512:
6
- metadata.gz: dd5d5eee2054aa159869bc852b9a0abf70c87ae58f2ef363e9183b41d46fd2784249becd823aa9258ac45af2280c8e24e26c2d11d89877a70bdeb2f8b4af0bf4
7
- data.tar.gz: de412a50f6da7a1e7d5c502a40dcc7ce2b9ffe9c7b0913af55f4d54a81193a8ec5f390bf71b0b1b3e323727672b5dc4aa61f9c5b309eef2c5a493cc52c667601
6
+ metadata.gz: f348dbdc4bee445dad4617e1f5a5f5964f5988adb168152c276c1a1424136dadab462aad32958cbae60dfaf22d9c215b419498e025a447283681224f89f6d38f
7
+ data.tar.gz: b16518ed4592c57b6168e13c0c3701cbbd6d8ece67f43e14d2312f6a69a3f9b1f8e4484f4e3aba2fe1376e10ec6cfa995c54e1069ab3da15af71da3152dcc488
@@ -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
@@ -11,3 +11,4 @@
11
11
  .rspec_status
12
12
  .idea/
13
13
  *.gem
14
+ coverage
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
@@ -1,4 +1,5 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
2
4
 
3
- # Specify your gem's dependencies in lecter.gemspec
4
5
  gemspec
data/Gemfile.lock CHANGED
@@ -1,73 +1,38 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lecter (0.1.5)
4
+ lecter (0.2.0)
5
5
  rest-client
6
- slim-rails
6
+ simplecov (= 0.17.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (5.2.3)
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
- erubi (1.8.0)
36
- http-cookie (1.0.3)
16
+ http-accept (1.7.0)
17
+ http-cookie (1.0.4)
37
18
  domain_name (~> 0.5)
38
- i18n (1.6.0)
39
- concurrent-ruby (~> 1.0)
40
- loofah (2.2.3)
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.2019.0331)
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
- nokogiri (1.10.3)
51
- mini_portile2 (~> 2.4.0)
52
- rack (2.0.7)
53
- rack-test (1.1.0)
54
- rack (>= 1.0, < 3)
55
- rails-dom-testing (2.0.3)
56
- activesupport (>= 4.2.0)
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
- slim (4.0.1)
85
- temple (>= 0.7.6, < 0.9)
86
- tilt (>= 2.0.6, < 2.1)
87
- slim-rails (3.2.0)
88
- actionpack (>= 3.1)
89
- railties (>= 3.1)
90
- slim (>= 3.0, < 5.0)
91
- temple (0.8.1)
92
- thor (0.20.3)
93
- thread_safe (0.3.6)
94
- tilt (2.0.9)
95
- tzinfo (1.2.5)
96
- thread_safe (~> 0.1)
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.7.6)
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 (~> 10.0)
74
+ rake (~> 13.0)
108
75
  rspec (~> 3.0)
76
+ rubocop
109
77
 
110
78
  BUNDLED WITH
111
- 2.0.2
79
+ 2.1.2
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019 Neodelf
3
+ Copyright (c) 2020 Neodelf
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal