From 6a4f9567c8009e347ee82cc1793902a75679cef8 Mon Sep 17 00:00:00 2001 From: FelipeGuzmanSierra <97761783+FelipeGuzmanSierra@users.noreply.github.com> Date: Mon, 25 Mar 2024 16:09:26 -0500 Subject: [PATCH] Update code and configuration files --- CHANGELOG.md | 28 --------- Gemfile | 2 +- README.md | 63 ++++++++++--------- bns.gemspec => bas.gemspec | 23 +++---- bin/console | 2 +- lib/bas.rb | 9 +++ lib/{bns => bas}/dispatcher/base.rb | 0 .../exceptions/invalid_webhook_token.rb | 0 .../dispatcher/discord/implementation.rb | 0 .../dispatcher/discord/types/response.rb | 0 .../slack/exceptions/invalid_webhook_token.rb | 0 .../dispatcher/slack/implementation.rb | 0 .../dispatcher/slack/types/response.rb | 0 lib/{bns => bas}/domain/birthday.rb | 0 lib/{bns => bas}/domain/email.rb | 0 .../exceptions/function_not_implemented.rb | 0 lib/{bns => bas}/domain/pto.rb | 0 lib/{bns => bas}/domain/work_items_limit.rb | 0 lib/{bns => bas}/fetcher/base.rb | 0 lib/{bns => bas}/fetcher/imap/base.rb | 0 .../fetcher/imap/types/response.rb | 0 .../fetcher/imap/use_case/support_emails.rb | 0 lib/{bns => bas}/fetcher/notion/base.rb | 0 .../notion/exceptions/invalid_api_key.rb | 0 .../notion/exceptions/invalid_database_id.rb | 0 lib/{bns => bas}/fetcher/notion/helper.rb | 0 .../fetcher/notion/types/response.rb | 0 .../notion/use_case/birthday_next_week.rb | 0 .../fetcher/notion/use_case/birthday_today.rb | 0 .../fetcher/notion/use_case/pto_next_week.rb | 0 .../fetcher/notion/use_case/pto_today.rb | 0 .../notion/use_case/work_items_limit.rb | 0 lib/{bns => bas}/fetcher/postgres/base.rb | 0 lib/{bns => bas}/fetcher/postgres/helper.rb | 0 .../fetcher/postgres/types/response.rb | 0 .../fetcher/postgres/use_case/pto_today.rb | 0 lib/{bns => bas}/formatter/base.rb | 0 lib/{bns => bas}/formatter/birthday.rb | 0 .../formatter/exceptions/invalid_data.rb | 0 lib/{bns => bas}/formatter/pto.rb | 0 lib/{bns => bas}/formatter/support_emails.rb | 0 .../formatter/work_items_limit.rb | 0 lib/{bns => bas}/mapper/base.rb | 0 .../mapper/imap/support_emails.rb | 0 .../mapper/notion/birthday_today.rb | 0 lib/{bns => bas}/mapper/notion/pto_today.rb | 0 .../mapper/notion/work_items_limit.rb | 0 lib/{bns => bas}/mapper/postgres/pto_today.rb | 0 lib/{bns => bas}/use_cases/types/config.rb | 0 lib/{bns => bas}/use_cases/use_case.rb | 0 lib/{bns => bas}/use_cases/use_cases.rb | 0 lib/{bns => bas}/version.rb | 4 +- lib/bns.rb | 9 --- ...tem.rbs => business_automation_system.rbs} | 0 spec/{bns => bas}/dispatcher/base_spec.rb | 0 spec/{bns => bas}/dispatcher/discord_spec.rb | 0 spec/{bns => bas}/dispatcher/slack_spec.rb | 0 spec/{bns => bas}/fetcher/base_spec.rb | 0 .../fetcher/imap/support_email_spec.rb | 0 .../fetcher/notion/birthday_next_week_spec.rb | 0 .../fetcher/notion/birthday_today_spec.rb | 0 .../fetcher/notion/pto_next_week_spec.rb | 0 .../fetcher/notion/pto_today_spec.rb | 0 .../fetcher/notion/work_items_limit_spec.rb | 0 .../fetcher/postgres/pto_today_spec.rb | 0 spec/{bns => bas}/formatter/base_spec.rb | 0 spec/{bns => bas}/formatter/birthday_spec.rb | 0 spec/{bns => bas}/formatter/pto_spec.rb | 0 .../formatter/support_email_spec.rb | 0 .../formatter/work_items_limit_spec.rb | 0 spec/{bns => bas}/mapper/base_spec.rb | 0 .../mapper/imap/support_emails_spec.rb | 0 .../mapper/notion/birthday_today_spec.rb | 0 spec/{bns => bas}/mapper/notion/pto_spec.rb | 0 .../mapper/notion/work_items_limit_spec.rb | 0 spec/{bns => bas}/mapper/postgres/pto_spec.rb | 0 spec/{bns_spec.rb => bas_spec.rb} | 4 +- spec/spec_helper.rb | 2 +- 78 files changed, 59 insertions(+), 87 deletions(-) rename bns.gemspec => bas.gemspec (62%) create mode 100644 lib/bas.rb rename lib/{bns => bas}/dispatcher/base.rb (100%) rename lib/{bns => bas}/dispatcher/discord/exceptions/invalid_webhook_token.rb (100%) rename lib/{bns => bas}/dispatcher/discord/implementation.rb (100%) rename lib/{bns => bas}/dispatcher/discord/types/response.rb (100%) rename lib/{bns => bas}/dispatcher/slack/exceptions/invalid_webhook_token.rb (100%) rename lib/{bns => bas}/dispatcher/slack/implementation.rb (100%) rename lib/{bns => bas}/dispatcher/slack/types/response.rb (100%) rename lib/{bns => bas}/domain/birthday.rb (100%) rename lib/{bns => bas}/domain/email.rb (100%) rename lib/{bns => bas}/domain/exceptions/function_not_implemented.rb (100%) rename lib/{bns => bas}/domain/pto.rb (100%) rename lib/{bns => bas}/domain/work_items_limit.rb (100%) rename lib/{bns => bas}/fetcher/base.rb (100%) rename lib/{bns => bas}/fetcher/imap/base.rb (100%) rename lib/{bns => bas}/fetcher/imap/types/response.rb (100%) rename lib/{bns => bas}/fetcher/imap/use_case/support_emails.rb (100%) rename lib/{bns => bas}/fetcher/notion/base.rb (100%) rename lib/{bns => bas}/fetcher/notion/exceptions/invalid_api_key.rb (100%) rename lib/{bns => bas}/fetcher/notion/exceptions/invalid_database_id.rb (100%) rename lib/{bns => bas}/fetcher/notion/helper.rb (100%) rename lib/{bns => bas}/fetcher/notion/types/response.rb (100%) rename lib/{bns => bas}/fetcher/notion/use_case/birthday_next_week.rb (100%) rename lib/{bns => bas}/fetcher/notion/use_case/birthday_today.rb (100%) rename lib/{bns => bas}/fetcher/notion/use_case/pto_next_week.rb (100%) rename lib/{bns => bas}/fetcher/notion/use_case/pto_today.rb (100%) rename lib/{bns => bas}/fetcher/notion/use_case/work_items_limit.rb (100%) rename lib/{bns => bas}/fetcher/postgres/base.rb (100%) rename lib/{bns => bas}/fetcher/postgres/helper.rb (100%) rename lib/{bns => bas}/fetcher/postgres/types/response.rb (100%) rename lib/{bns => bas}/fetcher/postgres/use_case/pto_today.rb (100%) rename lib/{bns => bas}/formatter/base.rb (100%) rename lib/{bns => bas}/formatter/birthday.rb (100%) rename lib/{bns => bas}/formatter/exceptions/invalid_data.rb (100%) rename lib/{bns => bas}/formatter/pto.rb (100%) rename lib/{bns => bas}/formatter/support_emails.rb (100%) rename lib/{bns => bas}/formatter/work_items_limit.rb (100%) rename lib/{bns => bas}/mapper/base.rb (100%) rename lib/{bns => bas}/mapper/imap/support_emails.rb (100%) rename lib/{bns => bas}/mapper/notion/birthday_today.rb (100%) rename lib/{bns => bas}/mapper/notion/pto_today.rb (100%) rename lib/{bns => bas}/mapper/notion/work_items_limit.rb (100%) rename lib/{bns => bas}/mapper/postgres/pto_today.rb (100%) rename lib/{bns => bas}/use_cases/types/config.rb (100%) rename lib/{bns => bas}/use_cases/use_case.rb (100%) rename lib/{bns => bas}/use_cases/use_cases.rb (100%) rename lib/{bns => bas}/version.rb (62%) delete mode 100644 lib/bns.rb rename sig/{business_notification_system.rbs => business_automation_system.rbs} (100%) rename spec/{bns => bas}/dispatcher/base_spec.rb (100%) rename spec/{bns => bas}/dispatcher/discord_spec.rb (100%) rename spec/{bns => bas}/dispatcher/slack_spec.rb (100%) rename spec/{bns => bas}/fetcher/base_spec.rb (100%) rename spec/{bns => bas}/fetcher/imap/support_email_spec.rb (100%) rename spec/{bns => bas}/fetcher/notion/birthday_next_week_spec.rb (100%) rename spec/{bns => bas}/fetcher/notion/birthday_today_spec.rb (100%) rename spec/{bns => bas}/fetcher/notion/pto_next_week_spec.rb (100%) rename spec/{bns => bas}/fetcher/notion/pto_today_spec.rb (100%) rename spec/{bns => bas}/fetcher/notion/work_items_limit_spec.rb (100%) rename spec/{bns => bas}/fetcher/postgres/pto_today_spec.rb (100%) rename spec/{bns => bas}/formatter/base_spec.rb (100%) rename spec/{bns => bas}/formatter/birthday_spec.rb (100%) rename spec/{bns => bas}/formatter/pto_spec.rb (100%) rename spec/{bns => bas}/formatter/support_email_spec.rb (100%) rename spec/{bns => bas}/formatter/work_items_limit_spec.rb (100%) rename spec/{bns => bas}/mapper/base_spec.rb (100%) rename spec/{bns => bas}/mapper/imap/support_emails_spec.rb (100%) rename spec/{bns => bas}/mapper/notion/birthday_today_spec.rb (100%) rename spec/{bns => bas}/mapper/notion/pto_spec.rb (100%) rename spec/{bns => bas}/mapper/notion/work_items_limit_spec.rb (100%) rename spec/{bns => bas}/mapper/postgres/pto_spec.rb (100%) rename spec/{bns_spec.rb => bas_spec.rb} (54%) diff --git a/CHANGELOG.md b/CHANGELOG.md index d71aab4..825c32f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,29 +1 @@ # Changelog - -## 0.3.0 (19.03.2024) -- [Add Component - Email fetcher](https://github.com/kommitters/bns/issues/40) -- [Use case - Email based notifications](https://github.com/kommitters/bns/issues/45) -- [Dynamic WIP limit value](https://github.com/kommitters/bns/issues/48) - -## 0.2.0 (29.02.2024) -- [Add a Postgres fetcher component](https://github.com/kommitters/bns/issues/28) -- [Use case - PTO's Postgres-Slack implementation](https://github.com/kommitters/bns/issues/30) -- [Slack dispatcher](https://github.com/kommitters/bns/issues/32) -- [Refactor fetcher components](https://github.com/kommitters/bns/issues/34) -- [Add Use Case - Boards WI alerts](https://github.com/kommitters/bns/issues/36) -- [Add Use Case - Next Week Birthday](https://github.com/kommitters/bns/issues/38) -- [Add Use Case - Next Week PTO's](https://github.com/kommitters/bns/issues/39) - -## 0.1.1 (07.02.2024) -- [Add custom templates option](https://github.com/kommitters/bns/issues/25) -- [PTO's formatting use cases](https://github.com/kommitters/bns/issues/24) - -## 0.1.0 (06.02.2024) - -- [Build initial codebase](https://github.com/kommitters/bns/issues/6) -- [Birthdays use case implementation](https://github.com/kommitters/bns/issues/7) -- [PTO’s use case implementation](https://github.com/kommitters/bns/issues/8) -- [Error handler implementation](https://github.com/kommitters/bns/issues/9) -- [Types implementation](https://github.com/kommitters/bns/issues/11) -- [Documentation completion](https://github.com/kommitters/bns/issues/12) -- [Opensource configurations](https://github.com/kommitters/bns/issues/10) diff --git a/Gemfile b/Gemfile index 0a86dc8..240d9a5 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -# Specify your gem's dependencies in bns.gemspec +# Specify your gem's dependencies in bas.gemspec gemspec gem "rake", "~> 13.0" diff --git a/README.md b/README.md index 80b0c52..8c09829 100644 --- a/README.md +++ b/README.md @@ -1,72 +1,77 @@ -# BNS - Business Notification System +# BAS - Business Automation System -Many organizations and individuals rely on automatic notifications across various contexts in their daily operations. With BNS, we aim to provide an open-source platform that empowers users to create customized notification systems tailored to their unique requirements. BNS consists of a series of abstract components designed to facilitate the creation of diverse use cases, regardless of context. +Many organizations and individuals rely on automation across various contexts in their daily operations. With BAS, we aim to provide an open-source platform that empowers users to create customized automation systems tailored to their unique requirements. BAS consists of a series of abstract components designed to facilitate the creation of diverse use cases, regardless of context. The underlying idea is to develop generic components that can serve a wide range of needs, this approach ensures that all members of the community can leverage the platform's evolving suite of components and use cases to their advantage. -![Gem Version](https://img.shields.io/gem/v/bns?style=for-the-badge) -![Gem Total Downloads](https://img.shields.io/gem/dt/bns?style=for-the-badge) -![Build Badge](https://img.shields.io/github/actions/workflow/status/kommitters/bns/ci.yml?branch=project-opensource-config&style=for-the-badge) -[![Coverage Status](https://img.shields.io/coveralls/github/kommitters/bns?style=for-the-badge)](https://coveralls.io/github/kommitters/bns?branch=main) -![GitHub License](https://img.shields.io/github/license/kommitters/bns?style=for-the-badge) -[![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/kommitters/bns?label=openssf%20scorecard&style=for-the-badge)](https://api.securityscorecards.dev/projects/github.com/kommitters/bns) +![Gem Version](https://img.shields.io/gem/v/bas?style=for-the-badge) +![Gem Total Downloads](https://img.shields.io/gem/dt/bas?style=for-the-badge) +![Build Badge](https://img.shields.io/github/actions/workflow/status/kommitters/bas/ci.yml?branch=project-opensource-config&style=for-the-badge) +[![Coverage Status](https://img.shields.io/coveralls/github/kommitters/bas?style=for-the-badge)](https://coveralls.io/github/kommitters/bas?branch=main) +![GitHub License](https://img.shields.io/github/license/kommitters/bas?style=for-the-badge) +[![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/kommitters/bas?label=openssf%20scorecard&style=for-the-badge)](https://api.securityscorecards.dev/projects/github.com/kommitters/bas) [![OpenSSF Best Practices](https://img.shields.io/cii/summary/8383?label=openssf%20best%20practices&style=for-the-badge)](https://bestpractices.coreinfrastructure.org/projects/8383) ## Installation Install the gem and add to the application's Gemfile by executing: - $ bundle add bns + $ bundle add bas If bundler is not being used to manage dependencies, install the gem by executing: - $ gem install bns + $ gem install bas ## Requirements -* Ruby 3.2.2 or higher +* Ruby 2.6.0 or higher ## Building my own use case The gem provides with basic interfaces, types, and methods to shape your own use cases in an easy way. -There are 2 currently implemented use cases: +There are 7 currently implemented use cases: * Birthday notifications - from Notion to Discord +* Next Week Birthday notifications - from Notion to Discord * PTO notifications - from Notion to Discord +* Next Week PTO notifications - from Notion to Discord +* PTO notifications - from Postgres to Slack +* WIP limit exceeded - from Notion to Discord +* Support email notification - from IMAP to Discord -For this example we'll analize the birthday notification use case, bringing data from a notion database, and dispatching the +For this example we'll analyze the birthday notification use case, bringing data from a notion database, and dispatching the notifications to a Discord channel. -A *Use Case* object, consists on 4 main componenets, having it's own responsability: +A *Use Case* object, consists on 4 main components, having it's own responsibility: ### 1. Fetcher - Obtaining the data Specifically, a fetcher is an object in charged of bringing data from a data source. The gem already provides the base interface for building your own fetcher for your specific data source, or rely on already built classes if they match your purpose. -The base interface for a fetcher can be found under the `bns/fetcher/base.rb` class. Since this is a implementation of the `Fetcher::Base` +The base interface for a fetcher can be found under the `bas/fetcher/base.rb` class. Since this is a implementation of the `Fetcher::Base` for bringing data from a Notion database, it was created on a new namespace for that data source, it can be found under -`/bns/fetcher/notion/birthday.rb`. It implements specific logic for fetching the data and validating the response. +`/bas/fetcher/notion/use_case/birthday_today.rb`. It implements specific logic for fetching the data and validating the response. ### 2. Mapper - Shaping it -The **Mapper** responsability, is to shape the data using custom types from the app domain, bringing it into a +The **Mapper** responsibility, is to shape the data using custom types from the app domain, bringing it into a common structure understandable for other components, specifically the **Formatter**. -Because of the use case, the Mapper implementation for it, relyes on specific types for representing a Birthday it self. It can be found -under `/bns/mapper/notion/birthday.rb` +Because of the use case, the Mapper implementation for it, relies on specific types for representing a Birthday it self. It can be found +under `/bas/mapper/notion/birthday_today.rb` ### 3. Formatter - Preparing the message The **Formatter**, is in charge of preparing the message to be sent in our notification, and give it the right format with the right data. -The template or 'format' to be used should be included in the use case configurations, which we'll review in a further step. It's -implementation can be found under `/bns/formatter/discord/birthday.rb`. +The template or 'format' to be used should be included in the use case configurations, which we'll review in a further step. It's +implementation can be found under `/bas/formatter/birthday.rb`. ### 4. Dispatcher - Sending your notification Finally, the **Dispatcher** basically, sends or dispatches the formatted message into a destination, since the use case was implemented for -Discord, it implements specific logic to communicate with a Discord channel using a webhook. The webhook configuration and name for the 'Sender' -in the channel should be provided with the initial use case configurations. It can be found under `/bns/dispatcher/discord/implementation.rb` +Discord, it implements specific logic to communicate with a Discord channel using a webhook. The webhook configuration and name for the 'Sender' +in the channel should be provided with the initial use case configurations. It can be found under `/bas/dispatcher/discord/implementation.rb` ## Examples @@ -84,7 +89,7 @@ We'll need some configurations for this specific use case: With the following formula for the **BD_this_year** column: `dateAdd(prop("BD"), year(now()) - year(prop("BD")), "years")` -* A Notion secret, which can be obtained, by creating an integration here: `https://developers.notion.com/`, browsing on the **View my integations** option, and selecting the **New Integration** or **Create new integration** buttons. +* A Notion secret, which can be obtained, by creating an integration here: `https://developers.notion.com/`, browsing on the **View my integrations** option, and selecting the **New Integration** or **Create new integration** buttons. * A webhook key, which can be generated directly on discord on the desired channel, following this instructions: `https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks` @@ -217,7 +222,7 @@ On your serverless configuration, create your lambda function, on your serverles ```ruby # frozen_string_literal: true -require 'bns' +require 'bas' # Initialize the environment variables NOTION_BASE_URL = 'https://api.notion.com' @@ -347,10 +352,10 @@ The gem is licensed under an MIT license. See [LICENSE][license] for details. -[license]: https://github.com/kommitters/bns/blob/main/LICENSE -[coc]: https://github.com/kommitters/bns/blob/main/CODE_OF_CONDUCT.md -[changelog]: https://github.com/kommitters/bns/blob/main/CHANGELOG.md -[contributing]: https://github.com/kommitters/bns/blob/main/CONTRIBUTING.md +[license]: https://github.com/kommitters/bas/blob/main/LICENSE +[coc]: https://github.com/kommitters/bas/blob/main/CODE_OF_CONDUCT.md +[changelog]: https://github.com/kommitters/bas/blob/main/CHANGELOG.md +[contributing]: https://github.com/kommitters/bas/blob/main/CONTRIBUTING.md [kommit-website]: https://kommit.co [kommit-github]: https://github.com/kommitters [kommit-x]: https://twitter.com/kommitco diff --git a/bns.gemspec b/bas.gemspec similarity index 62% rename from bns.gemspec rename to bas.gemspec index 7e3d815..e8b0e64 100644 --- a/bns.gemspec +++ b/bas.gemspec @@ -1,22 +1,23 @@ # frozen_string_literal: true -require_relative "lib/bns/version" +require_relative "lib/bas/version" Gem::Specification.new do |spec| - spec.name = "bns" - spec.version = Bns::VERSION + spec.name = "bas" + spec.version = Bas::VERSION spec.authors = ["kommitters Open Source"] - spec.summary = "BNS - Business notification system" + spec.summary = "BAS - Business automation system" spec.email = ["oss@kommit.co"] - spec.description = "A versatile business notification system offering key components for building various use cases. \ - It provides an easy-to-use tool for implementing notifications without excessive complexity." - spec.homepage = "https://github.com/kommitters/bns" + spec.description = "A versatile business automation system offering key components for building various use cases. \ + It provides an easy-to-use tool for implementing automation workflows without excessive complexity. \ + Formerly known as 'bns'." + spec.homepage = "https://github.com/kommitters/bas" spec.license = "MIT" spec.required_ruby_version = ">= 2.6.0" spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = "https://github.com/kommitters/bns" + spec.metadata["source_code_uri"] = "https://github.com/kommitters/bas" # 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. @@ -34,10 +35,4 @@ Gem::Specification.new do |spec| # For more information and examples about making a new gem, check out our # guide at: https://bundler.io/guides/creating_gem.html - - spec.post_install_message = <<-MESSAGE - ! The 'BNS' gem has been deprecated and has been replaced by 'BAS'. - ! See: https://rubygems.org/gems/bas - ! And: https://github.com/kommitters/bas - MESSAGE end diff --git a/bin/console b/bin/console index fcdf44d..3796213 100644 --- a/bin/console +++ b/bin/console @@ -2,7 +2,7 @@ # frozen_string_literal: true require "bundler/setup" -require "bns" +require "bas" # 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. diff --git a/lib/bas.rb b/lib/bas.rb new file mode 100644 index 0000000..1a9437c --- /dev/null +++ b/lib/bas.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require_relative "bas/version" +require_relative "bas/use_cases/use_cases" + +module Bas # rubocop:disable Style/Documentation + include UseCases + class Error < StandardError; end +end diff --git a/lib/bns/dispatcher/base.rb b/lib/bas/dispatcher/base.rb similarity index 100% rename from lib/bns/dispatcher/base.rb rename to lib/bas/dispatcher/base.rb diff --git a/lib/bns/dispatcher/discord/exceptions/invalid_webhook_token.rb b/lib/bas/dispatcher/discord/exceptions/invalid_webhook_token.rb similarity index 100% rename from lib/bns/dispatcher/discord/exceptions/invalid_webhook_token.rb rename to lib/bas/dispatcher/discord/exceptions/invalid_webhook_token.rb diff --git a/lib/bns/dispatcher/discord/implementation.rb b/lib/bas/dispatcher/discord/implementation.rb similarity index 100% rename from lib/bns/dispatcher/discord/implementation.rb rename to lib/bas/dispatcher/discord/implementation.rb diff --git a/lib/bns/dispatcher/discord/types/response.rb b/lib/bas/dispatcher/discord/types/response.rb similarity index 100% rename from lib/bns/dispatcher/discord/types/response.rb rename to lib/bas/dispatcher/discord/types/response.rb diff --git a/lib/bns/dispatcher/slack/exceptions/invalid_webhook_token.rb b/lib/bas/dispatcher/slack/exceptions/invalid_webhook_token.rb similarity index 100% rename from lib/bns/dispatcher/slack/exceptions/invalid_webhook_token.rb rename to lib/bas/dispatcher/slack/exceptions/invalid_webhook_token.rb diff --git a/lib/bns/dispatcher/slack/implementation.rb b/lib/bas/dispatcher/slack/implementation.rb similarity index 100% rename from lib/bns/dispatcher/slack/implementation.rb rename to lib/bas/dispatcher/slack/implementation.rb diff --git a/lib/bns/dispatcher/slack/types/response.rb b/lib/bas/dispatcher/slack/types/response.rb similarity index 100% rename from lib/bns/dispatcher/slack/types/response.rb rename to lib/bas/dispatcher/slack/types/response.rb diff --git a/lib/bns/domain/birthday.rb b/lib/bas/domain/birthday.rb similarity index 100% rename from lib/bns/domain/birthday.rb rename to lib/bas/domain/birthday.rb diff --git a/lib/bns/domain/email.rb b/lib/bas/domain/email.rb similarity index 100% rename from lib/bns/domain/email.rb rename to lib/bas/domain/email.rb diff --git a/lib/bns/domain/exceptions/function_not_implemented.rb b/lib/bas/domain/exceptions/function_not_implemented.rb similarity index 100% rename from lib/bns/domain/exceptions/function_not_implemented.rb rename to lib/bas/domain/exceptions/function_not_implemented.rb diff --git a/lib/bns/domain/pto.rb b/lib/bas/domain/pto.rb similarity index 100% rename from lib/bns/domain/pto.rb rename to lib/bas/domain/pto.rb diff --git a/lib/bns/domain/work_items_limit.rb b/lib/bas/domain/work_items_limit.rb similarity index 100% rename from lib/bns/domain/work_items_limit.rb rename to lib/bas/domain/work_items_limit.rb diff --git a/lib/bns/fetcher/base.rb b/lib/bas/fetcher/base.rb similarity index 100% rename from lib/bns/fetcher/base.rb rename to lib/bas/fetcher/base.rb diff --git a/lib/bns/fetcher/imap/base.rb b/lib/bas/fetcher/imap/base.rb similarity index 100% rename from lib/bns/fetcher/imap/base.rb rename to lib/bas/fetcher/imap/base.rb diff --git a/lib/bns/fetcher/imap/types/response.rb b/lib/bas/fetcher/imap/types/response.rb similarity index 100% rename from lib/bns/fetcher/imap/types/response.rb rename to lib/bas/fetcher/imap/types/response.rb diff --git a/lib/bns/fetcher/imap/use_case/support_emails.rb b/lib/bas/fetcher/imap/use_case/support_emails.rb similarity index 100% rename from lib/bns/fetcher/imap/use_case/support_emails.rb rename to lib/bas/fetcher/imap/use_case/support_emails.rb diff --git a/lib/bns/fetcher/notion/base.rb b/lib/bas/fetcher/notion/base.rb similarity index 100% rename from lib/bns/fetcher/notion/base.rb rename to lib/bas/fetcher/notion/base.rb diff --git a/lib/bns/fetcher/notion/exceptions/invalid_api_key.rb b/lib/bas/fetcher/notion/exceptions/invalid_api_key.rb similarity index 100% rename from lib/bns/fetcher/notion/exceptions/invalid_api_key.rb rename to lib/bas/fetcher/notion/exceptions/invalid_api_key.rb diff --git a/lib/bns/fetcher/notion/exceptions/invalid_database_id.rb b/lib/bas/fetcher/notion/exceptions/invalid_database_id.rb similarity index 100% rename from lib/bns/fetcher/notion/exceptions/invalid_database_id.rb rename to lib/bas/fetcher/notion/exceptions/invalid_database_id.rb diff --git a/lib/bns/fetcher/notion/helper.rb b/lib/bas/fetcher/notion/helper.rb similarity index 100% rename from lib/bns/fetcher/notion/helper.rb rename to lib/bas/fetcher/notion/helper.rb diff --git a/lib/bns/fetcher/notion/types/response.rb b/lib/bas/fetcher/notion/types/response.rb similarity index 100% rename from lib/bns/fetcher/notion/types/response.rb rename to lib/bas/fetcher/notion/types/response.rb diff --git a/lib/bns/fetcher/notion/use_case/birthday_next_week.rb b/lib/bas/fetcher/notion/use_case/birthday_next_week.rb similarity index 100% rename from lib/bns/fetcher/notion/use_case/birthday_next_week.rb rename to lib/bas/fetcher/notion/use_case/birthday_next_week.rb diff --git a/lib/bns/fetcher/notion/use_case/birthday_today.rb b/lib/bas/fetcher/notion/use_case/birthday_today.rb similarity index 100% rename from lib/bns/fetcher/notion/use_case/birthday_today.rb rename to lib/bas/fetcher/notion/use_case/birthday_today.rb diff --git a/lib/bns/fetcher/notion/use_case/pto_next_week.rb b/lib/bas/fetcher/notion/use_case/pto_next_week.rb similarity index 100% rename from lib/bns/fetcher/notion/use_case/pto_next_week.rb rename to lib/bas/fetcher/notion/use_case/pto_next_week.rb diff --git a/lib/bns/fetcher/notion/use_case/pto_today.rb b/lib/bas/fetcher/notion/use_case/pto_today.rb similarity index 100% rename from lib/bns/fetcher/notion/use_case/pto_today.rb rename to lib/bas/fetcher/notion/use_case/pto_today.rb diff --git a/lib/bns/fetcher/notion/use_case/work_items_limit.rb b/lib/bas/fetcher/notion/use_case/work_items_limit.rb similarity index 100% rename from lib/bns/fetcher/notion/use_case/work_items_limit.rb rename to lib/bas/fetcher/notion/use_case/work_items_limit.rb diff --git a/lib/bns/fetcher/postgres/base.rb b/lib/bas/fetcher/postgres/base.rb similarity index 100% rename from lib/bns/fetcher/postgres/base.rb rename to lib/bas/fetcher/postgres/base.rb diff --git a/lib/bns/fetcher/postgres/helper.rb b/lib/bas/fetcher/postgres/helper.rb similarity index 100% rename from lib/bns/fetcher/postgres/helper.rb rename to lib/bas/fetcher/postgres/helper.rb diff --git a/lib/bns/fetcher/postgres/types/response.rb b/lib/bas/fetcher/postgres/types/response.rb similarity index 100% rename from lib/bns/fetcher/postgres/types/response.rb rename to lib/bas/fetcher/postgres/types/response.rb diff --git a/lib/bns/fetcher/postgres/use_case/pto_today.rb b/lib/bas/fetcher/postgres/use_case/pto_today.rb similarity index 100% rename from lib/bns/fetcher/postgres/use_case/pto_today.rb rename to lib/bas/fetcher/postgres/use_case/pto_today.rb diff --git a/lib/bns/formatter/base.rb b/lib/bas/formatter/base.rb similarity index 100% rename from lib/bns/formatter/base.rb rename to lib/bas/formatter/base.rb diff --git a/lib/bns/formatter/birthday.rb b/lib/bas/formatter/birthday.rb similarity index 100% rename from lib/bns/formatter/birthday.rb rename to lib/bas/formatter/birthday.rb diff --git a/lib/bns/formatter/exceptions/invalid_data.rb b/lib/bas/formatter/exceptions/invalid_data.rb similarity index 100% rename from lib/bns/formatter/exceptions/invalid_data.rb rename to lib/bas/formatter/exceptions/invalid_data.rb diff --git a/lib/bns/formatter/pto.rb b/lib/bas/formatter/pto.rb similarity index 100% rename from lib/bns/formatter/pto.rb rename to lib/bas/formatter/pto.rb diff --git a/lib/bns/formatter/support_emails.rb b/lib/bas/formatter/support_emails.rb similarity index 100% rename from lib/bns/formatter/support_emails.rb rename to lib/bas/formatter/support_emails.rb diff --git a/lib/bns/formatter/work_items_limit.rb b/lib/bas/formatter/work_items_limit.rb similarity index 100% rename from lib/bns/formatter/work_items_limit.rb rename to lib/bas/formatter/work_items_limit.rb diff --git a/lib/bns/mapper/base.rb b/lib/bas/mapper/base.rb similarity index 100% rename from lib/bns/mapper/base.rb rename to lib/bas/mapper/base.rb diff --git a/lib/bns/mapper/imap/support_emails.rb b/lib/bas/mapper/imap/support_emails.rb similarity index 100% rename from lib/bns/mapper/imap/support_emails.rb rename to lib/bas/mapper/imap/support_emails.rb diff --git a/lib/bns/mapper/notion/birthday_today.rb b/lib/bas/mapper/notion/birthday_today.rb similarity index 100% rename from lib/bns/mapper/notion/birthday_today.rb rename to lib/bas/mapper/notion/birthday_today.rb diff --git a/lib/bns/mapper/notion/pto_today.rb b/lib/bas/mapper/notion/pto_today.rb similarity index 100% rename from lib/bns/mapper/notion/pto_today.rb rename to lib/bas/mapper/notion/pto_today.rb diff --git a/lib/bns/mapper/notion/work_items_limit.rb b/lib/bas/mapper/notion/work_items_limit.rb similarity index 100% rename from lib/bns/mapper/notion/work_items_limit.rb rename to lib/bas/mapper/notion/work_items_limit.rb diff --git a/lib/bns/mapper/postgres/pto_today.rb b/lib/bas/mapper/postgres/pto_today.rb similarity index 100% rename from lib/bns/mapper/postgres/pto_today.rb rename to lib/bas/mapper/postgres/pto_today.rb diff --git a/lib/bns/use_cases/types/config.rb b/lib/bas/use_cases/types/config.rb similarity index 100% rename from lib/bns/use_cases/types/config.rb rename to lib/bas/use_cases/types/config.rb diff --git a/lib/bns/use_cases/use_case.rb b/lib/bas/use_cases/use_case.rb similarity index 100% rename from lib/bns/use_cases/use_case.rb rename to lib/bas/use_cases/use_case.rb diff --git a/lib/bns/use_cases/use_cases.rb b/lib/bas/use_cases/use_cases.rb similarity index 100% rename from lib/bns/use_cases/use_cases.rb rename to lib/bas/use_cases/use_cases.rb diff --git a/lib/bns/version.rb b/lib/bas/version.rb similarity index 62% rename from lib/bns/version.rb rename to lib/bas/version.rb index 1196e34..3f4b76b 100644 --- a/lib/bns/version.rb +++ b/lib/bas/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Bns +module Bas # Gem version - VERSION = "0.3.0" + VERSION = "0.1.0" end diff --git a/lib/bns.rb b/lib/bns.rb deleted file mode 100644 index 2af1f6f..0000000 --- a/lib/bns.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -require_relative "bns/version" -require_relative "bns/use_cases/use_cases" - -module Bns # rubocop:disable Style/Documentation - include UseCases - class Error < StandardError; end -end diff --git a/sig/business_notification_system.rbs b/sig/business_automation_system.rbs similarity index 100% rename from sig/business_notification_system.rbs rename to sig/business_automation_system.rbs diff --git a/spec/bns/dispatcher/base_spec.rb b/spec/bas/dispatcher/base_spec.rb similarity index 100% rename from spec/bns/dispatcher/base_spec.rb rename to spec/bas/dispatcher/base_spec.rb diff --git a/spec/bns/dispatcher/discord_spec.rb b/spec/bas/dispatcher/discord_spec.rb similarity index 100% rename from spec/bns/dispatcher/discord_spec.rb rename to spec/bas/dispatcher/discord_spec.rb diff --git a/spec/bns/dispatcher/slack_spec.rb b/spec/bas/dispatcher/slack_spec.rb similarity index 100% rename from spec/bns/dispatcher/slack_spec.rb rename to spec/bas/dispatcher/slack_spec.rb diff --git a/spec/bns/fetcher/base_spec.rb b/spec/bas/fetcher/base_spec.rb similarity index 100% rename from spec/bns/fetcher/base_spec.rb rename to spec/bas/fetcher/base_spec.rb diff --git a/spec/bns/fetcher/imap/support_email_spec.rb b/spec/bas/fetcher/imap/support_email_spec.rb similarity index 100% rename from spec/bns/fetcher/imap/support_email_spec.rb rename to spec/bas/fetcher/imap/support_email_spec.rb diff --git a/spec/bns/fetcher/notion/birthday_next_week_spec.rb b/spec/bas/fetcher/notion/birthday_next_week_spec.rb similarity index 100% rename from spec/bns/fetcher/notion/birthday_next_week_spec.rb rename to spec/bas/fetcher/notion/birthday_next_week_spec.rb diff --git a/spec/bns/fetcher/notion/birthday_today_spec.rb b/spec/bas/fetcher/notion/birthday_today_spec.rb similarity index 100% rename from spec/bns/fetcher/notion/birthday_today_spec.rb rename to spec/bas/fetcher/notion/birthday_today_spec.rb diff --git a/spec/bns/fetcher/notion/pto_next_week_spec.rb b/spec/bas/fetcher/notion/pto_next_week_spec.rb similarity index 100% rename from spec/bns/fetcher/notion/pto_next_week_spec.rb rename to spec/bas/fetcher/notion/pto_next_week_spec.rb diff --git a/spec/bns/fetcher/notion/pto_today_spec.rb b/spec/bas/fetcher/notion/pto_today_spec.rb similarity index 100% rename from spec/bns/fetcher/notion/pto_today_spec.rb rename to spec/bas/fetcher/notion/pto_today_spec.rb diff --git a/spec/bns/fetcher/notion/work_items_limit_spec.rb b/spec/bas/fetcher/notion/work_items_limit_spec.rb similarity index 100% rename from spec/bns/fetcher/notion/work_items_limit_spec.rb rename to spec/bas/fetcher/notion/work_items_limit_spec.rb diff --git a/spec/bns/fetcher/postgres/pto_today_spec.rb b/spec/bas/fetcher/postgres/pto_today_spec.rb similarity index 100% rename from spec/bns/fetcher/postgres/pto_today_spec.rb rename to spec/bas/fetcher/postgres/pto_today_spec.rb diff --git a/spec/bns/formatter/base_spec.rb b/spec/bas/formatter/base_spec.rb similarity index 100% rename from spec/bns/formatter/base_spec.rb rename to spec/bas/formatter/base_spec.rb diff --git a/spec/bns/formatter/birthday_spec.rb b/spec/bas/formatter/birthday_spec.rb similarity index 100% rename from spec/bns/formatter/birthday_spec.rb rename to spec/bas/formatter/birthday_spec.rb diff --git a/spec/bns/formatter/pto_spec.rb b/spec/bas/formatter/pto_spec.rb similarity index 100% rename from spec/bns/formatter/pto_spec.rb rename to spec/bas/formatter/pto_spec.rb diff --git a/spec/bns/formatter/support_email_spec.rb b/spec/bas/formatter/support_email_spec.rb similarity index 100% rename from spec/bns/formatter/support_email_spec.rb rename to spec/bas/formatter/support_email_spec.rb diff --git a/spec/bns/formatter/work_items_limit_spec.rb b/spec/bas/formatter/work_items_limit_spec.rb similarity index 100% rename from spec/bns/formatter/work_items_limit_spec.rb rename to spec/bas/formatter/work_items_limit_spec.rb diff --git a/spec/bns/mapper/base_spec.rb b/spec/bas/mapper/base_spec.rb similarity index 100% rename from spec/bns/mapper/base_spec.rb rename to spec/bas/mapper/base_spec.rb diff --git a/spec/bns/mapper/imap/support_emails_spec.rb b/spec/bas/mapper/imap/support_emails_spec.rb similarity index 100% rename from spec/bns/mapper/imap/support_emails_spec.rb rename to spec/bas/mapper/imap/support_emails_spec.rb diff --git a/spec/bns/mapper/notion/birthday_today_spec.rb b/spec/bas/mapper/notion/birthday_today_spec.rb similarity index 100% rename from spec/bns/mapper/notion/birthday_today_spec.rb rename to spec/bas/mapper/notion/birthday_today_spec.rb diff --git a/spec/bns/mapper/notion/pto_spec.rb b/spec/bas/mapper/notion/pto_spec.rb similarity index 100% rename from spec/bns/mapper/notion/pto_spec.rb rename to spec/bas/mapper/notion/pto_spec.rb diff --git a/spec/bns/mapper/notion/work_items_limit_spec.rb b/spec/bas/mapper/notion/work_items_limit_spec.rb similarity index 100% rename from spec/bns/mapper/notion/work_items_limit_spec.rb rename to spec/bas/mapper/notion/work_items_limit_spec.rb diff --git a/spec/bns/mapper/postgres/pto_spec.rb b/spec/bas/mapper/postgres/pto_spec.rb similarity index 100% rename from spec/bns/mapper/postgres/pto_spec.rb rename to spec/bas/mapper/postgres/pto_spec.rb diff --git a/spec/bns_spec.rb b/spec/bas_spec.rb similarity index 54% rename from spec/bns_spec.rb rename to spec/bas_spec.rb index 2cbfaae..b24f3ae 100644 --- a/spec/bns_spec.rb +++ b/spec/bas_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -RSpec.describe Bns do +RSpec.describe Bas do it "has a version number" do - expect(Bns::VERSION).not_to be nil + expect(Bas::VERSION).not_to be nil end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 87912ba..fcbfd50 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "bns" +require "bas" require "vcr" require "simplecov" require "simplecov-lcov"