Skip to content
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

chore: fix gemspec metadata + housekeeping #43

Merged
merged 5 commits into from
Feb 26, 2024
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
43 changes: 31 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.0", "2.7", "2.6", "jruby", "truffleruby", "debug"]
ruby: ["3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "jruby", "truffleruby", "debug"]
runs-on: ubuntu-latest
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
steps:
Expand All @@ -29,18 +29,37 @@ jobs:
coverage:
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
runs-on: ubuntu-latest
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Upload code coverage data to CodeClimate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: bin/rake test:coverage
debug: true
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Generate coverage
run: bin/rake test:coverage
- name: Upload code coverage report to Coveralls
uses: coverallsapp/github-action@v2
with:
file: coverage/lcov.info
debug: true
if: success()
continue-on-error: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
verbose: true
if: success()
continue-on-error: true
- name: Upload code coverage data to CodeClimate
uses: paambaati/codeclimate-action@v5
with:
coverageLocations: coverage/coverage.json:simplecov
debug: true
if: success()
continue-on-error: true

lint:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-3.1.0
ruby-3.3.0
17 changes: 12 additions & 5 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
formatters = SimpleCov.formatters
require "simplecov_json_formatter"
require "simplecov-lcov"

if ENV.key?("CI")
require "codecov"
formatters << SimpleCov::Formatter::Codecov
SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = "coverage/lcov.info"
end

SimpleCov.formatters = formatters
SimpleCov.formatters = [
SimpleCov::Formatter::LcovFormatter,
SimpleCov::Formatter::JSONFormatter
]

SimpleCov.start do
enable_coverage_for_eval if SimpleCov.coverage_for_eval_supported?
enable_coverage(:branch)

track_files "**/*.rb"
end
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ group :test do
gem "rake"
gem "rspec"
gem "rspec-its"
gem "simplecov", require: false
gem "simplecov_json_formatter", require: false
gem "simplecov-lcov", require: false
gem "vcr"
gem "webmock"
end
Expand All @@ -18,9 +21,7 @@ group :development do
end

group :lint do
gem "codecov"
gem "bundler-audit", require: false
gem "simplecov", require: false
gem "standard", require: false
gem "yard-junk", require: false
end
157 changes: 92 additions & 65 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,41 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activemodel (7.0.2.2)
activesupport (= 7.0.2.2)
activesupport (7.0.2.2)
activemodel (7.1.3.2)
activesupport (= 7.1.3.2)
activesupport (7.1.3.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
backports (3.23.0)
break (0.30.0)
bundler-audit (0.9.0.1)
backports (3.24.1)
base64 (0.2.0)
bigdecimal (3.1.6)
break (0.40.0)
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
codecov (0.6.0)
simplecov (>= 0.15, < 0.22)
coderay (1.1.3)
concurrent-ruby (1.1.9)
crack (0.4.5)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
rexml
diff-lcs (1.5.0)
diff-lcs (1.5.1)
docile (1.4.0)
ffi (1.15.5)
drb (2.2.0)
ruby2_keywords
ffi (1.16.3)
formatador (1.1.0)
guard (2.18.0)
guard (2.18.1)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
lumberjack (>= 1.0.12, < 2.0)
Expand All @@ -47,86 +56,103 @@ GEM
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
hashdiff (1.0.1)
i18n (1.10.0)
hashdiff (1.1.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
listen (3.7.1)
json (2.7.1)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
lumberjack (1.2.8)
lumberjack (1.2.10)
method_source (1.0.0)
minitest (5.15.0)
minitest (5.22.2)
mutex_m (0.2.0)
nenv (0.3.0)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
parallel (1.21.0)
parser (3.1.0.0)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
pry (0.14.1)
racc
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
public_suffix (5.0.4)
racc (1.7.3)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.1)
rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.2.0)
rexml (3.2.5)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.2)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.2)
regexp_parser (2.9.0)
rexml (3.2.6)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (~> 3.13.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.10.3)
rspec-mocks (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.3)
rubocop (1.25.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.15.1, < 2.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.15.1)
parser (>= 3.0.1.1)
rubocop-performance (1.13.2)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.11.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
shellany (0.0.1)
simplecov (0.21.2)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
standard (1.7.0)
rubocop (= 1.25.0)
rubocop-performance (= 1.13.2)
thor (1.2.1)
tzinfo (2.0.4)
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.4)
standard (1.34.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.60)
standard-custom (~> 1.0.0)
standard-performance (~> 1.3)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.3.1)
lint_roller (~> 1.1)
rubocop-performance (~> 1.20.2)
thor (1.3.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.1.0)
vcr (6.0.0)
webmock (3.14.0)
unicode-display_width (2.5.0)
vcr (6.2.0)
webmock (3.23.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.7.0)
yard (0.9.27)
webrick (~> 1.7.0)
yard (0.9.34)
yard-junk (0.0.9)
backports (>= 3.18)
rainbow
Expand All @@ -139,13 +165,14 @@ PLATFORMS
DEPENDENCIES
break
bundler-audit
codecov
guard-rspec
pry
rake
rspec
rspec-its
simplecov
simplecov-lcov
simplecov_json_formatter
standard
vcr
webmock
Expand All @@ -154,4 +181,4 @@ DEPENDENCIES
yard-junk

