From dc26137f871148fd54d65e3e36138bc4e7ff598e Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Tue, 13 Feb 2024 12:29:32 -0800 Subject: [PATCH] Use .tool-versions in the Gemfile --- .ruby-version | 1 - Gemfile | 2 +- Gemfile.lock | 2 +- Guardfile | 81 --------------------------------------------------- 4 files changed, 2 insertions(+), 84 deletions(-) delete mode 100644 .ruby-version delete mode 100644 Guardfile diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index b347b11e..00000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.2.3 diff --git a/Gemfile b/Gemfile index ddda700d..06f80896 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby "3.2.3" +ruby file: '.tool-versions' gem "rails", "6.1.7.4" diff --git a/Gemfile.lock b/Gemfile.lock index 5cf3b41f..950f6302 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -612,4 +612,4 @@ RUBY VERSION ruby 3.2.3p157 BUNDLED WITH - 2.4.19 + 2.5.6 diff --git a/Guardfile b/Guardfile deleted file mode 100644 index a6fbebfb..00000000 --- a/Guardfile +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -# A sample Guardfile -# More info at https://github.com/guard/guard#readme - -## Uncomment and set this to only include directories you want to watch -# directories %w(app lib config test spec features) \ -# .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")} - -## Note: if you are using the `directories` clause above and you are not -## watching the project directory ('.'), then you will want to move -## the Guardfile to a watched dir and symlink it back, e.g. -# -# $ mkdir config -# $ mv Guardfile config/ -# $ ln -s config/Guardfile . -# -# and, you'll have to watch "config/Guardfile" instead of "Guardfile" - -# Note: The cmd option is now required due to the increasing number of ways -# rspec may be run, below are examples of the most common uses. -# * bundler: 'bundle exec rspec' -# * bundler binstubs: 'bin/rspec' -# * spring: 'bin/rspec' (This will use spring if running and you have -# installed the spring binstubs per the docs) -# * zeus: 'zeus rspec' (requires the server to be started separately) -# * 'just' rspec: 'rspec' - -guard :rspec, cmd: "bundle exec rspec" do - require "guard/rspec/dsl" - dsl = Guard::RSpec::Dsl.new(self) - - # Feel free to open issues for suggestions and improvements - - # RSpec files - rspec = dsl.rspec - watch(rspec.spec_helper) { rspec.spec_dir } - watch(rspec.spec_support) { rspec.spec_dir } - watch(rspec.spec_files) - - # Ruby files - ruby = dsl.ruby - dsl.watch_spec_files_for(ruby.lib_files) - - # Rails files - rails = dsl.rails(view_extensions: %w(erb haml slim)) - dsl.watch_spec_files_for(rails.app_files) - dsl.watch_spec_files_for(rails.views) - - watch(rails.controllers) do |m| - [ - rspec.spec.call("routing/#{m[1]}_routing"), - rspec.spec.call("controllers/#{m[1]}_controller"), - rspec.spec.call("acceptance/#{m[1]}") - ] - end - - # Rails config changes - watch(rails.spec_helper) { rspec.spec_dir } - watch(rails.routes) { "#{rspec.spec_dir}/routing" } - watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" } - - # Capybara features specs - watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") } - watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") } - - # Turnip features and steps - watch(%r{^spec/acceptance/(.+)\.feature$}) - watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m| - Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance" - end -end - -guard "cucumber" do - watch(%r{^features/.+\.feature$}) - watch(%r{^features/support/.+$}) { "features" } - - watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m| - Dir[File.join("**/#{m[1]}.feature")][0] || "features" - end -end