as-duration 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/as-duration.gemspec +19 -0
- data/lib/as/duration.rb +6 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19b4b28b075bf91a625f2e5d690347a6153ab9e8
|
4
|
+
data.tar.gz: 1f77a60a4b59d7ef4400cbaaa77a99e1c936fb8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9657883fc583a900210ef41a56fd41171b092aa2da3d5cba2f5320df95c04b9ca0ba0ef8e49310c5f8b89602b79d52e936170f4ded9cd3ac2138ce98baded93e
|
7
|
+
data.tar.gz: 4e10496d1c77b883a483547f19c24f8ae1eadd4fa43ec0b9adec1caf52612e1edd32dd179cc64be0d61535bc7d3196628f237bb9ee9ca6c27a903a61bc629cb3
|
data/as-duration.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Gem::Specification.new do |spec|
|
2
|
+
spec.name = "as-duration"
|
3
|
+
spec.version = "0.1.1"
|
4
|
+
spec.authors = ["Janko Marohnić"]
|
5
|
+
spec.email = ["janko.marohnic@gmail.com"]
|
6
|
+
|
7
|
+
spec.required_ruby_version = ">= 2.0.0"
|
8
|
+
|
9
|
+
spec.summary = "Extraction of ActiveSupport::Duration and the related core extensions."
|
10
|
+
spec.description = spec.summary
|
11
|
+
spec.homepage = "https://github.com/janko-m/as-duration"
|
12
|
+
spec.license = "MIT"
|
13
|
+
|
14
|
+
spec.files = Dir["README.md", "LICENSE.txt", "lib/**/*", "*.gemspec"]
|
15
|
+
spec.require_path = "lib"
|
16
|
+
|
17
|
+
spec.add_development_dependency "minitest", "5.6.0"
|
18
|
+
spec.add_development_dependency "rake"
|
19
|
+
end
|
data/lib/as/duration.rb
CHANGED
@@ -14,6 +14,12 @@ module AS
|
|
14
14
|
def to_i
|
15
15
|
@value
|
16
16
|
end
|
17
|
+
|
18
|
+
# reference: Rails-->activesupport/lib/active_support/duration.rb
|
19
|
+
# Add this method FOR something like 5.minutes.to_f, which is used in ActiveSupport::Cache::Entry#initialize.
|
20
|
+
def to_f
|
21
|
+
@value.to_f
|
22
|
+
end
|
17
23
|
|
18
24
|
def <=>(other)
|
19
25
|
return nil if not Duration === other
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: as-duration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -47,6 +47,7 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- LICENSE.txt
|
49
49
|
- README.md
|
50
|
+
- as-duration.gemspec
|
50
51
|
- lib/as-duration.rb
|
51
52
|
- lib/as/duration.rb
|
52
53
|
- lib/as/duration/core_ext.rb
|
@@ -75,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
76
|
version: '0'
|
76
77
|
requirements: []
|
77
78
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
79
|
+
rubygems_version: 2.5.1
|
79
80
|
signing_key:
|
80
81
|
specification_version: 4
|
81
82
|
summary: Extraction of ActiveSupport::Duration and the related core extensions.
|