Skip to content

Modernize gem. #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ jobs:
- ubuntu

ruby:
- 2.7

- "2.7"
- "3.0"
- "3.1"
- "3.2"

env:
BUNDLE_GEMFILE: gems/async-v1.rb

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Async head
name: Async v2

on: [push, pull_request]

Expand All @@ -12,10 +12,11 @@ jobs:
- ubuntu

ruby:
- head
- "3.1"
- "3.2"

env:
BUNDLE_GEMFILE: gems/async-head.rb
BUNDLE_GEMFILE: gems/async-v2.rb

steps:
- uses: actions/checkout@v2
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Coverage

on: [push, pull_request]

permissions:
contents: read

env:
CONSOLE_OUTPUT: XTerm
COVERAGE: PartialSummary

jobs:
test:
name: ${{matrix.ruby}} on ${{matrix.os}}
runs-on: ${{matrix.os}}-latest

strategy:
matrix:
os:
- ubuntu
- macos

ruby:
- "3.2"

steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true

- name: Run tests
timeout-minutes: 5
run: bundle exec bake test

- uses: actions/upload-artifact@v2
with:
name: coverage-${{matrix.os}}-${{matrix.ruby}}
path: .covered.db

validate:
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true

- uses: actions/download-artifact@v3

- name: Validate coverage
timeout-minutes: 5
run: bundle exec bake covered:validate --paths */.covered.db \;
61 changes: 61 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Documentation

on:
push:
branches:
- main

# Allows you to run this workflow manually from the Actions tab:
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages:
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment:
concurrency:
group: "pages"
cancel-in-progress: true

env:
CONSOLE_OUTPUT: XTerm
BUNDLE_WITH: maintenance

jobs:
generate:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true

- name: Installing packages
run: sudo apt-get install wget

- name: Generate documentation
timeout-minutes: 5
run: bundle exec bake utopia:project:static --force no

- name: Upload documentation artifact
uses: actions/upload-pages-artifact@v1
with:
path: docs

deploy:
runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}

needs: generate
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
32 changes: 0 additions & 32 deletions .github/workflows/documentation.yml

This file was deleted.

21 changes: 14 additions & 7 deletions .github/workflows/development.yml → .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name: Development
name: Test

on: [push, pull_request]

permissions:
contents: read

env:
CONSOLE_OUTPUT: XTerm

jobs:
test:
name: ${{matrix.ruby}} on ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
continue-on-error: ${{matrix.experimental}}

Expand All @@ -14,12 +21,12 @@ jobs:
- macos

ruby:
- 2.6
- 2.7
- "2.7"
- "3.0"
- "3.1"
- "3.2"

experimental: [false]
env: [""]

include:
- os: ubuntu
Expand All @@ -33,12 +40,12 @@ jobs:
experimental: true

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true

- name: Run tests
timeout-minutes: 5
run: ${{matrix.env}} bundle exec rspec
timeout-minutes: 10
run: bundle exec bake test
15 changes: 5 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
/.bundle/
/.yardoc
/gems.locked
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
/gems.locked
/.covered.db
/external

# rspec failure tracking
.rspec_status
.covered.db
/.rspec
/.rspec_status
8 changes: 6 additions & 2 deletions async-rspec.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true

require_relative "lib/async/rspec/version"

Expand All @@ -6,12 +7,15 @@ Gem::Specification.new do |spec|
spec.version = Async::RSpec::VERSION

spec.summary = "Helpers for writing specs against the async gem."
spec.authors = ["Samuel Williams"]
spec.authors = ["Samuel Williams", "Janko Marohnić", "Olle Jonsson", "Cyril Roelandt", "Jeremy Jung", "Robin Goos"]
spec.license = "MIT"

spec.cert_chain = ['release.cert']
spec.signing_key = File.expand_path('~/.gem/release.pem')

spec.homepage = "https://github.com/socketry/async-rspec"

spec.files = Dir.glob('{lib}/**/*', File::FNM_DOTMATCH, base: __dir__)
spec.files = Dir.glob(['{lib}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__)

spec.add_dependency "rspec", "~> 3.0"
spec.add_dependency "rspec-files", "~> 1.0"
Expand Down
11 changes: 9 additions & 2 deletions gems.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2017-2023, by Samuel Williams.

source 'https://rubygems.org'

# Specify your gem's dependencies in async-rspec.gemspec
gemspec

# gem "async", path: "../async"

gem "rugged", "= 1.4.4"

group :maintenance, optional: true do
gem "bake-modernize"
gem "bake-bundler"
gem "bake-gem"
end

group :test do
gem "ruby-prof", git: "https://github.com/ruby-prof/ruby-prof"
gem "bake-test"
end
7 changes: 0 additions & 7 deletions gems/async-head.rb

This file was deleted.

3 changes: 3 additions & 0 deletions gems/async-v1.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2021, by Samuel Williams.

source 'https://rubygems.org'

gemspec path: "../"
Expand Down
10 changes: 10 additions & 0 deletions gems/async-v2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2021-2023, by Samuel Williams.

source 'https://rubygems.org'

gemspec path: "../"

gem 'async', '~> 2.0'
23 changes: 4 additions & 19 deletions lib/async/rspec.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
# Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
#
# 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.
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2017-2018, by Samuel Williams.

require_relative "rspec/version"
require_relative "rspec/reactor"
Expand Down
23 changes: 4 additions & 19 deletions lib/async/rspec/buffer.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
# Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
#
# 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.
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2018, by Samuel Williams.

require 'securerandom'

Expand Down
Loading