Skip to content

Commit

Permalink
Bump version and fix version in specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign committed Oct 26, 2024
1 parent 42e9446 commit bb10e1c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/mint_json/mint_version_mismatch
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ I was looking for

but found instead:

0.20.0-alpha.3
99.99.99

It is here:

Expand Down
6 changes: 6 additions & 0 deletions spec/spec_helper.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions spec/version_spec.cr

This file was deleted.

2 changes: 1 addition & 1 deletion spec_cli/version_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/commands/version.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/mint_json/mint_version.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/version.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module Mint
VERSION = {{ `shards version "#{__DIR__}"`.chomp.stringify }}
def self.version
{{ `shards version "#{__DIR__}"`.chomp.stringify }}
end
end

0 comments on commit bb10e1c

Please sign in to comment.