Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .document
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.txt
*.md
lib/
2 changes: 2 additions & 0 deletions .rdoc_options
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
main_page: README.md
7 changes: 4 additions & 3 deletions cmath.gemspec
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
9 changes: 8 additions & 1 deletion lib/cmath.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions rakelib/epoch.rake
Original file line number Diff line number Diff line change
@@ -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
Loading