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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94ca19fae4a088d592146b8df934aa4b4a2b21f60e9318198ba79c3b0bff769c
4
- data.tar.gz: 39c4d8da1ece45a3a350efaf5efecd69ed3986e0da435a7d03f256186a7dd89d
3
+ metadata.gz: 30cfb694e76efab2af7c4c7fe8d281d5d3c8582587ec9b962544da5cc9b24d16
4
+ data.tar.gz: 124d3891525befd1102dced637e69d8ea6627ecfc6c7062722c1898617f41ca5
5
5
  SHA512:
6
- metadata.gz: 594a27d14711f26226a383aa74f45bc2bd58d880c700edc21fcd70efbd51204c0acf432366eb0ec884ae6505ea6fcd34729b6f5b862508b373c4977ca6213624
7
- data.tar.gz: 8947f736049078fe40be73c49325f45a2ce185c337c04ba979af45ae90dee33998d36107a89c4f2d461962d4c5aca23f6e9f839a513ef9c25da8a0d4c520c8ee
6
+ metadata.gz: 330ae85419d09945571a605856f466ef898afa03ada60c7ffa15aa94e02804fe1d9136e82f15c7ab19037495b529ba4d7f00a49dd2a4d89cb213e7ccb64454e7
7
+ data.tar.gz: 6a85afed01c681d3034670cc5b56bba3fd426694697b7ea9379b2aca12b92ad270f20abc3f406b6ba6fde31446961f1c76b3eed07c3f7501ae03f76ae14157cc
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ Dir["#{File.dirname(__FILE__)}/lib/tasks/**/*.rake"].each { |file| load file }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module A11yAgent
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
@@ -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.1
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