Skip to content

Commit

Permalink
Added project skeleton
Browse files Browse the repository at this point in the history
Generated with link:https://alchemists.io/projects/gemsmith[Gemsmith] 20.3.0. In addition to what Gemsmith provides, manual tweaks had to be made as follows:

* The link:https://alchemists.io/projects/caliber[Caliber] gem was replaced with plain RuboCop support. The configuration is also inhertied from the Dry RB project instead. All style differences were auto-corrected by RuboCop.
* The `.gitignore` was updated to ignore RuboCop configuration caches due to the above use of RuboCop inheritance.
* Ruby version support was adjust from supporting only Ruby 3.2.2 to supporting Ruby 3.0.0 and higher.
* The license was switched to an MIT license.
* The RSpec formatter was switched to showing progress only.
* The gemspec label was switched to using only the gem name (no titleization).
  • Loading branch information
bkuhlmann committed Sep 28, 2023
1 parent dd6c6f5 commit 8e5b03c
Show file tree
Hide file tree
Showing 23 changed files with 281 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: hanami
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Overview
<!-- Required. Describe, briefly, the behavior experienced and desired. -->

## Screenshots/Screencasts
<!-- Optional. Attach screenshot(s) and/or screencast(s) that demo the behavior. -->

## Steps to Recreate
<!-- Required. List exact steps (numbered list) to reproduce errant behavior. -->

## Environment
<!-- Optional. What is your operating system, software version(s), etc. -->
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Overview
<!-- Required. Why is this important/necessary and what is the overarching architecture. -->

## Screenshots/Screencasts
<!-- Optional. Provide supporting image/video. -->

## Details
<!-- Optional. List the key features/highlights as bullet points. -->
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Continuous Integration

on: [push, pull_request]

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Rake
run: bundle exec rake

- name: Archive SimpleCov Report
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.gem
.bundle
.rubocop-https*
Gemfile.lock
pkg
tmp
7 changes: 7 additions & 0 deletions .reek.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exclude_paths:
- tmp
- vendor

detectors:
LongParameterList:
enabled: false
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
inherit_from:
- https://raw.githubusercontent.com/dry-rb/template-gem/main/.rubocop.yml
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.2.2
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Versions

## 0.0.0 (?)

* Pending...
28 changes: 28 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# frozen_string_literal: true

ruby File.read(".ruby-version").strip

source "https://rubygems.org"

gemspec

group :code_quality do
gem "git-lint", "~> 6.0"
gem "reek", "~> 6.1", require: false
gem "rubocop", "~> 1.56"
gem "simplecov", "~> 0.22", require: false
end

group :development do
gem "rake", "~> 13.0"
end

group :test do
gem "guard-rspec", "~> 4.7", require: false
gem "rspec", "~> 3.12"
end

group :tools do
gem "amazing_print", "~> 1.4"
gem "debug", "~> 1.8"
end
7 changes: 7 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

guard :rspec, cmd: "NO_COVERAGE=true bin/rspec --format documentation" do
watch %r{^spec/.+_spec\.rb$}
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch("spec/spec_helper.rb") { "spec" }
end
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2015-2023 dry-rb team

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
# dry-operation
<!--- this file is synced from dry-rb/template-gem project -->
[gem]: https://rubygems.org/gems/dry-operation
[actions]: https://github.com/dry-rb/dry-operation/actions

# dry-operation [![Gem Version](https://badge.fury.io/rb/dry-operation.svg)][gem] [![CI Status](https://github.com/dry-rb/dry-operation/workflows/ci/badge.svg)][actions]

## Links

* [User documentation](https://dry-rb.org/gems/dry-operation)
* [API documentation](http://rubydoc.info/gems/dry-operation)
* [Forum](https://discourse.dry-rb.org)

## Supported Ruby versions

This library officially supports the following Ruby versions:

* MRI `>= 3.0.0`
* jruby `>= 9.4` (not tested on CI)

## License

See `LICENSE` file.
17 changes: 17 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

require "bundler/setup"
require "git/lint/rake/register"
require "reek/rake/task"
require "rspec/core/rake_task"
require "rubocop/rake_task"

Git::Lint::Rake::Register.call
Reek::Rake::Task.new
RSpec::Core::RakeTask.new { |task| task.verbose = false }
RuboCop::RakeTask.new

desc "Run code quality checks"
task code_quality: %i[git_lint reek rubocop]

task default: %i[code_quality spec]
10 changes: 10 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
Bundler.require :tools

require "dry/operation"
require "irb"

IRB.start __FILE__
6 changes: 6 additions & 0 deletions bin/guard
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"

load Gem.bin_path "guard", "guard"
6 changes: 6 additions & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"

load Gem.bin_path "rake", "rake"
6 changes: 6 additions & 0 deletions bin/rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"

load Gem.bin_path "rspec-core", "rspec"
6 changes: 6 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"

load Gem.bin_path "rubocop", "rubocop"
6 changes: 6 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /usr/bin/env bash

set -euxo pipefail
IFS=$'\n\t'

bundle install
26 changes: 26 additions & 0 deletions dry-operation.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# frozen_string_literal: true

Gem::Specification.new do |spec|
spec.name = "dry-operation"
spec.version = "0.0.0"
spec.authors = ["Tim Riley", "Marc Busque", "Brooke Kuhlmann"]
spec.email = ["tim@riley.id.au", "marc@lamarciana.com", "brooke@alchemists.io"]
spec.homepage = "https://dry-rb.org/gems/dry-operation"
spec.summary = "A domain specific language for composable business transaction workflows."
spec.license = "MIT"

spec.metadata = {
"bug_tracker_uri" => "https://github.com/dry-rb/dry-operation/issues",
"changelog_uri" => "https://github.com/dry-rb/dry-operation/blob/main/CHANGELOG.md",
"documentation_uri" => "https://dry-rb.org/gems/dry-operation",
"funding_uri" => "https://github.com/sponsors/hanami",
"label" => "dry-operation",
"source_code_uri" => "https://github.com/dry-rb/dry-operation"
}

spec.required_ruby_version = ">= 3.0.0"
spec.add_dependency "zeitwerk", "~> 2.6"

spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
spec.files = Dir["*.gemspec", "lib/**/*"]
end
14 changes: 14 additions & 0 deletions lib/dry/operation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

require "zeitwerk"

Zeitwerk::Loader.new.then do |loader|
loader.push_dir "#{__dir__}/.."
loader.setup
end

module Dry
# Main namespace.
module Operation
end
end
39 changes: 39 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# frozen_string_literal: true

require "simplecov"

unless ENV["NO_COVERAGE"]
SimpleCov.start do
add_filter %r{^/spec/}
enable_coverage :branch
enable_coverage_for_eval
minimum_coverage_by_file line: 95, branch: 95
end
end

Bundler.require :tools

require "dry/operation"

SPEC_ROOT = Pathname(__dir__).realpath.freeze

RSpec.configure do |config|
config.color = true
config.disable_monkey_patching!
config.example_status_persistence_file_path = "./tmp/rspec-examples.txt"
config.filter_run_when_matching :focus
config.formatter = :progress
config.order = :random
config.shared_context_metadata_behavior = :apply_to_host_groups
config.warnings = true

config.expect_with :rspec do |expectations|
expectations.syntax = :expect
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end

config.mock_with :rspec do |mocks|
mocks.verify_doubled_constant_names = true
mocks.verify_partial_doubles = true
end
end

0 comments on commit 8e5b03c

Please sign in to comment.