Update Thor dependency and everything else too 🙈 (#959)

* Update dependencies

* Revert some things

* Fix merged files

* feat: add stop_all command (#945)

* Start implementation

* Fix command, add some docs

* Sort cli args

* Update cli spec

* Fix rubocop issues

* feat: Add --no-pre-window option to start command

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>

* chore: Fix coveralls to run from GH actions

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>

* chore: Bump tmuxinator to v3.3.4

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>

* Implement suggestions

* Update readme and changelog

* Extract, fix rubocop issues

* Fix call issue

* Fix alignment

* Fix tests

* Remove alias

* Add alias

* Add test for alias

* Remove alias test

* refactor: fix codeclimate complexity

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>

---------

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>
Co-authored-by: Andrew Kofink <ajkofink@gmail.com>

* Add changelog

* feat: add stop_all command (#945)

* Start implementation

* Fix command, add some docs

* Sort cli args

* Update cli spec

* Fix rubocop issues

* feat: Add --no-pre-window option to start command

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>

* chore: Fix coveralls to run from GH actions

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>

* chore: Bump tmuxinator to v3.3.4

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>

* Implement suggestions

* Update readme and changelog

* Extract, fix rubocop issues

* Fix call issue

* Fix alignment

* Fix tests

* Remove alias

* Add alias

* Add test for alias

* Remove alias test

* refactor: fix codeclimate complexity

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>

---------

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>
Co-authored-by: Andrew Kofink <ajkofink@gmail.com>

* Fix double string freeze

* Fix PR feedback, failing tests

* Add explaining comment

* Fix version parse

* Update tmuxinator.gemspec

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove XDG depedency

---------

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>
Co-authored-by: Andrew Kofink <ajkofink@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Hans Schnedlitz
2025-08-02 13:44:00 +02:00
committed by GitHub
parent fe37bf0046
commit dfcf423a91
12 changed files with 65 additions and 88 deletions

View File

@@ -4,9 +4,7 @@ AllCops:
- "db/schema.rb"
DisplayCopNames: true
StyleGuideCopsOnly: false
TargetRubyVersion: 2.6
Rails:
Enabled: false
TargetRubyVersion: 2.7
Layout/AccessModifierIndentation:
Description: Check indentation of private/protected visibility modifiers.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
@@ -15,7 +13,7 @@ Layout/AccessModifierIndentation:
SupportedStyles:
- outdent
- indent
Layout/AlignHash:
Layout/HashAlignment:
Description: Align the elements of a hash literal if they span more than one line.
Enabled: true
EnforcedHashRocketStyle: key
@@ -26,7 +24,7 @@ Layout/AlignHash:
- always_ignore
- ignore_implicit
- ignore_explicit
Layout/AlignParameters:
Layout/ParameterAlignment:
Description: Align the parameters of a method call if they span more than one line.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
Enabled: true
@@ -50,14 +48,6 @@ Style/BarePercentLiterals:
SupportedStyles:
- percent_q
- bare_percent
Style/BracesAroundHashParameters:
Description: Enforce braces style around hash parameters.
Enabled: true
EnforcedStyle: no_braces
SupportedStyles:
- braces
- no_braces
- context_dependent
Layout/CaseIndentation:
Description: Indentation of when in a case/when/[else/]end.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
@@ -148,7 +138,7 @@ Naming/FileName:
Layout/FirstParameterIndentation:
Description: Checks the indentation of the first parameter in a method call.
Enabled: true
EnforcedStyle: special_for_inner_method_call_in_parentheses
EnforcedStyle: consistent
SupportedStyles:
- consistent
- special_for_inner_method_call
@@ -198,7 +188,7 @@ Layout/IndentationWidth:
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
Enabled: true
Width: 2
Layout/IndentHash:
Layout/FirstHashElementIndentation:
Description: Checks the indentation of the first key in a hash literal.
Enabled: true
EnforcedStyle: special_inside_parentheses
@@ -281,7 +271,7 @@ Style/PercentQLiterals:
SupportedStyles:
- lower_case_q
- upper_case_q
Naming/PredicateName:
Naming/PredicatePrefix:
Description: Check the names of predicate methods.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
Enabled: true
@@ -289,7 +279,7 @@ Naming/PredicateName:
- is_
- has_
- have_
NamePrefixBlacklist:
ForbiddenPrefixes:
- is_
Exclude:
- spec/**/*
@@ -401,9 +391,9 @@ Layout/SpaceInsideHashLiteralBraces:
Style/SymbolProc:
Description: Use symbols as procs instead of blocks when possible.
Enabled: true
IgnoredMethods:
AllowedMethods:
- respond_to
Layout/TrailingBlankLines:
Layout/TrailingEmptyLines:
Description: Checks trailing blank lines and final newline.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
Enabled: true
@@ -424,7 +414,7 @@ Style/TrivialAccessors:
ExactNameMatch: false
AllowPredicates: false
AllowDSLWriters: false
Whitelist:
AllowedMethods:
- to_ary
- to_a
- to_c
@@ -480,7 +470,7 @@ Metrics/CyclomaticComplexity:
cases needed to validate a method.
Enabled: false
Max: 6
Metrics/LineLength:
Layout/LineLength:
Description: Limit lines to 80 characters.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
Enabled: true
@@ -560,7 +550,7 @@ Style/Alias:
Description: Use alias_method instead of alias.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
Enabled: false
Layout/AlignArray:
Layout/ArrayAlignment:
Description: Align the elements of an array literal if they span more than one line.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
Enabled: true
@@ -672,7 +662,7 @@ Style/EvenOdd:
Description: Favor the use of Fixnum#even? && Fixnum#odd?
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
Enabled: false
Style/FlipFlop:
Lint/FlipFlop:
Description: Checks for flip flops
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
Enabled: false
@@ -683,7 +673,7 @@ Style/IfWithSemicolon:
Layout/IndentationConsistency:
Description: Keep indentation straight.
Enabled: true
Layout/IndentArray:
Layout/FirstArrayElementIndentation:
Description: Checks the indentation of the first element in an array literal.
Enabled: true
Style/InfiniteLoop:
@@ -838,7 +828,7 @@ Style/StructInheritance:
Description: Checks for inheritance from Struct.new.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
Enabled: true
Layout/Tab:
Layout/IndentationStyle:
Description: No hard tabs.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
Enabled: true
@@ -850,10 +840,10 @@ Style/UnlessElse:
Description: Do not use unless with else. Rewrite these with the positive case first.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
Enabled: true
Style/UnneededCapitalW:
Style/RedundantCapitalW:
Description: Checks for %W when interpolation is not needed.
Enabled: true
Style/UnneededPercentQ:
Style/RedundantPercentQ:
Description: Checks for %q/%Q when single quotes or double quotes would do.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
Enabled: true
@@ -911,9 +901,6 @@ Lint/EmptyEnsure:
Lint/EmptyInterpolation:
Description: Checks for empty string interpolation.
Enabled: true
Lint/EndInMethod:
Description: END blocks should not be placed inside method definitions.
Enabled: true
Lint/EnsureReturn:
Description: Do not use return in an ensure block.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
@@ -921,7 +908,7 @@ Lint/EnsureReturn:
Security/Eval:
Description: The use of eval represents a serious security risk.
Enabled: true
Lint/HandleExceptions:
Lint/SuppressedException:
Description: Don't suppress exception.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
Enabled: false
@@ -948,7 +935,7 @@ Lint/ShadowingOuterLocalVariable:
Description: Do not use the same name as outer local variable for block arguments
or block local variables.
Enabled: true
Lint/StringConversionInInterpolation:
Lint/RedundantStringCoercion:
Description: Checks for Object#to_s usage in string interpolation.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
Enabled: true
@@ -973,7 +960,7 @@ Lint/UselessAssignment:
Description: Checks for useless assignment to a local variable.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
Enabled: true
Lint/UselessComparison:
Lint/BinaryOperatorWithIdenticalOperands:
Description: Checks for comparison of something with itself.
Enabled: true
Lint/UselessElseWithoutRescue:

View File

@@ -2,6 +2,9 @@
## Misc
- Add Ruby 3.4 to the test matrix
- Document new from session feature in the README
- Update required Ruby version to >=2.7
- Update runtime dependencies to up-to-date versions
- Update development dependencies to up-to-date versions
## Fixes
- Properly pass args with equals (=) in their values
- Fix `fish-shell` completion

View File

@@ -5,7 +5,6 @@ require "fileutils"
require "shellwords"
require "thor"
require "thor/version"
require "xdg"
require "yaml"
module Tmuxinator

View File

@@ -94,7 +94,7 @@ module Tmuxinator
no_commands do
def new_project(name)
project_file = find_project_file(name, options[:local])
project_file = find_project_file(name, local: options[:local])
Kernel.system("$EDITOR #{project_file}") || doctor
end
@@ -146,14 +146,14 @@ module Tmuxinator
end
}
path = config_path(name, options[:local])
path = config_path(name, local: options[:local])
File.open(path, "w") do |f|
f.write(YAML.dump(yaml))
end
end
def find_project_file(name, local = false)
path = config_path(name, local)
def find_project_file(name, local: false)
path = config_path(name, local: local)
if File.exist?(path)
path
else
@@ -161,7 +161,7 @@ module Tmuxinator
end
end
def config_path(name, local = false)
def config_path(name, local: false)
if local
Tmuxinator::Config::LOCAL_DEFAULTS[0]
else
@@ -216,7 +216,7 @@ module Tmuxinator
def show_continuation_prompt
say
print "Press ENTER to continue."
STDIN.getc
$stdin.getc
end
def kill_project(project)

View File

@@ -20,7 +20,7 @@ module Tmuxinator
end
def home
ENV["HOME"] + "/.tmuxinator"
"#{ENV['HOME']}/.tmuxinator"
end
def home?
@@ -31,7 +31,9 @@ module Tmuxinator
# a custom value. (e.g. if $XDG_CONFIG_HOME is set to ~/my-config, the
# return value will be ~/my-config/tmuxinator)
def xdg
XDG["CONFIG"].to_s + "/tmuxinator"
xdg_config_directory = ENV.fetch("XDG_CONFIG_HOME", "~/.config")
config_home = File.expand_path(xdg_config_directory)
File.join(config_home, "tmuxinator")
end
def xdg?
@@ -203,7 +205,7 @@ module Tmuxinator
name = options[:name]
options[:force_attach] ||= false
options[:force_detach] ||= false
project_config = options.fetch(:project_config) { false }
project_config = options.fetch(:project_config, false)
project_file = if valid_project_config?(project_config)
project_config
elsif valid_local_project?(name)

View File

@@ -36,11 +36,8 @@ module Tmuxinator
`on_project_exit`) and will be removed in a future release.
M
attr_reader :yaml
attr_reader :force_attach
attr_reader :force_detach
attr_reader :custom_name
attr_reader :no_pre_window
attr_reader :yaml, :force_attach, :force_detach, :custom_name,
:no_pre_window
class << self
include Tmuxinator::Util
@@ -53,8 +50,8 @@ module Tmuxinator
content = render_template(path, binding)
YAML.safe_load(content, aliases: true)
rescue SyntaxError, StandardError => error
raise "Failed to parse config file: #{error.message}"
rescue SyntaxError, StandardError => e
raise "Failed to parse config file: #{e.message}"
end
new(yaml, options)
@@ -171,13 +168,8 @@ module Tmuxinator
end
def attach?
yaml_attach = if yaml["attach"].nil?
true
else
yaml["attach"]
end
attach = force_attach || !force_detach && yaml_attach
attach
yaml_attach = yaml["attach"].nil? || yaml["attach"]
force_attach || !force_detach && yaml_attach
end
def pre_window
@@ -413,17 +405,16 @@ module Tmuxinator
def pane_title_position_not_valid_warning
print_warning(
"The specified pane title position " +
"\"#{yaml['pane_title_position']}\" is not valid. " +
"Please choose one of: top, bottom, or off."
"The specified pane title position '#{yaml['pane_title_position']}' " \
"is not valid. Please choose one of: top, bottom, or off."
)
end
def pane_titles_not_supported_warning
print_warning(
"You have enabled pane titles in your configuration, " +
"but the feature is not supported by your version of tmux.\n" +
"Please consider upgrading to a version that supports it (tmux >=2.6)."
"You have enabled pane titles in your configuration, but the " \
"feature is not supported by your version of tmux.\nPlease consider " \
"upgrading to a version that supports it (tmux >=2.6)."
)
end

View File

@@ -29,7 +29,7 @@ module Tmuxinator
end
def layout
yaml["layout"] ? yaml["layout"].shellescape : nil
yaml["layout"]&.shellescape
end
def synchronize
@@ -139,7 +139,7 @@ module Tmuxinator
end
def synchronize_before?
synchronize == true || synchronize == "before"
[true, "before"].include?(synchronize)
end
def synchronize_after?

View File

@@ -924,7 +924,7 @@ describe Tmuxinator::Cli do
end
it "should generate a project file" do
new_path = described_class.new.find_project_file(name, false)
new_path = described_class.new.find_project_file(name, local: false)
expect(new_path).to eq path
expect(File).to exist new_path
end
@@ -946,7 +946,7 @@ describe Tmuxinator::Cli do
end
it "should _not_ generate a new project file" do
new_path = described_class.new.find_project_file(name, false)
new_path = described_class.new.find_project_file(name, local: false)
expect(new_path).to eq path
expect(File).to exist new_path
expect(File.read(new_path)).to match %r{#{extra}}

View File

@@ -55,7 +55,8 @@ describe Tmuxinator::Config do
Dir.mktmpdir do |dir|
config_parent = "#{dir}/non_existent_parent/s"
allow(XDG).to receive(:[]).with("CONFIG").and_return config_parent
allow(ENV).to receive(:fetch).with("XDG_CONFIG_HOME", "~/.config").
and_return config_parent
expect(described_class.directory).
to eq "#{config_parent}/tmuxinator"
expect(File.directory?("#{config_parent}/tmuxinator")).to be true
@@ -69,7 +70,6 @@ describe Tmuxinator::Config do
it "is $TMUXINATOR_CONFIG" do
allow(ENV).to receive(:[]).with("TMUXINATOR_CONFIG").
and_return "expected"
# allow(XDG).to receive(:[]).with("CONFIG").and_return "expected"
allow(File).to receive(:directory?).and_return true
expect(described_class.environment).to eq "expected"
end
@@ -87,7 +87,6 @@ describe Tmuxinator::Config do
context "environment variable $TMUXINATOR_CONFIG is set and empty" do
it "is an empty string" do
allow(XDG).to receive(:[]).with("CONFIG").and_return ""
allow(ENV).to receive(:[]).with("TMUXINATOR_CONFIG").and_return ""
expect(described_class.environment).to eq ""
end
@@ -136,7 +135,7 @@ describe Tmuxinator::Config do
describe "#xdg" do
it "is $XDG_CONFIG_HOME/tmuxinator" do
expect(described_class.xdg).to eq "#{XDG['CONFIG_HOME']}/tmuxinator"
expect(described_class.xdg).to eq File.expand_path("~/.config/tmuxinator")
end
end
@@ -181,7 +180,8 @@ describe Tmuxinator::Config do
before do
expect(Tmuxinator::Doctor).to receive(:installed?).and_return(true)
allow_any_instance_of(Kernel).to receive(:`).with(/tmux\s\-V/).
allow_any_instance_of(Kernel).to receive(:`).
with(/tmux\s-V/).
and_return("tmux #{version}")
end

View File

@@ -12,7 +12,7 @@ describe Tmuxinator::WemuxSupport do
it "renders the template" do
expect(File).to receive(:read).at_least(:once) { "wemux ls 2>/dev/null" }
expect(instance.render).to match %r{wemux.ls.2>\/dev\/null}
expect(instance.render).to match %r{wemux.ls.2>/dev/null}
end
end

View File

@@ -2,7 +2,6 @@
require "pry"
require "simplecov"
require "xdg"
SimpleCov.start do
if ENV["CI"]
@@ -59,11 +58,11 @@ def tmux_config(options = {})
"bell-on-alert off",
]
if base_index = options.fetch(:base_index) { 1 }
if base_index = options.fetch(:base_index, 1)
standard_options << "base-index #{base_index}"
end
if pane_base_index = options.fetch(:pane_base_index) { 1 }
if pane_base_index = options.fetch(:pane_base_index, 1)
standard_options << "pane-base-index #{pane_base_index}"
end

View File

@@ -37,22 +37,18 @@ Gem::Specification.new do |s|
__________________________________________________________
}
s.required_rubygems_version = ">= 1.8.23"
s.required_ruby_version = ">= 2.6.7"
s.required_rubygems_version = Gem::Requirement.new(">= 2.7")
s.required_ruby_version = ">= 2.7"
s.add_dependency "erubi", "~> 1.7"
s.add_dependency "thor", "~> 1.3.0"
s.add_dependency "xdg", "~> 2.2", ">= 2.2.5"
s.add_dependency "erubi", "~> 1.13"
s.add_dependency "thor", "~> 1.4.0"
s.add_development_dependency "awesome_print", "~> 1.9"
s.add_development_dependency "amazing_print", "~> 1.8"
s.add_development_dependency "bundler", ">= 1.3"
s.add_development_dependency "factory_bot", "~> 6.5"
s.add_development_dependency "pry", "~> 0.15"
s.add_development_dependency "rake", "~> 13.2"
s.add_development_dependency "rspec", "~> 3.3"
s.add_development_dependency "rubocop", "~> 0.61.1"
s.add_development_dependency "rake", "~> 13.3"
s.add_development_dependency "rspec", "~> 3.13"
s.add_development_dependency "rubocop", "~> 1.79"
s.add_development_dependency "simplecov", "~> 0.22"
# quiet "Gem.gunzip is deprecated" deprecation warning caused by rubocop
s.add_development_dependency "unicode-display_width", "~> 1.3"
end