enroute 0.0.2 → 0.0.5

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: 0a1933a0b54db509a086908e62c6c1c0cd32baa72fbeba4f2b19e180f179b7e0
4
- data.tar.gz: 65cd118dfb50f62b13b43fc2fe6ec95f3ada98d0d15947a7261f2858ae8b4b83
3
+ metadata.gz: a65a1195f13ae4e7252622ddbc6da85afd4076aff0e954acb1460ea5792b4018
4
+ data.tar.gz: 3ee3e8d588d5b525122530b89d20561eaaef96d4967e952c9b291ee9c74036ad
5
5
  SHA512:
6
- metadata.gz: 24398ef1734fe1964932aee1c3e5ea29efe4ff73a11e99612eadcc55579b31b0c8611e54e4a46a030059efbfcc597b4372d97fc856c62c420fb0dcb61f92419e
7
- data.tar.gz: 23d765635d12a58a14a263cc5cbf595d814b4443a46fceef1fab4cd61b93519e86b0d2e74e526639abd93749f0e1764a8a9409dec4dba73bf0267f7393e92407
6
+ metadata.gz: e2b6a3fab6873badc69fb61a1708dc6a090861b7f8859145e97492d97fc04a9dde3e314861b999756c3e9ba0c7db4bb5c93058f63d5b4d83f4542b989ac00e1f
7
+ data.tar.gz: c608f1415e466716c2f423f70e857739963963cc19d27976cded97bb2e0c4b48c9f726f2fa1307f15c96389868f2efa24d9e93e0b1ce6ff4e212016878fe3c46
@@ -0,0 +1,4 @@
1
+ # You can read more about CODEOWNERS at
2
+ # https://help.github.com/github/creating-cloning-and-archiving-repositories/about-code-owners
3
+
4
+ * @fnando
data/.github/FUNDING.yml CHANGED
@@ -1 +1,4 @@
1
+ # These are supported funding model platforms
2
+ ---
1
3
  github: [fnando]
