activesupport 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activesupport might be problematic. Click here for more details.

data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ *1.2.2* (October 26th, 2005)
2
+
3
+ * Set Logger.silencer = false to disable Logger#silence. Useful for debugging fixtures.
4
+
5
+ * Add title case method to String to do, e.g., 'action_web_service'.titlecase # => 'Action Web Service'. [Marcel Molina Jr.]
6
+
7
+
1
8
  *1.2.1* (October 19th, 2005)
2
9
 
3
10
  * Classify generated routing code as framework code to avoid appearing in application traces. [Nicholas Seckar]
@@ -1,12 +1,22 @@
1
1
  require 'logger'
2
+ require File.dirname(__FILE__) + '/class_attribute_accessors'
2
3
 
3
4
  class Logger #:nodoc:
5
+ cattr_accessor :silencer
6
+ self.silencer = true
7
+
4
8
  # Silences the logger for the duration of the block.
5
9
  def silence(temporary_level = Logger::ERROR)
6
- old_logger_level, self.level = level, temporary_level
7
- yield self
8
- ensure
9
- self.level = old_logger_level
10
+ if silencer
11
+ begin
12
+ old_logger_level, self.level = level, temporary_level
13
+ yield self
14
+ ensure
15
+ self.level = old_logger_level
16
+ end
17
+ else
18
+ yield self
19
+ end
10
20
  end
11
21
 
12
22
  private
@@ -15,6 +15,12 @@ module ActiveSupport #:nodoc:
15
15
  def camelize
16
16
  Inflector.camelize(self)
17
17
  end
18
+ alias_method :camelcase, :camelize
19
+
20
+ def titleize
21
+ Inflector.titleize(self)
22
+ end
23
+ alias_method :titlecase, :titleize
18
24
 
19
25
  def underscore
20
26
  Inflector.underscore(self)
@@ -112,6 +112,10 @@ module Inflector
112
112
  def camelize(lower_case_and_underscored_word)
113
113
  lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
114
114
  end
115
+
116
+ def titleize(word)
117
+ humanize(underscore(word)).gsub(/\b([a-z])/) { $1.capitalize }
118
+ end
115
119
 
116
120
  def underscore(camel_cased_word)
117
121
  camel_cased_word.to_s.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase
@@ -157,4 +161,4 @@ module Inflector
157
161
  end
158
162
  end
159
163
 
160
- require File.dirname(__FILE__) + '/inflections'
164
+ require File.dirname(__FILE__) + '/inflections'
@@ -2,7 +2,7 @@ module ActiveSupport
2
2
  module Version #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 2
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.10
2
+ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: activesupport
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.2.1
7
- date: 2005-10-19
6
+ version: 1.2.2
7
+ date: 2005-10-26 00:00:00 +02:00
8
8
  summary: Support and utility classes used by the Rails framework.
9
9
  require_paths:
10
10
  - lib
@@ -24,6 +24,8 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
24
24
  version: 0.0.0
25
25
  version:
26
26
  platform: ruby
27
+ signing_key:
28
+ cert_chain:
27
29
  authors:
28
30
  - David Heinemeier Hansson
29
31
  files: