Making a livecheck from a Github release's assets - macos

I am making a cask for PCSX2, but I have not been able to do a suitable livecheck for it.
The version of the app is not fully stated on the release's tag, but on its assets. Therefore I aim to get the version from the name of one of the downloadable assets.
With the current livecheck on the script I am getting Error: pcsx2-dev: Unable to get versions.
cask "pcsx2-dev" do
version "1.7.0-dev-20220325"
sha256 "6c5450718f88c6ff13613385fcac91e1c907aad707c3777463e74a2138eaf66e"
url "https://github.com/tellowkrinkle/pcsx2/releases/download/macos-#{version[/[0-9]{8}/]}/PCSX2-#{version}-Mac-64Bit.tar.gz",
verified: "https://github.com/tellowkrinkle/pcsx2/releases"
name "PCSX2"
desc "Playstation 2 Emulator"
homepage "hhttps://pcsx2.net"
livecheck do
url "https://github.com/tellowkrinkle/pcsx2/releases/"
strategy :page_match
regex(%r{PCSX2-/v?(\d+(?:\.\d+)+-dev-[0-9]{8}\b)$}i)
end
app "PCSX2.app"
zap trash: [
"~/Library/Application Support/PCSX2",
"~/Library/Preferences/net.pcsx2.pcsx2.plist",
]
end

Try this:
livecheck do
url "https://github.com/tellowkrinkle/pcsx2/releases/"
strategy :page_match
regex(/PCSX2[._-](\d+(?:\.\d+)+[._-]dev[._-]\d*\b)[._-]Mac[._-]64Bit\.t/i)
end

Related

Can't make code_ownership and code_teams gems to work

