aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-02 23:05:45 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-02 23:05:45 +0000
commit8ce71b616056fd6875d139a94c5577167beea7a4 (patch)
tree32688184d4af5acb73f39adf5244cfa3e38f9b0e
parent1dd43218445efe0e400594f21eebc81d7d2cf51a (diff)
downloadruby-8ce71b616056fd6875d139a94c5577167beea7a4.tar.gz
Promote Prime library to default gems.
* Its upstream is https://github.com/ruby/prime. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--doc/maintainers.rdoc4
-rw-r--r--doc/standard_library.rdoc2
-rw-r--r--lib/prime.gemspec22
-rw-r--r--lib/prime.rb3
4 files changed, 28 insertions, 3 deletions
diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc
index 81099817f2..5a99d81912 100644
--- a/doc/maintainers.rdoc
+++ b/doc/maintainers.rdoc
@@ -102,8 +102,6 @@ Zachary Scott (zzak)
Tanaka Akira (akr)
[lib/prettyprint.rb]
Tanaka Akira (akr)
-[lib/prime.rb]
- Yuki Sonoda (yugui)
[lib/profile.rb]
_unmaintained_
[lib/profiler.rb]
@@ -213,6 +211,8 @@ Zachary Scott (zzak)
https://github.com/ruby/fileutils
[lib/logger.rb]
Naotoshi Seo (sonots)
+[lib/prime.rb]
+ Yuki Sonoda (yugui)
[lib/rdoc.rb, lib/rdoc/*]
Eric Hodel (drbrain), Hiroshi SHIBATA (hsbt)
https://github.com/ruby/rdoc
diff --git a/doc/standard_library.rdoc b/doc/standard_library.rdoc
index 6aaa32c761..692859775e 100644
--- a/doc/standard_library.rdoc
+++ b/doc/standard_library.rdoc
@@ -40,7 +40,6 @@ OptionParser:: Ruby-oriented class for command-line option analysis
OpenStruct:: Class to build custom data structures, similar to a Hash
PP:: Provides a PrettyPrinter for Ruby objects
PrettyPrinter:: Implements a pretty printing algorithm for readable structure
-Prime:: Prime numbers and factorization library
profile.rb:: Runs the Ruby Profiler__
Profiler__:: Provides a way to profile your Ruby application
PStore:: Implements a file based persistence mechanism based on a Hash
@@ -93,6 +92,7 @@ CMath:: Provides Trigonometric and Transcendental functions for complex numbers
CSV:: Provides an interface to read and write CSV files and data
FileUtils:: Several file utility methods for copying, moving, removing, etc
Logger:: Provides a simple logging utility for outputting messages
+Prime:: Prime numbers and factorization library
RDoc:: Produces HTML and command-line documentation for Ruby
REXML:: An XML toolkit for Ruby
RSS:: Family of libraries that support various formats of XML "feeds"
diff --git a/lib/prime.gemspec b/lib/prime.gemspec
new file mode 100644
index 0000000000..de6d4f93b9
--- /dev/null
+++ b/lib/prime.gemspec
@@ -0,0 +1,22 @@
+require_relative "prime"
+
+Gem::Specification.new do |spec|
+ spec.name = "prime"
+ spec.version = Prime::VERSION
+ spec.authors = ["Yuki Sonoda"]
+ spec.email = ["yugui@yugui.jp"]
+
+ spec.summary = %q{Prime numbers and factorization library.}
+ spec.description = %q{Prime numbers and factorization library.}
+ spec.homepage = "https://github.com/ruby/prime"
+ spec.license = "BSD-2-Clause"
+
+ spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/prime.rb", "lib/prime/version.rb", "prime.gemspec"]
+ spec.bindir = "exe"
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
+ spec.require_paths = ["lib"]
+
+ spec.add_development_dependency "bundler"
+ spec.add_development_dependency "rake"
+ spec.add_development_dependency "test-unit"
+end
diff --git a/lib/prime.rb b/lib/prime.rb
index 2cd22da3a8..4fcbff678f 100644
--- a/lib/prime.rb
+++ b/lib/prime.rb
@@ -95,6 +95,9 @@ end
# has many prime factors. e.g. for Prime#prime? .
class Prime
+
+ VERSION = "0.1.0"
+
include Enumerable
include Singleton