scrutiny 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.textile +7 -0
- data/Rakefile +2 -2
- data/lib/scrutiny.rb +11 -3
- metadata +3 -3
data/README.textile
CHANGED
@@ -54,6 +54,13 @@ bq. @my_masterpiece.words.inject(:+) # => "HelloMynameisJoeIworkinabuttonfactory
|
|
54
54
|
|
55
55
|
h2. Release Notes
|
56
56
|
|
57
|
+
h3. 0.0.3
|
58
|
+
* Removed some structural characters from the definition for a word (e.g. parentheses, braces, quotes, etc.)
|
59
|
+
* Added semicolon the definition for a sentence.
|
60
|
+
* Added the @begins_with()@ method; Returns @true@ if the string begins with the given expression, @false@ otherwise.
|
61
|
+
* Added the @ends_with()@ method; Returns @true@ if the string ends with the given expression, @false@ otherwise.
|
62
|
+
* Updated the @has_something_like()@ method to expect a String instead of a Regexp. It still functions in the same way.
|
63
|
+
|
57
64
|
h3. 0.0.2
|
58
65
|
* Added support for per-letter constraints.
|
59
66
|
* Added the @each_letter()@ method; Returns @true@ if the constraint holds for each letter, @false@ otherwise.
|
data/Rakefile
CHANGED
@@ -3,11 +3,11 @@ require 'rubygems/package_task'
|
|
3
3
|
require 'rspec/core/rake_task'
|
4
4
|
|
5
5
|
GEM = "scrutiny"
|
6
|
-
GEM_VERSION = "0.0.
|
6
|
+
GEM_VERSION = "0.0.3"
|
7
7
|
SUMMARY = "Helper methods for analyzing written words in strings."
|
8
8
|
AUTHOR = "Jared Stilwell"
|
9
9
|
EMAIL = "jared.k.stilwell@gmail.com"
|
10
|
-
HOMEPAGE = "http://
|
10
|
+
HOMEPAGE = "http://github.com/jared-stilwell/scrutiny"
|
11
11
|
|
12
12
|
spec = Gem::Specification.new do |s|
|
13
13
|
s.name = GEM
|
data/lib/scrutiny.rb
CHANGED
@@ -4,11 +4,11 @@ module Scrutiny
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def words
|
7
|
-
self.scan(/[\w\'
|
7
|
+
self.scan(/[\w\'\-\_\$\#\@\^\*\~]+/)
|
8
8
|
end
|
9
9
|
|
10
10
|
def sentences
|
11
|
-
self.scan(/[\w
|
11
|
+
self.scan(/[\w\;\'\"\-\_\$\#\@\^\&\*\(\)\~\[\]\{\}\<\>\/][^\.\?\!]*[\.\?\!]/)
|
12
12
|
end
|
13
13
|
|
14
14
|
def has_at_least(matcher)
|
@@ -26,8 +26,16 @@ module Scrutiny
|
|
26
26
|
constraint[:matches].count == constraint[:limit]
|
27
27
|
end
|
28
28
|
|
29
|
+
def begins_with(regexp)
|
30
|
+
self.scan(/^#{regexp}/).count > 0
|
31
|
+
end
|
32
|
+
|
33
|
+
def ends_with(regexp)
|
34
|
+
self.scan(/#{regexp}$/).count > 0
|
35
|
+
end
|
36
|
+
|
29
37
|
def has_something_like(regexp)
|
30
|
-
self.scan(regexp).count > 0
|
38
|
+
self.scan(/#{regexp}/).count > 0
|
31
39
|
end
|
32
40
|
|
33
41
|
def each_letter(action, matcher)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: scrutiny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jared Stilwell
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-09-
|
13
|
+
date: 2011-09-20 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description:
|
@@ -25,7 +25,7 @@ files:
|
|
25
25
|
- lib/scrutiny.rb
|
26
26
|
- README.textile
|
27
27
|
- Rakefile
|
28
|
-
homepage: http://
|
28
|
+
homepage: http://github.com/jared-stilwell/scrutiny
|
29
29
|
licenses: []
|
30
30
|
|
31
31
|
post_install_message:
|