Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi! We cleaned up your code for you! #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Fixed bug #20723: using modified patch contributed by Justin Cunningham. This partially reverted changes made by bug fix #5749, REDay by default now returns true for less precise arguments but accepts an optional constructor parameter which will override this behavior

* Removed deprecated "autorequire" property configuration from Rakefile

* Added properly spelled constant Runt::Eighth to the Runt module

* Added month constants defined in Date class to runt.rb for use by shortcuts
Expand All @@ -22,7 +22,7 @@

* Changed runttest.rb to use local Time so test doesn't fail when run from another time zone

* Fixed usage of deprecated methods in Date when accessing them from PDate subclass
* Fixed usage of deprecated methods in Date when accessing them from PDate subclass

* Applied patches providing week precision and expanded RFC2445 compliance tests contributed by Larry Karnowski

Expand Down Expand Up @@ -52,9 +52,9 @@

* Added update method to Schedule allowing clients to update existing expressions

* Added select method to Schedule allowing clients to query Events using arbitrary criteria
* Added select method to Schedule allowing clients to query Events using arbitrary criteria

* Added events method to Schedule which returns an Array of the currrently held Events
* Added events method to Schedule which returns an Array of the currrently held Events

* Added time-related shortcuts to Runt module contributed by Ara T. Howard

Expand Down Expand Up @@ -84,12 +84,12 @@

== Version 0.3.0

* TExpr (finally!) becomes a Module instead of a superclass
* TExpr (finally!) becomes a Module instead of a superclass

* Added overlap? method for all temporal expressions and DateRange

* Added REMonth expression which matches a range of dates each month

* Contributed by Emmett Shear: TExpr#dates method which returns an array of dates occurring within the supplied DateRange

* Rakefile fixes:
Expand All @@ -114,7 +114,7 @@
* Renamed file dateprecisiontest.rb to dprecisiontest.rb
* Renamed several methods on PDate:
- second -> sec
- minute -> min
- minute -> min
- hour_of_day -> hour
- day_of_month -> day

Expand Down
12 changes: 6 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ PKG_FILES = FileList[
if(RUBY_PLATFORM =~ /win32/i)
PKG_EXEC_TAR = false
else
PKG_EXEC_TAR = true
PKG_EXEC_TAR = true
end

# build directory
TARGET_DIR = "target"

Expand Down Expand Up @@ -75,7 +75,7 @@ end
Rake::TestTask.new do |t|
t.libs << "test" << "examples"
t.pattern = '**/*test.rb'
t.verbose = false
t.verbose = false
t.warning = false
end

Expand Down Expand Up @@ -114,16 +114,16 @@ else
s.homepage = 'http://runt.rubyforge.org'
s.has_rdoc = true
s.rdoc_options += %w{--main README --title Runt}
s.extra_rdoc_files = FileList["README","CHANGES","TODO","LICENSE.txt","doc/*.rdoc"]
s.extra_rdoc_files = FileList["README","CHANGES","TODO","LICENSE.txt","doc/*.rdoc"]
s.test_files = Dir['**/*test.rb']
s.rubyforge_project = 'runt'
s.description = <<EOF
Runt is a Ruby version of temporal patterns by
Martin Fowler. Runt provides an API for scheduling
recurring events using set-like semantics.
recurring events using set-like semantics.
EOF
end

Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = PKG_EXEC_TAR
Expand Down
18 changes: 9 additions & 9 deletions lib/runt/expressionbuilder.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'runt'

# Convenience class for building temporal expressions in a more
# human-friendly way. Used in conjunction with shortcuts defined in the
# Convenience class for building temporal expressions in a more
# human-friendly way. Used in conjunction with shortcuts defined in the
# sugar.rb file, this allows one to create expressions like the following:
#
#
# b = ExpressionBuilder.new
# expr = b.define do
# occurs daily_8_30am_to_9_45am
Expand All @@ -15,18 +15,18 @@
#
# expr = REDay.new(8,30,9,45) & DIWeek.new(Tuesday) | DIWeek.new(Wednesday)
#
# ExpressionBuilder creates expressions by evaluating a block passed to the
# ExpressionBuilder creates expressions by evaluating a block passed to the
# :define method. From inside the block, methods :occurs, :on, :every, :possibly,
# and :maybe can be called with a temporal expression which will be added to
# a composite expression as follows:
#
# * <b>:on</b> - creates an "and" (&)
# * <b>:possibly</b> - creates an "or" (|)
# * <b>:possibly</b> - creates an "or" (|)
# * <b>:except</b> - creates a "not" (-)
# * <b>:every</b> - alias for :on method
# * <b>:occurs</b> - alias for :on method
# * <b>:maybe</b> - alias for :possibly method
#
# * <b>:maybe</b> - alias for :possibly method
#
class ExpressionBuilder

include Runt
Expand All @@ -40,7 +40,7 @@ def initialize
def define(&block)
instance_eval(&block)
end

def on(expr)
add(expr, :&)
end
Expand All @@ -54,7 +54,7 @@ def add(expr, op)
def except(expr)
add(expr, :-)
end

def possibly(expr)
add(expr, :|)
end
Expand Down
14 changes: 7 additions & 7 deletions setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ConfigTable
((major == 1) and
((minor >= 5) or
((minor == 4) and (teeny >= 4)))))

