Skip to content

Commit

Permalink
Adjustment for Embulk v0.9.X
Browse files Browse the repository at this point in the history
  • Loading branch information
t3t5u committed Jul 12, 2024
1 parent 935ce64 commit 7c692d2
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 25 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ jobs:
strategy:
matrix:
jruby_version:
- 9.3.10.0
- 9.4.2.0
- 9.1.17.0
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -22,21 +21,23 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 'jruby-${{ matrix.jruby_version }}'
bundler-cache: true
bundler-cache: false
- name: show ruby version
run: ruby -v
- name: bundle install
run: bundle install
#
# This step avoids the following error in the JRuby 9.4 test.
#
# Gem::LoadError: You have already activated rake 13.0.6,
# but your Gemfile requires rake 13.1.0. Prepending
# `bundle exec` to your command may solve this.
#
- name: install rake 13.1.0
run: gem install rake -v 13.1.0
- name: install rake 10.4.2
run: gem install rake -v 10.4.2
- name: install embulk.jar
run: "curl -L -o embulk.jar https://github.com/embulk/embulk/releases/download/v0.10.49/embulk-0.10.49.jar"
run: "curl -L -o embulk.jar https://github.com/embulk/embulk/releases/download/v0.9.25/embulk-0.9.25.jar"
- name: chmod embulk.jar
run: chmod a+x embulk.jar
- name: bundle install
run: ./embulk.jar bundle install --path vendor/bundle
- name: rake test
run: bundle exec env RUBYOPT="-r ./embulk.jar" rake test
run: bundle exec env RUBYOPT="-r ./embulk.jar -r embulk -r embulk/java/bootstrap" rake test
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
source 'https://rubygems.org/'

gemspec
gem 'embulk', '= 0.10.49'
gem 'embulk', '< 0.10'
gem 'liquid', '= 4.0.0' # the version included in embulk.jar
gem 'embulk-parser-none'
gem 'embulk-parser-jsonl'
gem 'pry-nav'
gem 'test-unit'
gem 'test-unit-rr'
gem 'rake', '13.1.0'
gem 'rake', '10.4.2'
22 changes: 15 additions & 7 deletions embulk-output-bigquery.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec)/})
spec.require_paths = ["lib"]

# the latest version
spec.add_dependency 'google-apis-storage_v1'
spec.add_dependency 'google-apis-bigquery_v2'
# TODO
# signet 0.12.0 and google-api-client 0.33.0 require >= Ruby 2.4.
# Embulk 0.9 use JRuby 9.1.X.Y and it's compatible with Ruby 2.3.
# So, force install signet < 0.12 and google-api-client < 0.33.0
# Also, representable version >= 3.1.0 requires Ruby version >= 2.4
spec.add_dependency 'signet', '~> 0.7', '< 0.12.0'
spec.add_dependency 'google-api-client','< 0.33.0'
spec.add_dependency 'time_with_zone'
spec.add_dependency 'thwait'
# activesupport require Ruby >= 2.7.0
# jruby-9.3.0.0 is MRI 2.6 compatible
spec.add_dependency 'activesupport', "< 7.0"
spec.add_dependency "representable", ['~> 3.0.0', '< 3.1']
# faraday 1.1.0 require >= Ruby 2.4.
# googleauth 0.9.0 requires faraday ~> 0.12
spec.add_dependency "faraday", '~> 0.12'
spec.add_dependency "multipart-post", '1.2.0'
spec.add_dependency "mini_mime", '1.1.2'
spec.add_dependency "jwt", '2.3.0'
spec.add_dependency "public_suffix", '4.0.7'

spec.add_development_dependency 'bundler', ['>= 1.10.6']
spec.add_development_dependency 'rake', ['>= 10.0']
Expand Down
14 changes: 7 additions & 7 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
require 'test/unit'
require 'test/unit/rr'

# Embulk 0.10.x introduced new bootstrap mechanism.
# https://github.com/embulk/embulk/blob/641f35fec064cca7b1a7314d634a4b64ef8637f1/embulk-ruby/test/vanilla/run-test.rb#L8-L13
static_initializer = Java::org.embulk.EmbulkDependencyClassLoader.staticInitializer().useSelfContainedJarFiles()
static_initializer.java_send :initialize

require 'embulk/java/bootstrap'
require 'embulk'

begin
# Embulk ~> 0.8.x
Embulk.setup
rescue NotImplementedError, NoMethodError, NameError
# Embulk ~> 0.9.x
require 'embulk/java/bootstrap'
end
Embulk.logger = Embulk::Logger.new('/dev/null')

APP_ROOT = File.expand_path('../', __dir__)
Expand Down

0 comments on commit 7c692d2

Please sign in to comment.