Merge pull request #894 from matthiasbeyer/revert-871-ruby-build-setup

Revert "Ruby build setup"
This commit is contained in:
Matthias Beyer 2017-02-06 16:07:50 +01:00 committed by GitHub
commit 2beb79581d
12 changed files with 123 additions and 78 deletions

View file

@ -1,40 +1,14 @@
sudo: false sudo: false
os:
- linux
dist:
- trusty
language: rust language: rust
rust:
matrix: - 1.13.0
include: - beta
- rust: 1.13.0 - stable
env: IMAG_RUBY_VERSION=2.3.3 cache: cargo
- rust: beta
env: IMAG_RUBY_VERSION=2.3.3
- rust: stable
env: IMAG_RUBY_VERSION=2.3.3
cache:
cargo: true
directories:
- $TRAVIS_BUILD_DIR/libimagruby/vendor/bundle
before_install:
- |
rvm install "$IMAG_RUBY_VERSION"
rvm use "$IMAG_RUBY_VERSION"
ruby --version
pushd libimagruby
bundle install --jobs=3 --retry=3 --path=$TRAVIS_BUILD_DIR/libimagruby/vendor/bundle
popd
before_script: before_script:
- | - |
pip install 'travis-cargo<0.2' --user && pip install 'travis-cargo<0.2' --user &&
export PATH=$HOME/.local/bin:$PATH export PATH=$HOME/.local/bin:$PATH
script: script:
- | - |
make all test make all test
@ -51,14 +25,12 @@ addons:
- tree - tree
sources: sources:
- kalakris-cmake - kalakris-cmake
after_success: after_success:
- | - |
pushd .imag-documentation && pushd .imag-documentation &&
travis-cargo --only stable doc && travis-cargo --only stable doc &&
travis-cargo --only stable doc-upload travis-cargo --only stable doc-upload
popd popd
notifications: notifications:
email: email:
on_success: never on_success: never
@ -67,11 +39,7 @@ notifications:
- chat.freenode.net#imag - chat.freenode.net#imag
template: template:
- "%{repository_name} (%{branch} @ %{commit} by %{author}): %{result}" - "%{repository_name} (%{branch} @ %{commit} by %{author}): %{result}"
env: env:
global: global:
- THERMITE_DEBUG_FILENAME=/tmp/thermite-debug.log - TRAVIS_CARGO_NIGHTLY_FEATURE=dev
- secure: D+3exBnbvzFvk7fvLOxkF7UotCc4gBbvvOW4xGr9u6dDjEjV5y6CdDy/OQAkhfKhvSou+lIC22g5M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KnKe6IpN2M7qNgWa+6MCSXJ1v4BgPb7kN74EynJUM8+yWEFN7MZtWEUQ4ZsHdCs8Pub4C/zHpYGV8qGenZwQzosAFq56YwoGCvJezz35yg4BDd3IMKenOzNnXLBrdxxqX8ySgwt5B3zBqwve/64Lx6OXjae2m8wZKlsmeqad/s6K7nx0zG15/qqRIzyvgcLXq3jwBaHkteq49FRFWvHQFpBQcsPZ2uH4=
matrix:
- IMAG_RUBY_VERSION=2.3.3
- IMAG_RUBY_VERSION=2.4.0

View file

@ -68,9 +68,9 @@ lib: $(LIB_TARGETS)
lib-test: $(LIB_TARGETS_TEST) lib-test: $(LIB_TARGETS_TEST)
lib-imag-ruby-test: lib-imag-ruby-test:
@$(MAKE) -C libimagruby test @$(MAKE) -C libimagruby
test: bin-test lib-test lib-imag-ruby-test test: bin-test lib-test
install: $(INSTALL_TARGETS) imag-bin-install install: $(INSTALL_TARGETS) imag-bin-install
@$(ECHO) "\t[INSTALL]" @$(ECHO) "\t[INSTALL]"

View file

