tic_tac_toe_magnus 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 109f8ef723f3e3e918965b8c610cd0abdd6d6c58371a64e906343dbfef366315
4
- data.tar.gz: 78a4641c8683ef822cd6557ae7f70f9efb8af720109eaf711d25893b08bb6611
3
+ metadata.gz: f9b852f256c4105c34dceda8ae194ea1931426a95b0d2677c395ed36fad287be
4
+ data.tar.gz: f755768f499d24b9450997879bbbf83c94b3a6de9ef17e7ae668b4c8903bd7e3
5
5
  SHA512:
6
- metadata.gz: 6c5254e99d18412bdb42e1b38b08c654a65e08b67cf724e864d7dc4204fdd0064f73bf039b302dbbbaf7e3bb8d7c67e57ced92164ee31082ddb1046b1e025624
7
- data.tar.gz: b14e10f0b2f016b189f8ee3fc7ff7089fe0d69ca818212d6e07f889015b945e6c358a30be91e9dace2d331da138c7432a6a19befd5fb2be46930ac4107dfa982
6
+ metadata.gz: 6b417148ad6c815e90630043e47c00e9bb80f451a92ca22da84fb65d28c41e8766c40b3317b7263551a01a5030222b99b432e60039fe80e578520880ee2c7ad4
7
+ data.tar.gz: 033a5302afd9c865e5e2456fe625c385187ca05bd2360999f83e3b833573a4ddd41d00c1f65e79da455c7708aefede4402129fc7238087514a28c444e9393cf3
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # tic-tac-toe-magnus-rb 🦀💎
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/tic_tac_toe_magnus.svg)](https://rubygems.org/gems/tic_tac_toe_magnus)
4
+ [![CI](https://github.com/kisp/tic-tac-toe-magnus-rb/actions/workflows/ci.yml/badge.svg)](https://github.com/kisp/tic-tac-toe-magnus-rb/actions/workflows/ci.yml)
5
+ [![Nix](https://github.com/kisp/tic-tac-toe-magnus-rb/actions/workflows/nix.yml/badge.svg)](https://github.com/kisp/tic-tac-toe-magnus-rb/actions/workflows/nix.yml)
6
+
3
7
  A Tic Tac Toe game engine with a **Rust core** and a clean **Ruby API**,
4
8
  packaged with **Nix**.
5
9
 
@@ -18,9 +22,11 @@ Exists mostly to practice Ruby + Rust gem packaging with Nix.
18
22
 
19
23
  - [What's inside](#whats-inside)
20
24
  - [Getting started](#getting-started)
25
+ - [Install the gem](#install-the-gem)
21
26
  - [With Nix (recommended)](#with-nix-recommended)
22
27
  - [Without Nix](#without-nix)
23
28
  - [Try it in the REPL](#try-it-in-the-repl)
29
+ - [Releasing a new version](#releasing-a-new-version)
24
30
  - [Nix architecture](#nix-architecture)
25
31
  - [Vendoring Cargo dependencies](#vendoring-cargo-dependencies)
26
32
  - [Gem pinning with bundix](#gem-pinning-with-bundix)
@@ -46,6 +52,12 @@ Exists mostly to practice Ruby + Rust gem packaging with Nix.
46
52
 
47
53
  ## Getting started
48
54
 
55
+ ### Install the gem
56
+
57
+ ```sh
58
+ gem install tic_tac_toe_magnus
59
+ ```
60
+
49
61
  ### With Nix (recommended)
50
62
 
51
63
  ```sh
@@ -123,6 +135,26 @@ irb(main):007> exit
123
135
 
124
136
  ---
125
137
 
138
+ ## Releasing a new version
139
+
140
+ A single Rake task bumps the version, commits, tags, builds the gem, and
141
+ prints the `gem push` command so you can review before publishing:
142
+
143
+ ```sh
144
+ bundle exec rake release # patch bump (e.g. 0.1.0 → 0.1.1)
145
+ bundle exec rake release[minor] # minor bump (e.g. 0.1.0 → 0.2.0)
146
+ bundle exec rake release[major] # major bump (e.g. 0.1.0 → 1.0.0)
147
+ ```
148
+
149
+ The task will:
150
+
151
+ 1. Increment the version in `lib/tictactoe/version.rb`.
152
+ 2. Create a git commit (`Bump version to X.Y.Z`) and an annotated tag (`vX.Y.Z`).
153
+ 3. Build the gem (`tic_tac_toe_magnus-X.Y.Z.gem`).
154
+ 4. Print the exact `gem push` command to publish it.
155
+
156
+ ---
157
+
126
158
  ## Nix architecture
127
159
 
128
160
  ```
data/Rakefile CHANGED
@@ -26,3 +26,64 @@ desc "Launch IRB with the gem loaded and ready to use"
26
26
  task irb: :compile do
27
27
  exec "irb -I lib -r tictactoe"
28
28
  end
29
+
30
+ # ---------------------------------------------------------------------------
31
+ # Release helpers
32
+ # ---------------------------------------------------------------------------
33
+
34
+ def current_version
35
+ require_relative "lib/tictactoe/version"
36
+ TicTacToe::VERSION
37
+ end
38
+
39
+ def bump_version(version, type)
40
+ major, minor, patch = version.split(".").map(&:to_i)
41
+ case type.to_sym
42
+ when :major then "#{major + 1}.0.0"
43
+ when :minor then "#{major}.#{minor + 1}.0"
44
+ when :patch then "#{major}.#{minor}.#{patch + 1}"
45
+ else raise ArgumentError, "Unknown bump type '#{type}'. Use major, minor, or patch."
46
+ end
47
+ end
48
+
49
+ desc <<~DESC
50
+ Bump version, commit, tag, build gem, and print the push command.
51
+
52
+ Usage:
53
+ bundle exec rake release # default: patch bump
54
+ bundle exec rake release[minor]
55
+ bundle exec rake release[major]
56
+ DESC
57
+ task :release, [:type] do |_, args|
58
+ type = args[:type] || "patch"
59
+ old_version = current_version
60
+ new_version = bump_version(old_version, type)
61
+
62
+ version_file = "lib/tictactoe/version.rb"
63
+ content = File.read(version_file)
64
+ updated = content.sub(/VERSION\s*=\s*"[^"]+"/, %(VERSION = "#{new_version}"))
65
+ if content == updated
66
+ raise "VERSION constant not found in #{version_file} — cannot update version"
67
+ end
68
+
69
+ File.write(version_file, updated)
70
+ puts "Bumped #{old_version} → #{new_version}"
71
+
72
+ sh "bundle lock"
73
+ sh "git add #{version_file}"
74
+ sh "git add Gemfile.lock"
75
+ sh %(git commit -m "Bump version to #{new_version}")
76
+ sh %(git tag -a "v#{new_version}" -m "Release v#{new_version}")
77
+
78
+ gemspec_file = File.basename(GEMSPEC.loaded_from)
79
+ sh "gem build #{gemspec_file}"
80
+
81
+ gem_file = "#{GEMSPEC.name}-#{new_version}.gem"
82
+ puts
83
+ puts "Gem built: #{gem_file}"
84
+ puts
85
+ puts "Push to RubyGems with:"
86
+ puts
87
+ puts " gem push #{gem_file}"
88
+ puts
89
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "tictactoe"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TicTacToe
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tic_tac_toe_magnus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kilian Sprotte
@@ -102,6 +102,7 @@ files:
102
102
  - ext/tictactoe/Cargo.toml
103
103
  - ext/tictactoe/extconf.rb
104
104
  - ext/tictactoe/src/lib.rs
105
+ - lib/tic_tac_toe_magnus.rb
105
106
  - lib/tictactoe.rb
106
107
  - lib/tictactoe/version.rb
107
108
  - tic_tac_toe_magnus.gemspec