rich_support 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = Rich-Support CHANGELOG
2
2
 
3
- == Version 0.1.0 (April 10, 2011)
3
+ == Version 0.1.1 (April 23, 2011)
4
+
5
+ Added String.singular? and String.plural?
6
+
7
+ == Version 0.1.0 (April 13, 2011)
4
8
 
5
9
  * Initial release
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -32,6 +32,14 @@ module Rich
32
32
  downcase == (result = pluralize).downcase ? nil : replace(result)
33
33
  end
34
34
 
35
+ def singular?
36
+ !dup.singularize!
37
+ end
38
+
39
+ def plural?
40
+ !singular?
41
+ end
42
+
35
43
  end
36
44
  end
37
45
  end
@@ -3,7 +3,7 @@ module Rich
3
3
  module VERSION
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- TINY = 0
6
+ TINY = 1
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join(".")
9
9
  end
@@ -46,6 +46,20 @@ module Core
46
46
  assert_equal "TeSts", "TeSt" .pluralize!
47
47
  end
48
48
 
49
+ test "singular?" do
50
+ assert "baby" .singular?
51
+ assert "person" .singular?
52
+ assert "question".singular?
53
+ assert "status " .singular?
54
+ end
55
+
56
+ test "plural?" do
57
+ assert "babies" .plural?
58
+ assert "people" .plural? unless Rails::VERSION::MAJOR < 3 # This fails in Rails < 3
59
+ assert "questions".plural?
60
+ assert "statuses" .plural?
61
+ end
62
+
49
63
  end
50
64
  end
51
65
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rich_support
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Paul Engel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-13 00:00:00 +02:00
18
+ date: 2011-04-23 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21