in_utc_extension 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9dc2893f1f4ddf8c3b7273d4abe0604e45475aa5fc00e47bd68208248115428d
4
+ data.tar.gz: 27f69ef1fdcdb7fcea445cbcd255c2227178d315417cf5b4f88745c947febd61
5
+ SHA512:
6
+ metadata.gz: b70085408039369ce6a685485af05491c00ed2d6bbea314cb27269e9614e33fccc23d8bf119b65a2723363a24ea8c8f46b3e3f8aef45c76f89ca519b2e6dc738
7
+ data.tar.gz: 428a2ee7840a05adccf0aded2600eeb502120d344a4d8aa32f515f127ff578bd8fbcb5b16e05ed99b4d25f2bce77fac8615fb93fd3dbe34744e80023f988e1ff
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ Unreleased Changes
2
+ ------------------
3
+
4
+ 0.0.1 (2022-03-28)
5
+ ------------------
6
+
7
+ * Inital release
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Marcus Wyatt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/core_ext/date_and_time/zones'
4
+ class DateTime
5
+ # @return [DateTime]
6
+ def in_utc
7
+ utc? ? self : in_time_zone('UTC').to_datetime
8
+ end
9
+ end
10
+
11
+
12
+ require 'active_support/time_with_zone'
13
+ class Time
14
+ # @return [Time]
15
+ def in_utc
16
+ utc? ? self : in_time_zone('UTC')
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: in_utc_extension
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Marcus Wyatt
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-03-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 6.0.3.6
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 6.0.3.6
27
+ description:
28
+ email:
29
+ - mwyatt@brandsinsurance.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - CHANGELOG.md
35
+ - LICENSE.txt
36
+ - VERSION
37
+ - lib/in_utc_extension.rb
38
+ homepage: https://github.com/mlwyatt/rails-extensions
39
+ licenses:
40
+ - MIT
41
+ metadata:
42
+ source_code_uri: https://github.com/mlwyatt/rails-extensions
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: 3.0.1
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubygems_version: 3.2.15
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: Adds `in_utc` method to `DateTime` and `Time`
62
+ test_files: []