-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
118 lines (103 loc) · 2.98 KB
/
Copy pathRakefile
File metadata and controls
118 lines (103 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
require 'rake/testtask'
# Default task
task default: :test
# Test task
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/test_*.rb']
t.verbose = true
end
# Individual test tasks for each component
namespace :test do
desc "Run TermBuffer tests"
Rake::TestTask.new(:termbuffer) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/test_termbuffer.rb']
t.verbose = true
end
desc "Run EscapeParser tests"
Rake::TestTask.new(:escapeparser) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/test_escapeparser.rb']
t.verbose = true
end
desc "Run UTF8Decoder tests"
Rake::TestTask.new(:utf8decoder) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/test_utf8decoder.rb']
t.verbose = true
end
desc "Run Palette tests"
Rake::TestTask.new(:palette) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/test_palette.rb']
t.verbose = true
end
desc "Run Charsets tests"
Rake::TestTask.new(:charsets) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/test_charsets.rb']
t.verbose = true
end
end
# Run the terminal application
desc "Run the terminal emulator"
task :run do
sh "bundle exec ruby bin/rubyterm"
end
# Debug mode
desc "Run the terminal emulator in debug mode"
task :debug do
sh "DEBUG=1 bundle exec ruby bin/rubyterm"
end
# Build executable (requires rubypkg tool)
desc "Build standalone executable"
task :build do
sh "make build"
end
# Install to ~/bin
desc "Install to ~/bin"
task :promote do
sh "make promote"
end
# Gem packaging — distinct from `rake build`, which builds the standalone
# executable. Note: until skrift and its plugins are on RubyGems, a published
# rubyterm gem can't resolve them, so publish those first.
require_relative "lib/rubyterm/version"
GEM_PKG = File.expand_path("pkg", __dir__)
desc "Build the rubyterm gem into pkg/"
task :gem do
require "fileutils"
FileUtils.mkdir_p(GEM_PKG)
sh "gem build rubyterm.gemspec -o #{GEM_PKG}/rubyterm-#{RubyTerm::VERSION}.gem"
end
desc "Build + push the rubyterm gem to RubyGems"
task publish: :gem do
sh "gem push #{GEM_PKG}/rubyterm-#{RubyTerm::VERSION}.gem"
end
# Show available tasks
desc "Show all available tasks"
task :help do
puts "Available tasks:"
puts " rake test - Run all tests"
puts " rake test:COMPONENT - Run tests for specific component"
puts " rake run - Run the terminal emulator"
puts " rake debug - Run in debug mode"
puts " rake build - Build standalone executable"
puts " rake promote - Install to ~/bin"
puts " rake gem - Build the rubyterm gem into pkg/"
puts " rake publish - Build + push the rubyterm gem to RubyGems"
puts ""
puts "Test components available:"
puts " - termbuffer"
puts " - escapeparser"
puts " - utf8decoder"
puts " - palette"
puts " - charsets"
end