BUNDLED WITH
2.3.5
2.5.6
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# XDR, for Ruby

[![Build Status](https://travis-ci.org/stellar/ruby-xdr.svg?branch=master)](https://travis-ci.org/stellar/ruby-xdr)
[![Docs](http://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/gems/xdr)
[![Gem Version](https://badge.fury.io/rb/xdr.svg)](https://badge.fury.io/rb/xdr)
[![CI](https://github.com/astroband/ruby-xdr/actions/workflows/ci.yml/badge.svg)](https://github.com/astroband/ruby-xdr/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/astroband/ruby-xdr/badge.svg?branch=main)](https://coveralls.io/github/astroband/ruby-xdr?branch=main)
[![Code Climate](https://codeclimate.com/github/stellar/ruby-xdr/badges/gpa.svg)](https://codeclimate.com/github/stellar/ruby-xdr)

XDR is an open data format, specified in [RFC 4506](http://tools.ietf.org/html/rfc4506.html). This library provides a
Expand Down
10 changes: 5 additions & 5 deletions lib/xdr/concerns/converts_to_xdr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ def to_xdr(val, encoding = "raw")
# @return [Object] the deserialized value
def from_xdr(string, encoding = "raw")
raw = case String(encoding)
when "raw" then string
when "hex" then [string].pack("H*")
when "base64" then Base64.strict_decode64(string)
else
raise ArgumentError, "Invalid encoding #{encoding.inspect}: must be 'raw', 'base64', or 'hex'"
when "raw" then string
when "hex" then [string].pack("H*")
when "base64" then Base64.strict_decode64(string)
else
raise ArgumentError, "Invalid encoding #{encoding.inspect}: must be 'raw', 'base64', or 'hex'"
end

io = StringIO.new(raw)
Expand Down
2 changes: 1 addition & 1 deletion lib/xdr/dsl/struct.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def attribute(name, type)
read_attribute(name)
end

define_method "#{name}=" do |v|
define_method :"#{name}=" do |v|
write_attribute(name, v)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/xdr/struct.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class XDR::Struct
def self.read(io)
new.tap do |result|
fields.each do |name, type|
result.public_send("#{name}=", type.read(io))
result.public_send(:"#{name}=", type.read(io))
end
end
end
Expand Down
6 changes: 4 additions & 2 deletions xdr.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ Gem::Specification.new do |spec|
spec.bindir = "exe"

spec.metadata = {
"github_repo" => spec.homepage.sub("https", "ssh"),
"source_code_uri" => spec.homepage,
"bug_tracker_uri" => "#{spec.homepage}/issues",
"changelog_uri" => "#{spec.homepage}/blob/v#{spec.version}/CHANGELOG.md",
"documentation_uri" => "https://rubydoc.info/gems/xdr/#{spec.version}/",
"source_code_uri" => "#{spec.homepage}/tree/v#{spec.version}"
"homepage_uri" => "#{spec.homepage}/tree/v#{spec.version}/",
"documentation_uri" => "https://rubydoc.info/gems/xdr/#{spec.version}/"
}

spec.required_ruby_version = ">= 2.4.0"
Expand Down
Loading