ratatui_ruby-devtools 0.1.3 → 0.2.0
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 +11 -0
- data/LICENSES/BSD-2-Clause.txt +9 -0
- data/README.md +1 -1
- data/exe/hbs +149 -209
- data/exe/scaffold +169 -282
- data/lib/ratatui_ruby/devtools/tasks/lint.rake +3 -7
- data/lib/ratatui_ruby/devtools/tasks/release/ci_run.rb +44 -0
- data/lib/ratatui_ruby/devtools/tasks/release/github_cli.rb +36 -0
- data/lib/ratatui_ruby/devtools/tasks/release/native_gem_version.rb +70 -0
- data/lib/ratatui_ruby/devtools/tasks/release/platform_gem.rb +63 -0
- data/lib/ratatui_ruby/devtools/tasks/release/versioned_binary.rb +36 -0
- data/lib/ratatui_ruby/devtools/tasks/release.rake +87 -0
- data/lib/ratatui_ruby/devtools/tasks/resources/rubies.yml +1 -1
- data/lib/ratatui_ruby/devtools/templates/.github/workflows/build-gems.yml.erb +124 -0
- data/lib/ratatui_ruby/devtools/templates/.github/workflows/ci.yml.erb +77 -0
- data/lib/ratatui_ruby/devtools/templates/.gitignore.erb +2 -0
- data/lib/ratatui_ruby/devtools/templates/.rubocop.yml.erb +6 -4
- data/lib/ratatui_ruby/devtools/templates/AGENTS.md.erb +101 -28
- data/lib/ratatui_ruby/devtools/templates/CODE_OF_CONDUCT.md.erb +44 -0
- data/lib/ratatui_ruby/devtools/templates/CONTRIBUTING.md.erb +80 -0
- data/lib/ratatui_ruby/devtools/templates/Gemfile.erb +2 -2
- data/lib/ratatui_ruby/devtools/templates/README.md.erb +46 -13
- data/lib/ratatui_ruby/devtools/templates/REUSE.toml.erb +2 -2
- data/lib/ratatui_ruby/devtools/templates/Rakefile.erb +4 -4
- data/lib/ratatui_ruby/devtools/templates/bin/setup.erb +21 -11
- data/lib/ratatui_ruby/devtools/templates/bin/setup.ps1.erb +105 -0
- data/lib/ratatui_ruby/devtools/templates/doc/custom.css.erb +3 -3
- data/lib/ratatui_ruby/devtools/templates/doc/getting_started/quickstart.md.erb +3 -3
- data/lib/ratatui_ruby/devtools/templates/doc/index.md.erb +2 -2
- data/lib/ratatui_ruby/devtools/templates/ext/.cargo/config.toml.erb +15 -0
- data/lib/ratatui_ruby/devtools/templates/ext/.gitignore.erb +6 -0
- data/lib/ratatui_ruby/devtools/templates/ext/Cargo.toml.erb +20 -0
- data/lib/ratatui_ruby/devtools/templates/ext/clippy.toml.erb +9 -0
- data/lib/ratatui_ruby/devtools/templates/ext/extconf.rb.erb +23 -0
- data/lib/ratatui_ruby/devtools/templates/ext/src/lib.rs.erb +13 -0
- data/lib/ratatui_ruby/devtools/templates/gemspec.erb +21 -14
- data/lib/ratatui_ruby/devtools/templates/lib/main.rb.erb +19 -0
- data/lib/ratatui_ruby/devtools/templates/lib/test_helper.rb.erb +26 -0
- data/lib/ratatui_ruby/devtools/templates/lib/version.rb.erb +10 -0
- data/lib/ratatui_ruby/devtools/templates/mise.toml.erb +3 -3
- data/lib/ratatui_ruby/devtools/templates/tasks/example_viewer.html.erb +23 -23
- data/lib/ratatui_ruby/devtools/templates/tasks/resources/index.html.erb +15 -16
- data/lib/ratatui_ruby/devtools/templates/tasks/resources/rubies.yml.erb +5 -6
- data/lib/ratatui_ruby/devtools/templates/test/test_helper.rb.erb +15 -0
- data/lib/ratatui_ruby/devtools/version.rb +1 -1
- data/lib/ratatui_ruby/devtools.rb +2 -2
- metadata +24 -5
- data/lib/ratatui_ruby/devtools/tasks/resources/build.yml.erb +0 -54
- data/lib/ratatui_ruby/devtools/tasks/sourcehut.rake +0 -94
- data/lib/ratatui_ruby/devtools/templates/tasks/resources/build.yml.erb +0 -62
- /data/lib/ratatui_ruby/devtools/templates/{vendor/goodcop/base.yml → lib/rubocop.yml} +0 -0
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
#--
|
|
4
|
-
# SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
|
|
5
|
-
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
6
|
-
#++
|
|
7
|
-
|
|
8
|
-
desc "Generate SourceHut build manifests from template"
|
|
9
|
-
task sourcehut: "sourcehut:build"
|
|
10
|
-
|
|
11
|
-
namespace :sourcehut do
|
|
12
|
-
desc "Build SourceHut manifests"
|
|
13
|
-
task build: "sourcehut:build:manifest"
|
|
14
|
-
|
|
15
|
-
namespace :build do
|
|
16
|
-
desc "Generate SourceHut build manifests from template"
|
|
17
|
-
task :manifest do
|
|
18
|
-
require "erb"
|
|
19
|
-
require "yaml"
|
|
20
|
-
|
|
21
|
-
gem_name = RatatuiRuby::Devtools.gem_name
|
|
22
|
-
gemspec_file = RatatuiRuby::Devtools.gemspec_file
|
|
23
|
-
version_file = RatatuiRuby::Devtools.version_file
|
|
24
|
-
|
|
25
|
-
# Detect if this is a Rust extension gem
|
|
26
|
-
has_rust = File.exist?("ext/#{gem_name}/Cargo.toml") ||
|
|
27
|
-
File.exist?("ext/#{gem_name.tr('-', '_')}/Cargo.toml")
|
|
28
|
-
|
|
29
|
-
spec = Gem::Specification.load(gemspec_file)
|
|
30
|
-
|
|
31
|
-
# Read version directly from file to ensure we get the latest version
|
|
32
|
-
# even if it was just bumped in the same Rake execution
|
|
33
|
-
version_content = File.read(version_file)
|
|
34
|
-
version = version_content.match(/VERSION = "(.+?)"/)[1]
|
|
35
|
-
|
|
36
|
-
gem_filename = "#{spec.name}-#{version}.gem"
|
|
37
|
-
|
|
38
|
-
rubies = YAML.load_file("tasks/resources/rubies.yml")
|
|
39
|
-
|
|
40
|
-
bundler_version = File.read("Gemfile.lock").match(/BUNDLED WITH\n\s+([\d.]+)/)[1]
|
|
41
|
-
|
|
42
|
-
template = File.read("tasks/resources/build.yml.erb")
|
|
43
|
-
erb = ERB.new(template, trim_mode: "-")
|
|
44
|
-
|
|
45
|
-
FileUtils.mkdir_p ".builds"
|
|
46
|
-
|
|
47
|
-
# Remove old generated files to ensure a clean state
|
|
48
|
-
Dir.glob(".builds/*.yml").each { |f| File.delete(f) }
|
|
49
|
-
|
|
50
|
-
rubies.each do |ruby_version|
|
|
51
|
-
filename = ".builds/ruby-#{ruby_version}.yml"
|
|
52
|
-
puts "Generating #{filename}..."
|
|
53
|
-
content = erb.result_with_hash(gem_name:, has_rust:, ruby_version:, gem_filename:, bundler_version:)
|
|
54
|
-
File.write(filename, content)
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
desc "Update stable branch to match release and set as default"
|
|
60
|
-
task :update_stable do
|
|
61
|
-
version_file = RatatuiRuby::Devtools.version_file
|
|
62
|
-
|
|
63
|
-
# Read version to determine tag
|
|
64
|
-
version_content = File.read(version_file)
|
|
65
|
-
version = version_content.match(/VERSION = "(.+?)"/)[1]
|
|
66
|
-
tag_name = "v#{version}"
|
|
67
|
-
|
|
68
|
-
# Verify that the version file matches the actual git tag
|
|
69
|
-
# This prevents updating stable to the wrong version if the release failed
|
|
70
|
-
latest_tag = `git describe --tags --abbrev=0`.strip
|
|
71
|
-
if latest_tag != tag_name
|
|
72
|
-
abort "Fatal: Version mismatch! '#{version_file}' says #{tag_name}, " \
|
|
73
|
-
"but the latest git tag is #{latest_tag}."
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
puts "Updating stable branch to point to #{tag_name}..."
|
|
77
|
-
# Resolve the tag to a commit hash (peel annotated tags)
|
|
78
|
-
# This renders a commit SHA that can be pushed to a branch head
|
|
79
|
-
commit_sha = `git rev-parse #{tag_name}^{}`.strip
|
|
80
|
-
|
|
81
|
-
# Update local stable branch to match
|
|
82
|
-
sh "git branch -f stable #{commit_sha}"
|
|
83
|
-
|
|
84
|
-
# Push the commit to remote stable branch
|
|
85
|
-
# This creates 'stable' if it doesn't exist, or fast-forwards it.
|
|
86
|
-
sh "git push origin #{commit_sha}:stable"
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
if Rake::Task.task_defined?("release")
|
|
91
|
-
Rake::Task["release"].enhance do
|
|
92
|
-
Rake::Task["sourcehut:update_stable"].invoke
|
|
93
|
-
end
|
|
94
|
-
end
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: <%= Time.now.year %> <%= copyright_holder %>
|
|
2
|
-
# REUSE-IgnoreStart
|
|
3
|
-
# SPDX-License-Identifier: <%= license %>
|
|
4
|
-
# REUSE-IgnoreEnd
|
|
5
|
-
|
|
6
|
-
image: archlinux
|
|
7
|
-
packages:
|
|
8
|
-
- bash
|
|
9
|
-
- base-devel
|
|
10
|
-
- curl
|
|
11
|
-
- openssl
|
|
12
|
-
- libyaml
|
|
13
|
-
- zlib
|
|
14
|
-
- readline
|
|
15
|
-
- gdbm
|
|
16
|
-
- ncurses
|
|
17
|
-
- libffi
|
|
18
|
-
<%- if has_rust -%>
|
|
19
|
-
- clang
|
|
20
|
-
<%- end -%>
|
|
21
|
-
- git
|
|
22
|
-
artifacts:
|
|
23
|
-
- <%= gem_name %>/pkg/<%= gem_filename %>
|
|
24
|
-
sources:
|
|
25
|
-
- https://git.sr.ht/~kerrick/<%= gem_name %>
|
|
26
|
-
tasks:
|
|
27
|
-
- setup: |
|
|
28
|
-
curl https://mise.jdx.dev/install.sh | sh
|
|
29
|
-
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.buildenv
|
|
30
|
-
echo 'eval "$($HOME/.local/bin/mise activate bash)"' >> ~/.buildenv
|
|
31
|
-
echo 'export LANG="en_US.UTF-8"' >> ~/.buildenv
|
|
32
|
-
echo 'export LC_ALL="en_US.UTF-8"' >> ~/.buildenv
|
|
33
|
-
<%- if has_rust -%>
|
|
34
|
-
echo 'export BINDGEN_EXTRA_CLANG_ARGS="-include stdbool.h"' >> ~/.buildenv
|
|
35
|
-
<%- end -%>
|
|
36
|
-
. ~/.buildenv
|
|
37
|
-
export CI="true"
|
|
38
|
-
cd <%= gem_name %>
|
|
39
|
-
sed -i 's/ruby = .*/ruby = "<%= ruby_version %>"/' mise.toml
|
|
40
|
-
mise install
|
|
41
|
-
mise x -- pip install reuse
|
|
42
|
-
mise x -- gem install bundler:<%= bundler_version %>
|
|
43
|
-
mise reshim
|
|
44
|
-
mise x -- bundle config set --local frozen 'true'
|
|
45
|
-
mise x -- bundle install
|
|
46
|
-
<%- if has_rust -%>
|
|
47
|
-
mise x -- bundle exec rake compile
|
|
48
|
-
<%- end -%>
|
|
49
|
-
- test: |
|
|
50
|
-
. ~/.buildenv
|
|
51
|
-
cd <%= gem_name %>
|
|
52
|
-
echo "Testing Ruby <%= ruby_version %>"
|
|
53
|
-
mise x -- bundle exec rake test
|
|
54
|
-
- lint: |
|
|
55
|
-
. ~/.buildenv
|
|
56
|
-
cd <%= gem_name %>
|
|
57
|
-
echo "Linting Ruby <%= ruby_version %>"
|
|
58
|
-
mise x -- bundle exec rake lint
|
|
59
|
-
- package: |
|
|
60
|
-
. ~/.buildenv
|
|
61
|
-
cd <%= gem_name %>
|
|
62
|
-
mise x -- bundle exec rake build
|
|
File without changes
|