mirror of
https://github.com/jimeh/time_ext.git
synced 2026-02-19 13:26:39 +00:00
updated readme
This commit is contained in:
35
README.md
35
README.md
@@ -1,6 +1,32 @@
|
|||||||
# time_ext
|
# Ruby Time Extensions
|
||||||
|
|
||||||
|
This gem extends the abilities of Ruby's built-in Time class by building on top of what [ActiveSupport][as] already adds. Hence I must also warn that using this gem will load all of ActiveSupport at this time.
|
||||||
|
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
gem install time_ext
|
||||||
|
|
||||||
|
|
||||||
|
## Basic Usage
|
||||||
|
|
||||||
|
require "time/ext"
|
||||||
|
Time.now.round(:week)
|
||||||
|
#=> Beginning of this week, or next week depending on which date is closest
|
||||||
|
|
||||||
|
|
||||||
|
## Notable Methods
|
||||||
|
|
||||||
|
The `round`, `floor`, and `ceil` methods were the main reason I created this gem. Each of them takes a unit argument, which can be one of the following: `:sec`, `:min`, `:hour`, `:day`, `:week`, `:month`, `:quarter`, and `:year`.
|
||||||
|
|
||||||
|
For more, please refer to the source code or the spec tests for now.
|
||||||
|
|
||||||
|
|
||||||
|
## To-Do
|
||||||
|
|
||||||
|
* Improve ReadMe file.
|
||||||
|
* Improve documentation.
|
||||||
|
|
||||||
Description goes here.
|
|
||||||
|
|
||||||
## Note on Patches/Pull Requests
|
## Note on Patches/Pull Requests
|
||||||
|
|
||||||
@@ -12,6 +38,7 @@ Description goes here.
|
|||||||
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
||||||
* Send me a pull request. Bonus points for topic branches.
|
* Send me a pull request. Bonus points for topic branches.
|
||||||
|
|
||||||
|
|
||||||
## Copyright
|
## Copyright
|
||||||
|
|
||||||
(The MIT License)
|
(The MIT License)
|
||||||
@@ -36,3 +63,7 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[as]: http://as.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Time/Calculations.html
|
||||||
Reference in New Issue
Block a user