Skip to content
Closed
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
13 changes: 10 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
require 'bundler/gem_tasks'

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = 'spec/cypress_on_rails/*_spec.rb'
end

# Manually define build task (normally provided by bundler/gem_tasks)
desc "Build cypress-on-rails-#{CypressOnRails::VERSION}.gem into the pkg directory"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

NameError: constant referenced before loading.

The task description interpolates CypressOnRails::VERSION before it's loaded. This will raise a NameError when Rake loads the Rakefile, as the constant is only required inside the task block (line 9).

Apply this diff to fix the issue by using a static description:

-desc "Build cypress-on-rails-#{CypressOnRails::VERSION}.gem into the pkg directory"
+desc "Build cypress-on-rails gem into the pkg directory"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
desc "Build cypress-on-rails-#{CypressOnRails::VERSION}.gem into the pkg directory"
desc "Build cypress-on-rails gem into the pkg directory"
🤖 Prompt for AI Agents
In Rakefile around line 7, the task description currently interpolates
CypressOnRails::VERSION which triggers a NameError because the constant isn't
loaded until inside the task; change the desc to a static string (e.g. "Build
cypress-on-rails gem into the pkg directory") so Rake can parse the Rakefile
without loading the constant, and keep any use of CypressOnRails::VERSION inside
the task body where the constant is required.

task :build do
require_relative 'lib/cypress_on_rails/version'
sh "gem build cypress-on-rails.gemspec"
sh "mkdir -p pkg"
sh "mv cypress-on-rails-#{CypressOnRails::VERSION}.gem pkg/"
end

task default: %w[spec build]

namespace :release do
Expand Down Expand Up @@ -38,7 +45,7 @@ namespace :release do

# Use gem bump to update version
puts "\n→ Bumping version with gem-release..."
unless system("gem bump --version #{version} --no-commit")
unless system("gem bump -v #{version} --no-commit")
puts "Error: Failed to bump version"
exit 1
end
Expand Down
59 changes: 0 additions & 59 deletions lib/tasks/release.rake

This file was deleted.