Skip to content

Commit

Permalink
feat: remove jruby support
Browse files Browse the repository at this point in the history
BREAKING CHANGE: remove jruby support
  • Loading branch information
classicalliu committed Jun 14, 2019
1 parent fbf9ec0 commit f42e369
Show file tree
Hide file tree
Showing 16 changed files with 100 additions and 516 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
/spec/reports/
/tmp/
/.ruby-version
/.mvn

# rspec failure tracking
.rspec_status

*.jar
37 changes: 1 addition & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rvm:
- 2.6.1
env:
- SKIP_RPC_TESTS=true
before_install:
before_install:
- gem install bundler -v 2.0.1
- sudo apt-get update
- sudo apt-get install -y libsodium-dev
Expand All @@ -18,38 +18,3 @@ install:
- bundle install
script:
- bundle exec rake

stages:
- test
- deploy
jobs:
include:
- rvm: jruby
before_install:
- gem install bundler -v 2.0.1
install:
- bundle install
- jruby -rjars/installer -e 'Jars::Installer.vendor_jars!'
- stage: deploy
if: 'tag IS present AND env(GITHUB_TOKEN) IS present'
rvm: jruby
before_install:
- gem install bundler -v 2.0.1
install:
- bundle install
- jruby -rjars/installer -e 'Jars::Installer.vendor_jars!'
script:
- bundle exec rake jar
- export CKB_VERSION=$(bundle exec ruby -e 'require "ckb"; puts CKB::VERSION')
- echo "java -jar ckb-console-${CKB_VERSION}.jar" > ckb-console-${CKB_VERSION}.bat
- zip ckb-console-${CKB_VERSION}-jar.zip ckb-console-${CKB_VERSION}.jar ckb-console-${CKB_VERSION}.bat
deploy:
provider: releases
api_key: "$GITHUB_TOKEN"
file_glob: true
file: ckb-console-*-jar.zip
skip_cleanup: true
prerelease: true
on:
tags: true
condition: '"$GITHUB_TOKEN" != ""'
19 changes: 5 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ GEM
connection_pool (2.2.2)
diff-lcs (1.3)
ffi (1.11.1)
ffi (1.11.1-java)
jaro_winkler (1.5.2)
jaro_winkler (1.5.2-java)
method_source (0.9.2)
net-http-persistent (3.0.1)
connection_pool (~> 2.2)
Expand All @@ -28,10 +26,6 @@ GEM
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry (0.12.2-java)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
spoon (~> 0.0)
rainbow (3.0.0)
rake (10.5.0)
rbnacl (6.0.1)
Expand All @@ -40,29 +34,26 @@ GEM
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-core (3.8.1)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
rspec-expectations (3.8.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
rspec-mocks (3.8.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rspec-support (3.8.2)
rubocop (0.69.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.0)
spoon (0.0.6)
ffi
ruby-progressbar (1.10.1)
unicode-display_width (1.6.0)

PLATFORMS
java
ruby

DEPENDENCIES
Expand Down
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ bundle install
bundle exec bin/console
```

Or download a jar from releases page, which does not require libsecp256k1 and
libsodium but only JRE to run the console:

```
java -jar ckb-console-VERSION.jar
```

## Usage

RPC interface returns parsed `JSON` object
Expand Down Expand Up @@ -107,8 +100,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run

To install this gem onto your local machine, run `bundle exec rake install`.

To create a jar using JRuby, run `bundle exec rake jar`.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
Expand Down
5 changes: 0 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@ require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

if RUBY_PLATFORM == "java"
require "warbler"
Warbler::Task.new
end

task default: :spec
4 changes: 0 additions & 4 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ IFS=$'\n\t'
set -vx

bundle install

if ruby --version 2> /dev/null | grep '^jruby' &> /dev/null; then
jruby -rjars/installer -e 'Jars::Installer.vendor_jars!'
fi
13 changes: 2 additions & 11 deletions ckb-sdk-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "ckb/version"

is_jruby = RUBY_PLATFORM == 'java'

Gem::Specification.new do |spec|
spec.name = "ckb-sdk-ruby"
spec.version = CKB::VERSION
Expand Down Expand Up @@ -44,13 +42,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "pry", "~> 0.12.2"

spec.add_dependency "net-http-persistent", "~> 3.0.0"

if !is_jruby
spec.add_dependency "rbnacl", "~> 6.0", ">= 6.0.1"
spec.add_dependency "bitcoin-secp256k1", "~> 0.5.0"
else
spec.add_development_dependency "warbler", "~> 2.0"

spec.requirements << "jar org.bouncycastle, bcprov-jdk15on, 1.61"
end
spec.add_dependency "rbnacl", "~> 6.0", ">= 6.0.1"
spec.add_dependency "bitcoin-secp256k1", "~> 0.5.0"
end
188 changes: 0 additions & 188 deletions config/warble.rb

This file was deleted.

11 changes: 0 additions & 11 deletions lib/ckb-sdk-ruby_jars.rb

This file was deleted.

2 changes: 0 additions & 2 deletions lib/ckb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
require "ckb/address"
require "ckb/key"

require "ckb-sdk-ruby_jars" if RUBY_PLATFORM == "java"

module CKB
class Error < StandardError; end
# Your code goes here...
Expand Down
Loading

0 comments on commit f42e369

Please sign in to comment.