Skip to content

Commit

Permalink
Separate gemspec, new Ruby header directory
Browse files Browse the repository at this point in the history
  • Loading branch information
wedesoft committed May 15, 2015
1 parent 8c7566b commit 1ae1d98
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 90 deletions.
2 changes: 0 additions & 2 deletions .yardopts

This file was deleted.

88 changes: 1 addition & 87 deletions Rakefile
Expand Up @@ -4,22 +4,7 @@ require 'rake/clean'
require 'rake/testtask'
require 'rake/packagetask'
require 'rbconfig'

PKG_NAME = 'multiarray'
PKG_VERSION = '1.0.3'
RB_FILES = FileList[ 'lib/**/*.rb' ]
TC_FILES = FileList[ 'test/tc_*.rb' ]
TS_FILES = FileList[ 'test/ts_*.rb' ]
PKG_FILES = [ 'Rakefile', 'README.md', 'COPYING', '.document' ] +
RB_FILES + TS_FILES + TC_FILES
BIN_FILES = [ 'README.md', 'COPYING', '.document' ] +
RB_FILES + TS_FILES + TC_FILES
SUMMARY = %q{Multi-dimensional and uniform Ruby arrays}
DESCRIPTION = %q{This Ruby-extension defines Hornetseye::MultiArray and other native datatypes. Hornetseye::MultiArray provides multi-dimensional Ruby arrays with elements of same type. The extension is designed to be mostly compatible with Masahiro Tanaka's NArray. However it allows the definition of custom element types and operations on them. This work was also inspired by Ronald Garcia's boost::multi_array and by Todd Veldhuizen's Blitz++.}
LICENSE = 'GPL-3+'
AUTHOR = %q{Jan Wedekind}
EMAIL = %q{jan@wedesoft.de}
HOMEPAGE = %q{http://wedesoft.github.com/multiarray/}
require_relative 'config'

$SITELIBDIR = RbConfig::CONFIG[ 'sitelibdir' ]

Expand Down Expand Up @@ -67,75 +52,4 @@ Rake::PackageTask.new PKG_NAME, PKG_VERSION do |p|
p.package_files = PKG_FILES
end

begin
require 'rubygems'
require 'rubygems/builder'
$SPEC = Gem::Specification.new do |s|
s.name = PKG_NAME
s.version = PKG_VERSION
s.platform = Gem::Platform::RUBY
s.date = Date.today.to_s
s.summary = SUMMARY
s.description = DESCRIPTION
s.license = LICENSE
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE
s.files = PKG_FILES
s.test_files = TC_FILES
s.require_paths = [ 'lib' ]
s.rubyforge_project = %q{hornetseye}
s.extensions = %w{Rakefile}
s.has_rdoc = 'yard'
s.extra_rdoc_files = []
s.rdoc_options = %w{--no-private}
s.add_dependency %q<malloc>, [ '~> 1.1' ]
s.add_development_dependency %q{rake}
end
GEM_SOURCE = "#{PKG_NAME}-#{PKG_VERSION}.gem"
$BINSPEC = Gem::Specification.new do |s|
s.name = PKG_NAME
s.version = PKG_VERSION
s.platform = Gem::Platform::CURRENT
s.date = Date.today.to_s
s.summary = SUMMARY
s.description = DESCRIPTION
s.license = LICENSE
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE
s.files = BIN_FILES
s.test_files = TC_FILES
s.require_paths = [ 'lib' ]
s.rubyforge_project = %q{hornetseye}
s.has_rdoc = 'yard'
s.extra_rdoc_files = []
s.rdoc_options = %w{--no-private}
s.add_dependency %q<malloc>, [ '~> 1.1' ]
end
GEM_BINARY = "#{PKG_NAME}-#{PKG_VERSION}-#{$BINSPEC.platform}.gem"
desc "Build the gem file #{GEM_SOURCE}"
task :gem => [ "pkg/#{GEM_SOURCE}" ]
file "pkg/#{GEM_SOURCE}" => [ 'pkg' ] + $SPEC.files do
when_writing 'Creating GEM' do
Gem::Builder.new( $SPEC ).build
verbose true do
FileUtils.mv GEM_SOURCE, "pkg/#{GEM_SOURCE}"
end
end
end
desc "Build the gem file #{GEM_BINARY}"
task :gem_binary => [ "pkg/#{GEM_BINARY}" ]
file "pkg/#{GEM_BINARY}" => [ 'pkg' ] + $BINSPEC.files do
when_writing 'Creating binary GEM' do
Gem::Builder.new( $BINSPEC ).build
verbose true do
FileUtils.mv GEM_BINARY, "pkg/#{GEM_BINARY}"
end
end
end
rescue LoadError
STDERR.puts 'Please install \'rubygems\' if you want to create Gem packages'
end

CLOBBER.include 'doc', '.yardoc'
18 changes: 18 additions & 0 deletions config.rb
@@ -0,0 +1,18 @@
require 'rake'

PKG_NAME = 'multiarray'
PKG_VERSION = '1.0.4'
RB_FILES = FileList[ 'config.rb', 'lib/**/*.rb' ]
TC_FILES = FileList[ 'test/tc_*.rb' ]
TS_FILES = FileList[ 'test/ts_*.rb' ]
PKG_FILES = [ 'Rakefile', 'README.md', 'COPYING', '.document' ] +
RB_FILES + TS_FILES + TC_FILES
BIN_FILES = [ 'README.md', 'COPYING', '.document' ] +
RB_FILES + TS_FILES + TC_FILES
SUMMARY = %q{Multi-dimensional and uniform Ruby arrays}
DESCRIPTION = %q{This Ruby-extension defines Hornetseye::MultiArray and other native datatypes. Hornetseye::MultiArray provides multi-dimensional Ruby arrays with elements of same type. The extension is designed to be mostly compatible with Masahiro Tanaka's NArray. However it allows the definition of custom element types and operations on them. This work was also inspired by Ronald Garcia's boost::multi_array and by Todd Veldhuizen's Blitz++.}
LICENSE = 'GPL-3+'
AUTHOR = %q{Jan Wedekind}
EMAIL = %q{jan@wedesoft.de}
HOMEPAGE = %q{http://wedesoft.github.com/multiarray/}

5 changes: 4 additions & 1 deletion lib/multiarray/gcccontext.rb
Expand Up @@ -27,7 +27,10 @@ class GCCContext
# @private
CFG = RbConfig::CONFIG

if CFG[ 'rubyhdrdir' ]
if CFG['rubyarchhdrdir']
CFLAGS = "-DNDEBUG -Wno-unused-function #{CFG[ 'CFLAGS' ]} " +
"-I#{CFG['rubyhdrdir']} -I#{CFG['rubyarchhdrdir']}"
elsif CFG[ 'rubyhdrdir' ]
# GCC compiler flags
#
# @private
Expand Down
23 changes: 23 additions & 0 deletions multiarray.gemspec
@@ -0,0 +1,23 @@
require_relative 'config'

Gem::Specification.new do |s|
s.name = PKG_NAME
s.version = PKG_VERSION
s.platform = Gem::Platform::RUBY
s.date = Date.today.to_s
s.summary = SUMMARY
s.description = DESCRIPTION
s.license = LICENSE
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE
s.files = PKG_FILES
s.test_files = TC_FILES
s.require_paths = [ 'lib' ]
s.rubyforge_project = %q{hornetseye}
s.extensions = %w{Rakefile}
s.has_rdoc = 'yard'
s.extra_rdoc_files = []
s.rdoc_options = %w{--no-private}
s.add_dependency %q<malloc>, [ '~> 1.1' ]
end

0 comments on commit 1ae1d98

Please sign in to comment.