jekyll-recker 1.2.2 → 1.7.0
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/README.md +105 -0
- data/_includes/figure.html +14 -0
- data/_includes/footer.html +10 -1
- data/_includes/head.html +21 -0
- data/_includes/nav.html +3 -6
- data/_includes/pager.html +13 -0
- data/_layouts/home.html +13 -9
- data/_layouts/page.html +13 -8
- data/_layouts/post.html +20 -28
- data/lib/jekyll-recker.rb +11 -13
- data/lib/jekyll_recker/commands.rb +31 -0
- data/lib/{jekyll-recker → jekyll_recker}/configuration.rb +6 -0
- data/lib/{jekyll-recker → jekyll_recker}/error.rb +0 -0
- data/lib/jekyll_recker/filters.rb +15 -0
- data/lib/{jekyll-recker/stats.rb → jekyll_recker/generators.rb} +42 -39
- data/lib/jekyll_recker/mixins.rb +45 -0
- data/lib/{jekyll-recker → jekyll_recker}/shell.rb +0 -0
- data/lib/jekyll_recker/social.rb +173 -0
- data/lib/{jekyll-recker → jekyll_recker}/tags.rb +1 -1
- data/lib/{jekyll-recker → jekyll_recker}/version.rb +1 -1
- data/lib/{jekyll-recker → jekyll_recker}/words.rb +0 -0
- metadata +87 -35
- data/README.org +0 -205
- data/_layouts/default.html +0 -14
- data/assets/jekyll-recker.scss +0 -111
- data/lib/jekyll-recker/commands.rb +0 -12
- data/lib/jekyll-recker/commands/share.rb +0 -25
- data/lib/jekyll-recker/commands/slack.rb +0 -30
- data/lib/jekyll-recker/commands/tweet.rb +0 -31
- data/lib/jekyll-recker/generators.rb +0 -17
- data/lib/jekyll-recker/logger.rb +0 -20
- data/lib/jekyll-recker/mixins.rb +0 -27
- data/lib/jekyll-recker/slack.rb +0 -70
- data/lib/jekyll-recker/twitter.rb +0 -83
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 853460ad6e8cc68998d94ec9b8370fcc8c91ac36e464c20bb503a430c0b61775
|
4
|
+
data.tar.gz: b41ff9a6f988de20e74265844092d6bda6a458f3720e9ac49c8276f07702c0e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e8981f6cfe48b770faca2e93836c4f85994237e981cb2b767d760cc23f9decfdc4f24f800daf1b759258efd9b9ff060444034cb3d91a4534a471f5ca19306e0
|
7
|
+
data.tar.gz: 3d9c4aaacc354e02570cf31c18761a02b529cd6b624a389e6e8effe50db599678850e1ec19ea32e0353e33905a97e72e1e40f9060b1324ce112357473e110a03
|
data/README.md
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
# jekyll-recker
|
2
|
+
|
3
|
+
The Greatest Jekyll Plugin in the World. For a live example, check
|
4
|
+
out [my personal website].
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add `jekyll-recker` to the `jekyll_plugins` group in your `Gemfile`.
|
9
|
+
|
10
|
+
group :jekyll_plugins do
|
11
|
+
gem 'jekyll-recker'
|
12
|
+
end
|
13
|
+
|
14
|
+
Then add the plugin to jekyll site's `config.yml` file.
|
15
|
+
|
16
|
+
pugins:
|
17
|
+
- jekyll-recker
|
18
|
+
|
19
|
+
If you'd like to make your site look like mine too, set the theme in
|
20
|
+
`config.yml` too.
|
21
|
+
|
22
|
+
theme: jekyll-recker
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
### Share
|
27
|
+
|
28
|
+
Use the `share` jekyll command to post a link to your latest published
|
29
|
+
blog post to any or all of the configured Shares.
|
30
|
+
|
31
|
+
# TODO: example of `be jekyll share`
|
32
|
+
|
33
|
+
Perform a test run with the `--dry` flag.
|
34
|
+
|
35
|
+
# TODO: example of `be jekyll share --dry`
|
36
|
+
|
37
|
+
Send to all configured shares, or just pick one of them.
|
38
|
+
|
39
|
+
$ jekyll share slack
|
40
|
+
$ jekyll share twitter
|
41
|
+
|
42
|
+
#### Slack
|
43
|
+
|
44
|
+
Send the latest published post to a slack channel.
|
45
|
+
|
46
|
+
![example slack]
|
47
|
+
|
48
|
+
Configure the slack share in `_config.yml`.
|
49
|
+
|
50
|
+
recker:
|
51
|
+
slack:
|
52
|
+
myteam:
|
53
|
+
channel: '#blogs'
|
54
|
+
username: 'blogbot'
|
55
|
+
emoji: ':robot:'
|
56
|
+
webhook_cmd: cat ~/.secrets/slack-webhook.txt
|
57
|
+
|
58
|
+
Use the `webhook_cmd` option to shell out to `gpg` or another CLI
|
59
|
+
password manager. Alternatively, you can supply the private incoming
|
60
|
+
webhook using an environment variable.
|
61
|
+
|
62
|
+
export SLACK_MYTEAM_WEBHOOK="https://.../" # SLACK_ + MyTeam.upcase + _WEBHOOK
|
63
|
+
|
64
|
+
Multiple teams are supported as well.
|
65
|
+
|
66
|
+
recker:
|
67
|
+
slack:
|
68
|
+
MyTeamA:
|
69
|
+
channel: '#blogs'
|
70
|
+
username: 'blogbot'
|
71
|
+
emoji: ':robot:'
|
72
|
+
MyTeamB:
|
73
|
+
channel: '#blogs'
|
74
|
+
username: 'blogbot'
|
75
|
+
emoji: ':robot:'
|
76
|
+
MyTeamC:
|
77
|
+
channel: '#blogs'
|
78
|
+
username: 'blogbot'
|
79
|
+
emoji: ':robot:'
|
80
|
+
|
81
|
+
#### Twitter
|
82
|
+
|
83
|
+
Send a tweet with a link to the latest published post.
|
84
|
+
|
85
|
+
![example tweet]
|
86
|
+
|
87
|
+
Configure the tweet share in `_config.yml`.
|
88
|
+
|
89
|
+
recker:
|
90
|
+
twitter:
|
91
|
+
access_token_secret_cmd: pass twitter/reckerbot/access-token-secret
|
92
|
+
access_token_cmd: pass twitter/reckerbot/access-token
|
93
|
+
consumer_api_key_cmd: pass twitter/reckerbot/consumer-api-key
|
94
|
+
consumer_api_secret_cmd: pass twitter/reckerbot/consumer-api-secret-key
|
95
|
+
|
96
|
+
Alternatively, ensure these environment variables are set.
|
97
|
+
|
98
|
+
export TWITTER_ACCESS_TOKEN_SECRET="..."
|
99
|
+
export TWITTER_ACCESS_TOKEN="..."
|
100
|
+
export TWITTER_CONSUMER_API_KEY="..."
|
101
|
+
export TWITTER_CONSUMER_API_SECRET="..."
|
102
|
+
|
103
|
+
[example slack]: screenshots/example-slack.png
|
104
|
+
[example tweet]: screenshots/example-tweet.png
|
105
|
+
[my personal website]: https://www.alexrecker.com
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<figure>
|
2
|
+
{%- if include.url %}
|
3
|
+
<a href="{{ include.url }}">
|
4
|
+
{%- endif %}
|
5
|
+
<img alt="{{ alt | default: include.filename }}" src="{{ site.baseurl }}assets/images/{{ include.filename }}"/>
|
6
|
+
{%- if include.url %}
|
7
|
+
</a>
|
8
|
+
{%- endif %}
|
9
|
+
{%- if include.caption %}
|
10
|
+
<figcaption>
|
11
|
+
<p>{{ include.caption }}</p>
|
12
|
+
</figcaption>
|
13
|
+
{%- endif %}
|
14
|
+
</figure>
|
data/_includes/footer.html
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
<footer>
|
2
|
-
|
2
|
+
<nav>
|
3
|
+
find me on:  
|
4
|
+
<a href="mailto:{{ site.email }}">email</a>
|
5
|
+
<a href="https://www.github.com/{{ site.github_username }}">github</a>
|
6
|
+
<a href="https://www.twitter.com/{{ site.twitter_username }}">twitter</a>
|
7
|
+
<a href="{{ site.basurl }}/assets/public.gpg.asc">gpg</a>
|
8
|
+
<a href="https://www.linkedin.com/in/{{ site.linkedin_username }}">linkedin</a>
|
9
|
+
<a href="https://www.facebook.com/{{ site.facebook_username }}">facebook</a>
|
10
|
+
</nav>
|
11
|
+
built with <a href="https://jekyllrb.com/">jekyll</a> using <a href="https://www.github.com/arecker/jekyll-recker/">jekyll-recker</a> v{% recker_version %}
|
3
12
|
<br/>
|
4
13
|
<small>© copyright {{ 'now' | date: '%Y' }}, {{ site.author }}</small>
|
5
14
|
</footer>
|
data/_includes/head.html
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
{%- capture title %}{{ include.title | default: page.title }}{%- endcapture %}
|
2
|
+
{%- capture description %}{{ include.description | default: site.description }}{%- endcapture %}
|
3
|
+
{%- capture image %}{{ include.image | default: page.image }}{%- endcapture %}
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8"/>
|
6
|
+
<title>{{ title }} | {{ description }}</title>
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
|
+
<meta name="twitter:card" content="summary" />
|
9
|
+
<meta name="twitter:site" content="@{{ site.twitter_username }}" />
|
10
|
+
<meta name="twitter:title" content="{{ include.title }}" />
|
11
|
+
<meta name="twitter:description" content="{{ include.description }}" />
|
12
|
+
<meta property="og:url" content="{{ site.url }}{{ page.url }}" />
|
13
|
+
<meta property="og:type" content="article" />
|
14
|
+
<meta property="og:title" content="{{ title }}"/>
|
15
|
+
<meta property="og:description" content="{{ description }}" />
|
16
|
+
{%- if image %}
|
17
|
+
<meta name="twitter:image" content="{{ site.url }}{{ site.base_url }}/assets/images/{{ image }}"/>
|
18
|
+
<meta property="og:image" content="{{ site.url }}{{ site.base_url }}/assets/images/{{ image }}"/>
|
19
|
+
{%- endif %}
|
20
|
+
<link href="{{ site.baseurl }}/assets/jekyll-recker.css" rel="stylesheet"/>
|
21
|
+
</head>
|
data/_includes/nav.html
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
<nav>
|
2
|
-
<a href="{{ site.baseurl }}/" class="{% if page.active == 'index' %}active{% endif %}">index</a>
|
3
|
-
<a href="{
|
4
|
-
<a href="{% link stats.org %}" class="{% if page.active == 'stats' %}active{% endif %}">stats</a>
|
5
|
-
<a href="{% link projects.html %}" class="{% if page.active == 'projects' %}active{% endif %}">projects</a>
|
6
|
-
<a href="{% link contact.html %}" class="{% if page.active == 'contact' %}active{% endif %}">contact</a>
|
2
|
+
<a href="{{ site.baseurl }}/" class="{% if page.active == 'index' %}active{% endif %}">index.html</a>
|
3
|
+
<a href="{{ site.basurl }}/feed.xml">feed.xml</a>
|
7
4
|
<span class="float-right hide-on-mobile">{{ page.slug }}</span>
|
8
|
-
</nav>
|
5
|
+
</nav>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<nav class="clearfix">
|
2
|
+
{%- if page.next -%}
|
3
|
+
<a href="{{ page.next.url }}">
|
4
|
+
⟵ {{ page.next.slug }}
|
5
|
+
</a>
|
6
|
+
{%- endif -%}
|
7
|
+
{%- if page.previous -%}
|
8
|
+
<a class="float-right" href="{{ page.previous.url }}">
|
9
|
+
{{ page.previous.slug }} ⟶
|
10
|
+
</a>
|
11
|
+
{%- endif -%}
|
12
|
+
</nav>
|
13
|
+
|
data/_layouts/home.html
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
{% include head.html title=site.title %}
|
4
|
+
<body>
|
5
|
+
{% include header.html title=site.title subtitle=site.description %}
|
6
|
+
<hr/>
|
7
|
+
{% include nav.html %}
|
8
|
+
<hr/>
|
9
|
+
{{ content }}
|
10
|
+
<hr/>
|
11
|
+
{% include footer.html %}
|
12
|
+
</body>
|
13
|
+
</html>
|
data/_layouts/page.html
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
{% include head.html title=site.title %}
|
4
|
+
<body>
|
5
|
+
{% include header.html title=page.title subtitle=page.description %}
|
6
|
+
<hr/>
|
7
|
+
{% include nav.html %}
|
8
|
+
<hr/>
|
9
|
+
{{ content }}
|
10
|
+
<hr/>
|
11
|
+
{% include footer.html %}
|
12
|
+
</body>
|
13
|
+
</html>
|
data/_layouts/post.html
CHANGED
@@ -1,28 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
{%
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
{
|
16
|
-
{
|
17
|
-
<
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
</a>
|
22
|
-
{%- endif -%}
|
23
|
-
{%- if page.previous -%}
|
24
|
-
<a class="float-right" href="{{ page.previous.url }}">
|
25
|
-
{{ page.previous.slug }} ⟶
|
26
|
-
</a>
|
27
|
-
</nav>
|
28
|
-
{%- endif -%}
|
1
|
+
{%- capture datestring %}{{ page.date | uyd_date }}{% endcapture %}
|
2
|
+
<!doctype html>
|
3
|
+
<html lang="en">
|
4
|
+
{% include head.html title=datestring description=page.title %}
|
5
|
+
<body>
|
6
|
+
{% include header.html title=datestring subtitle=page.title %}
|
7
|
+
<hr/>
|
8
|
+
{% include nav.html %}
|
9
|
+
<hr/>
|
10
|
+
{%- if page.image -%}
|
11
|
+
<br/>
|
12
|
+
{% include figure.html filename=page.image %}
|
13
|
+
<br/>
|
14
|
+
{%- endif -%}
|
15
|
+
{{ content }}
|
16
|
+
{% include pager.html %}
|
17
|
+
<hr/>
|
18
|
+
{% include footer.html %}
|
19
|
+
</body>
|
20
|
+
</html>
|
data/lib/jekyll-recker.rb
CHANGED
@@ -5,19 +5,17 @@ require 'jekyll'
|
|
5
5
|
module Jekyll
|
6
6
|
# Recker
|
7
7
|
module Recker
|
8
|
-
require '
|
9
|
-
require 'jekyll-recker/mixins.rb'
|
8
|
+
require 'jekyll_recker/mixins.rb'
|
10
9
|
|
11
|
-
require '
|
12
|
-
require '
|
13
|
-
require '
|
14
|
-
require '
|
15
|
-
require '
|
16
|
-
require '
|
17
|
-
require '
|
18
|
-
require '
|
19
|
-
require '
|
20
|
-
require '
|
21
|
-
require 'jekyll-recker/words.rb'
|
10
|
+
require 'jekyll_recker/commands.rb'
|
11
|
+
require 'jekyll_recker/configuration.rb'
|
12
|
+
require 'jekyll_recker/error.rb'
|
13
|
+
require 'jekyll_recker/filters.rb'
|
14
|
+
require 'jekyll_recker/generators.rb'
|
15
|
+
require 'jekyll_recker/shell.rb'
|
16
|
+
require 'jekyll_recker/social.rb'
|
17
|
+
require 'jekyll_recker/tags.rb'
|
18
|
+
require 'jekyll_recker/version.rb'
|
19
|
+
require 'jekyll_recker/words.rb'
|
22
20
|
end
|
23
21
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Jekyll
|
4
|
+
module Recker
|
5
|
+
# Commands
|
6
|
+
module Commands
|
7
|
+
# Share
|
8
|
+
class Share < Jekyll::Command
|
9
|
+
include Mixins::Logging
|
10
|
+
|
11
|
+
def self.init_with_program(prog)
|
12
|
+
prog.command(:share) do |c|
|
13
|
+
c.syntax 'share'
|
14
|
+
c.description 'Share latest post with each configured backend'
|
15
|
+
c.option 'dry', '-d', '--dry', 'perform dry run'
|
16
|
+
c.action { |args, opts| action(args, opts) }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.action(args, options)
|
21
|
+
args += %w[slack twitter] if args.empty?
|
22
|
+
Recker::Social::Slack.share(dry: options['dry']) if args.include?('slack')
|
23
|
+
Recker::Social::Twitter.share(dry: options['dry']) if args.include?('twitter')
|
24
|
+
rescue ReckerError => e
|
25
|
+
logger.error e.message
|
26
|
+
exit 1
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Jekyll
|
2
4
|
module Recker
|
3
5
|
# Configuration
|
@@ -10,6 +12,10 @@ module Jekyll
|
|
10
12
|
jekyll.fetch('recker', {})
|
11
13
|
end
|
12
14
|
|
15
|
+
def self.facebook
|
16
|
+
recker.fetch('facebook', {})
|
17
|
+
end
|
18
|
+
|
13
19
|
def self.twitter
|
14
20
|
recker.fetch('twitter', {})
|
15
21
|
end
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Jekyll
|
4
|
+
module Recker
|
5
|
+
# Filters
|
6
|
+
module Filters
|
7
|
+
# Converts a date object to standard Uhh Yeah Dude format.
|
8
|
+
def uyd_date(date)
|
9
|
+
date.strftime('%A, %B %d %Y')
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Liquid::Template.register_filter(Jekyll::Recker::Filters)
|
@@ -1,41 +1,44 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'date'
|
4
|
-
|
5
3
|
module Jekyll
|
6
4
|
module Recker
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
cruncher = cruncher_class.new(site)
|
15
|
-
logger.info "crunching stats.#{cruncher.stats_key}"
|
16
|
-
stats[cruncher.stats_key] = cruncher.crunch
|
17
|
-
end
|
18
|
-
stats
|
19
|
-
end
|
20
|
-
|
21
|
-
# Base Cruncher
|
22
|
-
class BaseCruncher
|
5
|
+
module Generators
|
6
|
+
# Stats Module
|
7
|
+
#
|
8
|
+
# Functions for stats generators.
|
9
|
+
# @abstract
|
10
|
+
module Stats
|
11
|
+
include Mixins::Logging
|
23
12
|
include Jekyll::Filters
|
24
|
-
include DescendantsMixin
|
25
13
|
|
26
|
-
def
|
27
|
-
|
14
|
+
def key
|
15
|
+
self.class.const_get(:KEY)
|
28
16
|
end
|
29
17
|
|
30
|
-
|
18
|
+
def generate(site)
|
19
|
+
@site = site
|
20
|
+
logger.info "crunching stats.#{key}"
|
21
|
+
@site.data['stats'] ||= {}
|
22
|
+
@site.data['stats'][key] = crunch
|
23
|
+
end
|
31
24
|
|
32
|
-
|
25
|
+
def crunch
|
26
|
+
raise NotImplementedError, '#crunch not implemented!'
|
27
|
+
end
|
33
28
|
|
29
|
+
# Calculates the average of a list of numbers.
|
30
|
+
#
|
31
|
+
# @param [Array<Numeric>] numlist list of numbers to be averaged.
|
32
|
+
# @return [Numeric] rounded, calculated average of numlist.
|
34
33
|
def average(numlist)
|
35
34
|
calc = numlist.inject { |sum, el| sum + el }.to_f / numlist.size
|
36
35
|
calc.round
|
37
36
|
end
|
38
37
|
|
38
|
+
# Calculates the total of a list of numbers.
|
39
|
+
#
|
40
|
+
# @param [Array<Numeric>] numlist list of numbers to be totaled.
|
41
|
+
# @return [Numeric] calculated total of numlist.
|
39
42
|
def total(numlist)
|
40
43
|
numlist.inject(0) { |sum, x| sum + x }
|
41
44
|
end
|
@@ -45,22 +48,22 @@ module Jekyll
|
|
45
48
|
end
|
46
49
|
end
|
47
50
|
|
48
|
-
#
|
49
|
-
class
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
# Post Count Generator
|
52
|
+
class PostCount < Jekyll::Generator
|
53
|
+
include Stats
|
54
|
+
|
55
|
+
KEY = 'posts'
|
53
56
|
|
54
57
|
def crunch
|
55
58
|
entries.count.pretty
|
56
59
|
end
|
57
60
|
end
|
58
61
|
|
59
|
-
#
|
60
|
-
class
|
61
|
-
|
62
|
-
|
63
|
-
|
62
|
+
# Word Count Generator
|
63
|
+
class Words < Jekyll::Generator
|
64
|
+
include Stats
|
65
|
+
|
66
|
+
KEY = 'words'
|
64
67
|
|
65
68
|
def crunch
|
66
69
|
total_counts = entries.collect(&:content).map { |c| number_of_words(c) }
|
@@ -71,11 +74,11 @@ module Jekyll
|
|
71
74
|
end
|
72
75
|
end
|
73
76
|
|
74
|
-
# Streak
|
75
|
-
class
|
76
|
-
|
77
|
-
|
78
|
-
|
77
|
+
# Streak Count Generator
|
78
|
+
class Streaks < Jekyll::Generator
|
79
|
+
include Stats
|
80
|
+
|
81
|
+
KEY = 'days'
|
79
82
|
|
80
83
|
def crunch
|
81
84
|
streaks.take(1).map do |count, dates|
|
@@ -94,7 +97,7 @@ module Jekyll
|
|
94
97
|
entry_dates.slice_when do |prev, curr|
|
95
98
|
curr != prev - 1
|
96
99
|
end.each do |dates|
|
97
|
-
first, last = dates.
|
100
|
+
first, last = dates.minmax
|
98
101
|
_streaks << [(last - first).to_i, [first, last]]
|
99
102
|
end
|
100
103
|
_streaks
|