capydash 0.2.0 → 0.2.2

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.
@@ -1,67 +0,0 @@
1
- namespace :capydash do
2
- desc "Start local server to view static HTML report"
3
- task server: :environment do
4
- require 'webrick'
5
- require 'capydash/report_generator'
6
-
7
- report_dir = File.join(Dir.pwd, "capydash_report")
8
-
9
- unless Dir.exist?(report_dir)
10
- puts "No report directory found. Run 'bundle exec rake capydash:report' first."
11
- exit 1
12
- end
13
-
14
- # Try different ports if 5173 is busy
15
- port = 5173
16
- begin
17
- server = WEBrick::HTTPServer.new(
18
- Port: port,
19
- DocumentRoot: report_dir,
20
- Logger: WEBrick::Log.new(nil, WEBrick::Log::ERROR),
21
- AccessLog: [],
22
- BindAddress: '127.0.0.1'
23
- )
24
- rescue Errno::EADDRINUSE
25
- port = 8080
26
- puts "Port 5173 is busy, trying port #{port}..."
27
- server = WEBrick::HTTPServer.new(
28
- Port: port,
29
- DocumentRoot: report_dir,
30
- Logger: WEBrick::Log.new(nil, WEBrick::Log::ERROR),
31
- AccessLog: [],
32
- BindAddress: '127.0.0.1'
33
- )
34
- end
35
-
36
- puts "Starting static file server on http://localhost:#{port}"
37
- puts "Report available at: http://localhost:#{port}/index.html"
38
- puts "Press Ctrl+C to stop the server"
39
-
40
- trap("INT") {
41
- puts "\nShutting down server..."
42
- server.shutdown
43
- }
44
-
45
- begin
46
- server.start
47
- rescue => e
48
- puts "Error starting server: #{e.message}"
49
- exit 1
50
- end
51
- end
52
-
53
- desc "Generate static HTML test report"
54
- task report: :environment do
55
- require 'capydash/report_generator'
56
-
57
- report_path = CapyDash::ReportGenerator.generate_report
58
-
59
- if report_path
60
- puts "Report generated: file://#{File.absolute_path(report_path)}"
61
- else
62
- puts "No test data found. Run some tests first to generate a report."
63
- exit 1
64
- end
65
- end
66
-
67
- end