Permalink
Browse files

Release 0.8.7 (improved startup time)

CHANGE: Improved startup time (via autoload)
  • Loading branch information...
1 parent 0dd4340 commit 8ae5f9b547a756f92d969f1f12f761a2eca64c52 @delano committed Oct 7, 2009
Showing with 27 additions and 16 deletions.
  1. +2 −1 CHANGES.txt
  2. +22 −11 lib/tryouts.rb
  3. +1 −1 lib/tryouts/drill.rb
  4. +1 −2 lib/tryouts/drill/sergeant/cli.rb
  5. +1 −1 tryouts.gemspec
View
@@ -11,13 +11,14 @@ TRYOUTS, CHANGES
* TODO: Clear stash between drills
-#### 0.8.5 (2009-09-??) ###############################
+#### 0.8.5 (2009-10-07) ###############################
NOTE: Benchmark tryouts must now use proc style dreams
* CHANGE: Benchmark tryouts now display complex benchmark info
(utime, stime, cutime, cstime, total, real)
* CHANGE: Benchmark tryouts now run a brief warmup
+* CHANGE: Improved startup time (via autoload)
#### 0.8.4 (2009-07-20) ###############################
View
@@ -1,10 +1,11 @@
require 'time'
-require 'attic'
-require 'sysinfo'
require 'digest/sha1'
-require 'ostruct'
-require 'yaml'
+
+autoload :Attic, 'attic'
+autoload :SysInfo, 'sysinfo'
+autoload :OpenStruct, 'ostruct'
+autoload :YAML, 'yaml'
## NOTE: Don't require rye here so
## we can still run tryouts on the
@@ -46,22 +47,29 @@ def message
end
end
- VERSION = "0.8.4"
+ VERSION = "0.8.5"
require 'tryouts/mixins'
require 'tryouts/tryout'
require 'tryouts/drill'
- require 'tryouts/stats'
- require 'tryouts/orderedhash'
- HASH_TYPE = (RUBY_VERSION =~ /1.9/) ? ::Hash : Tryouts::OrderedHash
-
+ autoload :Stats, 'tryouts/stats'
+
+ unless defined?(HASH_TYPE)
+ if RUBY_VERSION =~ /1.8/
+ require 'tryouts/orderedhash'
+ HASH_TYPE = Tryouts::OrderedHash
+ else
+ HASH_TYPE = Hash
+ end
+ end
+
# An Array of +_tryouts.rb+ file paths that have been loaded.
@@loaded_files = []
# An Hash of Tryouts instances stored under the name of the Tryouts subclass.
@@instances = HASH_TYPE.new
# An instance of SysInfo
- @@sysinfo = SysInfo.new
+ @@sysinfo = nil
@@debug = false
@@verbose = 0
@@ -81,7 +89,10 @@ def self.failed=(v); @@failed = v; end
# Returns +@@instances+
def self.instances; @@instances; end
# Returns +@@sysinfo+
- def self.sysinfo; @@sysinfo; end
+ def self.sysinfo
+ @@sysinfo = SysInfo.new if @@sysinfo.nil?
+ @@sysinfo
+ end
# The name of this group of Tryout objects
attr_accessor :group
View
@@ -15,7 +15,7 @@ class Drill
require 'tryouts/drill/sergeant/cli'
require 'tryouts/drill/sergeant/api'
require 'tryouts/drill/sergeant/benchmark'
- require 'tryouts/drill/sergeant/rbenchmark'
+ #require 'tryouts/drill/sergeant/rbenchmark'
class NoSergeant < Tryouts::Exception; end
class UnknownFormat < Tryouts::Exception; end
@@ -1,4 +1,4 @@
-
+autoload :Rye, 'rye' # Make sure rye is loaded
class Tryouts; class Drill; module Sergeant
@@ -17,7 +17,6 @@ class CLI
attr_accessor :command
def initialize(*args)
- require 'rye' # Make sure rye is loaded
@command = args.shift
@rbox_args = args
@rbox = Rye::Box.new
View
@@ -1,7 +1,7 @@
@spec = Gem::Specification.new do |s|
s.name = "tryouts"
s.rubyforge_project = "tryouts"
- s.version = "0.8.5.001"
+ s.version = "0.8.5"
s.summary = "Tryouts is a high-level testing library (DSL) for your Ruby codes and command-line applications."
s.description = s.summary
s.author = "Delano Mandelbaum"

0 comments on commit 8ae5f9b

Please sign in to comment.