Skip to content

Commit

Permalink
Fix documentation typos and spelling errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
philr committed Dec 24, 2018
1 parent 587b11a commit 8c54937
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 41 deletions.
22 changes: 11 additions & 11 deletions CHANGES.md
Expand Up @@ -10,7 +10,7 @@
* `abbreviation`, `dst?`, `base_utc_offset` and `observed_utc_offset` instance
methods have been added to `TZInfo::Timezone`, returning the abbreviation,
whether daylight savings time is in effect and the UTC offset of the time zone
at a specfied time.
at a specified time.
* A `TZInfo::Timestamp` class has been added. It can be used with
`TZInfo::Timezone` in place of a `Time` or `DateTime`.
* `local_time`, `local_datetime` and `local_timestamp` instance methods have
Expand Down Expand Up @@ -106,7 +106,7 @@
`TZInfo::DataSources::TransitionsDataTimezoneInfo` is constructed with an
`Array` of `TZInfo::TimezoneTransition` instances representing times when the
offset changes. `TZInfo::DataSources::ConstantOffsetDataTimezoneInfo` is
constructed with a `TZInfo::TimezoneOffset` instance repsenting the offset
constructed with a `TZInfo::TimezoneOffset` instance representing the offset
constantly observed in a time zone.
* The `TZInfo::DataSource#timezone_identifiers` method should no longer be
overridden in custom data source implementations. The implementation in the
Expand Down Expand Up @@ -663,7 +663,7 @@
* `Country` has a new `zone_info` method that returns `CountryTimezone` objects
containing additional information (latitude, longitude and a description)
relating to each `Timezone`. #4140.
* Timezones within a `Country` are now returned in an order that makes
* Time zones within a `Country` are now returned in an order that makes
geographic sense.
* The zdumptest utility now checks local to utc conversions in addition to
utc to local conversions.
Expand Down Expand Up @@ -695,7 +695,7 @@
time and then returns it formatted. `%Z` is replaced with the timezone
abbreviation for the given time (for example, EST or EDT). #4143.
* Fix escaping of quotes in `TZDataParser`. This affected country names and
descriptions of timezones within countries.
descriptions of time zones within countries.


