greenbar 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/greenbar/RandSetup.rb +6 -11
  2. data/rakefile.rb +1 -1
  3. metadata +2 -2
@@ -40,22 +40,17 @@ module Greenbar::RandSetup
40
40
  #:stopdoc:
41
41
  include Greenbar::TestSetup
42
42
 
43
- @@rand_sequences = {}
43
+ RAND_SEQUENCES = {}
44
44
 
45
45
  def setup_mixin
46
- Kernel.instance_eval {
47
- rand_sequences = Greenbar::RandSetup.instance_eval { class_variable_get :@@rand_sequences }
48
- class_variable_set :@@rand_sequences, rand_sequences
49
- }
50
-
51
46
  Kernel.class_eval do
52
47
 
53
48
  alias :rand_saved_by_RandSetup :rand
54
49
 
55
50
  def rand(max=0)
56
- raise "Must use seed_rand_sequence(#{max}) before using rand(#{max})." unless @@rand_sequences.has_key? max
57
- @@rand_sequences[max] << @@rand_sequences[max].shift
58
- @@rand_sequences[max][-1]
51
+ raise "Must use seed_rand_sequence(#{max}) before using rand(#{max})." unless RAND_SEQUENCES.has_key? max
52
+ RAND_SEQUENCES[max] << RAND_SEQUENCES[max].shift
53
+ RAND_SEQUENCES[max][-1]
59
54
  end
60
55
  end
61
56
  end
@@ -64,7 +59,7 @@ module Greenbar::RandSetup
64
59
  Kernel.class_eval do
65
60
  alias :rand :rand_saved_by_RandSetup
66
61
  remove_method :rand_saved_by_RandSetup
67
- Kernel.instance_eval { remove_class_variable :@@rand_sequences}
62
+ RAND_SEQUENCES.clear
68
63
  end
69
64
  end
70
65
  #:startdoc:#
@@ -76,7 +71,7 @@ module Greenbar::RandSetup
76
71
  def seed_rand_sequence(max, sequence)
77
72
  array = sequence.to_a
78
73
  raise "Must provide a non-empty sequence." if array.empty?
79
- @@rand_sequences[max] = array
74
+ RAND_SEQUENCES[max] = array
80
75
  end
81
76
 
82
77
  end
@@ -4,7 +4,7 @@ require 'rake/clean'
4
4
  require 'rake/testtask'
5
5
  require 'rake/rdoctask'
6
6
 
7
- GREENBAR_VERSION = '1.0.0'
7
+ GREENBAR_VERSION = '1.0.1'
8
8
  WEB_BUILD="web/build"
9
9
 
10
10
  desc "Default Task"
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: greenbar
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.0
7
- date: 2006-05-01 00:00:00 -04:00
6
+ version: 1.0.1
7
+ date: 2006-07-16 00:00:00 -04:00
8
8
  summary: Test::Unit tools.
9
9
  require_paths:
10
10
  - lib