month 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -2
- data/lib/month/yaml.rb +23 -0
- data/month.gemspec +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc374de89e555a551ec3e4f67ca198a4fd0103d9bc256068b892f2405a049a6a
|
4
|
+
data.tar.gz: 8cc382ea4e97c8bbd0f234fcdb8808db495ad4ed487fbe8acb1ce7585c03d4d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11816342dee7af3574b80824283675823d703232fe39d3170e3f3ad424073584a0f4a95bae6b2ee1218b164a9d845245c2f8fe2ab63043554d2093c00abc7279
|
7
|
+
data.tar.gz: 0327fe3d9a9df8ea2957b13e28e1670585241187510a6f047883c2d0e02caea0cbb7ecb05b19f118f333ae46fd3b55d4774e654f72c785fe6cf5493142108fd1
|
data/README.md
CHANGED
@@ -4,10 +4,16 @@
|
|
4
4
|
![Build Status](https://github.com/readysteady/month/workflows/Test/badge.svg)
|
5
5
|
|
6
6
|
|
7
|
-
|
7
|
+
Ruby gem for working with months.
|
8
8
|
|
9
9
|
|
10
|
-
##
|
10
|
+
## Install
|
11
|
+
|
12
|
+
Using Bundler:
|
13
|
+
|
14
|
+
$ bundle add month
|
15
|
+
|
16
|
+
Using RubyGems:
|
11
17
|
|
12
18
|
$ gem install month
|
13
19
|
|
data/lib/month/yaml.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
class Month
|
4
|
+
def encode_with(coder)
|
5
|
+
coder.represent_scalar(nil, to_s)
|
6
|
+
end
|
7
|
+
|
8
|
+
module ScalarScannerPatch
|
9
|
+
REGEXP = /\A(\d{4})-(\d{2})\z/
|
10
|
+
|
11
|
+
def tokenize(string)
|
12
|
+
if !string.empty? && string.match(REGEXP)
|
13
|
+
return Month.new($1.to_i, $2.to_i)
|
14
|
+
end
|
15
|
+
|
16
|
+
super string
|
17
|
+
end
|
18
|
+
|
19
|
+
YAML::ScalarScanner.prepend(self)
|
20
|
+
end
|
21
|
+
|
22
|
+
private_constant :ScalarScannerPatch
|
23
|
+
end
|
data/month.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'month'
|
3
|
-
s.version = '1.
|
3
|
+
s.version = '1.7.0'
|
4
4
|
s.license = 'MIT'
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.authors = ['Tim Craft']
|
7
7
|
s.email = ['mail@timcraft.com']
|
8
8
|
s.homepage = 'https://github.com/readysteady/month'
|
9
|
-
s.description = '
|
9
|
+
s.description = 'Ruby gem for working with months'
|
10
10
|
s.summary = 'See description'
|
11
11
|
s.files = Dir.glob('lib/**/*.rb') + %w(LICENSE.txt README.md month.gemspec)
|
12
12
|
s.required_ruby_version = '>= 1.9.3'
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: month
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Craft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: Ruby gem for working with months
|
14
14
|
email:
|
15
15
|
- mail@timcraft.com
|
16
16
|
executables: []
|
@@ -20,6 +20,7 @@ files:
|
|
20
20
|
- LICENSE.txt
|
21
21
|
- README.md
|
22
22
|
- lib/month.rb
|
23
|
+
- lib/month/yaml.rb
|
23
24
|
- month.gemspec
|
24
25
|
homepage: https://github.com/readysteady/month
|
25
26
|
licenses:
|