@ -7,8 +7,6 @@ let
]; ];
dependencies = with pkgs; [ dependencies = with pkgs; [
ruby
bundler
cmake cmake
curl curl
gcc gcc

View file

@ -1,5 +1,3 @@
.bundle .bundle
Gemfile.lock Gemfile.lock
lib/liblibimagruby.so
vendor/bundle vendor/bundle
libimagruby*.tar.gz

View file

@ -1,22 +1,20 @@
ECHO=$(shell which echo) -e ECHO=$(shell which echo) -e
RUBY=$(shell which ruby) RUBY=$(shell which ruby)
BUNDLE=$(shell which bundle) RUBY_TESTS=$(shell find ./test -maxdepth 1 -name "*.rb" -type f)
RUBY_TEST_TARGETS=$(foreach x,$(subst ,,$(RUBY_TESTS)),$(x))
all: all: lib
@$(ECHO) "There is no default target here"
bundle: lib:
@$(ECHO) "[BUNDLE]" $(MAKE) -C .. libimagruby
@$(BUNDLE) install --path vendor/bundle
bundle-rake-thermite-test: lib-release:
@$(ECHO) "[RAKE ][thermite]" $(MAKE) -C .. libimagruby-release
@CARGO_TARGET=debug $(BUNDLE) exec rake thermite:tarball
test: lib bundle-rake-thermite-test test: lib $(RUBY_TEST_TARGETS)
@$(ECHO) "[TEST ]"
$(RUBY_TEST_TARGETS): %: lib .FORCE
@$(ECHO) "\t[TEST ]:\t$@"
@$(RUBY) $(subst -test,,$@)
.FORCE: .FORCE:
.PHONY: all

View file

@ -1,5 +1,2 @@
require "bundler/gem_tasks" require "bundler/gem_tasks"
require 'thermite/tasks' task :default => :spec
Thermite::Tasks.new(cargo_project_path: "..", cargo_workspace_member: "libimagruby")

View file

@ -1,5 +0,0 @@
require 'thermite/tasks'
Thermite::Tasks.new(cargo_project_path: "..", cargo_workspace_member: "libimagruby")
task default: %w(thermite:build)

View file

@ -23,7 +23,4 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", "~> 1.13" spec.add_development_dependency "bundler", "~> 1.13"
spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency 'thermite', "~> 0.11", ">= 0.11.1"
spec.extensions << 'ext/Rakefile'
end end

View file

@ -1,12 +1,5 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require 'thermite/fiddle'
toplevel_dir = File.dirname(File.dirname(__FILE__))
Thermite::Fiddle.load_module('init_imag',
cargo_project_path: toplevel_dir,
ruby_project_path: toplevel_dir)
module Imag module Imag
IMAG_INIT_FN_NAME = 'imag_ruby_initialize' IMAG_INIT_FN_NAME = 'imag_ruby_initialize'

View file

@ -0,0 +1,27 @@
#!/usr/bin/env ruby
require "../target/debug/liblibimagruby.so"
color = true
verbose = true
debug = false
RImag.init_logger debug, verbose, color
store_handle = RStoreHandle::new(false, "/tmp/store")
id = RStoreId::new_baseless("test")
test_handle = store_handle.retrieve(id)
puts "Header: #{test_handle.header.to_s}"
puts "Content: '#{test_handle.content}'"
test_handle.content = "Foo"
test_handle.header = {
"imag" => {
"links" => [],
"version" => "0.2.0"
},
"example" => {
"test" => "foo"
}
}

View file

@ -0,0 +1,58 @@
#!/usr/bin/env ruby
require "../target/debug/liblibimagruby.so"
color = true
verbose = true
debug = true
RImag.init_logger debug, verbose, color
RImag.trace "Trace-Hello from Ruby"
RImag.dbg "Debug-Hello from Ruby"
RImag.debug "Debug-Hello from Ruby"
RImag.info "Info-Hello from Ruby"
RImag.warn "Warn-Hello from Ruby"
RImag.error "Error-Hello from Ruby"
def works name, b
if b
RImag.info "Works: #{name}"
else
RImag.error "Fails: #{name}"
end
end
def has_instance_method klass, meth
works "#{klass}.instance_methods.include? #{meth}",
(klass.instance_methods.include? meth)
end
puts "---"
works "RStoreId.new_baseless", (not RStoreId.new_baseless("test").nil?)
works "RStoreHandle.respond_to? :new", (RStoreHandle.respond_to? :new)
has_instance_method RStoreHandle, :create
has_instance_method RStoreHandle, :get
has_instance_method RStoreHandle, :retrieve
has_instance_method RStoreHandle, :delete
has_instance_method RStoreHandle, :update
has_instance_method RStoreHandle, :move_by_id
has_instance_method RStoreHandle, :save_as
has_instance_method RStoreHandle, :save_to
has_instance_method RFileLockEntryHandle, :content
has_instance_method RFileLockEntryHandle, :content=
has_instance_method RFileLockEntryHandle, :header
has_instance_method RFileLockEntryHandle, :header=
has_instance_method REntryHeader, :read
has_instance_method REntryHeader, :[]
has_instance_method REntryHeader, :set
has_instance_method REntryHeader, :[]=
has_instance_method REntryHeader, :insert
works "REntryContent.superclass == String", (REntryContent.superclass == String)

View file

@ -0,0 +1,16 @@
#!/usr/bin/env ruby
require "../target/debug/liblibimagruby.so"
color = true
verbose = true
debug = true
RImag.init_logger debug, verbose, color
store_handle = RStoreHandle::new(false, "/tmp/store")
id = RStoreId::new_baseless("test")
test_handle = store_handle.create(id)
RImag.info "Created #{test_handle.location.to_str} from Ruby"