diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..935010f --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,36 @@ +version: 2.1 +jobs: + build: + working_directory: ~/project + docker: + - image: bkuhlmann/alpine-ruby:latest + steps: + - checkout + + - restore_cache: + name: Gems Restore + keys: + - gem-cache-{{.Branch}}-{{checksum "Gemfile.lock"}} + - gem-cache- + + - run: + name: Gems Install + command: | + gem update --system + bundle config set path "vendor/bundle" + bundle install + + - save_cache: + name: Gems Store + key: gem-cache-{{.Branch}}-{{checksum "Gemfile.lock"}} + paths: + - vendor/bundle + + - run: + name: Rake + command: bundle exec rake + + - store_artifacts: + name: SimpleCov Report + path: ~/project/coverage + destination: coverage diff --git a/.config/rubocop/config.yml b/.config/rubocop/config.yml new file mode 100644 index 0000000..bb2750e --- /dev/null +++ b/.config/rubocop/config.yml @@ -0,0 +1,2 @@ +inherit_gem: + caliber: config/all.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..9052769 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Community + url: https://discord.gg/CAgBZQqVWp + about: Please ask questions or discuss specifics here. diff --git a/.github/ISSUE_TEMPLATE/issue.md b/.github/ISSUE_TEMPLATE/issue.md new file mode 100644 index 0000000..61adc6e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue.md @@ -0,0 +1,18 @@ +--- +name: Issue +title: "Add|Update|Fix|Remove|Refactor " +about: Report an issue. Please use only one of the subject prefixes. +--- + + + +## Why + + +## How + + +## Notes + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1b93c92 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +## Overview + + +## Screenshots/Screencasts + + +## Details + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bdad464 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.bundle +tmp +Gemfile.lock diff --git a/.reek.yml b/.reek.yml new file mode 100644 index 0000000..a2736e3 --- /dev/null +++ b/.reek.yml @@ -0,0 +1,7 @@ +exclude_paths: + - tmp + - vendor + +detectors: + LongParameterList: + enabled: false diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..1454f6e --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +4.0.1 diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..e7d9b56 --- /dev/null +++ b/Gemfile @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +ruby file: ".ruby-version" + +source "https://rubygems.org" + +gem "refinements", "~> 14.0" +gem "zeitwerk", "~> 2.7" + +group :quality do + gem "caliber", "~> 0.87" + gem "git-lint", "~> 10.0" + gem "reek", "~> 6.5", require: false + gem "simplecov", "~> 0.22", require: false +end + +group :development do + gem "rake", "~> 13.3" +end + +group :test do + gem "rspec", "~> 3.13" +end + +group :tools do + gem "amazing_print", "~> 2.0" + gem "debug", "~> 1.11" + gem "irb-kit", "~> 2.0" + gem "repl_type_completor", "~> 0.1" +end diff --git a/LICENSE.adoc b/LICENSE.adoc new file mode 100644 index 0000000..26c1ada --- /dev/null +++ b/LICENSE.adoc @@ -0,0 +1,20 @@ +Copyright 2025 link:https://trmnl.com[TRMNL]. + +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/README.adoc b/README.adoc new file mode 100644 index 0000000..2f9673c --- /dev/null +++ b/README.adoc @@ -0,0 +1,58 @@ +:toc: macro +:toclevels: 5 +:figure-caption!: + += Sensor Scanner + +toc::[] + +== Features + +== Requirements + +. link:https://www.ruby-lang.org[Ruby]. + +== Setup + +To set up project, run: + +[source,bash] +---- +git clone https://github.com/bkuhlmann/sensor_scanner +cd sensor_scanner +bin/setup +---- + +== Usage + +== Development + +To contribute, run: + +[source,bash] +---- +git clone https://github.com/usetrmnl/sensor_scanner +cd sensor_scanner +bin/setup +---- + +You can also use the IRB console for direct access to all objects: + +[source,bash] +---- +bin/console +---- + +== Tests + +To test, run: + +[source,bash] +---- +bin/rake +---- + +== Credits + +* Built with link:https://alchemists.io/projects/rubysmith[Rubysmith]. +* Engineered by {trmnl_link}. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..7d50342 --- /dev/null +++ b/Rakefile @@ -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 quality: %i[git_lint reek rubocop] + +task default: %i[quality spec] diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..9bef742 --- /dev/null +++ b/bin/rake @@ -0,0 +1,6 @@ +#! /usr/bin/env ruby +# frozen_string_literal: true + +require "bundler/setup" + +load Gem.bin_path "rake", "rake" diff --git a/bin/rspec b/bin/rspec new file mode 100755 index 0000000..328edde --- /dev/null +++ b/bin/rspec @@ -0,0 +1,6 @@ +#! /usr/bin/env ruby +# frozen_string_literal: true + +require "bundler/setup" + +load Gem.bin_path "rspec-core", "rspec" diff --git a/bin/rubocop b/bin/rubocop new file mode 100755 index 0000000..fcc59f5 --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,6 @@ +#! /usr/bin/env ruby +# frozen_string_literal: true + +require "bundler/setup" + +load Gem.bin_path "rubocop", "rubocop" diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..158efba --- /dev/null +++ b/bin/setup @@ -0,0 +1,16 @@ +#! /usr/bin/env ruby +# frozen_string_literal: true + +require "debug" +require "fileutils" + +APP_ROOT = Pathname(__dir__).join("..").expand_path + +Runner = lambda do |*arguments, kernel: Kernel| + kernel.system(*arguments) || kernel.abort("\nERROR: Command #{arguments.inspect} failed.") +end + +FileUtils.chdir APP_ROOT do + puts "Installing dependencies..." + Runner.call "bundle install" +end