## Version 0.2.2 (tzdata v2006g) - 17-May-2006
Expand Down Expand Up @@ -725,7 +725,7 @@
* Added abbreviation as an alias for `TimezonePeriod.zone_identifier`.
* Updated to tzdata version 2006d
(<https://mm.icann.org/pipermail/tz/2006-April/013517.html>).
* Ignore any offset in `DateTime` instancess passed in (as is already done for
* Ignore any offset in `DateTime` instances passed in (as is already done for
`Time` instances). All of the following now refer to the same UTC time (15:40 on 17 April 2006). Previously, the `DateTime` in the second line would have been interpreted as 20:40.

```ruby
Expand Down Expand Up @@ -766,7 +766,7 @@
* Updated to tzdata version 2006a
(<https://mm.icann.org/pipermail/tz/2006-January/013311.html>).
* `build_tz_classes` rake task now handles running svn add and svn delete as new
timezones and countries are added and old ones are removed.
time zones and countries are added and old ones are removed.
* Return a better error when attempting to use a `Timezone` instance that was
constructed with `Timezone.new(nil)`. This will occur when using Rails'
`composed_of`. When the timezone identifier in the database is null,
Expand All @@ -776,7 +776,7 @@

## Version 0.1.1 (tzdata v2005q) - 18-Dec-2005

* Timezones that are defined by a single unbounded period (e.g. UTC) now
* Time zones that are defined by a single unbounded period (e.g. UTC) now
work again.
* Updated to tzdata version 2005q.

Expand All @@ -799,7 +799,7 @@
* Moved `TimezonePeriod` class to `timezone_period.rb`.
* New `TimezonePeriodList` class to store `TimezonePeriod` instances for a
timezone and perform searches for periods.
* Timezones now defined using blocks. `TimezonePeriod` instances are only
* Time zones are now defined using blocks. `TimezonePeriod` instances are only
created when they are needed. Thanks to Jamis Buck for the suggestion.
* Add options to `TZDataParser` to allow exclusion of specific zones and
countries.
Expand All @@ -822,8 +822,8 @@
apostrophes into UTC, GMT, etc).
* Fixed `Country` `<=>` operator (was comparing non-existent attribute)
* Fixed `Timezone.period_for_local` error when period not found.
* Added testcases for `Timezone`, `TimezoneProxy`, `TimezonePeriod`, `Country`
and some selected timezones.
* Added test cases for `Timezone`, `TimezoneProxy`, `TimezonePeriod`, `Country`
and some selected time zones.


## Version 0.0.3 (tzdata v2005m) - 17-Sep-2005
Expand All @@ -845,7 +845,7 @@
return `TimezoneProxy` instances instead. This makes these methods much
quicker.

In Ruby on Rails, you can now show a drop-down list of all timezones using the
In Ruby on Rails, you can now show a drop-down list of all time zones using the
Rails `time_zone_select` helper method:

```ruby
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -159,7 +159,7 @@ period.local_ends_at.to_time # => 2018-11-04 02:00:00 -0400

A list of transitions between periods where different rules are observed can be
obtained with the `transitions_up_to` method. The result is returned as an
`Array` of `TZInfo::TimzoneTransition` objects:
`Array` of `TZInfo::TimezoneTransition` objects:

```ruby
transitions = tz.transitions_up_to(Time.utc(2019, 1, 1), Time.utc(2017, 1, 1))
Expand Down
2 changes: 1 addition & 1 deletion lib/tzinfo/country.rb
Expand Up @@ -55,7 +55,7 @@ def all

private

# @return [DataSouce] the current DataSource.
# @return [DataSource] the current DataSource.
def data_source
DataSource.get
end
Expand Down
6 changes: 3 additions & 3 deletions lib/tzinfo/data_source.rb
Expand Up @@ -32,7 +32,7 @@ class DataSource
# @private
@@instance = nil

# Mutex used to ensure the default data source is only created once.
# A `Mutex` used to ensure the default data source is only created once.
#
# @private
@@default_mutex = Mutex.new
Expand All @@ -46,7 +46,7 @@ def get
# This is done at the first request rather than when TZInfo is loaded to
# avoid unnecessary attempts to find a suitable DataSource.
#
# A Mutex is used to ensure that only a single default instance is
# A `Mutex` is used to ensure that only a single default instance is
# created (this avoiding the possibility of retaining two copies of the
# same data in memory).

Expand All @@ -66,7 +66,7 @@ def get
# * `:ruby` - read data from the Ruby modules included in the TZInfo::Data
# library (tzinfo-data gem).
# * `:zoneinfo` - read data from the zoneinfo files included with most
# Unix-like operating sytems (e.g. in /usr/share/zoneinfo).
# Unix-like operating systems (e.g. in /usr/share/zoneinfo).
#
# To set TZInfo to use one of the standard data source types, call
# `TZInfo::DataSource.set`` in one of the following ways:
Expand Down
12 changes: 6 additions & 6 deletions lib/tzinfo/data_sources/zoneinfo_data_source.rb
Expand Up @@ -5,17 +5,17 @@ module TZInfo
module DataSources
# An {InvalidZoneinfoDirectory} exception is raised if {ZoneinfoDataSource}
# is initialized with a specific zoneinfo path that is not a valid zoneinfo
# directory. A valid zoneinfo directory is one that contains timezone files,
# a country code index file named iso3166.tab and a timezone index file
# named zone1970.tab or zone.tab.
# directory. A valid zoneinfo directory is one that contains time zone
# files, a country code index file named iso3166.tab and a time zone index
# file named zone1970.tab or zone.tab.
class InvalidZoneinfoDirectory < StandardError
end

# A {ZoneinfoDirectoryNotFound} exception is raised if no valid zoneinfo
# directory could be found when checking the paths listed in
# {ZoneinfoDataSource.search_path}. A valid zoneinfo directory is one that
# contains timezone files, a country code index file named iso3166.tab and a
# timezone index file named zone1970.tab or zone.tab.
# contains time zone files, a country code index file named iso3166.tab and
# a time zone index file named zone1970.tab or zone.tab.
class ZoneinfoDirectoryNotFound < StandardError
end

Expand Down Expand Up @@ -306,7 +306,7 @@ def load_country_info(code)
# and zone1970.tab or zone.tab files if valid. If the directory is not
# valid, returns `nil`.
#
# The path to the iso3166.tab file may be overriden by passing in a path.
# The path to the iso3166.tab file may be overridden by passing in a path.
# This is treated as either absolute or relative to the current working
# directory.
#
Expand Down
4 changes: 2 additions & 2 deletions lib/tzinfo/data_sources/zoneinfo_reader.rb
Expand Up @@ -84,8 +84,8 @@ def check_read(file, bytes)
# transition.
def derive_offsets(transitions, offsets)
# The first non-DST offset (if there is one) is the offset observed
# before the first transition. Fallback to the first DST offset if there
# are no non-DST offsets.
# before the first transition. Fall back to the first DST offset if
# there are no non-DST offsets.
first_non_dst_offset_index = offsets.index {|o| !o[:is_dst] }
first_offset_index = first_non_dst_offset_index || 0
return first_offset_index if transitions.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/tzinfo/format1/timezone_definer.rb
Expand Up @@ -49,7 +49,7 @@ def offset(id, utc_offset, std_offset, abbreviation)
# @raise [ArgumentError] if `offset_id` does not reference a defined
# offset.
# @raise [ArgumentError] if `timestamp_value` is not greater than the
# `timestamp_value` of the previously defined transtion.
# `timestamp_value` of the previously defined transition.
# @raise [ArgumentError] if `datetime_numerator` is specified, but
# `datetime_denominator` is not. In older versions of TZInfo, it was
# possible to define a transition with the `DateTime` numerator as the
Expand Down
2 changes: 1 addition & 1 deletion lib/tzinfo/format2/timezone_definer.rb
Expand Up @@ -70,7 +70,7 @@ def offset(id, base_utc_offset, std_offset, abbreviation)
# @raise [ArgumentError] if `offset_id` does not reference a defined
# offset.
# @raise [ArgumentError] if `timestamp_value` is not greater than the
# `timestamp_value` of the previously defined transtion.
# `timestamp_value` of the previously defined transition.
def transition(offset_id, timestamp_value)
offset = @offsets[offset_id]
raise ArgumentError, 'offset_id has not been defined' unless offset
Expand Down
8 changes: 4 additions & 4 deletions lib/tzinfo/format2/timezone_index_definition.rb
Expand Up @@ -2,8 +2,8 @@

module TZInfo
module Format2
# The format 2 timezone index file includes {TimezoneIndexDefinition}, which
# provides the {TimezoneIndexDefinition::ClassMethods#timezone_index
# The format 2 time zone index file includes {TimezoneIndexDefinition},
# which provides the {TimezoneIndexDefinition::ClassMethods#timezone_index
# timezone_index} method used to define the index.
#
# @private
Expand All @@ -28,12 +28,12 @@ def self.append_features(base)
# @private
module ClassMethods #:nodoc:
# @return [Array<String>] a frozen `Array` containing the identifiers of
# all data timezones. Identifiers are sorted according to
# all data time zones. Identifiers are sorted according to
# `String#<=>`.
attr_reader :data_timezones

# @return [Array<String>] a frozen `Array` containing the identifiers of
# all linked timezones. Identifiers are sorted according to
# all linked time zones. Identifiers are sorted according to
# `String#<=>`.
attr_reader :linked_timezones

Expand Down
22 changes: 11 additions & 11 deletions lib/tzinfo/timezone.rb
Expand Up @@ -260,9 +260,9 @@ def inspect
"#<#{self.class}: #{identifier}>"
end

# Returns {identifier}, modified to make it more readable. Set `skip_first_part` to
# omit the first part of the identifier (typically a region name) where
# there is more than one part.
# Returns {identifier}, modified to make it more readable. Set
# `skip_first_part` to omit the first part of the identifier (typically a
# region name) where there is more than one part.
#
# For example:
#
Expand Down Expand Up @@ -384,7 +384,7 @@ def transitions_up_to(to, from = nil)
# (and creating an alias for) America/New_York.
#
# Links are also used for time zones that are currently identical to a full
# Zone, but that are administered seperately. For example, Europe/Vatican is
# Zone, but that are administered separately. For example, Europe/Vatican is
# a Link to (and alias for) Europe/Rome.
#
# For a full Zone (implemented by {DataTimezone}), {canonical_zone} returns
Expand Down Expand Up @@ -568,7 +568,7 @@ def to_local(time)
# @param utc_time [Object] a `Time`, `DateTime` or {Timestamp}.
# @return [Object] the local equivalent of `utc_time` as a {TimeWithOffset},
# {DateTimeWithOffset} or {TimestampWithOffset}.
# @raise [ArgumentErrror] if `utc_time` is `nil`.
# @raise [ArgumentError] if `utc_time` is `nil`.
def utc_to_local(utc_time)
raise ArgumentError, 'utc_time must be specified' unless utc_time

Expand Down Expand Up @@ -664,8 +664,8 @@ def local_to_utc(local_time, dst = Timezone.default_dst)
# _Warning:_ There are time values that are not valid as local times in a
# time zone (for example, during the transition from standard time to
# daylight savings time). There are also time values that are ambiguous,
# occuring more than once with different offsets to UTC (for example, during
# the transition from daylight savings time to standard time).
# occurring more than once with different offsets to UTC (for example,
# during the transition from daylight savings time to standard time).
#
# In the first case (an invalid local time), a {PeriodNotFound} exception
# will be raised.
Expand Down Expand Up @@ -752,8 +752,8 @@ def local_time(year, month = 1, day = 1, hour = 0, minute = 0, second = 0, sub_s
# _Warning:_ There are time values that are not valid as local times in a
# time zone (for example, during the transition from standard time to
# daylight savings time). There are also time values that are ambiguous,
# occuring more than once with different offsets to UTC (for example, during
# the transition from daylight savings time to standard time).
# occurring more than once with different offsets to UTC (for example,
# during the transition from daylight savings time to standard time).
#
# In the first case (an invalid local time), a {PeriodNotFound} exception
# will be raised.
Expand Down Expand Up @@ -840,8 +840,8 @@ def local_datetime(year, month = 1, day = 1, hour = 0, minute = 0, second = 0, s
# _Warning:_ There are time values that are not valid as local times in a
# time zone (for example, during the transition from standard time to
# daylight savings time). There are also time values that are ambiguous,
# occuring more than once with different offsets to UTC (for example, during
# the transition from daylight savings time to standard time).
# occurring more than once with different offsets to UTC (for example,
# during the transition from daylight savings time to standard time).
#
# In the first case (an invalid local time), a {PeriodNotFound} exception
# will be raised.
Expand Down

0 comments on commit 8c54937

Please sign in to comment.