Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gemfile.lock: specify Ruby/Bundler versions. #48

Merged
merged 4 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ jobs:
persist-credentials: false
- name: Set up Ruby 3
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Configure git
run: |
git config user.email '[email protected]'
git config user.name 'TANIGUCHI Masaya'
- name: Convert and commit
run: |
git submodule update --init --remote
gem install bundler
bundle install --jobs 4 --retry 3 --without development
bundle exec ruby cask2formula convert
bundle exec ruby cask2formula commit
- name: Clean Formula directory
run: |
comm -23 --nocheck-order <(ls -1 Formula) <(ls -1 homebrew-cask/Casks/font/) | xargs -I{} sh -c 'git rm ./Formula/{} && git commit -m "Remove {}"'
comm -23 --nocheck-order <(ls -1 Formula) <(basename -a homebrew-cask-fonts/Casks/font/*/*) | xargs -I{} sh -c 'git rm ./Formula/{} && git commit -m "Remove {}"'
- name: Publish to GitHub
if: github.event_name != 'pull_request'
env:
Expand Down
5 changes: 4 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ PLATFORMS
DEPENDENCIES
parslet

RUBY VERSION
ruby 3.3.1p55

BUNDLED WITH
2.3.10
2.5.9
5 changes: 4 additions & 1 deletion cask2formula
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ end

class CaskConverter
def convert
FileUtils.mkdir_p("Formula")
ignores = IO.readlines('.caskignore', chomp: true)
transform = CaskTransform.new(true)
parser = CaskParser.new
Expand All @@ -188,7 +189,9 @@ class CaskConverter
def commit
`git diff --name-only; git ls-files --others --exclude-standard`.split(/\s+/).each do |file|
if file != "homebrew-cask-fonts" then
remote_source = "https://github.com/homebrew/#{file.sub(/Formula/, "homebrew-cask-fonts/blob/master/Casks")}"
shard_letter = File.basename(file).delete_prefix("font-")[0]
remote_dir = "homebrew-cask/blob/master/Casks/font/font-#{shard_letter}"
remote_source = "https://github.com/Homebrew/#{file.sub(/Formula/, remote_dir)}"
commit_id = `git -C homebrew-cask-fonts log -n 1 --pretty=format:%H -- #{file.sub(/Formula/, 'Casks')}`
system 'git', 'add', file
system 'git', 'commit', '-m', "import #{remote_source} from #{commit_id}"
Expand Down