diff --git a/.document b/.document new file mode 100644 index 0000000000..439654c10a --- /dev/null +++ b/.document @@ -0,0 +1,3 @@ +*.txt +*.md +lib/ diff --git a/.rdoc_options b/.rdoc_options new file mode 100644 index 0000000000..f9297d90b5 --- /dev/null +++ b/.rdoc_options @@ -0,0 +1,2 @@ +--- +main_page: README.md diff --git a/cmath.gemspec b/cmath.gemspec index 8f2be11cbb..fa92bbc5a9 100644 --- a/cmath.gemspec +++ b/cmath.gemspec @@ -1,18 +1,19 @@ # coding: utf-8 # frozen_string_literal: true +version = File.read("#{__dir__}/lib/cmath.rb")[/^\s*VERSION\s*=\s*"([^"]*)"/, 1] Gem::Specification.new do |spec| spec.name = "cmath" - spec.version = "1.0.0" + spec.version = version spec.authors = ["Tadayoshi Funaba"] - spec.email = [nil] + spec.email = ["tadf@dotrb.org"] spec.summary = "Provides Trigonometric and Transcendental functions for complex numbers" spec.description = "CMath is a library that provides trigonometric and transcendental functions for complex numbers. The functions in this module accept integers, floating-point numbers or complex numbers as arguments." spec.homepage = "https://github.com/ruby/cmath" spec.license = "BSD-2-Clause" - spec.files = "lib/cmath.rb" + spec.files = %w[.document .rdoc_options LICENSE.txt README.md lib/cmath.rb] spec.bindir = "exe" spec.executables = [] spec.require_paths = ["lib"] diff --git a/lib/cmath.rb b/lib/cmath.rb index 0a301b718d..e4fe39e118 100644 --- a/lib/cmath.rb +++ b/lib/cmath.rb @@ -24,13 +24,20 @@ module CMath include Math + # The version string. + VERSION = "1.0.0" + # Backup of Math is needed because mathn.rb replaces Math with CMath. RealMath = Math # :nodoc: private_constant :RealMath module_function - def domain?(z, nonreal = false) + # Returns +false+ if _z_ is real but not in domain by the block. + # If no block is given, domain is not limited. + # If _z_ is not real, returns _nonreal_ that is defaulted to +false+. + # If _z_ does not have +real?+ method, returns +true+. + private def domain?(z, nonreal = false) # :nodoc: unless z.respond_to?(:real?) return true end diff --git a/rakelib/epoch.rake b/rakelib/epoch.rake new file mode 100644 index 0000000000..80f27c9571 --- /dev/null +++ b/rakelib/epoch.rake @@ -0,0 +1,5 @@ +task "build" => "date_epoch" + +task "date_epoch" do + ENV["SOURCE_DATE_EPOCH"] = IO.popen(%W[git -C #{__dir__} log -1 --format=%ct], &:read).chomp +end