roko 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 013c4ee53e530601ab0aabdc0c6ca3157a77f10aa89245a0afef5c30b4fff1f5
4
- data.tar.gz: 61b7d06cf58ed0ce1227ab05d5cbff77ebaf0250a5820ed7455eff1d2c1be493
3
+ metadata.gz: 04d8f3c95dda5013fdc6b63e42dd847024fb6d997d9bfca395411c07bb84e29f
4
+ data.tar.gz: fcd3cc89e896de281dc7cbe21d858a02080dfbd18dd9e453966752050c06161b
5
5
  SHA512:
6
- metadata.gz: 11b457465df19d24dff56bf330ecc9e8a5867cde98463d34104951cb57a4657252a05ce64eb24c1ba72b5a3bb5d119f221317054a7879c74373b8f857d51ce15
7
- data.tar.gz: 825349fe22dfe6c38d94d1fed12cc2f141f0fbcfbab067928f84bcfc6f75705849640d8afba562e0a63d7024dc6db04a4adc6167d4adbc75cc5a87f4986a9d50
6
+ metadata.gz: 967a142c23b272343b344dd50062f713a315a20775c31aeaa5d70bcb6071727db4d0bd5c3da575405ce7d3b8f10124540b5c54d819a3fe731c045a64deac8111
7
+ data.tar.gz: 6931555e6f01a9354026f9dc640adec65061c4a0c7d31ab85c79ec839fb58c9d6eec4276aa09014bc61ef5fd240ede5ae6f0e982ca438ea4acc1c0235f449e99
@@ -30,8 +30,30 @@ module Roko
30
30
  end
31
31
 
32
32
  def oneline
33
+ format(oneline_template, time_hash.merge(content_hash))
34
+ end
35
+
36
+ private
37
+
38
+ def time_hash
39
+ time = @created_at.getlocal
40
+ {
41
+ Y: time.year,
42
+ m: time.strftime('%m'),
43
+ d: time.strftime('%d'),
44
+ H: time.strftime('%H'),
45
+ M: time.strftime('%M')
46
+ }
47
+ end
48
+
49
+ def content_hash
33
50
  oneline_summary = @summary.gsub("\n", ' ')
34
- format(oneline_template, Y: @created_at.year, m: @created_at.strftime('%m'), d: @created_at.strftime('%d'), H: @created_at.hour, M: @created_at.min, event_type: @event_type, summary: oneline_summary, url: @url, detail: @detail)
51
+ {
52
+ event_type: @event_type,
53
+ summary: oneline_summary,
54
+ url: @url,
55
+ detail: @detail
56
+ }
35
57
  end
36
58
  end
37
59
  end
@@ -12,7 +12,10 @@ module Roko
12
12
  class ReportEvents < Roko::Source::Base::ReportEvents
13
13
  def client
14
14
  Octokit.configure do |c|
15
- c.netrc_file = ENV['NETRC_FILE_PATH'] || '~/.netrc'
15
+ c.netrc_file = ENV.fetch(
16
+ 'NETRC_FILE_PATH',
17
+ File.expand_path('~/.netrc')
18
+ )
16
19
  c.auto_paginate = true
17
20
  end
18
21
  Octokit::Client.new(netrc: true)
@@ -1,3 +1,3 @@
1
1
  module Roko
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - miyado
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-15 00:00:00.000000000 Z
11
+ date: 2020-03-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: generate daily activity report such as github, slack, jira, confluence
14
14
  email: