Skip to content

Commit

Permalink
Modernize gem.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Feb 7, 2024
1 parent 751ad80 commit dd0567d
Show file tree
Hide file tree
Showing 24 changed files with 109 additions and 33 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = tab
indent_size = 2

[*.{yml,yaml}]
indent_style = space
indent_size = 2
10 changes: 5 additions & 5 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
- macos

ruby:
- "3.2"
- "3.3"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
Expand All @@ -34,7 +34,7 @@ jobs:
timeout-minutes: 5
run: bundle exec bake test

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: coverage-${{matrix.os}}-${{matrix.ruby}}
path: .covered.db
Expand All @@ -44,10 +44,10 @@ jobs:
runs-on: ubuntu-latest

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

- uses: actions/download-artifact@v3
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Documentation

on:
push:
branches:
- main

# 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@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
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@v2
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@v3
2 changes: 1 addition & 1 deletion .github/workflows/test-external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- "3.3"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ jobs:
experimental: true

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

- name: Run tests
timeout-minutes: 10
run: bundle exec rspec
run: bundle exec bake test
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/pkg
/.bundle/
/pkg/
/gems.locked
/.rspec_status
/.covered.db
/external
2 changes: 1 addition & 1 deletion .rspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
--format documentation
--backtrace
--require spec_helper
--warnings
--warnings
9 changes: 8 additions & 1 deletion gems.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2022, by Samuel Williams.
# Copyright, 2010, by Tohru Hashimoto.
# Copyright, 2011-2013, by Nick Sieger.
# Copyright, 2017-2024, by Samuel Williams.

source "https://rubygems.org"

Expand All @@ -13,10 +15,15 @@
group :maintenance, optional: true do
gem "bake-gem"
gem "bake-modernize"

gem "utopia-project"
end
end

group :test do
gem "covered"
gem "rspec", "~> 3.4"

gem "bake-test"
gem "bake-test-external"
end
2 changes: 1 addition & 1 deletion lib/composite_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Copyright, 2013, by Mislav Marohnić.
# Copyright, 2013, by Leo Cassarani.
# Copyright, 2019, by Olle Jonsson.
# Copyright, 2022, by Samuel Williams.
# Copyright, 2022-2024, by Samuel Williams.

warn "Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!"
require_relative 'multipart/post'
2 changes: 1 addition & 1 deletion lib/multipart/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Released under the MIT License.
# Copyright, 2019, by Patrick Davey.
# Copyright, 2021-2022, by Samuel Williams.
# Copyright, 2021-2024, by Samuel Williams.

require_relative 'post/multipartable'
require_relative 'post/upload_io'
2 changes: 1 addition & 1 deletion lib/multipart/post/composite_read_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Copyright, 2019, by Olle Jonsson.
# Copyright, 2019, by Patrick Davey.
# Copyright, 2021, by Lewis Cowles.
# Copyright, 2021-2022, by Samuel Williams.
# Copyright, 2021-2024, by Samuel Williams.

module Multipart
module Post
Expand Down
2 changes: 1 addition & 1 deletion lib/multipart/post/multipartable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Copyright, 2013, by Socrates Vicente.
# Copyright, 2013, by Steffen Grunwald.
# Copyright, 2019, by Olle Jonsson.
# Copyright, 2019-2022, by Samuel Williams.
# Copyright, 2019-2024, by Samuel Williams.
# Copyright, 2019, by Patrick Davey.
# Copyright, 2022, by Jason York.

Expand Down
2 changes: 1 addition & 1 deletion lib/multipart/post/parts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Copyright, 2019-2021, by Olle Jonsson.
# Copyright, 2019, by Ethan Turkeltaub.
# Copyright, 2019, by Patrick Davey.
# Copyright, 2021-2022, by Samuel Williams.
# Copyright, 2021-2024, by Samuel Williams.

require 'stringio'

Expand Down
2 changes: 1 addition & 1 deletion lib/multipart/post/upload_io.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2022, by Samuel Williams.
# Copyright, 2022-2024, by Samuel Williams.

module Multipart
module Post
Expand Down
2 changes: 1 addition & 1 deletion lib/multipart_post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Released under the MIT License.
# Copyright, 2009-2013, by Nick Sieger.
# Copyright, 2019-2022, by Samuel Williams.
# Copyright, 2019-2024, by Samuel Williams.

warn "Top level ::MultipartPost is deprecated, require 'multipart/post' and use `Multipart::Post` instead!"
require_relative 'multipart/post'
Expand Down
2 changes: 1 addition & 1 deletion lib/multipartable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Copyright, 2013, by Socrates Vicente.
# Copyright, 2013, by Steffen Grunwald.
# Copyright, 2019, by Olle Jonsson.
# Copyright, 2019-2022, by Samuel Williams.
# Copyright, 2019-2024, by Samuel Williams.
# Copyright, 2019, by Patrick Davey.

warn "Top level ::Multipartable is deprecated, require 'multipart/post' and use `Multipart::Post::Multipartable` instead!"
Expand Down
2 changes: 1 addition & 1 deletion lib/net/http/post/multipart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Copyright, 2008, by McClain Looney.
# Copyright, 2019, by Olle Jonsson.
# Copyright, 2019, by Patrick Davey.
# Copyright, 2021-2022, by Samuel Williams.
# Copyright, 2021-2024, by Samuel Williams.

require 'net/http'

Expand Down
2 changes: 1 addition & 1 deletion lib/parts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Copyright, 2017, by Eric Hutzelman.
# Copyright, 2019, by Olle Jonsson.
# Copyright, 2019, by Ethan Turkeltaub.
# Copyright, 2022, by Samuel Williams.
# Copyright, 2022-2024, by Samuel Williams.

warn "Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!"
require_relative 'multipart/post'
Expand Down
3 changes: 2 additions & 1 deletion license.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Copyright, 2013, by Leo Cassarani.
Copyright, 2013, by Jagtesh Chadha.
Copyright, 2013, by Steffen Grunwald.
Copyright, 2013, by Lonre Wang.
Copyright, 2017-2023, by Samuel Williams.
Copyright, 2017-2024, by Samuel Williams.
Copyright, 2017, by Feuda Nan.
Copyright, 2017, by David Moles.
Copyright, 2017, by Matt Colyer.
Expand All @@ -37,6 +37,7 @@ Copyright, 2021, by Lewis Cowles.
Copyright, 2022, by Jason York.
Copyright, 2022, by Takuya Noguchi.
Copyright, 2023, by Peter Goldstein.
Copyright, 2024, by Masato Nakamura.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 2 additions & 6 deletions multipart-post.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@ Gem::Specification.new do |spec|
spec.version = Multipart::Post::VERSION

spec.summary = "A multipart form post accessory for Net::HTTP."
spec.authors = ["Nick Sieger", "Samuel Williams", "Olle Jonsson", "McClain Looney", "Lewis Cowles", "Gustav Ernberg", "Patrick Davey", "Steven Davidovitz", "Alex Koppel", "Ethan Turkeltaub", "Jagtesh Chadha", "Jason York", "Tohru Hashimoto", "Vincent Pellé", "hexfet", "Christine Yen", "David Moles", "Eric Hutzelman", "Feuda Nan", "Gerrit Riessen", "Jan Piotrowski", "Jan-Joost Spanjers", "Jason Moore", "Jeff Hodges", "Johannes Wagener", "Jordi Massaguer Pla", "Lachlan Priest", "Leo Cassarani", "Lonre Wang", "Luke Redpath", "Matt Colyer", "Mislav Marohnić", "Peter Goldstein", "Socrates Vicente", "Steffen Grunwald", "Takuya Noguchi", "Tim Barkley"]
spec.authors = ["Nick Sieger", "Samuel Williams", "Olle Jonsson", "McClain Looney", "Lewis Cowles", "Gustav Ernberg", "Patrick Davey", "Steven Davidovitz", "Alex Koppel", "Ethan Turkeltaub", "Jagtesh Chadha", "Jason York", "Tohru Hashimoto", "Vincent Pellé", "hexfet", "Christine Yen", "David Moles", "Eric Hutzelman", "Feuda Nan", "Gerrit Riessen", "Jan Piotrowski", "Jan-Joost Spanjers", "Jason Moore", "Jeff Hodges", "Johannes Wagener", "Jordi Massaguer Pla", "Lachlan Priest", "Leo Cassarani", "Lonre Wang", "Luke Redpath", "Masato Nakamura", "Matt Colyer", "Mislav Marohnić", "Peter Goldstein", "Socrates Vicente", "Steffen Grunwald", "Takuya Noguchi", "Tim Barkley"]
spec.license = "MIT"

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

spec.homepage = "https://github.com/socketry/multipart-post"

spec.files = Dir['{lib}/**/*', '*.md']
spec.files = Dir['{lib}/**/*', '*.md', base: __dir__]

spec.required_ruby_version = ">= 2.5.0"

spec.add_development_dependency "bundler"
spec.add_development_dependency "rspec", "~> 3.4"
spec.add_development_dependency "covered"
end
7 changes: 6 additions & 1 deletion spec/multipart/post/composite_read_io_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2017-2021, by Samuel Williams.
# Copyright, 2006-2013, by Nick Sieger.
# Copyright, 2010, by Tohru Hashimoto.
# Copyright, 2011, by Alex Koppel.
# Copyright, 2011, by Luke Redpath.
# Copyright, 2013, by Mislav Marohnić.
# Copyright, 2017-2024, by Samuel Williams.
# Copyright, 2019, by Patrick Davey.
# Copyright, 2021, by Lewis Cowles.

Expand Down
2 changes: 1 addition & 1 deletion spec/multipart/post/parts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Copyright, 2011-2013, by Nick Sieger.
# Copyright, 2012, by Steven Davidovitz.
# Copyright, 2012, by hexfet.
# Copyright, 2017-2022, by Samuel Williams.
# Copyright, 2017-2024, by Samuel Williams.
# Copyright, 2017, by Eric Hutzelman.
# Copyright, 2019, by Ethan Turkeltaub.
# Copyright, 2019, by Patrick Davey.
Expand Down
2 changes: 1 addition & 1 deletion spec/net/http/post/multipart_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Copyright, 2013, by Gustav Ernberg.
# Copyright, 2013, by Socrates Vicente.
# Copyright, 2013, by Steffen Grunwald.
# Copyright, 2017-2021, by Samuel Williams.
# Copyright, 2017-2024, by Samuel Williams.
# Copyright, 2019, by Patrick Davey.
# Copyright, 2022, by Jason York.

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2017-2022, by Samuel Williams.
# Copyright, 2017-2024, by Samuel Williams.
# Copyright, 2019, by Patrick Davey.

require "bundler/setup"
Expand Down

0 comments on commit dd0567d

Please sign in to comment.