Skip to content

Commit

Permalink
Set up project
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbrictson committed Jul 8, 2024
1 parent e4ce1cd commit ca3276b
Show file tree
Hide file tree
Showing 21 changed files with 79 additions and 356 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Release notes for this project are kept here: https://github.com/mattbrictson/gem/releases
Release notes for this project are kept here: https://github.com/mattbrictson/bundle_update_interactive/releases
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ This Code of Conduct applies within all community spaces, and also applies when

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at owner@example.com. All complaints will be reviewed and investigated promptly and fairly.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at opensource@mattbrictson.com. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2024 Example Owner
Copyright (c) 2024 Matt Brictson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 8 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@
# gem template
# bundle_update_interactive

This is a GitHub template for creating Ruby gems. Press [**Use this template**](https://github.com/mattbrictson/gem/generate) to generate a project from this template. In the generated project, run this script to rename the gem to meet your needs:

```
ruby rename_template.rb
```

Note that to get the full benefits of the script, you will need the [gh](https://github.com/cli/cli) command installed.

This template is based on `bundle gem` with some notable improvements:

- GitHub Actions configuration
- Minitest, with minitest-rg for nicely formatted test output
- Rubocop with a good set of configuration
- CLI scaffolding, built on top of Thor (optional; for more background, read [Fixing Thor’s CLI Quirks](https://mattbrictson.com/blog/fixing-thor-cli-behavior))
- [release-drafter](https://github.com/apps/release-drafter) GitHub Action for automating release notes
- A `rake bump` task to keep your Ruby and Bundler dependencies up to date
- A nice README with badges ready to go (see below)

---

<!-- END FRONT MATTER -->

# example

[![Gem Version](https://img.shields.io/gem/v/replace_with_gem_name)](https://rubygems.org/gems/replace_with_gem_name)
[![Gem Downloads](https://img.shields.io/gem/dt/replace_with_gem_name)](https://www.ruby-toolbox.com/projects/replace_with_gem_name)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mattbrictson/gem/ci.yml)](https://github.com/mattbrictson/gem/actions/workflows/ci.yml)
[![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/mattbrictson/gem)](https://codeclimate.com/github/mattbrictson/gem)
[![Gem Version](https://img.shields.io/gem/v/bundle_update_interactive)](https://rubygems.org/gems/bundle_update_interactive)
[![Gem Downloads](https://img.shields.io/gem/dt/bundle_update_interactive)](https://www.ruby-toolbox.com/projects/bundle_update_interactive)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mattbrictson/bundle_update_interactive/ci.yml)](https://github.com/mattbrictson/bundle_update_interactive/actions/workflows/ci.yml)
[![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/mattbrictson/bundle_update_interactive)](https://codeclimate.com/github/mattbrictson/bundle_update_interactive)

TODO: Description of this gem goes here.

Expand All @@ -42,16 +18,16 @@ TODO: Description of this gem goes here.
## Quick start

```
gem install example
gem install bundle_update_interactive
```

```ruby
require "example"
require "bundle_update_interactive"
```

## Support

If you want to report a bug, or have ideas, feedback or questions about the gem, [let me know via GitHub issues](https://github.com/mattbrictson/gem/issues/new) and I will do my best to provide a helpful answer. Happy hacking!
If you want to report a bug, or have ideas, feedback or questions about the gem, [let me know via GitHub issues](https://github.com/mattbrictson/bundle_update_interactive/issues/new) and I will do my best to provide a helpful answer. Happy hacking!

## License

Expand Down
8 changes: 4 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ task default: %i[test rubocop]

Rake::Task["release"].enhance do
puts "Don't forget to publish the release on GitHub!"
system "open https://github.com/mattbrictson/gem/releases"
system "open https://github.com/mattbrictson/bundle_update_interactive/releases"
end

task :disable_overcommit do
Expand All @@ -27,13 +27,13 @@ Rake::Task[:build].enhance [:disable_overcommit]

task :verify_gemspec_files do
git_files = `git ls-files -z`.split("\x0")
gemspec_files = Gem::Specification.load("example.gemspec").files.sort
gemspec_files = Gem::Specification.load("bundle_update_interactive.gemspec").files.sort
ignored_by_git = gemspec_files - git_files
next if ignored_by_git.empty?

raise <<~ERROR
The `spec.files` specified in example.gemspec include the following files
The `spec.files` specified in bundle_update_interactive.gemspec include the following files
that are being ignored by git. Did you forget to add them to the repo? If
not, you may need to delete these files or modify the gemspec to ensure
that they are not included in the gem by mistake:
Expand All @@ -55,7 +55,7 @@ namespace :bump do
end

task :ruby do
replace_in_file "example.gemspec", /ruby_version = .*">= (.*)"/ => RubyVersions.lowest
replace_in_file "bundle_update_interactive.gemspec", /ruby_version = .*">= (.*)"/ => RubyVersions.lowest
replace_in_file ".rubocop.yml", /TargetRubyVersion: (.*)/ => RubyVersions.lowest
replace_in_file ".github/workflows/ci.yml", /ruby: (\[.+\])/ => RubyVersions.all.inspect
end
Expand Down
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby

require "bundler/setup"
require "example"
require "bundle_update_interactive"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
Expand Down
30 changes: 30 additions & 0 deletions bundle_update_interactive.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require_relative "lib/bundle_update_interactive/version"

Gem::Specification.new do |spec|
spec.name = "bundle_update_interactive"
spec.version = BundleUpdateInteractive::VERSION
spec.authors = ["Matt Brictson"]
spec.email = ["opensource@mattbrictson.com"]

spec.summary = "TODO"
spec.homepage = "https://github.com/mattbrictson/bundle_update_interactive"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.1"

spec.metadata = {
"bug_tracker_uri" => "https://github.com/mattbrictson/bundle_update_interactive/issues",
"changelog_uri" => "https://github.com/mattbrictson/bundle_update_interactive/releases",
"source_code_uri" => "https://github.com/mattbrictson/bundle_update_interactive",
"homepage_uri" => spec.homepage,
"rubygems_mfa_required" => "true"
}

# Specify which files should be added to the gem when it is released.
spec.files = Dir.glob(%w[LICENSE.txt README.md {exe,lib}/**/*]).reject { |f| File.directory?(f) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

# Runtime dependencies
spec.add_dependency "thor", "~> 1.2"
end
30 changes: 0 additions & 30 deletions example.gemspec

This file was deleted.

4 changes: 4 additions & 0 deletions exe/bundle_update_interactive
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby

require "bundle_update_interactive"
BundleUpdateInteractive::CLI.start(ARGV)
4 changes: 0 additions & 4 deletions exe/example

This file was deleted.

5 changes: 5 additions & 0 deletions lib/bundle_update_interactive.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module BundleUpdateInteractive
autoload :CLI, "bundle_update_interactive/cli"
autoload :VERSION, "bundle_update_interactive/version"
autoload :ThorExt, "bundle_update_interactive/thor_ext"
end
14 changes: 14 additions & 0 deletions lib/bundle_update_interactive/cli.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require "thor"

module BundleUpdateInteractive
class CLI < Thor
extend ThorExt::Start

map %w[-v --version] => "version"

desc "version", "Display bundle_update_interactive version", hide: true
def version
say "bundle_update_interactive/#{VERSION} #{RUBY_DESCRIPTION}"
end
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Example
module BundleUpdateInteractive
module ThorExt
# Configures Thor to behave more like a typical CLI, with better help and error handling.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Example
module BundleUpdateInteractive
VERSION = "0.1.0".freeze
end
5 changes: 0 additions & 5 deletions lib/example.rb

This file was deleted.

14 changes: 0 additions & 14 deletions lib/example/cli.rb

This file was deleted.

Loading

0 comments on commit ca3276b

Please sign in to comment.