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
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test

on: [push]

jobs:
test:
strategy:
fail-fast: false
matrix:
ruby-version:
- '2.0'
- '2.1'
- '2.2'
- '2.3'
- '2.4'
- '2.5'
- '2.6'
- '2.7'
- '3.0'
- '3.1'
- '3.2'
- '3.3'
- '3.4'

name: Ruby ${{ matrix.ruby-version }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake test

# A utility job upon which Branch Protection can depend,
# thus remaining agnostic of the matrix.
test_matrix:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Matrix
needs: test
steps:
- name: Check build matrix status
if: ${{ needs.test.result != 'success' }}
run: exit 1
38 changes: 38 additions & 0 deletions .github/workflows/test_ruby193.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test Ruby 1.9

on: [push]

jobs:
test:
strategy:
fail-fast: false
matrix:
ruby-version:
- '1.9'

name: Ruby ${{ matrix.ruby-version }}

runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake test

# A utility job upon which Branch Protection can depend,
# thus remaining agnostic of the matrix.
test_matrix:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Matrix
needs: test
steps:
- name: Check build matrix status
if: ${{ needs.test.result != 'success' }}
run: exit 1
2 changes: 1 addition & 1 deletion lib/msworddoc/extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def retrieve_substring(f, offset, length = -1)
i -= 1
raise 'could not find suitable heading piece' unless i >= 0

output = ""
output = "".dup
while length > 0 || length < 0
pcd = @pcds[i]

Expand Down
3 changes: 2 additions & 1 deletion msworddoc-extractor.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.version = '0.2.0'

has_rake = RUBY_VERSION >= '1.9.'
has_rake = RUBY_VERSION >= '1.9.' && RUBY_VERSION < '2.3'

if gem.respond_to? :specification_version then
gem.specification_version = 3
Expand All @@ -39,4 +39,5 @@ Gem::Specification.new do |gem|
gem.add_dependency 'ruby-ole'
gem.add_dependency 'rake' unless has_rake
end
gem.add_development_dependency 'test-unit'
end