Skip to content
Open
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
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/*.gem
doc
test/test-data/lorem2.txt.xz
pkg/
/.bundle
/.yardoc
/doc
/pkg
/spec/.status
/spec/coverage
/spec/test-data/lorem2.txt.xz
/spec/test-data/testtarball.tar.xz
24 changes: 19 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ before_script:
- rm -rf /var/cache/apk
- ln -s "$PWD"/vendor/apk /var/cache/
- apk add git xz
- gem install bundler -v 2.3.7
- if [ "$RUBY_IS_EOL" ]; then
echo "[!] Turning off pins in Gemfile.lock. Here be dragons!" &&
export BUNDLE_DEPLOYMENT=false &&
rm Gemfile.lock &&
gem update --system 3.2.3;
fi
- gem install bundler -v 2.3.17
- bundle install || (apk add gcc g++ make && bundle install)
cache:
key: global-dependency-cache
Expand All @@ -18,6 +24,12 @@ cache:
stages:
- test

test ruby-3.2-rc:
image: ruby:3.2-rc-alpine
stage: test
script:
- bundle exec rake

test ruby-3.1:
image: ruby:3.1-alpine
stage: test
Expand Down Expand Up @@ -45,23 +57,25 @@ test ruby-2.6:
test ruby-2.5:
image: ruby:2.5-alpine
stage: test
variables:
RUBY_IS_EOL: since 2021-04-05
script:
- gem update --system 3.2.3
- bundle exec rake

test ruby-2.4:
image: ruby:2.4-alpine
stage: test
variables:
RUBY_IS_EOL: since 2020-03-31
script:
- gem update --system 3.2.3
- bundle exec rake


test ruby-2.3:
image: ruby:2.3-alpine
stage: test
variables:
RUBY_IS_EOL: since 2019-03-31
script:
- gem update --system 3.2.3
- bundle exec rake

check for bundle updates:
Expand Down
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--require spec_helper
63 changes: 63 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
require: rubocop-rspec

AllCops:
TargetRubyVersion: 2.3.0
NewCops: enable

Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation
Layout/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true
Layout/EmptyLines: # Directly conflicts with YARDs only way to suppress unwanted
Enabled: false # comments, such as copyright headers
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
Layout/LineEndStringConcatenationIndentation:
EnforcedStyle: indented
Layout/SpaceInsideBlockBraces:
SpaceBeforeBlockParameters: false
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

Lint/NumberConversion:
Enabled: true
Lint/Void:
CheckForMethodsWithNoSideEffects: true
Lint/AmbiguousOperatorPrecedence:
Enabled: false

Metrics/AbcSize:
CountRepeatedAttributes: false
Metrics/BlockLength:
IgnoredMethods:
- describe

RSpec/MultipleExpectations:
Enabled: false
RSpec/ExampleLength:
Max: 10
RSpec/DescribedClass:
EnforcedStyle: explicit

Style/AsciiComments:
Enabled: false
Style/FormatStringToken:
Enabled: false
Style/NegatedIf:
Enabled: false
Style/NumericLiterals:
MinDigits: 7
Style/NumericPredicate:
EnforcedStyle: comparison
Style/SymbolArray:
EnforcedStyle: brackets
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
Style/WordArray:
MinSize: 4
56 changes: 53 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,69 @@ PATH
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
diff-lcs (1.5.0)
docile (1.4.0)
json (2.6.2)
minitar (0.9)
minitest (5.15.0)
parallel (1.22.1)
parser (3.1.2.0)
ast (~> 2.4.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.5.0)
rexml (3.2.5)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubocop (1.31.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.18.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.18.0)
parser (>= 3.1.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.12.1)
rubocop (~> 1.31)
ruby-progressbar (1.11.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
unicode-display_width (2.2.0)

PLATFORMS
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
minitar (~> 0.6)
minitest (~> 5.14)
rake (~> 13.0)
rspec (~> 3.11)
rubocop
rubocop-rake
rubocop-rspec
ruby-xz!
simplecov (~> 0.17)

BUNDLED WITH
2.3.7
2.3.17
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2011-2018 Marvin Gülker et al.
Copyright © 2011-2022 Marvin Gülker et al.

See AUTHORS for the full list of contributors.

Expand Down
71 changes: 35 additions & 36 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
# -*- mode: ruby; coding: utf-8 -*-
=begin
Basic liblzma-bindings for Ruby.
# -*- mode: ruby -*-
# frozen_string_literal: true

# Basic liblzma-bindings for Ruby.
#
# Copyright © 2011-2022 Alex Gittemeier et al.
#
# See AUTHORS for the full list of contributors.
#
# 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.

Copyright © 2011-2018 Marvin Gülker et al.

See AUTHORS for the full list of contributors.

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.
=end

require 'bundler/setup'
require "rake/testtask"
require "rdoc/task"
require 'rdoc/task'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'

# Documentation
Rake::RDocTask.new do |rd|
rd.rdoc_files.include("lib/**/*.rb", "*.md", "**/*.rdoc", "LICENSE", "AUTHORS")
rd.title = "ruby-xz RDocs"
rd.main = "README.md"
rd.generator = "hanna"
rd.rdoc_dir = "doc"
rd.rdoc_files.include('lib/**/*.rb', '*.md', '**/*.rdoc', 'LICENSE', 'AUTHORS')
rd.title = 'ruby-xz RDocs'
rd.main = 'README.md'
rd.rdoc_dir = 'doc'
end

# Testing
Rake::TestTask.new do |t|
t.test_files = FileList["test/test_*.rb"]
t.warning = true
RSpec::Core::RakeTask.new(:spec) do |task|
task.verbose = false
end

task default: [:test]
task default: [:spec]
5 changes: 3 additions & 2 deletions lib/xz/version.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true
# -*- coding: utf-8 -*-

#--
# Basic liblzma-bindings for Ruby.
#
# Copyright © 2011-2018 Marvin Gülker et al.
# Copyright © 2011-2022 Marvin Gülker et al.
#
# See AUTHORS for the full list of contributors.
#
Expand All @@ -26,6 +26,7 @@
# THE SOFTWARE.
#++


module XZ
# The version of this library.
VERSION = '1.0.4.pre'
Expand Down
15 changes: 9 additions & 6 deletions ruby-xz.gemspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- mode: ruby -*-
# frozen_string_literal: true
# -*- mode: ruby; coding: utf-8 -*-
#--

# Basic liblzma-bindings for Ruby.
#
# Copyright © 2011-2018 Marvin Gülker et al.
# Copyright © 2011-2022 Alex Gittemeier et al.
#
# See AUTHORS for the full list of contributors.
#
Expand All @@ -24,7 +24,6 @@
# 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.
#++

require_relative 'lib/xz/version'

Expand All @@ -39,7 +38,7 @@ GEMSPEC = Gem::Specification.new do |spec|
Since fiddle is used to implement the bindings, no compilation
is needed.
DESCRIPTION
spec.authors = ['Marvin Gülker', 'Alex Gittemeier']
spec.authors = ['Alex Gittemeier', 'Marvin Gülker']
spec.email = 'me@a.lexg.dev'
spec.license = 'MIT'

Expand All @@ -61,6 +60,10 @@ GEMSPEC = Gem::Specification.new do |spec|
spec.post_install_message = 'Version 1.0.0 of ruby-xz breaks the API. Read HISTORY.rdoc and adapt your code to the new API.'

spec.add_development_dependency 'minitar', '~> 0.6'
spec.add_development_dependency 'minitest', '~> 5.14'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.11'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rubocop-rake'
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'simplecov', '~> 0.17'
end
Loading