Skip to content

Commit

Permalink
use rubygems/package_task, add --exclude in rdoc_options
Browse files Browse the repository at this point in the history
  • Loading branch information
masa16 committed Feb 27, 2013
1 parent aafb79d commit 1c2c517
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 45 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ na_op.c

pkg/
src
ext
doc

narray-*.gem
16 changes: 16 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2013-02-27 Masahiro TANAKA <[email protected]>

* Rakefile: use rubygems/package_task.
* narray.gemspec: add --exclude in rdoc_options.
* ver 0.6.0.8

2013-02-26 Masahiro TANAKA <[email protected]>

* test/ld.rb: add require "rubygems".
* narray.gemspec: change gem directory from src to ext.
* narray.c: avoid warnings in require "complex" and rdoc parsing.

2013-02-13 Masahiro TANAKA <[email protected]>

* lib/narray_ext.rb: new method: NArray.cast

2013-02-01 Masahiro TANAKA <[email protected]>

* lib/narray_ext.rb: eql? hash methods implemented.
Expand Down
34 changes: 15 additions & 19 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
require 'rubygems'
require 'rubygems/package_task'

def version
open("narray.h") do |f|
f.each_line do |l|
return $1 if /NARRAY_VERSION "([\d.]+)"/ =~ l
end
end
end

GEM = "narray-#{version}.gem"
FileUtils.ln_s('.', 'src') if !File.symlink?('src')

task :default => GEM
load './narray.gemspec'

file GEM => "ext" do
sh "gem build narray.gemspec"
pkgtsk = Gem::PackageTask.new(GEMSPEC) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end

file "ext" do
sh "ln -s . ext"
end
task :default => "gem"

#--
GEMFILE = File.join(pkgtsk.package_dir, GEMSPEC.file_name)

task :install => GEM do
sh "gem install -V --backtrace #{GEM}"
task :install => GEMFILE do
sh "gem install -V --backtrace #{GEMFILE}"
end

task :push => GEM do
sh "gem push #{GEM}"
task :push => GEMFILE do
sh "gem push #{GEMFILE}"
end
61 changes: 36 additions & 25 deletions narray.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open("ext/narray.h") do |f|
open("src/narray.h") do |f|
f.each_line do |l|
if /NARRAY_VERSION "([\d.]+)"/ =~ l
NARRAY_VERSION = $1
Expand All @@ -7,7 +7,7 @@ open("ext/narray.h") do |f|
end
end

Gem::Specification.new do |s|
GEMSPEC = Gem::Specification.new do |s|
s.name = "narray"
s.version = NARRAY_VERSION

Expand All @@ -16,31 +16,42 @@ Gem::Specification.new do |s|
s.date = Time.now.strftime("%F")
s.description = "Numerical N-dimensional Array class"
s.email = "[email protected]"
s.extensions = ["ext/extconf.rb"]
s.extensions = ["src/extconf.rb"]
s.files = %w[
ext/ChangeLog
ext/MANIFEST
ext/README.en
ext/README.ja
ext/SPEC.en
ext/SPEC.ja
ext/depend
ext/extconf.rb
ext/mkmath.rb
ext/mknafunc.rb
ext/mkop.rb
ext/na_array.c
ext/na_func.c
ext/na_index.c
ext/na_linalg.c
ext/na_random.c
ext/narray.c
ext/narray.def
ext/narray.h
ext/narray_local.h
ext/lib/narray_ext.rb
ext/lib/nmatrix.rb
ChangeLog
MANIFEST
README.en
README.ja
SPEC.en
SPEC.ja
src/depend
src/extconf.rb
src/mkmath.rb
src/mknafunc.rb
src/mkop.rb
src/na_array.c
src/na_func.c
src/na_index.c
src/na_linalg.c
src/na_random.c
src/narray.c
src/narray.def
src/narray.h
src/narray_local.h
src/lib/narray_ext.rb
src/lib/nmatrix.rb
]
s.rdoc_options = %w[
--title NArray
--main NArray
--exclude mk.*
--exclude extconf\.rb
--exclude src/.*\.h
--exclude src/lib/
--exclude .*\.o
--exclude narray\.so
--exclude libnarray\.*
]
s.homepage = "http://narray.rubyforge.org/"
s.require_paths = ["."]
s.rubyforge_project = "narray"
Expand Down

0 comments on commit 1c2c517

Please sign in to comment.