rails_accessibility_testing 1.5.1 → 1.5.3
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/CHANGELOG.md +27 -0
- data/README.md +3 -1
- data/exe/rails_server_safe +54 -46
- data/lib/generators/rails_a11y/install/install_generator.rb +43 -28
- data/lib/rails_accessibility_testing/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 58922a0f7334ba5695d55aeb1d02576e975504492d7ae47c1ae37552cba246c3
|
|
4
|
+
data.tar.gz: a07f66b20c17b6da10ef18518d58a20d4de9429f2fac3af7dc9e2505bf3d218e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f12b4e6da01ca76d1deb3aba955f284915857bf003fa6cb7568b8be05ea78e2eb7dddaf94bbe89fbe665cf99afb951ffbb86517eb3ea4862084b767939e779a
|
|
7
|
+
data.tar.gz: f638f6fbc1a0e4f7f3405f2c49929172d364910ad8140be4b662e823ab3c734fcde487666ae9874d973ec6d2643cb97ca2dc33e4419f805be45b0e2dec8daa2e
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.5.3] - 2024-11-20
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Gem packaging**: Verified all required files are included in gem package
|
|
12
|
+
- All executables (rails_a11y, rails_server_safe, a11y_live_scanner)
|
|
13
|
+
- All generator templates (.erb files)
|
|
14
|
+
- Complete library files and documentation
|
|
15
|
+
|
|
16
|
+
### Verified
|
|
17
|
+
- All executables properly included in gemspec
|
|
18
|
+
- Generator templates correctly packaged
|
|
19
|
+
- rails_server_safe Ruby script working correctly
|
|
20
|
+
- Local development setup confirmed working
|
|
21
|
+
|
|
22
|
+
## [1.5.2] - 2024-11-20
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- **Bundler compatibility**: Converted `rails_server_safe` from shell script to Ruby script to fix Bundler wrapper loading issues
|
|
26
|
+
- **Generator Procfile.dev setup**: Generator now automatically uses `rails_server_safe` in Procfile.dev to prevent Foreman from terminating all processes when server is already running
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
- Generator behavior: When installing, automatically replaces `web: bin/rails server` with `web: bundle exec rails_server_safe` in existing Procfile.dev files
|
|
30
|
+
- Generator behavior: When creating new Procfile.dev, uses `rails_server_safe` by default
|
|
31
|
+
|
|
32
|
+
## [1.5.1] - 2024-11-20
|
|
33
|
+
|
|
8
34
|
## [1.5.0] - 2025-11-19
|
|
9
35
|
|
|
10
36
|
### 🎉 Major Release: Enhanced View Detection & Performance Optimizations
|
|
@@ -301,6 +327,7 @@ This release introduces significant improvements to view file detection, partial
|
|
|
301
327
|
- Compatible with RSpec Rails 6.0+
|
|
302
328
|
- Modular architecture with rule engine and check definitions
|
|
303
329
|
|
|
330
|
+
[1.5.2]: https://github.com/rayraycodes/rails-accessibility-testing/releases/tag/v1.5.2
|
|
304
331
|
[1.5.0]: https://github.com/rayraycodes/rails-accessibility-testing/releases/tag/v1.5.0
|
|
305
332
|
[1.4.3]: https://github.com/rayraycodes/rails-accessibility-testing/releases/tag/v1.4.3
|
|
306
333
|
[1.4.2]: https://github.com/rayraycodes/rails-accessibility-testing/releases/tag/v1.4.2
|
data/README.md
CHANGED
|
@@ -99,7 +99,8 @@ This creates:
|
|
|
99
99
|
- `config/accessibility.yml` - Check settings
|
|
100
100
|
- `spec/system/all_pages_accessibility_spec.rb` - Comprehensive spec that dynamically tests all GET routes
|
|
101
101
|
- Updates `spec/rails_helper.rb` (if using RSpec)
|
|
102
|
-
- Updates `Procfile.dev` with accessibility
|
|
102
|
+
- Updates `Procfile.dev` with live accessibility scanner (if present)
|
|
103
|
+
- Optionally uses `rails_server_safe` wrapper (convenience helper, not required)
|
|
103
104
|
|
|
104
105
|
### Setup (Option 2: Manual)
|
|
105
106
|
|
|
@@ -445,6 +446,7 @@ See [ARCHITECTURE.md](ARCHITECTURE.md) for detailed architecture documentation.
|
|
|
445
446
|
1. **🎯 Live Accessibility Scanner**
|
|
446
447
|
- Real-time scanning as you browse during development
|
|
447
448
|
- Integrated with `bin/dev` via Procfile.dev
|
|
449
|
+
- Uses `rails_server_safe` wrapper to prevent Foreman process termination issues
|
|
448
450
|
- Smart cancellation when navigating to new pages
|
|
449
451
|
- Detailed reporting showing exactly what's being scanned
|
|
450
452
|
|
data/exe/rails_server_safe
CHANGED
|
@@ -1,58 +1,66 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
2
3
|
|
|
3
4
|
# Safe wrapper for Rails server that doesn't fail if server is already running
|
|
4
5
|
# This prevents Foreman from terminating all processes when server is already up
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
PORT="${PORT:-3000}"
|
|
7
|
+
require 'fileutils'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
pidfile = ENV.fetch('PIDFILE', 'tmp/pids/server.pid')
|
|
10
|
+
port = ENV.fetch('PORT', '3000').to_i
|
|
11
|
+
|
|
12
|
+
# Check if PID file exists and process is running
|
|
13
|
+
if File.exist?(pidfile)
|
|
14
|
+
pid = File.read(pidfile).strip.to_i rescue nil
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
16
|
+
if pid && pid > 0
|
|
17
|
+
# Check if the process is actually running
|
|
18
|
+
begin
|
|
19
|
+
Process.kill(0, pid)
|
|
20
|
+
# Process is running, check if it's listening on the expected port
|
|
21
|
+
port_check = `lsof -ti:#{port} -sTCP:LISTEN 2>/dev/null`.strip
|
|
22
|
+
if port_check == pid.to_s
|
|
23
|
+
puts "Server is already running (pid: #{pid}, port: #{port})"
|
|
24
|
+
puts "Keeping process alive for Foreman..."
|
|
25
|
+
# Keep the process alive by waiting indefinitely
|
|
26
|
+
loop do
|
|
27
|
+
begin
|
|
28
|
+
Process.kill(0, pid)
|
|
29
|
+
rescue Errno::ESRCH
|
|
30
|
+
puts "Server process ended. Exiting."
|
|
31
|
+
exit 0
|
|
32
|
+
end
|
|
33
|
+
sleep 5
|
|
34
|
+
end
|
|
35
|
+
else
|
|
36
|
+
# PID exists but not listening on port - stale PID file
|
|
37
|
+
puts "Removing stale PID file (pid: #{pid} not listening on port #{port})"
|
|
38
|
+
FileUtils.rm_f(pidfile)
|
|
39
|
+
end
|
|
40
|
+
rescue Errno::ESRCH
|
|
41
|
+
# PID file exists but process is dead - stale PID file
|
|
42
|
+
puts "Removing stale PID file (process #{pid} not running)"
|
|
43
|
+
FileUtils.rm_f(pidfile)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
40
47
|
|
|
41
48
|
# Check if something else is using the port
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
port_check = `lsof -ti:#{port} -sTCP:LISTEN 2>/dev/null`.strip
|
|
50
|
+
if !port_check.empty?
|
|
51
|
+
existing_pid = port_check.split("\n").first.to_i
|
|
52
|
+
puts "Port #{port} is already in use by process #{existing_pid}"
|
|
53
|
+
puts "Server may already be running. Keeping process alive for Foreman..."
|
|
46
54
|
# Keep the process alive by monitoring the existing server
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
loop do
|
|
56
|
+
port_check = `lsof -ti:#{port} -sTCP:LISTEN 2>/dev/null`.strip
|
|
57
|
+
if port_check.empty?
|
|
58
|
+
puts "Port #{port} is now free. Exiting so Foreman can restart."
|
|
59
|
+
exit 0
|
|
60
|
+
end
|
|
52
61
|
sleep 5
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
end
|
|
63
|
+
end
|
|
55
64
|
|
|
56
65
|
# Start the server normally
|
|
57
|
-
exec
|
|
58
|
-
|
|
66
|
+
exec('bin/rails', 'server', *ARGV)
|
|
@@ -53,34 +53,49 @@ module RailsA11y
|
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
56
|
+
def update_procfile_dev
|
|
57
|
+
procfile_path = 'Procfile.dev'
|
|
58
|
+
|
|
59
|
+
if File.exist?(procfile_path)
|
|
60
|
+
procfile_content = File.read(procfile_path)
|
|
61
|
+
modified = false
|
|
62
|
+
|
|
63
|
+
# Update web line to use rails_server_safe if it's using standard rails server
|
|
64
|
+
if procfile_content.match?(/^web:\s*bin\/rails server/)
|
|
65
|
+
procfile_content.gsub!(/^web:\s*bin\/rails server/, 'web: bundle exec rails_server_safe')
|
|
66
|
+
modified = true
|
|
67
|
+
say "✅ Updated web process to use rails_server_safe in #{procfile_path}", :green
|
|
68
|
+
say " 💡 This prevents Foreman from terminating processes when server is already running", :cyan
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Check if a11y line already exists
|
|
72
|
+
unless procfile_content.include?('a11y:')
|
|
73
|
+
# Add live scanner to Procfile.dev
|
|
74
|
+
a11y_line = "a11y: bundle exec a11y_live_scanner\n"
|
|
75
|
+
procfile_content += a11y_line
|
|
76
|
+
modified = true
|
|
77
|
+
say "✅ Added live accessibility scanner to #{procfile_path}", :green
|
|
78
|
+
say " 💡 Run 'bin/dev' to start live scanning as you browse pages", :cyan
|
|
79
|
+
else
|
|
80
|
+
say "⚠️ Procfile.dev already contains an a11y entry. Skipping.", :yellow
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Save if we made changes
|
|
84
|
+
File.write(procfile_path, procfile_content) if modified
|
|
85
|
+
else
|
|
86
|
+
# Create Procfile.dev if it doesn't exist
|
|
87
|
+
# Use rails_server_safe to prevent Foreman termination issues
|
|
88
|
+
procfile_content = <<~PROCFILE
|
|
89
|
+
web: bundle exec rails_server_safe
|
|
90
|
+
a11y: bundle exec a11y_live_scanner
|
|
91
|
+
PROCFILE
|
|
92
|
+
|
|
93
|
+
File.write(procfile_path, procfile_content)
|
|
94
|
+
say "✅ Created #{procfile_path} with live accessibility scanner", :green
|
|
95
|
+
say " 💡 Using rails_server_safe to prevent Foreman process termination", :cyan
|
|
96
|
+
say " 💡 Run 'bin/dev' to start live scanning as you browse pages", :cyan
|
|
97
|
+
end
|
|
98
|
+
end
|
|
84
99
|
|
|
85
100
|
def update_gitignore
|
|
86
101
|
gitignore_path = '.gitignore'
|