Commit 55c6b27
2021-12-22 21:41:06
Changed files (21)
.github
workflows
lib
straw
sig
.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
bin/bootstrap
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+
+cd "$(dirname "$0")/.."
bin/console
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+require "bundler/setup"
+require "straw"
+
+require "irb"
+IRB.start(__FILE__)
bin/lint
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+bundle exec rubocop "$@"
bin/setup
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+gem install bundler
+bundle install
bin/shipit
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+bundle exec rake release
bin/test
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+bundle exec rake test "$@"
lib/straw/version.rb
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+module Straw
+ VERSION = "0.1.0"
+end
lib/straw.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+require_relative "straw/version"
+
+module Straw
+ class Error < StandardError; end
+end
sig/straw.rbs
@@ -0,0 +1,4 @@
+module Straw
+ VERSION: String
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
+end
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"
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
.gitignore
@@ -0,0 +1,8 @@
+/.bundle/
+/.yardoc
+/_yardoc/
+/coverage/
+/doc/
+/pkg/
+/spec/reports/
+/tmp/
.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
CHANGELOG.md
@@ -0,0 +1,5 @@
+## [Unreleased]
+
+## [0.1.0] - 2021-12-22
+
+- Initial release
Gemfile
@@ -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"
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
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.
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]
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).
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