From bb10e1cf501aa2b7e953610248a4f4e7c9900af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Sat, 26 Oct 2024 13:29:02 +0200 Subject: [PATCH] Bump version and fix version in specs. --- shard.yml | 2 +- spec/mint_json/mint_version_mismatch | 2 +- spec/spec_helper.cr | 6 ++++++ spec/version_spec.cr | 9 --------- spec_cli/version_spec.cr | 2 +- src/commands/version.cr | 2 +- src/mint_json/mint_version.cr | 4 ++-- src/version.cr | 4 +++- 8 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 spec/version_spec.cr diff --git a/shard.yml b/shard.yml index b04fca793..9449b2a68 100644 --- a/shard.yml +++ b/shard.yml @@ -1,6 +1,6 @@ name: mint -version: 0.20.0-alpha.3 +version: 0.20.0-rc.1 license: BSD-3-Clause crystal: ~> 1.7 diff --git a/spec/mint_json/mint_version_mismatch b/spec/mint_json/mint_version_mismatch index 2a83757d4..51f010b1f 100644 --- a/spec/mint_json/mint_version_mismatch +++ b/spec/mint_json/mint_version_mismatch @@ -12,7 +12,7 @@ I was looking for but found instead: - 0.20.0-alpha.3 + 99.99.99 It is here: diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr index c44c6d5cd..1cc4144fd 100644 --- a/spec/spec_helper.cr +++ b/spec/spec_helper.cr @@ -6,6 +6,12 @@ MINT_ENV["TEST"] = "TRUE" require "./spec_helpers" require "../src/all" +module Mint + def self.version + "99.99.99" + end +end + # Mock things class Mint::Installer::Repository @terminal = Render::Terminal.new diff --git a/spec/version_spec.cr b/spec/version_spec.cr deleted file mode 100644 index 563d09ec5..000000000 --- a/spec/version_spec.cr +++ /dev/null @@ -1,9 +0,0 @@ -require "yaml" -require "./spec_helper" - -describe Mint::VERSION do - it "should match shard.yml" do - version = YAML.parse(File.read(Path[__DIR__, "..", "shard.yml"]))["version"].as_s - version.should eq Mint::VERSION - end -end diff --git a/spec_cli/version_spec.cr b/spec_cli/version_spec.cr index 45b4c964e..a5bbec72d 100644 --- a/spec_cli/version_spec.cr +++ b/spec_cli/version_spec.cr @@ -2,7 +2,7 @@ require "./spec_helper" context "Version" do it "prints the version" do - expect_output ["version"], "Mint #{Mint::VERSION}" + expect_output ["version"], "Mint #{Mint.version}" end it "prints the help" do diff --git a/src/commands/version.cr b/src/commands/version.cr index ca9e795c8..310d2a87d 100644 --- a/src/commands/version.cr +++ b/src/commands/version.cr @@ -6,7 +6,7 @@ module Mint define_help description: "Shows version." def run - terminal.puts "Mint #{Mint::VERSION}" + terminal.puts "Mint #{Mint.version}" end end end diff --git a/src/mint_json/mint_version.cr b/src/mint_json/mint_version.cr index 6d3eefcf3..8e5541018 100644 --- a/src/mint_json/mint_version.cr +++ b/src/mint_json/mint_version.cr @@ -34,7 +34,7 @@ module Mint end unless constraint resolved = - Installer::Semver.parse(VERSION.rchop("-devel")) + Installer::Semver.parse(Mint.version.rchop("-devel")) error! :mint_version_mismatch do block do @@ -44,7 +44,7 @@ module Mint end snippet "I was looking for", constraint.to_s - snippet "but found instead:", VERSION + snippet "but found instead:", Mint.version snippet "It is here:", snippet_data(location) end unless resolved < constraint.upper && resolved >= constraint.lower diff --git a/src/version.cr b/src/version.cr index 91bd7f83a..007cbf333 100644 --- a/src/version.cr +++ b/src/version.cr @@ -1,3 +1,5 @@ module Mint - VERSION = {{ `shards version "#{__DIR__}"`.chomp.stringify }} + def self.version + {{ `shards version "#{__DIR__}"`.chomp.stringify }} + end end