diff --git a/CHANGELOG.md b/CHANGELOG.md index 70af5df..970dc01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - No unreleased changes! +## [0.2.8] +### Changed +- Updated the aoc command to self-heal the `bin/aoc` stub with the expected `AocRb::App.start` command ([#32](https://github.com/pacso/aoc_rb/pull/32) by [@pacso](https://github.com/pacso)) + ## [0.2.7] ### Added - Version command, which outputs the installed version of the gem ([#30](https://github.com/pacso/aoc_rb/pull/30) by [@pacso](https://github.com/pacso)) @@ -66,7 +70,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Initial release. -[Unreleased]: https://github.com/pacso/aoc_rb/compare/v0.2.7...HEAD +[Unreleased]: https://github.com/pacso/aoc_rb/compare/v0.2.8...HEAD +[0.2.8]: https://github.com/pacso/aoc_rb/compare/v0.2.7...v0.2.8 [0.2.7]: https://github.com/pacso/aoc_rb/compare/v0.2.6...v0.2.7 [0.2.6]: https://github.com/pacso/aoc_rb/compare/v0.2.5...v0.2.6 [0.2.5]: https://github.com/pacso/aoc_rb/compare/v0.2.4...v0.2.5 diff --git a/aoc_rb.gemspec b/aoc_rb.gemspec index 35b6d1c..845ed80 100644 --- a/aoc_rb.gemspec +++ b/aoc_rb.gemspec @@ -13,7 +13,6 @@ Gem::Specification.new do |spec| spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0") spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = "https://github.com/pacso/aoc_rb" spec.metadata["changelog_uri"] = "https://github.com/pacso/aoc_rb/blob/main/CHANGELOG" # Specify which files should be added to the gem when it is released. diff --git a/lib/aoc_rb/app.rb b/lib/aoc_rb/app.rb index f333b65..c00dbff 100644 --- a/lib/aoc_rb/app.rb +++ b/lib/aoc_rb/app.rb @@ -27,6 +27,24 @@ end end +def ensure_aoc_start_in_bin + bin_path = File.join(Dir.pwd, 'bin/aoc') + + return unless File.exist?(bin_path) + + unless File.read(bin_path).include?('AocRb::App.start') + puts "Adding missing `AocRb::App.start` line to `bin/aoc`..." + + File.open(bin_path, 'a') do |file| + file.puts "\nAocRb::App.start\n" + end + + puts "`AocRb::App.start` has been added to `bin/aoc`.\n\nPlease re-run your aoc command." + end +end + +ensure_aoc_start_in_bin + module AocRb class App < Thor def self.exit_on_failure? diff --git a/lib/aoc_rb/version.rb b/lib/aoc_rb/version.rb index 0f6448f..36529d9 100644 --- a/lib/aoc_rb/version.rb +++ b/lib/aoc_rb/version.rb @@ -1,3 +1,3 @@ module AocRb - VERSION = "0.2.7" + VERSION = "0.2.8" end diff --git a/spec/lib/aoc_rb_spec.rb b/spec/lib/aoc_rb_spec.rb index d03b5fa..194c28d 100644 --- a/spec/lib/aoc_rb_spec.rb +++ b/spec/lib/aoc_rb_spec.rb @@ -4,6 +4,6 @@ RSpec.describe AocRb do it "has the expected version number" do - expect(AocRb::VERSION).to eq "0.2.7" + expect(AocRb::VERSION).to eq "0.2.8" end end