randexp 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.1.3 "Oological" 2008-07-08
2
+ * Randgen.word should not return a string that does not match /^\w+$/
3
+
1
4
  == 0.1.2 "I'm Not Saying It's Not Beta"
2
5
  * Changed rand to Kernel#rand to avoid conflicting with rails (thanks agile!)
3
6
 
data/README CHANGED
@@ -12,8 +12,7 @@ andexp makes it easy to generate random string from most regular expressions.
12
12
 
13
13
  == INSTALL:
14
14
 
15
- $ gem sources -a http://gems.github.com/ (you only need to do this once)
16
- $ gem install benburkert-randexp
15
+ $ sudo gem install randexp
17
16
 
18
17
  == USAGE:
19
18
 
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require 'rake/rdoctask'
7
7
 
8
8
  PROJECT_NAME = "randexp"
9
9
  GEM = "randexp"
10
- GEM_VERSION = "0.1.2"
10
+ GEM_VERSION = "0.1.3"
11
11
  AUTHOR = "Ben Burkert"
12
12
  EMAIL = "ben@benburkert.com"
13
13
  HOMEPAGE = "http://github.com/benburkert/randexp"
data/TODO CHANGED
@@ -1,5 +1,4 @@
1
1
  == Todo list
2
2
  * add a ~/.randexp dir for configuration
3
- * clean up Randexp::Parser.parse
4
3
  * add [] syntax: /[aeiou]{4}/.gen
5
4
  * more generators for Randgen
@@ -31,7 +31,11 @@ class Randgen
31
31
  end
32
32
 
33
33
  def self.word(options = {})
34
- Dictionary.words(options).pick
34
+ begin
35
+ word = Dictionary.words(options).pick
36
+ end until word =~ /^\w+$/
37
+
38
+ word
35
39
  end
36
40
 
37
41
  def self.sentence(options = {})
@@ -70,6 +70,15 @@ describe Randgen do
70
70
  Randgen.word(:length => length).length.should == length
71
71
  end
72
72
  end
73
+
74
+ it "should not return a string that is not a word" do
75
+ strings = %w[foo's bars]
76
+ Dictionary.should_receive(:words).at_least(1).and_return strings
77
+
78
+ 100.times do
79
+ Randgen.word.should_not == "foo's"
80
+ end
81
+ end
73
82
  end
74
83
 
75
84
  describe ".sentence" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: randexp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Burkert
@@ -9,7 +9,7 @@ autorequire: randexp
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-28 00:00:00 -05:00
12
+ date: 2008-09-08 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15