diff --git a/.github/workflows/api_chai.yml b/.github/workflows/api_chai.yml new file mode 100644 index 00000000..5dd06c54 --- /dev/null +++ b/.github/workflows/api_chai.yml @@ -0,0 +1,12 @@ +name: api_chai + +on: + push: + +jobs: + ruby: + uses: powerhome/github-actions-workflows/.github/workflows/ruby-gem.yml@main + with: + package: ${{ github.workflow }} + workdir: "packages/${{ github.workflow }}" + secrets: inherit diff --git a/docs/README.md b/docs/README.md index cadb570c..e5029499 100644 --- a/docs/README.md +++ b/docs/README.md @@ -6,58 +6,62 @@ At [Power Home Remodeling](https://powerhrg.com/), we have created foundational power-tools currently contains the following packages (marked for release to rubygems 💎 or npm ☕️): -[nitro_config](https://github.com/powerhome/power-tools/blob/main/packages/nitro_config/docs/README.md) 💎 +[api_chai](https://github.com/powerhome/power-tools/blob/main/packages/api_chai/docs/README.md) 💎 -When included in a Rails application, NitroConfig loads the configuration file at `config/config.yml` within the application directory and makes its values available at `NitroConfig.config`. Config values are loaded based on the Rails environment, permitting the specification of multiple environments' configurations in a single file. +ApiChai provides a simple integration with net-http around a lightweight layer for reporting and graceful error handling. [audit_tracker](https://github.com/powerhome/power-tools/blob/main/packages/audit_tracker/docs/README.md) 💎 AuditTracker helps you centralize data tracking configuration to be used across different models. -[lumberaxe](https://github.com/powerhome/power-tools/blob/main/packages/lumberaxe/docs/README.md) 💎 +[camel_trail](https://github.com/powerhome/power-tools/blob/main/packages/camel_trail/docs/README.md) 💎 -Lumberaxe handles logging output formatting. +CamelTrail makes it easy to keep a history of attribute changes on a model. [consent](https://github.com/powerhome/power-tools/blob/main/packages/consent/docs/README.md) 💎 Consent provides permission-based authorization. -[rubocop-powerhome](https://github.com/powerhome/power-tools/blob/main/packages/rubocop-powerhome/docs/README.md) 💎 - -This gem is focused on providing standard rubocop configuration for Power Home Remodeling ruby apps. See more in [`rubocop-powerhome`](../packages/rubocop-powerhome). - -[rubocop-cobra](https://github.com/powerhome/power-tools/blob/main/packages/rubocop-cobra/docs/README.md) 💎 - -This gem is focused on providing Cops to support a healthy cobra app development. See more in [`rubocop-cobra`](../packages/rubocop-cobra). - -[@powerhome/eslint-config](https://github.com/powerhome/power-tools/blob/main/packages/eslint-config/docs/README.md) ☕️ - -Shared eslint-config and Prettier formatting from Power Home Remodeling. - [cygnet](https://github.com/powerhome/power-tools/blob/main/packages/cygnet/docs/README.md) 💎 Helping ruby developers implement easy patterns. -[rabbet](https://github.com/powerhome/power-tools/blob/main/packages/rabbet/docs/README.md) 💎 +[data_taster](https://github.com/powerhome/power-tools/blob/main/packages/data_taster/docs/README.md) 💎 -A shared layout so that your suite of applications can have the same look and feel. +Delicious and sanitized data samples for development and testing. [edgestitch](https://github.com/powerhome/power-tools/blob/main/packages/edgestitch/docs/README.md) 💎 Edgestitch allows engines to define partial structure-self.sql files to be stitched into a single structure.sql file by the umbrella application. -[camel_trail](https://github.com/powerhome/power-tools/blob/main/packages/camel_trail/docs/README.md) 💎 +[lumberaxe](https://github.com/powerhome/power-tools/blob/main/packages/lumberaxe/docs/README.md) 💎 -CamelTrail makes it easy to keep a history of attribute changes on a model. +Lumberaxe handles logging output formatting. -[data_taster](https://github.com/powerhome/power-tools/blob/main/packages/data_taster/docs/README.md) 💎 +[nitro_config](https://github.com/powerhome/power-tools/blob/main/packages/nitro_config/docs/README.md) 💎 -Delicious and sanitized data samples for development and testing. +When included in a Rails application, NitroConfig loads the configuration file at `config/config.yml` within the application directory and makes its values available at `NitroConfig.config`. Config values are loaded based on the Rails environment, permitting the specification of multiple environments' configurations in a single file. [ostruct-sanitizer](https://github.com/powerhome/power-tools/blob/main/packages/ostruct-sanitizer/docs/README.md) 💎 Rails-like sanitization hooks to be applied to OpenStruct fields. +[@powerhome/eslint-config](https://github.com/powerhome/power-tools/blob/main/packages/eslint-config/docs/README.md) ☕️ + +Shared eslint-config and Prettier formatting from Power Home Remodeling. + +[rabbet](https://github.com/powerhome/power-tools/blob/main/packages/rabbet/docs/README.md) 💎 + +A shared layout so that your suite of applications can have the same look and feel. + +[rubocop-cobra](https://github.com/powerhome/power-tools/blob/main/packages/rubocop-cobra/docs/README.md) 💎 + +This gem is focused on providing Cops to support a healthy cobra app development. See more in [`rubocop-cobra`](../packages/rubocop-cobra). + +[rubocop-powerhome](https://github.com/powerhome/power-tools/blob/main/packages/rubocop-powerhome/docs/README.md) 💎 + +This gem is focused on providing standard rubocop configuration for Power Home Remodeling ruby apps. See more in [`rubocop-powerhome`](../packages/rubocop-powerhome). + ## Installation 🛠 These packages are all meant to install inside of an application and aren't intended to stand alone; currently, they are all published to [RubyGems](https://rubygems.org/) or [npm](https://www.npmjs.com/) and you can use standard methods to install them. diff --git a/packages/api_chai/.gitignore b/packages/api_chai/.gitignore new file mode 100644 index 00000000..802a9756 --- /dev/null +++ b/packages/api_chai/.gitignore @@ -0,0 +1,10 @@ +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/pkg/ +/spec/reports/ +/tmp/ + +# rspec failure tracking +.rspec_status diff --git a/packages/api_chai/.rubocop.yml b/packages/api_chai/.rubocop.yml new file mode 100644 index 00000000..e3462a74 --- /dev/null +++ b/packages/api_chai/.rubocop.yml @@ -0,0 +1,13 @@ +AllCops: + TargetRubyVersion: 2.6 + +Style/StringLiterals: + Enabled: true + EnforcedStyle: double_quotes + +Style/StringLiteralsInInterpolation: + Enabled: true + EnforcedStyle: double_quotes + +Layout/LineLength: + Max: 120 diff --git a/packages/api_chai/Appraisals b/packages/api_chai/Appraisals new file mode 100644 index 00000000..895c313c --- /dev/null +++ b/packages/api_chai/Appraisals @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +appraise "rails-6-0" do + gem "rails", "6.0.6.1" +end + +appraise "rails-6-1" do + gem "rails", "6.1.7.4" +end + +appraise "rails-7-0" do + gem "rails", "7.0.6" +end diff --git a/packages/api_chai/Gemfile b/packages/api_chai/Gemfile new file mode 100644 index 00000000..8f5bba95 --- /dev/null +++ b/packages/api_chai/Gemfile @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +# Specify your gem's dependencies in api_chai.gemspec +gemspec + +gem "rake", "~> 13.0" + +gem "rspec", "~> 3.0" + +gem "rubocop", "~> 1.21" diff --git a/packages/api_chai/Gemfile.lock b/packages/api_chai/Gemfile.lock new file mode 100644 index 00000000..81eaebdd --- /dev/null +++ b/packages/api_chai/Gemfile.lock @@ -0,0 +1,130 @@ +PATH + remote: . + specs: + api_chai (0.0.1) + +GEM + remote: https://rubygems.org/ + specs: + activesupport (7.1.2) + 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) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + base64 (0.2.0) + bigdecimal (3.1.5) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) + diff-lcs (1.5.0) + drb (2.2.0) + ruby2_keywords + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.7.1) + language_server-protocol (3.17.0.3) + license_finder (7.1.0) + bundler + rubyzip (>= 1, < 3) + thor (~> 1.2) + tomlrb (>= 1.3, < 2.1) + with_env (= 1.1.0) + xml-simple (~> 1.1.9) + minitest (5.20.0) + mutex_m (0.2.0) + parallel (1.24.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc + racc (1.7.3) + rack (3.0.8) + rainbow (3.1.1) + rake (13.1.0) + regexp_parser (2.8.3) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubocop (1.59.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.2.2.4) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.24.0) + rubocop (~> 1.33) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-powerhome (0.5.0) + rubocop + rubocop-performance + rubocop-rails + rubocop-rake + rubocop-rspec + rubocop-rails (2.23.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + thor (1.3.0) + tomlrb (2.0.3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + with_env (1.1.0) + xml-simple (1.1.9) + rexml + +PLATFORMS + arm64-darwin-22 + x86_64-linux + +DEPENDENCIES + api_chai! + appraisal (~> 2.5.0) + license_finder (~> 7.0) + rake (~> 13.0) + rspec (~> 3.0) + rubocop (~> 1.21) + rubocop-powerhome (= 0.5.0) + +BUNDLED WITH + 2.4.22 diff --git a/packages/api_chai/LICENSE.txt b/packages/api_chai/LICENSE.txt new file mode 100644 index 00000000..3e4b348e --- /dev/null +++ b/packages/api_chai/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 Jill Klang + +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. diff --git a/packages/api_chai/Rakefile b/packages/api_chai/Rakefile new file mode 100644 index 00000000..cca71754 --- /dev/null +++ b/packages/api_chai/Rakefile @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) + +require "rubocop/rake_task" + +RuboCop::RakeTask.new + +task default: %i[spec rubocop] diff --git a/packages/api_chai/api_chai.gemspec b/packages/api_chai/api_chai.gemspec new file mode 100644 index 00000000..98027ec9 --- /dev/null +++ b/packages/api_chai/api_chai.gemspec @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require_relative "lib/api_chai/version" + +Gem::Specification.new do |spec| + spec.name = "api_chai" + spec.version = ApiChai::VERSION + spec.authors = ["Jill Klang"] + spec.email = ["jillian.emilie@gmail.com"] + + spec.summary = "net-http simplicity infused with error handling and reporting" + spec.description = "Serve up smooth API integrations lightly steeped in graceful errors, Sentry & NewRelic reporting." + spec.homepage = "https://github.com/powerhome/power-tools" + spec.license = "MIT" + spec.required_ruby_version = ">= 2.6.0" + + spec.metadata["rubygems_mfa_required"] = "true" + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = spec.homepage + spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/packages/api_chai/docs/CHANGELOG.md" + + # 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. + spec.files = Dir.chdir(__dir__) do + `git ls-files -z`.split("\x0").reject do |f| + (File.expand_path(f) == __FILE__) || + f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile]) + end + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + spec.add_development_dependency "appraisal", "~> 2.5.0" + + spec.add_development_dependency "license_finder", "~> 7.0" + + spec.add_development_dependency "rubocop-powerhome", "0.5.0" +end diff --git a/packages/api_chai/bin/console b/packages/api_chai/bin/console new file mode 100755 index 00000000..69b13813 --- /dev/null +++ b/packages/api_chai/bin/console @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require "bundler/setup" +require "api_chai" + +# 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 "irb" +IRB.start(__FILE__) diff --git a/packages/api_chai/bin/setup b/packages/api_chai/bin/setup new file mode 100755 index 00000000..dce67d86 --- /dev/null +++ b/packages/api_chai/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/packages/api_chai/doc/dependency_decisions.yml b/packages/api_chai/doc/dependency_decisions.yml new file mode 100644 index 00000000..f734baa9 --- /dev/null +++ b/packages/api_chai/doc/dependency_decisions.yml @@ -0,0 +1,3 @@ +--- +- - :inherit_from + - https://raw.githubusercontent.com/powerhome/oss-guide/master/license_rules.yml diff --git a/packages/api_chai/docs/CHANGELOG.md b/packages/api_chai/docs/CHANGELOG.md new file mode 100644 index 00000000..2962a7b2 --- /dev/null +++ b/packages/api_chai/docs/CHANGELOG.md @@ -0,0 +1,5 @@ +## [Unreleased] + +## [0.0.1] - 2024-01-03 + +- Initial release diff --git a/packages/api_chai/docs/README.md b/packages/api_chai/docs/README.md new file mode 100644 index 00000000..b43d0c0f --- /dev/null +++ b/packages/api_chai/docs/README.md @@ -0,0 +1,5 @@ +# ApiChai + +Serve up smooth API integrations with net-http, lightly steeped in graceful errors, Sentry & NewRelic reporting. + +More information coming soon. diff --git a/packages/api_chai/gemfiles/.bundle/config b/packages/api_chai/gemfiles/.bundle/config new file mode 100644 index 00000000..c127f802 --- /dev/null +++ b/packages/api_chai/gemfiles/.bundle/config @@ -0,0 +1,2 @@ +--- +BUNDLE_RETRY: "1" diff --git a/packages/api_chai/gemfiles/rails_6_0.gemfile b/packages/api_chai/gemfiles/rails_6_0.gemfile new file mode 100644 index 00000000..f6b7e6a7 --- /dev/null +++ b/packages/api_chai/gemfiles/rails_6_0.gemfile @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "6.0.6.1" +gem "rake", "~> 13.0" +gem "rspec", "~> 3.0" +gem "rubocop", "~> 1.21" + +gemspec path: "../" diff --git a/packages/api_chai/gemfiles/rails_6_0.gemfile.lock b/packages/api_chai/gemfiles/rails_6_0.gemfile.lock new file mode 100644 index 00000000..2d4626fa --- /dev/null +++ b/packages/api_chai/gemfiles/rails_6_0.gemfile.lock @@ -0,0 +1,239 @@ +PATH + remote: .. + specs: + api_chai (0.0.1) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.6.1) + actionpack (= 6.0.6.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.6.1) + actionpack (= 6.0.6.1) + activejob (= 6.0.6.1) + activerecord (= 6.0.6.1) + activestorage (= 6.0.6.1) + activesupport (= 6.0.6.1) + mail (>= 2.7.1) + actionmailer (6.0.6.1) + actionpack (= 6.0.6.1) + actionview (= 6.0.6.1) + activejob (= 6.0.6.1) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.6.1) + actionview (= 6.0.6.1) + activesupport (= 6.0.6.1) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.6.1) + actionpack (= 6.0.6.1) + activerecord (= 6.0.6.1) + activestorage (= 6.0.6.1) + activesupport (= 6.0.6.1) + nokogiri (>= 1.8.5) + actionview (6.0.6.1) + activesupport (= 6.0.6.1) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.6.1) + activesupport (= 6.0.6.1) + globalid (>= 0.3.6) + activemodel (6.0.6.1) + activesupport (= 6.0.6.1) + activerecord (6.0.6.1) + activemodel (= 6.0.6.1) + activesupport (= 6.0.6.1) + activestorage (6.0.6.1) + actionpack (= 6.0.6.1) + activejob (= 6.0.6.1) + activerecord (= 6.0.6.1) + marcel (~> 1.0) + activesupport (6.0.6.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + builder (3.2.4) + concurrent-ruby (1.2.2) + crass (1.0.6) + date (3.3.3) + diff-lcs (1.5.0) + erubi (1.12.0) + globalid (1.1.0) + activesupport (>= 5.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.7.1) + language_server-protocol (3.17.0.3) + license_finder (7.1.0) + bundler + rubyzip (>= 1, < 3) + thor (~> 1.2) + tomlrb (>= 1.3, < 2.1) + with_env (= 1.1.0) + xml-simple (~> 1.1.9) + loofah (2.21.3) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.2) + method_source (1.0.0) + mini_mime (1.1.2) + minitest (5.20.0) + net-imap (0.3.6) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.3.3) + net-protocol + nio4r (2.5.9) + nokogiri (1.15.2-arm64-darwin) + racc (~> 1.4) + parallel (1.24.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc + racc (1.7.3) + rack (2.2.7) + rack-test (2.1.0) + rack (>= 1.3) + rails (6.0.6.1) + actioncable (= 6.0.6.1) + actionmailbox (= 6.0.6.1) + actionmailer (= 6.0.6.1) + actionpack (= 6.0.6.1) + actiontext (= 6.0.6.1) + actionview (= 6.0.6.1) + activejob (= 6.0.6.1) + activemodel (= 6.0.6.1) + activerecord (= 6.0.6.1) + activestorage (= 6.0.6.1) + activesupport (= 6.0.6.1) + bundler (>= 1.3.0) + railties (= 6.0.6.1) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (6.0.6.1) + actionpack (= 6.0.6.1) + activesupport (= 6.0.6.1) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rainbow (3.1.1) + rake (13.1.0) + regexp_parser (2.8.3) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubocop (1.59.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.2.2.4) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.24.0) + rubocop (~> 1.33) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-powerhome (0.5.0) + rubocop + rubocop-performance + rubocop-rails + rubocop-rake + rubocop-rspec + rubocop-rails (2.23.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + rubyzip (2.3.2) + sprockets (4.2.0) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + thor (1.3.0) + thread_safe (0.3.6) + timeout (0.4.0) + tomlrb (2.0.3) + tzinfo (1.2.11) + thread_safe (~> 0.1) + unicode-display_width (2.5.0) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + with_env (1.1.0) + xml-simple (1.1.9) + rexml + zeitwerk (2.6.8) + +PLATFORMS + arm64-darwin-22 + +DEPENDENCIES + api_chai! + appraisal (~> 2.5.0) + license_finder (~> 7.0) + rails (= 6.0.6.1) + rake (~> 13.0) + rspec (~> 3.0) + rubocop (~> 1.21) + rubocop-powerhome (= 0.5.0) + +BUNDLED WITH + 2.4.22 diff --git a/packages/api_chai/gemfiles/rails_6_1.gemfile b/packages/api_chai/gemfiles/rails_6_1.gemfile new file mode 100644 index 00000000..a578cf4f --- /dev/null +++ b/packages/api_chai/gemfiles/rails_6_1.gemfile @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "6.1.7.4" +gem "rake", "~> 13.0" +gem "rspec", "~> 3.0" +gem "rubocop", "~> 1.21" + +gemspec path: "../" diff --git a/packages/api_chai/gemfiles/rails_6_1.gemfile.lock b/packages/api_chai/gemfiles/rails_6_1.gemfile.lock new file mode 100644 index 00000000..61fcdb6e --- /dev/null +++ b/packages/api_chai/gemfiles/rails_6_1.gemfile.lock @@ -0,0 +1,243 @@ +PATH + remote: .. + specs: + api_chai (0.0.1) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.1.7.4) + actionpack (= 6.1.7.4) + activesupport (= 6.1.7.4) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.1.7.4) + actionpack (= 6.1.7.4) + activejob (= 6.1.7.4) + activerecord (= 6.1.7.4) + activestorage (= 6.1.7.4) + activesupport (= 6.1.7.4) + mail (>= 2.7.1) + actionmailer (6.1.7.4) + actionpack (= 6.1.7.4) + actionview (= 6.1.7.4) + activejob (= 6.1.7.4) + activesupport (= 6.1.7.4) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.1.7.4) + actionview (= 6.1.7.4) + activesupport (= 6.1.7.4) + rack (~> 2.0, >= 2.0.9) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.1.7.4) + actionpack (= 6.1.7.4) + activerecord (= 6.1.7.4) + activestorage (= 6.1.7.4) + activesupport (= 6.1.7.4) + nokogiri (>= 1.8.5) + actionview (6.1.7.4) + activesupport (= 6.1.7.4) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.1.7.4) + activesupport (= 6.1.7.4) + globalid (>= 0.3.6) + activemodel (6.1.7.4) + activesupport (= 6.1.7.4) + activerecord (6.1.7.4) + activemodel (= 6.1.7.4) + activesupport (= 6.1.7.4) + activestorage (6.1.7.4) + actionpack (= 6.1.7.4) + activejob (= 6.1.7.4) + activerecord (= 6.1.7.4) + activesupport (= 6.1.7.4) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (6.1.7.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + builder (3.2.4) + concurrent-ruby (1.2.2) + crass (1.0.6) + date (3.3.4) + diff-lcs (1.5.0) + erubi (1.12.0) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.7.1) + language_server-protocol (3.17.0.3) + license_finder (7.1.0) + bundler + rubyzip (>= 1, < 3) + thor (~> 1.2) + tomlrb (>= 1.3, < 2.1) + with_env (= 1.1.0) + xml-simple (~> 1.1.9) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.2) + method_source (1.0.0) + mini_mime (1.1.5) + minitest (5.20.0) + net-imap (0.4.9) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.4.0) + net-protocol + nio4r (2.7.0) + nokogiri (1.16.0-arm64-darwin) + racc (~> 1.4) + parallel (1.24.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc + racc (1.7.3) + rack (2.2.8) + rack-test (2.1.0) + rack (>= 1.3) + rails (6.1.7.4) + actioncable (= 6.1.7.4) + actionmailbox (= 6.1.7.4) + actionmailer (= 6.1.7.4) + actionpack (= 6.1.7.4) + actiontext (= 6.1.7.4) + actionview (= 6.1.7.4) + activejob (= 6.1.7.4) + activemodel (= 6.1.7.4) + activerecord (= 6.1.7.4) + activestorage (= 6.1.7.4) + activesupport (= 6.1.7.4) + bundler (>= 1.15.0) + railties (= 6.1.7.4) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (6.1.7.4) + actionpack (= 6.1.7.4) + activesupport (= 6.1.7.4) + method_source + rake (>= 12.2) + thor (~> 1.0) + rainbow (3.1.1) + rake (13.1.0) + regexp_parser (2.8.3) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubocop (1.59.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.2.2.4) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.24.0) + rubocop (~> 1.33) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-powerhome (0.5.0) + rubocop + rubocop-performance + rubocop-rails + rubocop-rake + rubocop-rspec + rubocop-rails (2.23.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + rubyzip (2.3.2) + sprockets (4.2.1) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + thor (1.3.0) + timeout (0.4.1) + tomlrb (2.0.3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + with_env (1.1.0) + xml-simple (1.1.9) + rexml + zeitwerk (2.6.12) + +PLATFORMS + arm64-darwin-22 + +DEPENDENCIES + api_chai! + appraisal (~> 2.5.0) + license_finder (~> 7.0) + rails (= 6.1.7.4) + rake (~> 13.0) + rspec (~> 3.0) + rubocop (~> 1.21) + rubocop-powerhome (= 0.5.0) + +BUNDLED WITH + 2.4.22 diff --git a/packages/api_chai/gemfiles/rails_7_0.gemfile b/packages/api_chai/gemfiles/rails_7_0.gemfile new file mode 100644 index 00000000..c0b24228 --- /dev/null +++ b/packages/api_chai/gemfiles/rails_7_0.gemfile @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "7.0.6" +gem "rake", "~> 13.0" +gem "rspec", "~> 3.0" +gem "rubocop", "~> 1.21" + +gemspec path: "../" diff --git a/packages/api_chai/gemfiles/rails_7_0.gemfile.lock b/packages/api_chai/gemfiles/rails_7_0.gemfile.lock new file mode 100644 index 00000000..a74e5e23 --- /dev/null +++ b/packages/api_chai/gemfiles/rails_7_0.gemfile.lock @@ -0,0 +1,242 @@ +PATH + remote: .. + specs: + api_chai (0.0.1) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.0.6) + actionpack (= 7.0.6) + activesupport (= 7.0.6) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.6) + actionpack (= 7.0.6) + activejob (= 7.0.6) + activerecord (= 7.0.6) + activestorage (= 7.0.6) + activesupport (= 7.0.6) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.6) + actionpack (= 7.0.6) + actionview (= 7.0.6) + activejob (= 7.0.6) + activesupport (= 7.0.6) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.6) + actionview (= 7.0.6) + activesupport (= 7.0.6) + rack (~> 2.0, >= 2.2.4) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.6) + actionpack (= 7.0.6) + activerecord (= 7.0.6) + activestorage (= 7.0.6) + activesupport (= 7.0.6) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.6) + activesupport (= 7.0.6) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.6) + activesupport (= 7.0.6) + globalid (>= 0.3.6) + activemodel (7.0.6) + activesupport (= 7.0.6) + activerecord (7.0.6) + activemodel (= 7.0.6) + activesupport (= 7.0.6) + activestorage (7.0.6) + actionpack (= 7.0.6) + activejob (= 7.0.6) + activerecord (= 7.0.6) + activesupport (= 7.0.6) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + builder (3.2.4) + concurrent-ruby (1.2.2) + crass (1.0.6) + date (3.3.4) + diff-lcs (1.5.0) + erubi (1.12.0) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.7.1) + language_server-protocol (3.17.0.3) + license_finder (7.1.0) + bundler + rubyzip (>= 1, < 3) + thor (~> 1.2) + tomlrb (>= 1.3, < 2.1) + with_env (= 1.1.0) + xml-simple (~> 1.1.9) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.2) + method_source (1.0.0) + mini_mime (1.1.5) + minitest (5.20.0) + net-imap (0.4.9) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.4.0) + net-protocol + nio4r (2.7.0) + nokogiri (1.16.0-arm64-darwin) + racc (~> 1.4) + parallel (1.24.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc + racc (1.7.3) + rack (2.2.8) + rack-test (2.1.0) + rack (>= 1.3) + rails (7.0.6) + actioncable (= 7.0.6) + actionmailbox (= 7.0.6) + actionmailer (= 7.0.6) + actionpack (= 7.0.6) + actiontext (= 7.0.6) + actionview (= 7.0.6) + activejob (= 7.0.6) + activemodel (= 7.0.6) + activerecord (= 7.0.6) + activestorage (= 7.0.6) + activesupport (= 7.0.6) + bundler (>= 1.15.0) + railties (= 7.0.6) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.0.6) + actionpack (= 7.0.6) + activesupport (= 7.0.6) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rainbow (3.1.1) + rake (13.1.0) + regexp_parser (2.8.3) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubocop (1.59.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.2.2.4) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.24.0) + rubocop (~> 1.33) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-powerhome (0.5.0) + rubocop + rubocop-performance + rubocop-rails + rubocop-rake + rubocop-rspec + rubocop-rails (2.23.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + rubyzip (2.3.2) + thor (1.3.0) + timeout (0.4.1) + tomlrb (2.0.3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + with_env (1.1.0) + xml-simple (1.1.9) + rexml + zeitwerk (2.6.12) + +PLATFORMS + arm64-darwin-22 + +DEPENDENCIES + api_chai! + appraisal (~> 2.5.0) + license_finder (~> 7.0) + rails (= 7.0.6) + rake (~> 13.0) + rspec (~> 3.0) + rubocop (~> 1.21) + rubocop-powerhome (= 0.5.0) + +BUNDLED WITH + 2.4.22 diff --git a/packages/api_chai/lib/api_chai.rb b/packages/api_chai/lib/api_chai.rb new file mode 100644 index 00000000..dfa7584b --- /dev/null +++ b/packages/api_chai/lib/api_chai.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require_relative "api_chai/version" + +module ApiChai + class Error < StandardError; end + # Your code goes here... +end diff --git a/packages/api_chai/lib/api_chai/version.rb b/packages/api_chai/lib/api_chai/version.rb new file mode 100644 index 00000000..facb923d --- /dev/null +++ b/packages/api_chai/lib/api_chai/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module ApiChai + VERSION = "0.0.1" +end diff --git a/packages/api_chai/mkdocs.yml b/packages/api_chai/mkdocs.yml new file mode 100644 index 00000000..029c4609 --- /dev/null +++ b/packages/api_chai/mkdocs.yml @@ -0,0 +1,6 @@ +site_name: API Chai +nav: + - "Home": "README.md" + - "Changelog": "CHANGELOG.md" +plugins: + - techdocs-core diff --git a/packages/api_chai/sig/api_chai.rbs b/packages/api_chai/sig/api_chai.rbs new file mode 100644 index 00000000..c36a1ab0 --- /dev/null +++ b/packages/api_chai/sig/api_chai.rbs @@ -0,0 +1,4 @@ +module ApiChai + VERSION: String + # See the writing guide of rbs: https://github.com/ruby/rbs#guides +end diff --git a/packages/api_chai/spec/api_chai_spec.rb b/packages/api_chai/spec/api_chai_spec.rb new file mode 100644 index 00000000..23c99255 --- /dev/null +++ b/packages/api_chai/spec/api_chai_spec.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +RSpec.describe ApiChai do + it "has a version number" do + expect(ApiChai::VERSION).not_to be nil + end +end diff --git a/packages/api_chai/spec/spec_helper.rb b/packages/api_chai/spec/spec_helper.rb new file mode 100644 index 00000000..b1d97f67 --- /dev/null +++ b/packages/api_chai/spec/spec_helper.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require "api_chai" + +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 diff --git a/portal.yml b/portal.yml index 9e93da7c..f8afa07d 100644 --- a/portal.yml +++ b/portal.yml @@ -202,7 +202,7 @@ spec: apiVersion: backstage.io/v1alpha1 kind: Component metadata: - name: ostruct-sanitozer + name: ostruct-sanitizer title: OpenStruct sanitizer description: >- Provides Rails-like sanitization hooks to be applied to OpenStruct fields. @@ -212,3 +212,17 @@ spec: system: power-application-framework lifecycle: production subcomponentOf: power-tools +--- +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + name: api_chai + title: ApiChai + description: >- + Serve up smooth API integrations with net-http, lightly steeped in graceful errors, Sentry & NewRelic reporting. +spec: + type: library + owner: heroes-for-hire + system: power-application-framework + lifecycle: production + subcomponentOf: power-tools