4
+ custom: ["https://paypal.me/fnando/🍕"]
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: "🐛 Bug Report"
3
+ about: Report a reproducible bug or regression.
4
+ title: 'Bug: '
5
+ labels: 'Status: Unconfirmed'
6
+
7
+ ---
8
+
9
+ <!--
10
+ - Please provide a clear and concise description of what the bug is.
11
+ - If possible, add an example reproducing your issue.
12
+ - Please test using the latest version of normalize_attributes
13
+ to make sure your issue has not already been fixed.
14
+ -->
15
+
16
+ ## Description
17
+
18
+ [Add bug description here]
19
+
20
+ ## How to reproduce
21
+
22
+ [Add steps on how to reproduce this issue]
23
+
24
+ ## What do you expect
25
+
26
+ [Describe what do you expect to happen]
27
+
28
+ ## What happened instead
29
+
30
+ [Describe the actual results]
31
+
32
+ ## Software:
33
+
34
+ - Gem version: [Add gem version here]
35
+ - Ruby version: [Add version here]
36
+
37
+ ## Full backtrace
38
+
39
+ ```text
40
+ [Paste full backtrace here]
41
+ ```
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: "💡 Feature request"
3
+ about: Have an idea that may be useful? Make a suggestion!
4
+ title: 'Feature Request: '
5
+ labels: 'Feature request'
6
+
7
+ ---
8
+
9
+ ## Description
10
+
11
+ _A clear and concise description of what the problem is._
12
+
13
+ ## Describe the solution
14
+
15
+ _A clear and concise description of what you want to happen._
16
+
17
+ ## Alternatives you considered
18
+
19
+ _A clear and concise description of any alternative solutions or features you've considered._
20
+
21
+ ## Additional context
22
+
23
+ _Add any other context, screenshots, links, etc about the feature request here._
@@ -0,0 +1,38 @@
1
+ <!--
2
+ If you're making a doc PR or something tiny where the below is irrelevant,
3
+ delete this template and use a short description, but in your description aim to
4
+ include both what the change is, and why it is being made, with enough context
5
+ for anyone to understand.
6
+ -->
7
+
8
+ <details>
9
+ <summary>PR Checklist</summary>
10
+
11
+ ### PR Structure
12
+
13
+ - [ ] This PR has reasonably narrow scope (if not, break it down into smaller
14
+ PRs).
15
+ - [ ] This PR avoids mixing refactoring changes with feature changes (split into
16
+ two PRs otherwise).
17
+ - [ ] This PR's title starts is concise and descriptive.
18
+
19
+ ### Thoroughness
20
+
21
+ - [ ] This PR adds tests for the most critical parts of the new functionality or
22
+ fixes.
23
+ - [ ] I've updated any docs, `.md` files, etc… affected by this change.
24
+
25
+ </details>
26
+
27
+ ### What
28
+
29
+ [TODO: Short statement about what is changing.]
30
+
31
+ ### Why
32
+
33
+ [TODO: Why this change is being made. Include any context required to understand
34
+ the why.]
35
+
36
+ ### Known limitations
37
+
38
+ [TODO or N/A]
@@ -0,0 +1,15 @@
1
+ ---
2
+ # Documentation:
3
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
4
+
5
+ version: 2
6
+ updates:
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "daily"
11
+
12
+ - package-ecosystem: bundler
13
+ directory: "/"
14
+ schedule:
15
+ interval: "daily"
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: tests
3
+
4
+ on:
5
+ pull_request_target:
6
+ push:
7
+ branches:
8
+ - main
9
+ workflow_dispatch:
10
+ inputs: {}
11
+
12
+ jobs:
13
+ build:
14
+ name: Tests with Ruby ${{ matrix.ruby }} and ${{ matrix.gemfile }}
15
+ runs-on: "ubuntu-latest"
16
+ if: |
17
+ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target' ||
18
+ github.actor != 'dependabot[bot]'
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ ruby: ["2.7", "3.0", "3.1"]
23
+ node: ["16", "17"]
24
+ gemfile:
25
+ - gemfiles/rails_7_0.gemfile
26
+ - gemfiles/rails_6_1.gemfile
27
+
28
+ steps:
29
+ - uses: actions/checkout@v3
30
+
31
+ - uses: actions/cache@v3
32
+ with:
33
+ path: vendor/bundle
34
+ key: >
35
+ ${{ runner.os }}-${{ matrix.node }}-npm-${{
36
+ hashFiles('package.json') }}
37
+
38
+ - name: Set up Node
39
+ uses: actions/setup-node@v3
40
+ with:
41
+ node-version: ${{ matrix.node }}
42
+
43
+ - name: Install npm dependencies
44
+ run: |
45
+ yarn install
46
+
47
+ - uses: actions/cache@v3
48
+ with:
49
+ path: vendor/bundle
50
+ key: >
51
+ ${{ runner.os }}-${{ matrix.ruby }}-gems-${{
52
+ hashFiles(matrix.gemfile) }}
53
+
54
+ - name: Set up Ruby
55
+ uses: ruby/setup-ruby@v1
56
+ with:
57
+ ruby-version: ${{ matrix.ruby }}
58
+
59
+ - name: Install gem dependencies
60
+ env:
61
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
62
+ run: |
63
+ gem install bundler
64
+ bundle config path vendor/bundle
65
+ bundle update --jobs 4 --retry 3
66
+
67
+ - name: Run Tests
68
+ env:
69
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
70
+ run: |
71
+ bundle exec rake
data/.rubocop.yml CHANGED
@@ -5,6 +5,6 @@ inherit_gem:
5
5
  AllCops:
6
6
  TargetRubyVersion: 2.7
7
7
  NewCops: enable
