README.md in refinements-6.3.2 vs README.md in refinements-7.0.0
- old
+ new
@@ -7,11 +7,11 @@
[![Gem Version](https://badge.fury.io/rb/refinements.svg)](http://badge.fury.io/rb/refinements)
[![Code Climate Maintainability](https://api.codeclimate.com/v1/badges/98be62123a95d5ac32d2/maintainability)](https://codeclimate.com/github/bkuhlmann/refinements/maintainability)
[![Code Climate Test Coverage](https://api.codeclimate.com/v1/badges/98be62123a95d5ac32d2/test_coverage)](https://codeclimate.com/github/bkuhlmann/refinements/test_coverage)
[![Circle CI Status](https://circleci.com/gh/bkuhlmann/refinements.svg?style=svg)](https://circleci.com/gh/bkuhlmann/refinements)
-Provides additional enhancements (refinements) to core Ruby objects.
+A collection of refinements (enhancements) to core Ruby objects.
<!-- Tocer[start]: Auto-generated, don't remove. -->
## Table of Contents
@@ -21,10 +21,11 @@
- [Usage](#usage)
- [Requires](#requires)
- [Using](#using)
- [Examples](#examples)
- [Array](#array)
+ - [DateTime](#datetime)
- [Big Decimal](#big-decimal)
- [File](#file)
- [Hash](#hash)
- [Pathname](#pathname)
- [String](#string)
@@ -41,10 +42,12 @@
## Features
- Provides Array refinements:
- `#compress` - Removes `nil` and empty values without modifying itself.
- `#compress!` - Removes `nil` and empty values while modifying itself.
+- Provides DateTime refinements:
+ - `.utc` - Answers new DateTime object for current UTC date/time.
- Provides BigDecimal refinements:
- `#inspect` - Allows one to inspect a big decimal with numeric representation.
- Provides File refinements:
- `.rewrite` - When given a file path and a block, it provides the contents of the recently read
file for manipulation and immediate writing back to the same file.
@@ -97,10 +100,11 @@
gem "refinements", require: false
...then require the specific refinement, as needed. Example:
require "refinements/arrays"
+ require "refinements/date_times"
require "refinements/big_decimals"
require "refinements/files"
require "refinements/hashes"
require "refinements/pathnames"
require "refinements/strings"
@@ -109,10 +113,11 @@
Much like including/extending a module, you'll need modify your object(s) to use the refinement(s):
class Example
using Refinements::Arrays
+ using Refinements::DateTimes
using Refinements::BigDecimals
using Refinements::Files
using Refinements::Hashes
using Refinements::Pathnames
using Refinements::Strings
@@ -129,9 +134,13 @@
example # => ["An", nil, "", "Example"]
example = ["An", nil, "", "Example"]
example.compress! # => ["An", "Example"]
example # => ["An", "Example"]
+
+#### DateTime
+
+ DateTime.utc # => #<DateTime: 2019-12-31T18:17:00+00:00 ((2458849j,65820s,181867000n),+0s,2299161j)>
#### Big Decimal
BigDecimal.new("5.0E-10").inspect # => "#<BigDecimal:3fd3d458fe84 0.0000000005>"