[ruby-netcdf] 01/08: New upstream version 0.7.2
Youhei SASAKI
uwabami-guest at moszumanska.debian.org
Wed Sep 28 08:14:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
uwabami-guest pushed a commit to branch master
in repository ruby-netcdf.
commit 09e35549da0b4d9c4c4e09a34ca95ad4d3c3a304
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date: Tue Sep 27 17:58:33 2016 +0900
New upstream version 0.7.2
---
ChangeLog => .ChangeLog.until20150117 | 0
.gitignore | 8 --
.rspec | 2 -
.travis.yml | 3 -
Rakefile | 37 +++++-
bin/console | 14 ---
bin/setup | 7 --
extconf.rb => ext/numru/extconf.rb | 4 +-
netcdfraw.c => ext/numru/netcdfraw.c | 32 +++++
lib/{ => numru}/netcdf.rb | 12 +-
lib/numru/netcdf/version.rb | 7 ++
lib/{ => numru}/netcdf_miss.rb | 0
lib/version.rb | 5 -
metadata.yml | 138 ----------------------
ruby-netcdf.gemspec => ruby-netcdf-bigmem.gemspec | 24 ++--
ruby-netcdf.gemspec | 18 +--
test/test.rb | 8 +-
17 files changed, 103 insertions(+), 216 deletions(-)
diff --git a/ChangeLog b/.ChangeLog.until20150117
similarity index 100%
rename from ChangeLog
rename to .ChangeLog.until20150117
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 359a4c0..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/.bundle/
-/.yardoc
-/Gemfile.lock
-/_yardoc/
-/coverage/
-/pkg/
-/spec/reports/
-/tmp/
diff --git a/.rspec b/.rspec
deleted file mode 100644
index 8c18f1a..0000000
--- a/.rspec
+++ /dev/null
@@ -1,2 +0,0 @@
---format documentation
---color
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 11a115a..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: ruby
-rvm:
- - 1.9.3
diff --git a/Rakefile b/Rakefile
index 809eb56..e457f52 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,2 +1,37 @@
-require "bundler/gem_tasks"
+# -* coding: utf-8 -*-
+require 'rake/testtask'
+require 'rake/extensiontask'
+require 'rake/packagetask'
+begin
+ require 'bundler/gem_helper' # instead of 'bundler/gem_tasks' -> need manual
+ # calls of install_tasks (see below)
+rescue LoadError
+ puts 'If you want to create gem, You must install Bundler'
+end
+# manual calls of install_tasks to support multiple gemspec files
+Bundler::GemHelper.install_tasks(name: "ruby-netcdf")
+#Bundler::GemHelper.install_tasks(name: "ruby-netcdf-bigmem")
+
+require './lib/numru/netcdf/version'
+def version
+ NumRu::NetCDF::VERSION
+end
+
+task :default => :test
+task :test => :compile
+Rake::TestTask.new do |t|
+ t.libs << 'lib' << 'test'
+ t.test_files = FileList['test/*.rb']
+end
+
+Rake::ExtensionTask.new do |ext|
+ ext.name = 'netcdfraw'
+ ext.ext_dir = 'ext/numru'
+ ext.lib_dir = 'lib/numru'
+end
+
+Rake::PackageTask.new('ruby-netcdf', "#{version}") do |t|
+ t.need_tar_gz = true
+ t.package_files.include `git ls-files`.split("\n")
+end
diff --git a/bin/console b/bin/console
deleted file mode 100644
index 05ba4f4..0000000
--- a/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "ruby/netcdf"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start
diff --git a/bin/setup b/bin/setup
deleted file mode 100644
index b65ed50..0000000
--- a/bin/setup
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -euo pipefail
-IFS=$'\n\t'
-
-bundle install
-
-# Do any other automated setup that you need to do here
diff --git a/extconf.rb b/ext/numru/extconf.rb
similarity index 97%
rename from extconf.rb
rename to ext/numru/extconf.rb
index 1ad8b17..b3ee26d 100644
--- a/extconf.rb
+++ b/ext/numru/extconf.rb
@@ -8,14 +8,14 @@ else
ncversion = nil
end
-if Gem.respond_to?(:find_files)
+if Gem.respond_to?(:find_files) and Gem.find_files("narray.h").length > 0
require "rbconfig"
so = RbConfig::CONFIG["DLEXT"]
narray_include = File.expand_path(File.dirname(Gem.find_files("narray.h")[0]))
narray_lib = File.expand_path(File.dirname(Gem.find_files("narray." + so)[0]))
else
gem_home=(`gem environment GEM_HOME`).chomp
- narray_dir = Dir.glob("#{gem_home}/gems/narray-*").sort[-1]
+ narray_dir = Dir.glob("#{gem_home}/gems/narray-*/ext/narray").sort[-1]
if narray_dir
narray_include = narray_lib = narray_dir
else
diff --git a/netcdfraw.c b/ext/numru/netcdfraw.c
similarity index 99%
rename from netcdfraw.c
rename to ext/numru/netcdfraw.c
index 200e8f3..73a9778 100644
--- a/netcdfraw.c
+++ b/ext/numru/netcdfraw.c
@@ -1153,6 +1153,30 @@ NetCDF_unlimited(VALUE file)
return Qnil;
}
}
+
+#if NCVER >= 400
+
+VALUE
+NetCDF_format(VALUE file)
+{
+ int ncid;
+ int formatp;
+ int status;
+ VALUE Integer;
+ struct Netcdf *ncfile;
+
+ Data_Get_Struct(file,struct Netcdf,ncfile);
+ ncid=ncfile->ncid;
+ status=nc_inq_format(ncid,&formatp);
+ if(status != NC_NOERR) NC_RAISE (status);
+ Integer = INT2NUM(formatp);
+ /* one of NC_FORMAT_CLASSIC (1), NC_FORMAT_64BIT (2), NC_FORMAT_NETCDF4 (3),
+ NC_FORMAT_NETCDF4_CLASSIC (4)
+ */
+ return Integer;
+}
+
+#endif
VALUE
NetCDF_sync(VALUE file)
@@ -4591,6 +4615,11 @@ Init_netcdfraw(void)
rb_define_const(cNetCDF, "NC_ENDIAN_NATIVE", INT2FIX(NC_ENDIAN_NATIVE));
rb_define_const(cNetCDF, "NC_ENDIAN_LITTLE", INT2FIX(NC_ENDIAN_LITTLE));
rb_define_const(cNetCDF, "NC_ENDIAN_BIG", INT2FIX(NC_ENDIAN_BIG));
+
+ rb_define_const(cNetCDF, "NC_FORMAT_CLASSIC", INT2FIX(NC_FORMAT_CLASSIC));
+ rb_define_const(cNetCDF, "NC_FORMAT_64BIT", INT2FIX(NC_FORMAT_64BIT));
+ rb_define_const(cNetCDF, "NC_FORMAT_NETCDF4", INT2FIX(NC_FORMAT_NETCDF4));
+ rb_define_const(cNetCDF, "NC_FORMAT_NETCDF4_CLASSIC", INT2FIX(NC_FORMAT_NETCDF4_CLASSIC));
#endif
#ifdef NARRAY_BIGMEM
@@ -4617,6 +4646,9 @@ Init_netcdfraw(void)
rb_define_method(cNetCDF,"ndims",NetCDF_ndims,0);
rb_define_method(cNetCDF,"nvars",NetCDF_nvars,0);
rb_define_method(cNetCDF,"natts",NetCDF_natts,0);
+#if NCVER >= 400
+ rb_define_method(cNetCDF,"format",NetCDF_format,0);
+#endif
rb_define_method(cNetCDF,"sync",NetCDF_sync,0);
rb_define_method(cNetCDF,"path",NetCDF_path,0);
rb_define_method(cNetCDF,"dim",NetCDF_dim,1);
diff --git a/lib/netcdf.rb b/lib/numru/netcdf.rb
similarity index 98%
rename from lib/netcdf.rb
rename to lib/numru/netcdf.rb
index 2c6a922..4e68f01 100644
--- a/lib/netcdf.rb
+++ b/lib/numru/netcdf.rb
@@ -1,4 +1,5 @@
require 'narray'
+require 'numru/netcdf/version'
require 'numru/netcdfraw'
if NArray.const_defined?(:SUPPORT_BIGMEM) && NArray::SUPPORT_BIGMEM
@@ -34,13 +35,14 @@ module NumRu
def NetCDF.creation_format=(cmode)
raise("This method is available only for NetCDF >= 4") unless @@nc4
case cmode
- when 0, nil, NC_CLASSIC_MODEL, /^CLASSIC$/i # classic netcdf ver 3 fmt
+ when 0, nil, NC_CLASSIC_MODEL, /^CLASSIC$/i, NC_FORMAT_CLASSIC
+ # classic netcdf ver 3 fmt
@@cr_format = 0
- when NC_64BIT_OFFSET, /^64BIT_OFFSET$/i
+ when NC_64BIT_OFFSET, /^64BIT_OFFSET$/i, NC_FORMAT_64BIT
@@cr_format = NC_64BIT_OFFSET
- when NC_NETCDF4, /^NETCDF4$/i
+ when NC_NETCDF4, /^NETCDF4$/i, NC_FORMAT_NETCDF4
@@cr_format = NC_NETCDF4
- when ( NC_NETCDF4 | NC_CLASSIC_MODEL), /^NETCDF4_CLASSIC$/i
+ when ( NC_NETCDF4 | NC_CLASSIC_MODEL), /^NETCDF4_CLASSIC$/i, NC_FORMAT_NETCDF4_CLASSIC
# NetCDF4 but disabling new data models
@@cr_format = NC_NETCDF4 | NC_CLASSIC_MODEL
else
@@ -57,7 +59,7 @@ module NumRu
"64BIT_OFFSET"
when NC_NETCDF4
"NETCDF4"
- when NC_NETCDF4 | NC_CLASSIC_MODEL
+ when (NC_NETCDF4 | NC_CLASSIC_MODEL)
"NETCDF4_CLASSIC"
end
end
diff --git a/lib/numru/netcdf/version.rb b/lib/numru/netcdf/version.rb
new file mode 100644
index 0000000..7f9248a
--- /dev/null
+++ b/lib/numru/netcdf/version.rb
@@ -0,0 +1,7 @@
+module NumRu
+ class NetCDF
+
+ VERSION = "0.7.2"
+
+ end
+end
diff --git a/lib/netcdf_miss.rb b/lib/numru/netcdf_miss.rb
similarity index 100%
rename from lib/netcdf_miss.rb
rename to lib/numru/netcdf_miss.rb
diff --git a/lib/version.rb b/lib/version.rb
deleted file mode 100644
index 7043c9e..0000000
--- a/lib/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module Ruby
- module Netcdf
- VERSION = "0.7.1.1"
- end
-end
diff --git a/metadata.yml b/metadata.yml
deleted file mode 100644
index fb30c35..0000000
--- a/metadata.yml
+++ /dev/null
@@ -1,138 +0,0 @@
---- !ruby/object:Gem::Specification
-name: ruby-netcdf
-version: !ruby/object:Gem::Version
- version: 0.7.1.1
-platform: ruby
-authors:
-- Takeshi Horinouchi
-- Tsuyoshi Koshiro
-- Shigenori Otsuka
-- Seiya Nishizawa
-- T Sakakima
-autorequire:
-bindir: bin
-cert_chain: []
-date: 2015-03-02 00:00:00.000000000 Z
-dependencies:
-- !ruby/object:Gem::Dependency
- name: narray
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '0'
- type: :runtime
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '0'
-- !ruby/object:Gem::Dependency
- name: narray_miss
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '0'
- type: :runtime
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '0'
-description: RubyNetCDF is the Ruby interface to the NetCDF library built on the NArray
- library, which is an efficient multi-dimensional numeric array class for Ruby. This
- version works with Ruby2.0.
-email:
-- eriko at gfd-dennou.org
-executables: []
-extensions:
-- extconf.rb
-extra_rdoc_files: []
-files:
-- .gitignore
-- .rspec
-- .travis.yml
-- ChangeLog
-- Gemfile
-- INSTALL
-- LICENSE.txt
-- Rakefile
-- ToDo
-- bin/console
-- bin/setup
-- demo/README
-- demo/demo1-create-alt.rb
-- demo/demo1-create.rb
-- demo/demo2-graphic.rb
-- demo/demo3-ncepclim.rb
-- demo/demo4-copy.rb
-- demo/demo5-netcdf4.rb
-- doc/README_JP.txt
-- doc/Ref_man.html
-- doc/Ref_man.rd
-- doc/Ref_man_jp.html
-- doc/Ref_man_jp.rd
-- doc/to_html
-- extconf.rb
-- lib/netcdf.rb
-- lib/netcdf_miss.rb
-- lib/version.rb
-- netcdfraw.c
-- ruby-netcdf.gemspec
-- test/aref_aset.rb
-- test/char_var.rb
-- test/clone.rb
-- test/create_tmp.rb
-- test/def_var_with_dim.rb
-- test/factor_offset.rb
-- test/putatt.cdl
-- test/putatt.rb
-- test/test.cdl
-- test/test.rb
-- test/type.rb
-homepage: http://www.gfd-dennou.org/arch/ruby/products/ruby-netcdf/
-licenses:
-- GFD Dennou Club
-metadata: {}
-post_install_message:
-rdoc_options: []
-require_paths:
-- lib
-required_ruby_version: !ruby/object:Gem::Requirement
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '1.6'
-required_rubygems_version: !ruby/object:Gem::Requirement
- requirements:
- - - ! '>='
- - !ruby/object:Gem::Version
- version: '0'
-requirements: []
-rubyforge_project:
-rubygems_version: 2.4.6
-signing_key:
-specification_version: 4
-summary: Ruby interface to NetCDF
-test_files:
-- demo/README
-- demo/demo1-create-alt.rb
-- demo/demo1-create.rb
-- demo/demo2-graphic.rb
-- demo/demo3-ncepclim.rb
-- demo/demo4-copy.rb
-- demo/demo5-netcdf4.rb
-- test/aref_aset.rb
-- test/char_var.rb
-- test/clone.rb
-- test/create_tmp.rb
-- test/def_var_with_dim.rb
-- test/factor_offset.rb
-- test/putatt.cdl
-- test/putatt.rb
-- test/test.cdl
-- test/test.rb
-- test/type.rb
diff --git a/ruby-netcdf.gemspec b/ruby-netcdf-bigmem.gemspec
similarity index 53%
copy from ruby-netcdf.gemspec
copy to ruby-netcdf-bigmem.gemspec
index a6025bc..ec7076d 100644
--- a/ruby-netcdf.gemspec
+++ b/ruby-netcdf-bigmem.gemspec
@@ -1,34 +1,28 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require 'version'
+require 'numru/netcdf/version'
Gem::Specification.new do |spec|
- spec.name = "ruby-netcdf"
- spec.version = Ruby::Netcdf::VERSION
+ spec.name = "ruby-netcdf-bigmem"
+ spec.version = NumRu::NetCDF::VERSION
spec.authors = ["Takeshi Horinouchi", "Tsuyoshi Koshiro",\
"Shigenori Otsuka", "Seiya Nishizawa", "T Sakakima"]
spec.email = ['eriko at gfd-dennou.org']
- #if spec.respond_to?(:metadata)
- # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
- #end
-
spec.summary = %q{Ruby interface to NetCDF}
spec.description = %q{RubyNetCDF is the Ruby interface to the NetCDF library built on the NArray library, which is an efficient multi-dimensional numeric array class for Ruby. This version works with Ruby2.0.}
spec.homepage = 'http://www.gfd-dennou.org/arch/ruby/products/ruby-netcdf/'
- spec.licenses = ["GFD Dennou Club"]
+ spec.licenses = ["BSD-2-Clause"]
spec.files = `git ls-files -z`.split("\x0")
spec.test_files = spec.files.grep(%r{^(test|demo)/})
- #spec.bindir = "exe"
- #spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
+ spec.require_paths = ["ext","lib"]
+ spec.extensions << "ext/numru/extconf.rb"
- spec.required_ruby_version = Gem::Requirement.new(">= 1.6")
- spec.add_runtime_dependency(%q<narray>, [">= 0"])
- spec.add_runtime_dependency(%q<narray_miss>, [">= 0"])
+ spec.required_ruby_version = Gem::Requirement.new(">= 1.8")
+ spec.add_runtime_dependency(%q<narray-bigmem>, [">= 0"])
+ spec.add_runtime_dependency(%q<narray_miss-bigmem>, [">= 0"])
- spec.extensions << "extconf.rb"
end
diff --git a/ruby-netcdf.gemspec b/ruby-netcdf.gemspec
index a6025bc..cfdd516 100644
--- a/ruby-netcdf.gemspec
+++ b/ruby-netcdf.gemspec
@@ -1,34 +1,28 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require 'version'
+require 'numru/netcdf/version'
Gem::Specification.new do |spec|
spec.name = "ruby-netcdf"
- spec.version = Ruby::Netcdf::VERSION
+ spec.version = NumRu::NetCDF::VERSION
spec.authors = ["Takeshi Horinouchi", "Tsuyoshi Koshiro",\
"Shigenori Otsuka", "Seiya Nishizawa", "T Sakakima"]
spec.email = ['eriko at gfd-dennou.org']
- #if spec.respond_to?(:metadata)
- # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
- #end
-
spec.summary = %q{Ruby interface to NetCDF}
spec.description = %q{RubyNetCDF is the Ruby interface to the NetCDF library built on the NArray library, which is an efficient multi-dimensional numeric array class for Ruby. This version works with Ruby2.0.}
spec.homepage = 'http://www.gfd-dennou.org/arch/ruby/products/ruby-netcdf/'
- spec.licenses = ["GFD Dennou Club"]
+ spec.licenses = ["BSD-2-Clause"]
spec.files = `git ls-files -z`.split("\x0")
spec.test_files = spec.files.grep(%r{^(test|demo)/})
- #spec.bindir = "exe"
- #spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
+ spec.require_paths = ["ext","lib"]
+ spec.extensions << "ext/numru/extconf.rb"
- spec.required_ruby_version = Gem::Requirement.new(">= 1.6")
+ spec.required_ruby_version = Gem::Requirement.new(">= 1.8")
spec.add_runtime_dependency(%q<narray>, [">= 0"])
spec.add_runtime_dependency(%q<narray_miss>, [">= 0"])
- spec.extensions << "extconf.rb"
end
diff --git a/test/test.rb b/test/test.rb
index 7ec59c6..3b2b148 100644
--- a/test/test.rb
+++ b/test/test.rb
@@ -1,8 +1,8 @@
-##require 'numru/netcdf'
+require 'numru/netcdf'
## // to test before make install -->
-require 'narray'
-require '../netcdfraw'
-require '../lib/netcdf'
+#require 'narray'
+#require '../netcdfraw'
+#require '../lib/netcdf'
## <-- to test before make install //
include NumRu
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/ruby-netcdf.git
More information about the Pkg-grass-devel
mailing list