diff options
| author | mo khan <mo@mokhan.ca> | 2021-12-22 14:41:06 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2021-12-22 14:41:06 -0700 |
| commit | 55c6b27396a2a9d68cdfebe871159ed20b4cea17 (patch) | |
| tree | 31eb0008cbc2249d93468bdd539e2e3f85fbcf8a | |
initial commitv0.1.0
| -rw-r--r-- | .github/workflows/main.yml | 32 | ||||
| -rw-r--r-- | .gitignore | 8 | ||||
| -rw-r--r-- | .rubocop.yml | 86 | ||||
| -rw-r--r-- | CHANGELOG.md | 5 | ||||
| -rw-r--r-- | Gemfile | 12 | ||||
| -rw-r--r-- | Gemfile.lock | 48 | ||||
| -rw-r--r-- | LICENSE.txt | 21 | ||||
| -rw-r--r-- | README.md | 33 | ||||
| -rw-r--r-- | Rakefile | 16 | ||||
| -rwxr-xr-x | bin/bootstrap | 5 | ||||
| -rwxr-xr-x | bin/console | 8 | ||||
| -rwxr-xr-x | bin/lint | 7 | ||||
| -rwxr-xr-x | bin/setup | 8 | ||||
| -rwxr-xr-x | bin/shipit | 7 | ||||
| -rwxr-xr-x | bin/test | 7 | ||||
| -rw-r--r-- | lib/straw.rb | 7 | ||||
| -rw-r--r-- | lib/straw/version.rb | 5 | ||||
| -rw-r--r-- | sig/straw.rbs | 4 | ||||
| -rw-r--r-- | straw.gemspec | 33 | ||||
| -rw-r--r-- | test/test_helper.rb | 6 | ||||
| -rw-r--r-- | test/test_straw.rb | 9 |
21 files changed, 367 insertions, 0 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..3052995 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,32 @@ +name: ci +on: + push: + branches: + - main + pull_request: + workflow_dispatch: +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.0.3 + bundler-cache: true + - run: ./script/setup + - run: ./script/lint + test: + runs-on: ubuntu-latest + strategy: + matrix: + ruby: + - 3.0.3 + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: ./script/setup + - run: ./script/test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9106b2a --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..0ffb8e3 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,86 @@ +require: + - rubocop-minitest + - rubocop-rake + +AllCops: + NewCops: enable + TargetRubyVersion: 3.0 + +Style/StringLiterals: + Enabled: true + EnforcedStyle: double_quotes + +Style/StringLiteralsInInterpolation: + Enabled: true + EnforcedStyle: double_quotes + +Layout/ArgumentAlignment: + EnforcedStyle: with_fixed_indentation + +Layout/ParameterAlignment: + Enabled: true + EnforcedStyle: with_fixed_indentation + IndentationWidth: 2 + +Layout/EndOfLine: + EnforcedStyle: lf + +Layout/FirstArrayElementIndentation: + EnforcedStyle: consistent + +Layout/FirstHashElementIndentation: + EnforcedStyle: consistent + +Layout/MultilineMethodCallIndentation: + Enabled: true + EnforcedStyle: indented + +Lint/AmbiguousBlockAssociation: + Exclude: + - 'test/**/*.rb' + +Lint/RaiseException: + Enabled: true + +Lint/StructNewOverride: + Enabled: true + +Metrics/BlockLength: + Exclude: + - '*.gemspec' + - 'Rakefile' + - 'test/**/*.rb' + +Metrics/ModuleLength: + Exclude: + - 'test/**/*.rb' + +Layout/LineLength: + Exclude: + - 'test/**/*.rb' + IgnoredPatterns: + - '^#*' + +Naming/RescuedExceptionsVariableName: + PreferredName: boom + +Style/Documentation: + Enabled: false + +Style/HashEachMethods: + Enabled: true + +Style/HashTransformKeys: + Enabled: true + +Style/HashTransformValues: + Enabled: true + +Style/WordArray: + Enabled: false + +Style/TrailingCommaInArrayLiteral: + Enabled: false + +Style/TrailingCommaInHashLiteral: + Enabled: false diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f788ccf --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +## [Unreleased] + +## [0.1.0] - 2021-12-22 + +- Initial release @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +# Specify your gem's dependencies in straw.gemspec +gemspec + +gem "minitest", "~> 5.0" +gem "rake", "~> 13.0" +gem "rubocop", "~> 1.21" +gem "rubocop-minitest", "~> 0.17" +gem "rubocop-rake", "~> 0.6" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..c41a4bc --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,48 @@ +PATH + remote: . + specs: + straw (0.1.0) + +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.2) + minitest (5.15.0) + parallel (1.21.0) + parser (3.0.3.2) + ast (~> 2.4.1) + rainbow (3.0.0) + rake (13.0.6) + regexp_parser (2.2.0) + rexml (3.2.5) + rubocop (1.23.0) + parallel (~> 1.10) + parser (>= 3.0.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.12.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.15.0) + parser (>= 3.0.1.1) + rubocop-minitest (0.17.0) + rubocop (>= 0.90, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + ruby-progressbar (1.11.0) + unicode-display_width (2.1.0) + +PLATFORMS + x86_64-linux + +DEPENDENCIES + minitest (~> 5.0) + rake (~> 13.0) + rubocop (~> 1.21) + rubocop-minitest (~> 0.17) + rubocop-rake (~> 0.6) + straw! + +BUNDLED WITH + 2.3.0 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..d425916 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 mo khan + +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.md b/README.md new file mode 100644 index 0000000..86255b5 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# Straw + +You can build a lot of things with straw. + +## Installation + +Add this line to your application's Gemfile: + +```ruby +gem 'straw' +``` + +And then execute: + + $ bundle install + +Or install it yourself as: + + $ gem install straw + +## Development + +After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. + +To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/xlg-pkg/straw. + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..21ef734 --- /dev/null +++ b/Rakefile @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require "bundler/gem_tasks" +require "rake/testtask" + +Rake::TestTask.new(:test) do |t| + t.libs << "test" + t.libs << "lib" + t.test_files = FileList["test/**/test_*.rb"] +end + +require "rubocop/rake_task" + +RuboCop::RakeTask.new + +task default: %i[test rubocop] diff --git a/bin/bootstrap b/bin/bootstrap new file mode 100755 index 0000000..236c938 --- /dev/null +++ b/bin/bootstrap @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +cd "$(dirname "$0")/.." diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..d795742 --- /dev/null +++ b/bin/console @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require "bundler/setup" +require "straw" + +require "irb" +IRB.start(__FILE__) diff --git a/bin/lint b/bin/lint new file mode 100755 index 0000000..84c1e00 --- /dev/null +++ b/bin/lint @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +cd "$(dirname "$0")/.." + +bundle exec rubocop "$@" diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..809cbe2 --- /dev/null +++ b/bin/setup @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +cd "$(dirname "$0")/.." + +gem install bundler +bundle install diff --git a/bin/shipit b/bin/shipit new file mode 100755 index 0000000..43f815f --- /dev/null +++ b/bin/shipit @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +cd "$(dirname "$0")/.." + +bundle exec rake release diff --git a/bin/test b/bin/test new file mode 100755 index 0000000..87f4a7b --- /dev/null +++ b/bin/test @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +cd "$(dirname "$0")/.." + +bundle exec rake test "$@" diff --git a/lib/straw.rb b/lib/straw.rb new file mode 100644 index 0000000..1a7bad2 --- /dev/null +++ b/lib/straw.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require_relative "straw/version" + +module Straw + class Error < StandardError; end +end diff --git a/lib/straw/version.rb b/lib/straw/version.rb new file mode 100644 index 0000000..59da9e5 --- /dev/null +++ b/lib/straw/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module Straw + VERSION = "0.1.0" +end diff --git a/sig/straw.rbs b/sig/straw.rbs new file mode 100644 index 0000000..589ff81 --- /dev/null +++ b/sig/straw.rbs @@ -0,0 +1,4 @@ +module Straw + VERSION: String + # See the writing guide of rbs: https://github.com/ruby/rbs#guides +end diff --git a/straw.gemspec b/straw.gemspec new file mode 100644 index 0000000..545855b --- /dev/null +++ b/straw.gemspec @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require_relative "lib/straw/version" + +Gem::Specification.new do |spec| + spec.name = "straw" + spec.version = Straw::VERSION + spec.authors = ["mo khan"] + spec.email = ["mo@mokhan.ca"] + + spec.summary = "You can build a lot of things with straw." + spec.description = "You can build a lot of things with straw." + spec.homepage = "https://github.com/xlg-pkg/straw" + spec.license = "MIT" + spec.required_ruby_version = ">= 3.0.0" + + spec.metadata["changelog_uri"] = "https://github.com/xlg-pkg/straw" + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["rubygems_mfa_required"] = "true" + spec.metadata["source_code_uri"] = "https://github.com/xlg-pkg/straw" + + spec.files = Dir.glob([ + "*.gemspec", + "LICENSE.txt", + "README.md", + "lib/**/*.rb", + "sig/**/*.rbs", + ]) + + spec.bindir = "exe" + spec.executables = [] + spec.require_paths = ["lib"] +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..4bcd97a --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +$LOAD_PATH.unshift File.expand_path("../lib", __dir__) +require "straw" + +require "minitest/autorun" diff --git a/test/test_straw.rb b/test/test_straw.rb new file mode 100644 index 0000000..8de355b --- /dev/null +++ b/test/test_straw.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require "test_helper" + +class TestStraw < Minitest::Test + def test_that_it_has_a_version_number + refute_nil ::Straw::VERSION + end +end |