subprefix = lambda {|path|
path.sub(/\A#{Regexp.quote(c['prefix'])}/o, '$prefix')
}
Expand Down Expand Up @@ -303,7 +303,7 @@ def []=(k, v)
unless ConfigTable.config_key?(k)
@table[k] = v
end

def [](key)
return nil unless @table[key]
@table[key].gsub(%r<\$([^/]+)>) { self[$1] }
Expand Down Expand Up @@ -479,7 +479,7 @@ def command(str)
def ruby(str)
command config('ruby-prog') + ' ' + str
end

def make(task = '')
command config('make-prog') + ' ' + task
end
Expand Down Expand Up @@ -572,7 +572,7 @@ def srcexist?(path)
def srcdirectory?(path)
File.dir?(srcfile(path))
end

def srcfile?(path)
File.file? srcfile(path)
end
Expand Down Expand Up @@ -708,7 +708,7 @@ def parsearg_global
when '-v', '--version'
puts "#{File.basename($0)} version #{Version}"
exit 0

when '--copyright'
puts Copyright
exit 0
Expand Down Expand Up @@ -1165,9 +1165,9 @@ def install_files(list, dest, mode)
def ruby_scripts
collect_filenames_auto().select {|n| /\.rb\z/ =~ n }
end

# picked up many entries from cvs-1.11.1/src/ignore.c
reject_patterns = %w(
reject_patterns = %w(
core RCSLOG tags TAGS .make.state
.nse_depinfo #* .#* cvslog.* ,* .del-* *.olb
*~ *.old *.bak *.BAK *.orig *.rej _$* *$
Expand Down
29 changes: 14 additions & 15 deletions site/blue-robot3.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ a {
a:link {color:#09c;}
a:visited {color:#07a;}
a:hover {background-color:#eee;}


/* All the content boxes belong to the content class. */
.content {
Expand Down Expand Up @@ -70,21 +70,21 @@ a:hover {background-color:#eee;}
padding:10px;
z-index:2;

/* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity.
Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it.
IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style
declaration. The incorrect IE5/Win value is above, while the correct value is
/* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity.
Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it.
IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style
declaration. The incorrect IE5/Win value is above, while the correct value is
below. See http://glish.com/css/hacks.asp for details. */
voice-family: "\"}\"";
voice-family:inherit;
width:128px;
}
/* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct
length values to user agents that exhibit the parsing error exploited above yet get
/* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct
length values to user agents that exhibit the parsing error exploited above yet get
the CSS box model right and understand the CSS2 parent-child selector. ALWAYS include
a "be nice to Opera 5" rule every time you use the Tantek Celik hack (above). */
body>#navAlpha {width:128px;}

#navBeta {
position:absolute;
width:190px;
Expand Down Expand Up @@ -113,20 +113,19 @@ body>#navBeta {width:168px;}
font-size:10px;
}

#logo {

#logo {
border: 0px solid ;
width: 97px;
width: 97px;
height: 33px;
vertical-align: -50%;
}


#dcl-logo {
border: 0px solid ;
width: 140px;
height: 29px;
border: 0px solid ;
width: 140px;
height: 29px;
vertical-align: -110%;
margin: 2px;
}