Sha256: bd8a0d8129fe0b758700ae46cff81fb5d90dcd6ade3998241cc1593786f6ae3b

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

#require "bundler/gem_tasks"

require 'rake/extensiontask'
require 'rubygems/package_task'

##
# Rake::ExtensionTask comes from the rake-compiler and understands how to
# build and cross-compile extensions.
#
# See https://github.com/luislavena/rake-compiler for details

Rake::ExtensionTask.new 'gocr-ruby' do |ext|

  # This causes the shared object to be placed in lib/my_malloc/my_malloc.so
  #
  # It allows lib/my_malloc.rb to load different versions if you ship a
  # precompiled extension that supports multiple ruby versions.

  ext.lib_dir = 'lib/gocr'
end

s = Gem::Specification.new 'gocr-ruby', '0.0.1' do |s|
  s.summary = 'simple gocr wrapper'
  s.authors = %w[zyablitskiy@gmail.com]

  # this tells RubyGems to build an extension upon install

  s.extensions = %w[ext/gocr/extconf.rb]

  # naturally you must include the extension source in the gem

  s.files = `git ls-files`.split($/)
end

# The package task builds the gem in pkg/my_malloc-1.0.gem so you can test
# installing it.

Gem::PackageTask.new s do end

# This isn't a good test, but does provide a sanity check

task test: %w[compile] do
  ruby '-Ilib', '-rgocr', '-e', 'p GOCR::Image.recognize("image.png")'
#  ruby '-Ilib', '-rgocr', '-e', 'p 3'
end

task default: :test


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gocr-ruby-0.0.1 Rakefile