The gems code_teams, code_ownership should allow one to tag files/whole folders by team name but after adding them to my project, running bundle install etc, I still encounter the same error
Passed `nil` into T.must
sample team file (placed in config/teams as advised) is as following
name: Smurfs
owned_globs:
- folder/folder2/**/*
The code where I try to use the info is :
x = CodeOwnership.for_backtrace(e.backtrace)
Turns out the path was not in the format expected.
The path should not end with /*

Minima theme build shows "Liquid Exception: Invalid syntax for include tag. File contains invalid characters or sequences"

Here's a link to my website Facey's Thoughts and here's a link to the GitHub Pages project.
Cloning the (working) repository to my local machine and trying to run jekyll build fails with this error:
Liquid Exception: Invalid syntax for include tag. File contains invalid characters or sequences: social-icons/.svg Valid syntax: {% include file.ext param='value' param2='value' %} in assets/minima-social-ico.html
The Jekyll version is still the same as what's specified in my Gemfile:
jekyll 4.3.1. I have no idea what's changed.
I've tried removing the minima-social-ico.svg file; I've tried removing the posts that I was trying to add; I've tried searching Online for something similar to this issue without luck.
I tried jekyll build with local files, cloning my GitHub pages repo to a new directory, and that repo for sure built last night, and I've tried removing any new .markdown files that I made since the last time it successfully built.
I tried the following:
If I comment out social_links from my _config.yml file, it will build, I assume because it's not using the minima_social_icons.svg file. Why did it work and now it doesn't?
The problem is more with using the remote theme without locking to a specific commit/tag. (Since the v3.0 is still in development, any breaking change added to the main branch will break the build as well, if we refer to the latest changes always.)
One can lock to a specific commit/tag as: (in _config.yml file)
remote_theme: jekyll/minima#<insert-commit-hash_or_tag>
This time the breaking change was #686. Using social links more explicitly, as mentioned by Yshmarov should resolve the issue.
minima:
social_links:
- { platform: github, user_url: "https://github.com/jekyll/jekyll" }
- { platform: twitter, user_url: "https://twitter.com/jekyllrb" }
Updating social links to be more explicit solved it for me:
social_links:
- { platform: rss, user_url: "/feed.xml" }
- { platform: github, user_url: "https://github.com/yshmarov/" }
- { platform: twitter, user_url: "https://twitter.com/yarotheslav" }
- { platform: linkedin, user_url: "https://www.linkedin.com/in/yshmarov/" }

Issue creating a Homebrew cask (livecheck unable to find the latest version)

I'm trying to submit a cask for Tentacle Sync Studio but I'm having issues with livecheck being able to find the most recent version. I ran brew audit --new-cask tentacle-sync-studio and received the following error - Version '1.30' differs from '' retrieved by livecheck.
cask "tentacle-sync-studio" do
version "1.30"
sha256 "4f7bdaef85b78f576babac91d57da3b3276cc98a2f81ac621bea96a48fe8796a"
url "https://tentaclesync.com/files/downloads/ttsyncstudio-v#{version.dots_to_underscores}.dmg"
name "Tentacle Sync Studio"
desc "Automatically synchronize video and audio via timecode"
homepage "https://tentaclesync.com/"
livecheck do
url "https://tentaclesync.zendesk.com/hc/en-us/articles/115003866805-Tentacle-Sync-Studio-macOS-"
strategy :page_match
regex(%r{/v?(\d+(?:\.\d+)+)/ttsyncstudio\.dmg}i)
end
depends_on macos: ">= :high_sierra"
app "Tentacle Sync Studio.app"
end
I might not be using the correct "strategy" and I honestly have no idea how to set the regex despite reading Homebrew's instructions. Any help is appreciated.
The vitalsource-bookshelf cask had a similar issue:
Previous livecheck URL had Cloudflare protection, use API URL instead.
You'll want to change
https://tentaclesync.zendesk.com/hc/en-us/articles/115003866805-Tentacle-Sync-Studio-macOS-
to
https://tentaclesync.zendesk.com/api/v2/help_center/en-us/articles/115003866805
However, a few more changes must be made for the livecheck to work:
Change the regex to href=.*?/ttsyncstudio-v?(\d+(?:[._-]\d+)+)\.dmg
We want to match this string: href=\"https://tentaclesync.com/files/downloads/ttsyncstudio-v1_30.dmg
href=.*? is a convention in homebrew/cask
[._-] matches a dot, underscore, or hyphen (another convention)
Add a do to strategy :page_match to change underscores to dots:
strategy :page_match do |page, regex|
page.scan(regex).map { |match| match[0].tr("_", ".") }
end
match[0] corresponds to the regex capture (\d+(?:[._-]\d+)+)
Finally, your cask file should look like this.

Unable to use application_ruby cookbook with Chef 11.8.0, Cannot find a resource for bundle_options

I have been attempting to setup a chef recipe which installs ruby using RVM and then uses the application_ruby cookbook to configure the application, however I keep running into the error
NameError: Cannot find a resource for bundle_options on ubuntu version 12.04
I am using the following code
application "application setup" do
owner "ubuntu"
group "ubuntu"
repository "https://github.com/me/myapplication.git" // Real address removed
path rails_app_path
revision "master"
rails do
bundler true
precompile_assets true
bundler_deployment true
end
end
I noticed that the bundle_options was recently added, https://github.com/opscode-cookbooks/application_ruby/commit/e7719170a661a957796e8e5d58ba8f4ecd937487 however I am unable to track down if this is causing the issue. I have included
depends "application"
depends "application_ruby"
in my metadata.rb and made sure all my dependencies are installed so I am unsure what I am doing wrong at this point.
According to documentation bundle_options is an attribute of the rails resource, not a resource itself.
The only correct way of using it is INSIDE the "rails" block, so you got the message because you either used it as :
an attribute of the application resource (but outside of the "rails" block)
standalone resource (outside of any resource).
Message you mentioned is being displayed when nonexistent resource is being referenced. e.g. if you had tried to execute following code on your system:
nonexistent_resource "failure gonna happen" do
some_attribute "whatever_value"
end
you would've got a message
NameError: Cannot find a resource for nonexistent_resource on Ubuntu version 12.04
I ran into this problem today as well. It appears the problem is that commit e771917 forgot to add the necessary getter for the bundle_option. Someone filed a PR to fix it (https://github.com/poise/application_ruby/pull/44), but it has not yet been merged. I can confirm that when I made that change locally, this error went away. The forked branch in the PR is located at https://github.com/mauriciosilva/application_ruby/tree/bundle_options_fix.

no route matches for assets/images in Rails

Working on rails, images are not visible and giving error.
Started GET "/assets/home.png" for 127.0.0.1 at 2012-06-19 12:23:24 +0530
Served asset /home.png - 404 Not Found (24ms)
ActionController::RoutingError (No route matches [GET] "/assets/home.png"):
I have used command
rake assets:precompile
production.rb
config.assets.compress = true
config.assets.compile = false
application.rb
config.assets.enabled = true
config.assets.version = '1.0'
Thanks for any help!
Actually you cannot reference your image with /assets/home.png path.
It will work in development mode, but in production all of your assets have a fingerprint in their filename (read this http://guides.rubyonrails.org/asset_pipeline.html#what-is-fingerprinting-and-why-should-i-care-questionmark)
That's why, in assets-pipeline enabled applications you need to reference all of your assets using helper methods. Read this doc to learn about the different helpers available in Ruby, JS and Sass files: http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets
The lack of a fingerprint in the file request suggests that you are running this in development. I am also going to guess that this is an app upgraded from an older version of Rails.
Any images need to be in the folder /assets/images for the pipeline to work.
Also, you do not need to precompile when in development mode.
Delete the public/assets folder, delete the folder tmp/cache/assets, and restart your server.
If this images are in the correct location, it should work.

Resources