From 544a10e428cda02e7baa38586ef266daaef20d89 Mon Sep 17 00:00:00 2001 From: Mike Manewitz Date: Fri, 4 May 2012 10:24:56 -0500 Subject: Editing log levels to reflect this doc: http://api.rubyonrails.org/classes/ActiveSupport/BufferedLogger/Severity.html --- guides/source/debugging_rails_applications.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source') diff --git a/guides/source/debugging_rails_applications.textile b/guides/source/debugging_rails_applications.textile index 903ed59e7b..45fa4ada78 100644 --- a/guides/source/debugging_rails_applications.textile +++ b/guides/source/debugging_rails_applications.textile @@ -124,7 +124,7 @@ h4. Log Levels When something is logged it's printed into the corresponding log if the log level of the message is equal or higher than the configured log level. If you want to know the current log level you can call the +Rails.logger.level+ method. -The available log levels are: +:debug+, +:info+, +:warn+, +:error+, and +:fatal+, corresponding to the log level numbers from 0 up to 4 respectively. To change the default log level, use +The available log levels are: +:debug+, +:info+, +:warn+, +:error+, +:fatal+, and +:unknown+, corresponding to the log level numbers from 0 up to 5 respectively. To change the default log level, use config.log_level = :warn # In any environment initializer, or -- cgit v1.2.3 From 552f535796b92df57ae7e7ea339307c45683c71b Mon Sep 17 00:00:00 2001 From: Mark Rushakoff Date: Sun, 6 May 2012 20:40:48 -0700 Subject: are ran -> are run The former is grammatically incorrect. --- guides/source/configuring.textile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'guides/source') diff --git a/guides/source/configuring.textile b/guides/source/configuring.textile index 59f12e98ab..5bfb45f778 100644 --- a/guides/source/configuring.textile +++ b/guides/source/configuring.textile @@ -182,13 +182,13 @@ The full set of methods that can be used in this block are as follows: * +force_plural+ allows pluralized model names. Defaults to +false+. * +helper+ defines whether or not to generate helpers. Defaults to +true+. * +integration_tool+ defines which integration tool to use. Defaults to +nil+. -* +javascripts+ turns on the hook for javascripts in generators. Used in Rails for when the +scaffold+ generator is ran. Defaults to +true+. +* +javascripts+ turns on the hook for javascripts in generators. Used in Rails for when the +scaffold+ generator is run. Defaults to +true+. * +javascript_engine+ configures the engine to be used (for eg. coffee) when generating assets. Defaults to +nil+. * +orm+ defines which orm to use. Defaults to +false+ and will use Active Record by default. * +performance_tool+ defines which performance tool to use. Defaults to +nil+. * +resource_controller+ defines which generator to use for generating a controller when using +rails generate resource+. Defaults to +:controller+. * +scaffold_controller+ different from +resource_controller+, defines which generator to use for generating a _scaffolded_ controller when using +rails generate scaffold+. Defaults to +:scaffold_controller+. -* +stylesheets+ turns on the hook for stylesheets in generators. Used in Rails for when the +scaffold+ generator is ran, but this hook can be used in other generates as well. Defaults to +true+. +* +stylesheets+ turns on the hook for stylesheets in generators. Used in Rails for when the +scaffold+ generator is run, but this hook can be used in other generates as well. Defaults to +true+. * +stylesheet_engine+ configures the stylesheet engine (for eg. sass) to be used when generating assets. Defaults to +:css+. * +test_framework+ defines which test framework to use. Defaults to +false+ and will use Test::Unit by default. * +template_engine+ defines which template engine to use, such as ERB or Haml. Defaults to +:erb+. @@ -585,13 +585,13 @@ TIP: If you have any ordering dependency in your initializers, you can control t h3. Initialization events -Rails has 5 initialization events which can be hooked into (listed in the order that they are ran): +Rails has 5 initialization events which can be hooked into (listed in the order that they are run): * +before_configuration+: This is run as soon as the application constant inherits from +Rails::Application+. The +config+ calls are evaluated before this happens. * +before_initialize+: This is run directly before the initialization process of the application occurs with the +:bootstrap_hook+ initializer near the beginning of the Rails initialization process. -* +to_prepare+: Run after the initializers are ran for all Railties (including the application itself), but before eager loading and the middleware stack is built. More importantly, will run upon every request in +development+, but only once (during boot-up) in +production+ and +test+. +* +to_prepare+: Run after the initializers are run for all Railties (including the application itself), but before eager loading and the middleware stack is built. More importantly, will run upon every request in +development+, but only once (during boot-up) in +production+ and +test+. * +before_eager_load+: This is run directly before eager loading occurs, which is the default behaviour for the _production_ environment and not for the +development+ environment. @@ -732,7 +732,7 @@ The error occurred while evaluating nil.each *+load_config_initializers+* Loads all Ruby files from +config/initializers+ in the application, railties and engines. The files in this directory can be used to hold configuration settings that should be made after all of the frameworks are loaded. -*+engines_blank_point+* Provides a point-in-initialization to hook into if you wish to do anything before engines are loaded. After this point, all railtie and engine initializers are ran. +*+engines_blank_point+* Provides a point-in-initialization to hook into if you wish to do anything before engines are loaded. After this point, all railtie and engine initializers are run. *+add_generator_templates+* Finds templates for generators at +lib/templates+ for the application, railities and engines and adds these to the +config.generators.templates+ setting, which will make the templates available for all generators to reference. -- cgit v1.2.3 From 8c4777f446d9e14deb077f44d31579a5a96e68ae Mon Sep 17 00:00:00 2001 From: "Mark J. Titorenko" Date: Mon, 7 May 2012 12:04:51 +0100 Subject: Added documentation for +beginning_of_hour+ and +end_of_hour+ to Active Support Core Extensions guide. --- .../source/active_support_core_extensions.textile | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'guides/source') diff --git a/guides/source/active_support_core_extensions.textile b/guides/source/active_support_core_extensions.textile index e4a6e145b9..a238a84e8c 100644 --- a/guides/source/active_support_core_extensions.textile +++ b/guides/source/active_support_core_extensions.textile @@ -3064,6 +3064,28 @@ date.end_of_day # => Sun Jun 06 23:59:59 +0200 2010 +beginning_of_day+ is aliased to +at_beginning_of_day+, +midnight+, +at_midnight+. +h6. +beginning_of_hour+, +end_of_hour+ + +The method +beginning_of_hour+ returns a timestamp at the beginning of the hour (hh:00:00): + + +date = DateTime.new(2010, 6, 7, 19, 55, 25) +date.beginning_of_hour # => Mon Jun 07 19:00:00 +0200 2010 + + +The method +end_of_hour+ returns a timestamp at the end of the hour (hh:59:59): + + +date = DateTime.new(2010, 6, 7, 19, 55, 25) +date.end_of_hour # => Mon Jun 07 19:59:59 +0200 2010 + + ++beginning_of_hour+ is aliased to +at_beginning_of_hour+. + +INFO: +beginning_of_hour+ and +end_of_hour+ are implemented for +Time+ and +DateTime+ but *not* +Date+ as it does not make sense to request the beginning or end of an hour on a +Date+ instance. + +NOTE: All the following methods are defined in +active_support/core_ext/date/calculations.rb+. + h6. +ago+, +since+ The method +ago+ receives a number of seconds as argument and returns a timestamp those many seconds ago from midnight: @@ -3131,6 +3153,13 @@ since (in) On the other hand, +advance+ and +change+ are also defined and support more options, they are documented below. +The following methods are only implemented in +active_support/core_ext/date_time/calculations.rb+ as they only make sense when used with a +DateTime+ instance: + + +beginning_of_hour (at_beginning_of_hour) +end_of_hour + + h5. Named Datetimes h6. +DateTime.current+ @@ -3273,6 +3302,8 @@ ago since (in) beginning_of_day (midnight, at_midnight, at_beginning_of_day) end_of_day +beginning_of_hour (at_beginning_of_hour) +end_of_hour beginning_of_week (at_beginning_of_week) end_of_week (at_end_of_week) monday -- cgit v1.2.3 From f174e8dcef66446cb7483c48dc746887b29078b6 Mon Sep 17 00:00:00 2001 From: "Mark J. Titorenko" Date: Mon, 7 May 2012 12:07:35 +0100 Subject: Corrections to +beginning_of_day+ and +end_of_day+ example dates. --- guides/source/active_support_core_extensions.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guides/source') diff --git a/guides/source/active_support_core_extensions.textile b/guides/source/active_support_core_extensions.textile index a238a84e8c..c9e9a13c09 100644 --- a/guides/source/active_support_core_extensions.textile +++ b/guides/source/active_support_core_extensions.textile @@ -3052,14 +3052,14 @@ The method +beginning_of_day+ returns a timestamp at the beginning of the day (0 date = Date.new(2010, 6, 7) -date.beginning_of_day # => Sun Jun 07 00:00:00 +0200 2010 +date.beginning_of_day # => Mon Jun 07 00:00:00 +0200 2010 The method +end_of_day+ returns a timestamp at the end of the day (23:59:59): date = Date.new(2010, 6, 7) -date.end_of_day # => Sun Jun 06 23:59:59 +0200 2010 +date.end_of_day # => Mon Jun 07 23:59:59 +0200 2010 +beginning_of_day+ is aliased to +at_beginning_of_day+, +midnight+, +at_midnight+. -- cgit v1.2.3 From 61587b18d2b4b03041cc7e54da00cff6344abeec Mon Sep 17 00:00:00 2001 From: "Mark J. Titorenko" Date: Mon, 7 May 2012 12:24:40 +0100 Subject: Remove accidentally pasted NOTE section during introduction of +beginning_of_hour+ and +end_of_hour+ documentation. --- guides/source/active_support_core_extensions.textile | 2 -- 1 file changed, 2 deletions(-) (limited to 'guides/source') diff --git a/guides/source/active_support_core_extensions.textile b/guides/source/active_support_core_extensions.textile index c9e9a13c09..43dc0c12cf 100644 --- a/guides/source/active_support_core_extensions.textile +++ b/guides/source/active_support_core_extensions.textile @@ -3084,8 +3084,6 @@ date.end_of_hour # => Mon Jun 07 19:59:59 +0200 2010 INFO: +beginning_of_hour+ and +end_of_hour+ are implemented for +Time+ and +DateTime+ but *not* +Date+ as it does not make sense to request the beginning or end of an hour on a +Date+ instance. -NOTE: All the following methods are defined in +active_support/core_ext/date/calculations.rb+. - h6. +ago+, +since+ The method +ago+ receives a number of seconds as argument and returns a timestamp those many seconds ago from midnight: -- cgit v1.2.3