GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Resource-oriented open source Ruby framework for Web apps.
Homepage: http://rubywaves.com/
Clone URL: git://github.com/dyoder/waves.git
reworked English inflection into a layer

including this layer in Default foundation for now, as
putting it in the generated application would instantly break
all existing apps in a frustrating way
automatthew (author)
Tue Jul 01 12:31:39 -0700 2008
commit  81890ee6aa80262266c46ad67ed6d87777dbb71f
tree    a8766792c26116268b8eb3c55f141264e3da2367
parent  29288e13dabbc9a9200557e903e6ee7385dfd098
...
11
12
13
 
14
15
16
...
11
12
13
14
15
16
17
0
@@ -11,6 +11,7 @@ module Waves
0
 
0
         app.instance_eval do
0
 
0
+ include Waves::Layers::Inflect::English
0
           include Waves::Layers::Simple
0
           include Waves::Layers::MVC
0
           include Waves::Layers::DefaultErrors
...
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
...
17
18
19
 
 
 
 
 
 
 
 
 
 
 
 
20
21
22
0
@@ -17,18 +17,6 @@ module Waves
0
         File.join(self,string.to_s)
0
       end
0
 
0
- def singular
0
- Waves::Inflect::English.singular(self)
0
- end
0
-
0
- alias_method(:singularize, :singular)
0
-
0
- def plural
0
- Waves::Inflect::English.plural(self)
0
- end
0
-
0
- alias_method(:pluralize, :plural)
0
-
0
       # produces stringsLikeThis
0
       def lower_camel_case
0
         gsub(/(_)(\w)/) { $2.upcase }
...
32
33
34
35
36
37
38
...
88
89
90
 
91
...
32
33
34
 
35
36
37
...
87
88
89
90
91
0
@@ -32,7 +32,6 @@ require 'utilities/symbol'
0
 require 'utilities/object'
0
 require 'utilities/integer'
0
 require 'utilities/inflect'
0
-require 'utilities/inflect/english'
0
 require 'utilities/proc'
0
 require 'utilities/hash'
0
 require 'utilities/attributes'
0
@@ -88,4 +87,5 @@ require 'layers/simple_errors'
0
 require 'foundations/simple'
0
 require 'layers/mvc'
0
 require 'layers/default_errors'
0
+require 'layers/inflect/english'
0
 require 'foundations/default'
...
5
6
7
8
9
10
11
...
71
72
73
74
75
76
77
78
79
 
 
 
 
 
 
 
80
81
82
...
5
6
7
 
8
9
10
...
70
71
72
 
 
 
 
 
 
73
74
75
76
77
78
79
80
81
82
0
@@ -5,7 +5,6 @@ UTILITIES = "#{File.dirname(__FILE__)}/../../lib/utilities"
0
 
0
 require "#{UTILITIES}/module"
0
 require "#{UTILITIES}/inflect"
0
-require "#{UTILITIES}/inflect/english"
0
 require "#{UTILITIES}/string"
0
 require "#{UTILITIES}/symbol"
0
 require "#{UTILITIES}/object"
0
@@ -71,12 +70,13 @@ describe "a language extended with Waves::Utilities::Inflect" do
0
 end
0
 
0
 describe "Waves::Utilities::String" do
0
-
0
- it "delegates singular and plural inflection methods" do
0
- Waves::Inflect::English.should.receive(:singular).and_return("boring")
0
- Waves::Inflect::English.should.receive(:plural).and_return("still boring")
0
- "boring".singular.plural
0
- end
0
+
0
+ # ** API Change **
0
+ # it "delegates singular and plural inflection methods" do
0
+ # Waves::Inflect::English.should.receive(:singular).and_return("boring")
0
+ # Waves::Inflect::English.should.receive(:plural).and_return("still boring")
0
+ # "boring".singular.plural
0
+ # end
0
   
0
   it "defines / as syntactic sugar for File.join" do
0
     ( "lib" / "utilities" ).should == File.join( "lib", "utilities" )

Comments

    No one has commented yet.