Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add README, LICENSE, CHANGELOG, and gemspec, support building gems

  • Loading branch information...
commit 783994352c98321ae735d887e2266adc07600f8a 1 parent 21c29ec
@jeremyevans authored
View
1  .gitignore
@@ -2,4 +2,5 @@
/ext/Makefile
/ext/date.*o
/ext/date_parser.c
+*.gem
*.core
View
3  CHANGELOG
@@ -0,0 +1,3 @@
+=== 0.1.0 (Initial, unreleased version)
+
+* Basic working implementation with some specs.
View
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Jeremy Evans
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
View
63 README.rdoc
@@ -0,0 +1,63 @@
+= home_run
+
+home_run is an implementation of ruby's Date/DateTime classes in C,
+with much better performance (20-200x) than the version in the
+standard library, while being almost completely compatible.
+
+== Installing the gem
+
+ gem install home_run
+
+== Installing into site_ruby
+
+After installing the gem:
+
+ home_run --install
+
+Installing into site_ruby means that ruby will always use home_run's
+Date/DateTime classes instead of the ones in the standard library.
+
+== Running without installing into site_ruby
+
+If you don't want to install into site_ruby, you may need to run
+your script using home_run:
+
+ home_run ruby ...
+ home_run irb ...
+
+This manipulates the RUBYLIB environment variable so that home_run's
+Date/DateTime classes will be used.
+
+== Usage
+
+home_run aims to be compatible with the standard library, except
+for exceptions mentioned below. So you can use it the same way
+you use the standard library.
+
+== Differences from standard library
+
+* Written in C (mostly) instead of ruby. Stores information in a
+ C structure, and therefore has a range limitation. home_run
+ cannot handle dates after 5874773-08-15 or before -5877752-05-08
+ on 32-bit platforms (with larger limits for 64-bit platforms).
+* The Date class does not store fractional days (e.g. hours/minutes),
+ or offsets, only the DateTime class.
+* The DateTime class store fractional days as the number of
+ nanoseconds since midnight, so it cannot deal with differences
+ less than a nanosecond.
+* Neither Date nor DateTime uses Rational. Places where the standard
+ library returns Rationals, home_run returns integers or floats.
+* There is no support for modifying the date of calendar reform, the
+ Gregorian calendar is always used. This means that julian day 0
+ is displayed as -4173-11-24, instead of -4712-01-01.
+* The undocumented strftime format modifiers are not supported.
+* The DateTime offset is checked for reasonableness. home_run
+ does not support offsets with an absolute difference of more than
+ 14 hours from UTC.
+* DateTime offsets are stored in minutes, so it will round offsets
+ with fractional minutes to the nearest minute.
+
+== Author
+
+Jeremy Evans
+code@jeremyevans.net
View
7 Rakefile
@@ -6,12 +6,17 @@ RUBY=ENV['RUBY'] || 'ruby'
IRB=ENV['IRB'] || 'irb'
MSPEC=ENV['MSPEC'] || 'mspec'
-desc "Run the rubyspecs with mspec"
+desc "Run the specs with mspec"
task :default => :spec
task :spec do
sh %{#{MSPEC} -I ext -rdate spec/*/*_spec.rb}
end
+desc "Build the gem"
+task :gem => [:clean, :parser] do
+ sh %{gem build home_run.gemspec}
+end
+
desc "Build the ragel parser"
task :parser do
sh %{cd ext && ragel date_parser.rl}
View
24 home_run.gemspec
@@ -0,0 +1,24 @@
+spec = Gem::Specification.new do |s|
+ s.name = 'home_run'
+ s.version = '0.1.0'
+ s.platform = Gem::Platform::RUBY
+ s.has_rdoc = true
+ s.extra_rdoc_files = ["README.rdoc", "CHANGELOG", "LICENSE"]
+ s.rdoc_options += ["--quiet", "--line-numbers", "--inline-source", '--title', 'home_run: Fast Date/DateTime classes for ruby', '--main', 'README.rdoc']
+ s.summary = "Fast Date/DateTime classes for ruby"
+ s.author = "Jeremy Evans"
+ s.email = "code@jeremyevans.net"
+ s.homepage = "http://github.com/jeremyevans/home_run"
+ s.required_ruby_version = ">= 1.8.6"
+ s.files = %w(LICENSE CHANGELOG README.rdoc Rakefile) + Dir["{bin,ext,spec}/**/*"]
+ s.require_path = "ext"
+ s.extensions << 'ext/extconf.rb'
+ s.bindir = 'bin'
+ s.executables << 'home_run'
+ s.description = <<END
+home_run is an implementation of ruby's Date/DateTime classes in C,
+with much better performance (20-200x) than the version in the
+standard library, while being almost completely compatible.
+END
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.