8
-
9
- Metrics:
10
- Enabled: false
8
+ Exclude:
9
+ - vendor/**/*
10
+ - gemfiles/**/*
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- nodejs 16.7.0
1
+ nodejs 16.13.1
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,79 @@
1
+ # Contributing to normalize_attributes
2
+
3
+ 👍🎉 First off, thanks for taking the time to contribute! 🎉👍
4
+
5
+ The following is a set of guidelines for contributing to this project. These are
6
+ mostly guidelines, not rules. Use your best judgment, and feel free to propose
7
+ changes to this document in a pull request.
8
+
9
+ ## Code of Conduct
10
+
11
+ Everyone interacting in this project's codebases, issue trackers, chat rooms and
12
+ mailing lists is expected to follow the [code of conduct](https://github.com/fnando/normalize_attributes/blob/main/CODE_OF_CONDUCT.md).
13
+
14
+ ## Reporting bugs
15
+
16
+ This section guides you through submitting a bug report. Following these
17
+ guidelines helps maintainers and the community understand your report, reproduce
18
+ the behavior, and find related reports.
19
+
20
+ - Before creating bug reports, please check the open issues; somebody may
21
+ already have submitted something similar, and you may not need to create a new
22
+ one.
23
+ - When you are creating a bug report, please include as many details as
24
+ possible, with an example reproducing the issue.
25
+
26
+ ## Contributing with code
27
+
28
+ Before making any radicals changes, please make sure you discuss your intention
29
+ by [opening an issue on Github](https://github.com/fnando/normalize_attributes/issues).
30
+
31
+ When you're ready to make your pull request, follow checklist below to make sure
32
+ your contribution is according to how this project works.
33
+
34
+ 1. [Fork](https://help.github.com/forking/) normalize_attributes
35
+ 2. Create a topic branch - `git checkout -b my_branch`
36
+ 3. Make your changes using [descriptive commit messages](#commit-messages)
37
+ 4. Update CHANGELOG.md describing your changes by adding an entry to the
38
+ "Unreleased" section. If this section is not available, create one right
39
+ before the last version.
40
+ 5. Push to your branch - `git push origin my_branch`
41
+ 6. [Create a pull request](https://help.github.com/articles/creating-a-pull-request)
42
+ 7. That's it!
43
+
44
+ ## Styleguides
45
+
46
+ ### Commit messages
47
+
48
+ - Use the present tense ("Add feature" not "Added feature")
49
+ - Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
50
+ - Limit the first line to 72 characters or less
51
+ - Reference issues and pull requests liberally after the first line
52
+
53
+ ### Changelog
54
+
55
+ - Add a message describing your changes to the "Unreleased" section. The
56
+ changelog message should follow the same style as the commit message.
57
+ - Prefix your message with one of the following:
58
+ - `[Added]` for new features.
59
+ - `[Changed]` for changes in existing functionality.
60
+ - `[Deprecated]` for soon-to-be removed features.
61
+ - `[Removed]` for now removed features.
62
+ - `[Fixed]` for any bug fixes.
63
+ - `[Security]` in case of vulnerabilities.
64
+
65
+ ### Ruby code
66
+
67
+ - This project uses [Rubocop](https://rubocop.org) to enforce code style. Before
68
+ submitting your changes, make sure your tests are passing and code conforms to
69
+ the expected style by running `rake`.
70
+ - Do not change the library version. This will be done by the maintainer
71
+ whenever a new version is about to be released.
72
+
73
+ ### JavaScript code
74
+
75
+ - This project uses [ESLint](https://eslint.org) to enforce code style. Before
76
+ submitting your changes, make sure your tests are passing and code conforms to
77
+ the expected style by running `yarn test:ci`.
78
+ - Do not change the library version. This will be done by the maintainer
79
+ whenever a new version is about to be released.
File without changes
data/README.md CHANGED
@@ -3,6 +3,10 @@
3
3
  Generates a TypeScript file that defines all named routes from Rails as helper
4
4
  functions.
5
5
 
6
+ [![Tests](https://github.com/fnando/enroute/workflows/tests/badge.svg)](https://github.com/fnando/enroute)
7
+ [![Gem](https://img.shields.io/gem/v/enroute.svg)](https://rubygems.org/gems/enroute)
8
+ [![Gem](https://img.shields.io/gem/dt/enroute.svg)](https://rubygems.org/gems/enroute)
9
+
6
10
  ## Installation
7
11
 
8
12
  Add this line to your application's Gemfile:
@@ -114,33 +118,27 @@ userUrl();
114
118
  //=> raises `id is required, but received undefined`
115
119
  ```
116
120
 
117
- ## Development
121
+ ## Maintainer
122
+
123
+ - [Nando Vieira](https://github.com/fnando)
118
124
 
119
- After checking out the repo, run `bin/setup` to install dependencies. Then, run
120
- `rake test` to run the tests. You can also run `bin/console` for an interactive
121
- prompt that will allow you to experiment.
125
+ ## Contributors
122
126
 
123
- To install this gem onto your local machine, run `bundle exec rake install`. To
124
- release a new version, update the version number in `version.rb`, and then run
125
- `bundle exec rake release`, which will create a git tag for the version, push
126
- git commits and tags, and push the `.gem` file to
127
- [rubygems.org](https://rubygems.org).
127
+ - https://github.com/fnando/enroute/contributors
128
128
 
129
129
  ## Contributing
130
130
 
131
- Bug reports and pull requests are welcome on GitHub at
132
- https://github.com/fnando/enroute. This project is intended to be a safe,
133
- welcoming space for collaboration, and contributors are expected to adhere to
134
- the
135
- [code of conduct](https://github.com/fnando/enroute/blob/master/CODE_OF_CONDUCT.md).
131
+ For more details about how to contribute, please read
132
+ https://github.com/fnando/enroute/blob/main/CONTRIBUTING.md.
136
133
 
137
134
  ## License
138
135
 
139
136
  The gem is available as open source under the terms of the
140
- [MIT License](https://opensource.org/licenses/MIT).
137
+ [MIT License](https://opensource.org/licenses/MIT). A copy of the license can be
138
+ found at https://github.com/fnando/enroute/blob/main/LICENSE.md.
141
139
 
142
140
  ## Code of Conduct
143
141
 
144
- Everyone interacting in the Enroute project's codebases, issue trackers, chat
145
- rooms and mailing lists is expected to follow the
146
- [code of conduct](https://github.com/fnando/enroute/blob/master/CODE_OF_CONDUCT.md).
142
+ Everyone interacting in the enroute project's codebases, issue
143
+ trackers, chat rooms and mailing lists is expected to follow the
144
+ [code of conduct](https://github.com/fnando/enroute/blob/main/CODE_OF_CONDUCT.md).
data/enroute.gemspec CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
  spec.metadata["source_code_uri"] = spec.homepage
19
19
  spec.metadata["changelog_uri"] = spec.homepage
20
+ spec.metadata["rubygems_mfa_required"] = "true"
20
21
 
21
22
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
22
23
  `git ls-files -z`
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+ gemspec path: ".."
5
+
6
+ gem "rails", "~> 6.1.0"
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+ gemspec path: ".."
5
+
6
+ gem "rails", "~> 7.0.0"
@@ -42,7 +42,7 @@ module Enroute
42
42
  end
43
43
 
44
44
  def reduce_methods(routes)
45
- routes.map(&:verb).flatten.map(&:downcase).uniq
45
+ routes.map(&:verb).flatten.map(&:downcase).uniq.reject(&:empty?)
46
46
  end
47
47
 
48
48
  def camelize_map(list)
@@ -72,7 +72,7 @@ module Enroute
72
72
  # on `:ignore`.
73
73
  selected_routes.reject do |route|
74
74
  route.name.nil? ||
75
- route.name.match?(/rails|script/) ||
75
+ route.name.match?(/rails|script|turbo/) ||
76
76
  config.fetch(:ignore, []).include?(route.name)
77
77
  end
78
78
  end
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable */
2
2
  // This file has been automatically generated.
3
3
  // Don't edit it manually. Use `enroute export` instead.
4
- // Last updated on <%= Time.now.utc %>
5
4
 
6
5
  import { zipObject } from "lodash";
7
6
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Enroute
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.5"
5
5
  end
data/lib/enroute.rb CHANGED
@@ -1,6 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "thor"
4
+
5
+ begin
6
+ require "active_support/isolated_execution_state"
7
+ rescue LoadError
8
+ # noop
9
+ end
10
+
4
11
  require "active_support/core_ext/hash"
5
12
  require "active_support/hash_with_indifferent_access"
6
13
  require "fileutils"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enroute
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-27 00:00:00.000000000 Z
11
+ date: 2022-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -145,19 +145,27 @@ extensions: []
145
145
  extra_rdoc_files: []
146
146
  files:
147
147
  - ".eslintrc.json"
148
+ - ".github/CODEOWNERS"
148
149
  - ".github/FUNDING.yml"
150
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
151
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
152
+ - ".github/PULL_REQUEST_TEMPLATE.md"
153
+ - ".github/dependabot.yml"
154
+ - ".github/workflows/tests.yml"
149
155
  - ".gitignore"
150
156
  - ".prettierrc.js"
151
157
  - ".rubocop.yml"
152
158
  - ".tool-versions"
153
- - ".travis.yml"
154
159
  - CODE_OF_CONDUCT.md
160
+ - CONTRIBUTING.md
155
161
  - Gemfile
156
- - LICENSE.txt
162
+ - LICENSE.md
157
163
  - README.md
158
164
  - Rakefile
159
165
  - enroute.gemspec
160
166
  - exe/enroute
167
+ - gemfiles/rails_6_1.gemfile
168
+ - gemfiles/rails_7_0.gemfile
161
169
  - jest.config.js
162
170
  - lib/enroute.rb
163
171
  - lib/enroute/cli.rb
@@ -174,6 +182,7 @@ metadata:
174
182
  homepage_uri: https://github.com/fnando/enroute
175
183
  source_code_uri: https://github.com/fnando/enroute
176
184
  changelog_uri: https://github.com/fnando/enroute
185
+ rubygems_mfa_required: 'true'
177
186
  post_install_message:
178
187
  rdoc_options: []
179
188
  require_paths:
@@ -189,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
198
  - !ruby/object:Gem::Version
190
199
  version: '0'
191
200
  requirements: []
192
- rubygems_version: 3.2.22
201
+ rubygems_version: 3.3.17
193
202
  signing_key:
194
203
  specification_version: 4
195
204
  summary: Export Rails routes to TypeScript definitions
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.7.0
6
- before_install: gem install bundler -v 2.1.2