From 441455e4447119ce7bc2e936599a93cfd71fd154 Mon Sep 17 00:00:00 2001 From: Ben Fairless Date: Wed, 12 Aug 2026 09:52:48 +0800 Subject: [PATCH 1/2] Fill in gem metadata and refresh README The gem had an empty homepage on rubygems.org and no metadata URIs, so the rubygems.org page linked to nothing useful. - Set homepage and homepage_uri/source_code_uri/bug_tracker_uri/ changelog_uri metadata pointing at this repository - Require MFA for manual pushes to RubyGems (rubygems_mfa_required=true) and drop the RuboCop todo entry that was excusing its absence - Give the gem an accurate summary and description that mention morph.io and what the CLI actually does - Add a CHANGELOG.md (Keep a Changelog format) covering the unreleased modernisation work - Rewrite the README: working badges, accurate supported Ruby (>= 3.3), install/usage including where the API key is stored, development instructions, contributing section pointing at the OpenAustralia Foundation contributing guide, and a license section Assisted-by: opencode/anthropic.claude-fable-5 Signed-off-by: Ben Fairless --- .rubocop_todo.yml | 6 ----- CHANGELOG.md | 31 ++++++++++++++++++++++++ README.md | 60 +++++++++++++++++++++++++++++++++-------------- morph-cli.gemspec | 16 ++++++++++--- 4 files changed, 87 insertions(+), 26 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 1df5f74..06896ae 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,12 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Gemspec/RequireMFA: - Exclude: - - 'morph-cli.gemspec' - # Offense count: 8 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8d34b13 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,31 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Changed + +- Require Ruby 3.3 or later (was Ruby 2.7) +- Replace unmaintained `rest-client` with `faraday` + `faraday-multipart` +- Replace unmaintained `archive-tar-minitar` with `minitar` 1.x +- Write the upload tarball to a temporary file instead of the shared `/tmp/out` path +- Load `~/.morph` config with safe YAML loading +- Fill in gem metadata: homepage, source code, bug tracker and changelog URIs; require + MFA for manual pushes to RubyGems + +### Added + +- SimpleCov coverage reporting and a much expanded test suite (CLI and HTTP behaviour + tested with WebMock, no network access in tests) + +## [0.2.5] and earlier + +No changelog was kept for releases up to and including 0.2.5. See the +[commit history](https://github.com/openaustralia/morph-cli/commits/main) for details. + +[Unreleased]: https://github.com/openaustralia/morph-cli/compare/v0.2.5...HEAD +[0.2.5]: https://github.com/openaustralia/morph-cli/releases/tag/v0.2.5 diff --git a/README.md b/README.md index d05caa9..7cd6051 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,67 @@ -[![Gem Version](https://badge.fury.io/rb/morph-cli.png)](http://badge.fury.io/rb/morph-cli) +[![Gem Version](https://img.shields.io/gem/v/morph-cli)](https://rubygems.org/gems/morph-cli) [![CI](https://github.com/openaustralia/morph-cli/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/openaustralia/morph-cli/actions/workflows/ci.yml) -# Morph Commandline +# Morph CLI -Runs Morph scrapers from the commandline. +Runs [morph.io](https://morph.io) scrapers from the command line. -Actually it will run them on the Morph server identically to the real thing. That means not installing a bucket load of libraries -and bits and bobs that are already installed with the Morph scraper environments. +Actually it will run them on the morph.io server identically to the real thing. +That means not installing a bucket load of libraries and bits and bobs that are +already installed with the morph.io scraper environments. -To run a scraper in your local directory +## Installation + +You'll need Ruby 3.3 or later. Then + + gem install morph-cli + +## Usage + +To run the scraper in your current directory morph Yup, that's it. -It runs the code that's there right now. It doesn't need to be checked into git or anything. +It runs the code that's there right now. It doesn't need to be checked into git +or anything. + +The first time you run it, it will ask for your morph.io API key, which it +saves in `~/.morph`. For help morph help -## Installation +## Limitations -You'll need Ruby >= 1.9 and then +It uploads your code every time. So if it's big it might take a little while. +Scrapers are not usually so I'm hoping this won't really be an issue. - gem install morph-cli +It doesn't yet return you the resulting sqlite database (or use the one you +might have locally). -## Limitations +## Development -It uploads your code everytime. So if it's big it might take a little while. Scrapers are not usually so I'm hoping this won't really be an issue +After checking out the repo, run `bundle install` to install dependencies. +Then run the tests with -It doesn't yet return you the resulting sqlite database (or use the one you might have locally) + bundle exec rspec ## Contributing +Contributions are welcome! Please see the +[OpenAustralia Foundation contributing guide](https://github.com/openaustralia/.github/blob/main/.github/CONTRIBUTING.md) +for how we work: GitHub Flow, draft pull requests, signed-off commits (DCO) +and our contributor licence agreement. + 1. Fork it -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create new Pull Request +2. Create your feature branch (`git checkout -b feature/my-new-feature`) +3. Commit your changes (`git commit -s -am 'Add some feature'`) +4. Push to the branch (`git push origin feature/my-new-feature`) +5. Create a new pull request + +## License + +The gem is available as open source under the terms of the +[MIT License](LICENSE.txt). diff --git a/morph-cli.gemspec b/morph-cli.gemspec index 11ad1ca..0b76826 100644 --- a/morph-cli.gemspec +++ b/morph-cli.gemspec @@ -7,13 +7,23 @@ Gem::Specification.new do |spec| spec.version = MorphCLI::VERSION spec.authors = ["Matthew Landauer"] spec.email = ["matthew@oaf.org.au"] - spec.description = "Command line interface for Morph" - spec.summary = "Command line interface for Morph" - spec.homepage = "" + spec.summary = "Run morph.io scrapers from the command line" + spec.description = "Command line interface for morph.io. Uploads the scraper in the " \ + "current directory to a morph.io server, runs it there and streams " \ + "the output back to your terminal." + spec.homepage = "https://github.com/openaustralia/morph-cli" spec.license = "MIT" spec.required_ruby_version = ">= 3.2" + spec.metadata = { + "homepage_uri" => "https://github.com/openaustralia/morph-cli", + "source_code_uri" => "https://github.com/openaustralia/morph-cli", + "bug_tracker_uri" => "https://github.com/openaustralia/morph-cli/issues", + "changelog_uri" => "https://github.com/openaustralia/morph-cli/blob/main/CHANGELOG.md", + "rubygems_mfa_required" => "true" + } + spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) spec.executables = %w[morph] spec.require_paths = ["lib"] From 7f0fa5664de3de0b9ec4729a6569f2afeb5f1fd8 Mon Sep 17 00:00:00 2001 From: Ben Fairless Date: Wed, 12 Aug 2026 11:51:19 +0800 Subject: [PATCH 2/2] Update README Ruby requirement to 3.2 Assisted-by: Claude Code:anthropic.claude-fable-5 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7cd6051..1130113 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ already installed with the morph.io scraper environments. ## Installation -You'll need Ruby 3.3 or later. Then +You'll need Ruby 3.2 or later. Then gem install morph-cli