route_mechanic 0.1.0 → 0.1.1
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/.github/workflows/test.yml +59 -0
- data/README.md +4 -2
- data/lib/route_mechanic/testing/methods.rb +1 -2
- data/lib/route_mechanic/version.rb +1 -1
- data/route_mechanic.gemspec +2 -2
- metadata +6 -6
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2378e095ad88def369adb3b2b271a9e324a853b535670e3b1be95f4e98d2ee0
|
4
|
+
data.tar.gz: 12f172bb4021e0c56e4ea740a269d10e41a2c67d2f3f040137882dc414ffe448
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ee458593e8f2e095c11cb2ce1f36095c50d53eacab10e72032429b4514641d1afe676a37082121c629ba7c23e1ede37362a3ee0ce563caf35f76bf0760bb2ae
|
7
|
+
data.tar.gz: 3079f7b95a27e7c2c3bddd735352283f85cd6f83e362398406c70206160783dba53a83cfe35daf42ab2965857b445dac148d53cbf1cff29fbbb338443c9f7bde
|
@@ -0,0 +1,59 @@
|
|
1
|
+
name: test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
types:
|
9
|
+
- opened
|
10
|
+
- synchronize
|
11
|
+
- reopened
|
12
|
+
schedule:
|
13
|
+
- cron: "0 10 * * 5" # JST 19:00 (Fri)
|
14
|
+
|
15
|
+
env:
|
16
|
+
CI: "true"
|
17
|
+
|
18
|
+
jobs:
|
19
|
+
test:
|
20
|
+
runs-on: ubuntu-latest
|
21
|
+
container: ${{ matrix.ruby }}
|
22
|
+
strategy:
|
23
|
+
fail-fast: false
|
24
|
+
matrix:
|
25
|
+
ruby:
|
26
|
+
- ruby:2.3
|
27
|
+
- ruby:2.4
|
28
|
+
- ruby:2.5
|
29
|
+
- ruby:2.6
|
30
|
+
- ruby:2.7
|
31
|
+
- rubylang/ruby:master-nightly-bionic
|
32
|
+
test_framework:
|
33
|
+
- rspec
|
34
|
+
- rake
|
35
|
+
include:
|
36
|
+
- ruby: rubylang/ruby:master-nightly-bionic
|
37
|
+
allow_failures: "true"
|
38
|
+
|
39
|
+
steps:
|
40
|
+
- uses: actions/checkout@v2
|
41
|
+
- name: Cache vendor/bundle
|
42
|
+
uses: actions/cache@v2
|
43
|
+
with:
|
44
|
+
path: vendor/bundle
|
45
|
+
key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
|
46
|
+
restore-keys: |
|
47
|
+
v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
|
48
|
+
continue-on-error: ${{ matrix.allow_failures == 'true' }}
|
49
|
+
- name: bundle update
|
50
|
+
run: |
|
51
|
+
set -xe
|
52
|
+
bundle config path vendor/bundle
|
53
|
+
bundle update --jobs $(nproc) --retry 3
|
54
|
+
continue-on-error: ${{ matrix.allow_failures == 'true' }}
|
55
|
+
- name: Run ${{ matrix.test_framework }}
|
56
|
+
run: |
|
57
|
+
set -xe
|
58
|
+
bundle exec ${{ matrix.test_framework }}
|
59
|
+
continue-on-error: ${{ matrix.allow_failures == 'true' }}
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# RouteMechanic
|
2
|
+
[](https://badge.fury.io/rb/route_mechanic)
|
3
|
+
[](https://github.com/ohbarye/route_mechanic/actions?query=workflow%3Atest)
|
2
4
|
|
3
5
|
No need to maintain Rails' routing tests manually. RouteMechanic automatically detects broken routes and missing action methods in controller once you've finished installation.
|
4
6
|
|
@@ -44,7 +46,7 @@ Just add a test file like below.
|
|
44
46
|
class RoutingTest < Minitest::Test
|
45
47
|
include ::RouteMechanic::Testing::Methods
|
46
48
|
|
47
|
-
def
|
49
|
+
def test_that_application_has_correct_routes
|
48
50
|
assert_all_routes
|
49
51
|
end
|
50
52
|
end
|
@@ -55,7 +57,7 @@ end
|
|
55
57
|
It tells you broken routes as follows.
|
56
58
|
|
57
59
|
```ruby
|
58
|
-
0)
|
60
|
+
0) Rail.application fails if application does not have valid routes
|
59
61
|
Failure/Error: expect(Rails.application.routes).to have_valid_routes
|
60
62
|
|
61
63
|
[Route Mechanic]
|
@@ -55,9 +55,8 @@ module RouteMechanic
|
|
55
55
|
# If complicated controllers path is used, use Rails.application.eager_load! instead.
|
56
56
|
def eager_load_controllers
|
57
57
|
load_path = "#{Rails.root.join('app/controllers')}"
|
58
|
-
relname_range = (load_path.to_s.length + 1)...-3
|
59
58
|
Dir.glob("#{load_path}/**/*.rb").sort.each do |file|
|
60
|
-
require_dependency file
|
59
|
+
require_dependency file
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
data/route_mechanic.gemspec
CHANGED
@@ -8,12 +8,12 @@ Gem::Specification.new do |spec|
|
|
8
8
|
|
9
9
|
spec.summary = %q{RouteMechanic detects broken routes with ease}
|
10
10
|
spec.description = %q{No need to maintain Rails' routing tests manually. RouteMechanic automatically detects broken routes and missing action methods in controller once you've finished installation.}
|
11
|
-
spec.homepage = "https://github.com/ohbarye/
|
11
|
+
spec.homepage = "https://github.com/ohbarye/route_mechanic"
|
12
12
|
spec.license = "MIT"
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
14
14
|
|
15
15
|
spec.metadata["homepage_uri"] = spec.homepage
|
16
|
-
spec.metadata["source_code_uri"] = "https://github.com/ohbarye/
|
16
|
+
spec.metadata["source_code_uri"] = "https://github.com/ohbarye/route_mechanic"
|
17
17
|
|
18
18
|
# Specify which files should be added to the gem when it is released.
|
19
19
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: route_mechanic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ohbarye
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -39,9 +39,9 @@ executables: []
|
|
39
39
|
extensions: []
|
40
40
|
extra_rdoc_files: []
|
41
41
|
files:
|
42
|
+
- ".github/workflows/test.yml"
|
42
43
|
- ".gitignore"
|
43
44
|
- ".rspec"
|
44
|
-
- ".travis.yml"
|
45
45
|
- CODE_OF_CONDUCT.md
|
46
46
|
- Gemfile
|
47
47
|
- LICENSE.txt
|
@@ -61,12 +61,12 @@ files:
|
|
61
61
|
- lib/route_mechanic/testing/route_wrapper.rb
|
62
62
|
- lib/route_mechanic/version.rb
|
63
63
|
- route_mechanic.gemspec
|
64
|
-
homepage: https://github.com/ohbarye/
|
64
|
+
homepage: https://github.com/ohbarye/route_mechanic
|
65
65
|
licenses:
|
66
66
|
- MIT
|
67
67
|
metadata:
|
68
|
-
homepage_uri: https://github.com/ohbarye/
|
69
|
-
source_code_uri: https://github.com/ohbarye/
|
68
|
+
homepage_uri: https://github.com/ohbarye/route_mechanic
|
69
|
+
source_code_uri: https://github.com/ohbarye/route_mechanic
|
70
70
|
post_install_message:
|
71
71
|
rdoc_options: []
|
72
72
|
require_paths:
|