From 992e6dce85d9a2a8445d51e88c90020b680aff3a Mon Sep 17 00:00:00 2001 From: Matthew Greenfield Date: Thu, 22 Aug 2024 21:58:35 -0700 Subject: [PATCH] Removes unused files. Adds common Gems. Fills out generic gemspec --- .github/workflows/main.yml | 27 +++++ .gitignore | 11 +++ .rspec | 3 + Gemfile | 35 +++++++ Gemfile.lock | 154 +++++++++++++++++++++++++++++ README.md | 0 bin/console | 11 +++ bin/setup | 8 ++ lib/ruby_project_template.rb | 6 ++ ruby-project-template.gemspec | 36 +++++++ spec/ruby_project_template_spec.rb | 11 +++ spec/spec_helper.rb | 15 +++ 12 files changed, 317 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 .gitignore create mode 100644 .rspec create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 README.md create mode 100755 bin/console create mode 100755 bin/setup create mode 100644 lib/ruby_project_template.rb create mode 100644 ruby-project-template.gemspec create mode 100644 spec/ruby_project_template_spec.rb create mode 100644 spec/spec_helper.rb diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9305476 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,27 @@ +name: Ruby + +on: + push: + branches: + - main + + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + name: Ruby ${{ matrix.ruby }} + strategy: + matrix: + ruby: + - '3.2.1' + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Run the default task + run: bundle exec rake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b04a8c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ + +# rspec failure tracking +.rspec_status diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..34c5164 --- /dev/null +++ b/.rspec @@ -0,0 +1,3 @@ +--format documentation +--color +--require spec_helper diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..28ff937 --- /dev/null +++ b/Gemfile @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' + +gemspec + +# General +gem 'activesupport' +gem 'amatch' +gem 'dotenv' +gem 'hashdiff' +gem 'highline' +gem 'logger' +gem 'nokogiri' +gem 'text' +gem 'zeitwerk' + +# OMG +gem 'omg-attrs' +gem 'omg-audit-group' +gem 'omg-thor-ext' + +# Debugging +gem 'pry-byebug' +gem 'pry-stack_explorer' +gem 'pry' + +# Testing +gem 'rspec' + +# CLI +gem 'thor' +gem 'tty-cursor' +gem 'tty-prompt' +gem 'tty-spinner' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..4c0be54 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,154 @@ +PATH + remote: . + specs: + ruby-project-template (0.1.0) + +GEM + remote: https://rubygems.org/ + specs: + activemodel (7.1.4) + activesupport (= 7.1.4) + activerecord (7.1.4) + activemodel (= 7.1.4) + activesupport (= 7.1.4) + timeout (>= 0.4.0) + activesupport (7.1.4) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + amatch (0.4.1) + mize + tins (~> 1.0) + audited (5.7.0) + activerecord (>= 5.2, < 8.0) + activesupport (>= 5.2, < 8.0) + base64 (0.2.0) + bigdecimal (3.1.8) + binding_of_caller (1.0.1) + debug_inspector (>= 1.2.0) + byebug (11.1.3) + coderay (1.1.3) + concurrent-ruby (1.3.4) + connection_pool (2.4.1) + debug_inspector (1.2.0) + diff-lcs (1.5.1) + dotenv (3.1.2) + drb (2.2.1) + hashdiff (1.1.1) + highline (3.1.0) + reline + i18n (1.14.5) + concurrent-ruby (~> 1.0) + io-console (0.7.2) + logger (1.6.0) + method_source (1.1.0) + minitest (5.25.1) + mize (0.6.0) + mutex_m (0.2.0) + nokogiri (1.16.7-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.7-arm-linux) + racc (~> 1.4) + nokogiri (1.16.7-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.7-x86-linux) + racc (~> 1.4) + nokogiri (1.16.7-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.7-x86_64-linux) + racc (~> 1.4) + omg-attrs (0.1.1) + omg-audit-group (0.1.4) + activerecord (>= 5.2, < 7.2) + audited (>= 4.9, < 6.0) + omg-thor-ext (0.1.0) + pastel (0.8.0) + tty-color (~> 0.5) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-byebug (3.10.1) + byebug (~> 11.0) + pry (>= 0.13, < 0.15) + pry-stack_explorer (0.6.1) + binding_of_caller (~> 1.0) + pry (~> 0.13) + racc (1.8.1) + reline (0.5.9) + io-console (~> 0.5) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) + sync (0.5.0) + text (1.3.1) + thor (1.3.1) + timeout (0.4.1) + tins (1.33.0) + bigdecimal + sync + tty-color (0.6.0) + tty-cursor (0.7.1) + tty-prompt (0.23.1) + pastel (~> 0.8) + tty-reader (~> 0.8) + tty-reader (0.9.0) + tty-cursor (~> 0.7) + tty-screen (~> 0.8) + wisper (~> 2.0) + tty-screen (0.8.2) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + wisper (2.0.1) + zeitwerk (2.6.17) + +PLATFORMS + aarch64-linux + arm-linux + arm64-darwin + x86-linux + x86_64-darwin + x86_64-linux + +DEPENDENCIES + activesupport + amatch + dotenv + hashdiff + highline + logger + nokogiri + omg-attrs + omg-audit-group + omg-thor-ext + pry + pry-byebug + pry-stack_explorer + rspec + ruby-project-template! + text + thor + tty-cursor + tty-prompt + tty-spinner + zeitwerk + +BUNDLED WITH + 2.5.17 diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..f10bcc8 --- /dev/null +++ b/bin/console @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require 'bundler/setup' +require 'ruby/project/template' + +# 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. + +require 'pry' +Pry.start(__FILE__) diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..dce67d8 --- /dev/null +++ b/bin/setup @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle install + +# Do any other automated setup that you need to do here diff --git a/lib/ruby_project_template.rb b/lib/ruby_project_template.rb new file mode 100644 index 0000000..5ef30bf --- /dev/null +++ b/lib/ruby_project_template.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +class RubyProjectTemplate + VERSION = '0.1.0' +end + diff --git a/ruby-project-template.gemspec b/ruby-project-template.gemspec new file mode 100644 index 0000000..49b76f8 --- /dev/null +++ b/ruby-project-template.gemspec @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +require_relative 'lib/ruby_project_template' + +Gem::Specification.new do |spec| + spec.name = 'ruby-project-template' + spec.version = RubyProjectTemplate::VERSION + spec.authors = ['Matthew Greenfield'] + spec.email = ['mattgreenfield1@gmail.com'] + + spec.summary = 'SUMMARY HERE' + spec.description = 'DESCRIPTION HERE' + spec.homepage = 'https://github.com/omgreenfield/ruby_project_template' + spec.license = 'MIT' + spec.required_ruby_version = '>= 3.0.0' + + spec.metadata['homepage_uri'] = spec.homepage + spec.metadata['rubygems_mfa_required'] = 'true' + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + gemspec = File.basename(__FILE__) + spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls| + ls.readlines('\x0', chomp: true).reject do |f| + (f == gemspec) || + f.start_with?(*%w[bin/ spec/ .git .github Gemfile]) + end + end + spec.bindir = 'exe' + spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } + spec.require_paths = ['lib'] + + # spec.add_dependency 'example-gem', '~> 1.0' + + # guide at: https://bundler.io/guides/creating_gem.html +end diff --git a/spec/ruby_project_template_spec.rb b/spec/ruby_project_template_spec.rb new file mode 100644 index 0000000..edb5770 --- /dev/null +++ b/spec/ruby_project_template_spec.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +RSpec.describe Ruby::Project::Template do + it 'has a version number' do + expect(RubyProjectTemplate::VERSION).not_to be nil + end + + it 'does something useful' do + expect(false).to eq(true) + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..6b3a3ea --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require "ruby/project/template" + +RSpec.configure do |config| + # Enable flags like --only-failures and --next-failure + config.example_status_persistence_file_path = ".rspec_status" + + # Disable RSpec exposing methods globally on `Module` and `main` + config.disable_monkey_patching! + + config.expect_with :rspec do |c| + c.syntax = :expect + end +end