monkey-patch 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/monkey-patch.rb +1 -0
- data/lib/monkey-patch/time.rb +48 -0
- metadata +21 -3
data/lib/monkey-patch.rb
CHANGED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Copyright (c) 2013, Christopher Mark Gore,
|
2
|
+
# Soli Deo Gloria,
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# 8729 Lower Marine Road, Saint Jacob, Illinois 62281 USA.
|
6
|
+
# Web: http://cgore.com
|
7
|
+
# Email: cgore@cgore.com
|
8
|
+
#
|
9
|
+
# Redistribution and use in source and binary forms, with or without
|
10
|
+
# modification, are permitted provided that the following conditions are met:
|
11
|
+
#
|
12
|
+
# * Redistributions of source code must retain the above copyright
|
13
|
+
# notice, this list of conditions and the following disclaimer.
|
14
|
+
#
|
15
|
+
# * Redistributions in binary form must reproduce the above copyright
|
16
|
+
# notice, this list of conditions and the following disclaimer in the
|
17
|
+
# documentation and/or other materials provided with the distribution.
|
18
|
+
#
|
19
|
+
# * Neither the name of Christopher Mark Gore nor the names of other
|
20
|
+
# contributors may be used to endorse or promote products derived from
|
21
|
+
# this software without specific prior written permission.
|
22
|
+
#
|
23
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
26
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
27
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
28
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
29
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
30
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
31
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
32
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
33
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
|
35
|
+
require 'active_support/core_ext'
|
36
|
+
|
37
|
+
class Time
|
38
|
+
class << self
|
39
|
+
%w(commercial england gregorian italy jd jisx0301 julian ld mjd ordinal today)
|
40
|
+
.each do |method|
|
41
|
+
class_eval %{
|
42
|
+
def #{method}(*rest)
|
43
|
+
Date.#{method}(*rest).to_time
|
44
|
+
end
|
45
|
+
}
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monkey-patch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
13
|
-
dependencies:
|
12
|
+
date: 2013-04-14 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activesupport
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
14
30
|
description: A simple library with common monkey patches for the standard Ruby classes.
|
15
31
|
email: cgore@cgore.com
|
16
32
|
executables: []
|
@@ -19,6 +35,7 @@ extra_rdoc_files: []
|
|
19
35
|
files:
|
20
36
|
- lib/monkey-patch.rb
|
21
37
|
- lib/monkey-patch/string.rb
|
38
|
+
- lib/monkey-patch/time.rb
|
22
39
|
homepage: https://github.com/cgore/ruby-monkey-patch
|
23
40
|
licenses: []
|
24
41
|
post_install_message:
|
@@ -44,3 +61,4 @@ signing_key:
|
|
44
61
|
specification_version: 3
|
45
62
|
summary: A simple library with common monkey patches for the standard Ruby classes.
|
46
63
|
test_files: []
|
64
|
+
has_rdoc:
|