a11y_agent 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -0
- data/lib/a11y_agent/version.rb +1 -1
- data/lib/tasks/release.rake +74 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30cfb694e76efab2af7c4c7fe8d281d5d3c8582587ec9b962544da5cc9b24d16
|
4
|
+
data.tar.gz: 124d3891525befd1102dced637e69d8ea6627ecfc6c7062722c1898617f41ca5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 330ae85419d09945571a605856f466ef898afa03ada60c7ffa15aa94e02804fe1d9136e82f15c7ab19037495b529ba4d7f00a49dd2a4d89cb213e7ccb64454e7
|
7
|
+
data.tar.gz: 6a85afed01c681d3034670cc5b56bba3fd426694697b7ea9379b2aca12b92ad270f20abc3f406b6ba6fde31446961f1c76b3eed07c3f7501ae03f76ae14157cc
|
data/Rakefile
ADDED
data/lib/a11y_agent/version.rb
CHANGED
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# lib/tasks/homebrew_formula.rake
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
require 'rake'
|
7
|
+
|
8
|
+
namespace :release do
|
9
|
+
task :build_package do
|
10
|
+
system 'bundle config set cache_all true'
|
11
|
+
system 'bundle package'
|
12
|
+
name = Gem::Specification.load(Dir.glob('*.gemspec').first).name
|
13
|
+
version = Gem::Specification.load(Dir.glob('*.gemspec').first).version
|
14
|
+
license = Gem::Specification.load(Dir.glob('*.gemspec').first).license
|
15
|
+
system "rm -f #{name}*.tar* #{name}*.sha256"
|
16
|
+
system "fpm -s dir -t tar --name #{name} --version #{version} --license #{license} --exclude .git --exclude test --exclude spec ."
|
17
|
+
system "mv #{name}.tar #{name}-#{version}.tar"
|
18
|
+
system "xz -z #{name}-#{version}.tar"
|
19
|
+
sha = `shasum -a 256 #{name}-#{version}.tar.xz`.split(' ').first
|
20
|
+
File.write("#{name}-#{version}.sha256", sha)
|
21
|
+
end
|
22
|
+
|
23
|
+
task :upload_package do
|
24
|
+
name = Gem::Specification.load(Dir.glob('*.gemspec').first).name
|
25
|
+
version = Gem::Specification.load(Dir.glob('*.gemspec').first).version
|
26
|
+
file = "#{name}-#{version}.tar.xz"
|
27
|
+
file_sha256 = "#{name}-#{version}.sha256"
|
28
|
+
system "gh release create v#{version} #{file} #{file_sha256} --title 'v#{version}' --notes ''"
|
29
|
+
end
|
30
|
+
|
31
|
+
desc 'Generate Homebrew formula'
|
32
|
+
task :generate_homebrew_formula do
|
33
|
+
spec = Gem::Specification.load(Dir.glob('*.gemspec').first)
|
34
|
+
name = spec.name
|
35
|
+
version = spec.version
|
36
|
+
sha256sum = File.read("#{name}-#{version}.sha256").strip
|
37
|
+
url = `gh release view v#{version} --json assets | jq -r '.assets[] | select(.name == "#{name}-#{version}.tar.xz") | .url'`.strip
|
38
|
+
|
39
|
+
formula_name = spec.name.capitalize
|
40
|
+
class_name = formula_name.gsub(/_\w/) { |match| match[1].upcase }.to_s
|
41
|
+
|
42
|
+
formula = <<~RUBY
|
43
|
+
class #{class_name} < Formula
|
44
|
+
desc "#{spec.summary}"
|
45
|
+
homepage "#{spec.homepage}"
|
46
|
+
version "#{spec.version}"
|
47
|
+
url "#{url}"
|
48
|
+
sha256 "#{sha256sum}"
|
49
|
+
|
50
|
+
depends_on "ruby"
|
51
|
+
|
52
|
+
def install
|
53
|
+
ENV["GEM_HOME"] = libexec
|
54
|
+
|
55
|
+
# Extract all files to libexec, which is a common Homebrew practice for third-party tools
|
56
|
+
libexec.install Dir["*"]
|
57
|
+
|
58
|
+
bin.install libexec/"bin/a11y_agent"
|
59
|
+
bin.env_script_all_files(libexec/"bin", GEM_HOME: ENV.fetch("GEM_HOME"))
|
60
|
+
end
|
61
|
+
|
62
|
+
test do
|
63
|
+
# Simple test to check the version or a help command
|
64
|
+
system "\#{bin}/a11y_agent", "--version"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
RUBY
|
68
|
+
|
69
|
+
Dir.mkdir('tmp') unless Dir.exist?('tmp')
|
70
|
+
path = "tmp/#{spec.name.downcase}.rb"
|
71
|
+
File.write(path, formula)
|
72
|
+
puts "Generated Homebrew formula for #{spec.name} version #{spec.version} at #{path}"
|
73
|
+
end
|
74
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: a11y_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Cundiff
|
@@ -89,11 +89,13 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- ".env.sample"
|
91
91
|
- README.md
|
92
|
+
- Rakefile
|
92
93
|
- eslint.config.mjs
|
93
94
|
- fixtures/sample.tsx
|
94
95
|
- lib/a11y_agent.rb
|
95
96
|
- lib/a11y_agent/version.rb
|
96
97
|
- lib/fix_a11y_generator.rb
|
98
|
+
- lib/tasks/release.rake
|
97
99
|
- package.json
|
98
100
|
- trigger.txt
|
99
101
|
- yarn.lock
|