kobot 1.3.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08261437cd35a8b09dfad79740f2f6ec52e87fea47713aba5e00133aa570ac08'
4
- data.tar.gz: a7941208f88d46d40fb8d5366851f5b466bb85e975b3d5ff95e7753bf9f8032c
3
+ metadata.gz: 0e2452d15afce1b0ec273b240ab062cc526adedcf7f11ecaf98e7cbe3590d393
4
+ data.tar.gz: 16f3f7fefbf4f30c621148841ba93aa57b8859cc5adb092edad02b3e6970e95c
5
5
  SHA512:
6
- metadata.gz: f14ebacda3eaec90ae6f6e9f995821d3116599e2fdff2e19afcd546c43404f6453055d256828f4f549e07d5f3e08ac0ba4cbc1c6ee0e4b3739a02277b0285258
7
- data.tar.gz: d42d8f45187cc512eb08b13d5c891cd7b0bf567a76bf55b49ffc089c240946f0345208b7586fecbd2a32c8e3f3855f22086913bed5c79152e3248e5db0692d75
6
+ metadata.gz: 4ec4604ff3d7486b48bc574f3130f2856787d6cb46644ba11cf1832569590dfe5a6159518a8474390a28500f77cd506da58531981df855db8e0d220627bb6486
7
+ data.tar.gz: 6f57f5fdf3e1f5186ca8ae60b6a482d555ca5a6e23004fec8f5bef324942001f7008fddfc96e93151c8ad88a9d17a99440bfef912540c2715a622433ea67b1a1
data/CHANGELOG.md CHANGED
@@ -33,3 +33,7 @@
33
33
  - Added config option (-a, --auto-skip-without) to enable automatic skipping based on schedule
34
34
  - Replaced deprecated options with capabilities option in Selenium driver initialization
35
35
  - Refactored scattered attr_accessors and reduced instance variables count reported by Rubocop
36
+
37
+ ### v2.0.0
38
+ - Added -a, --auto-skip flag to support the enabling and disabling of auto-skipping feature
39
+ - Renamed the schedule config option from -a, --auto-skip-without to -w, --auto-skip-without
data/README.md CHANGED
@@ -62,9 +62,10 @@ Usage: kobot [options]
62
62
  -s, --skip [D1,D2,D3] Specify dates to skip clock in/out with date format YYYY-MM-DD and
63
63
  multiple values separated by comma, such as: 2020-05-01,2020-12-31;
64
64
  weekends and public holidays in Japan will be skipped by default
65
- -a [SCHEDULE], Enable automatic skipping by reading schedule from the Time Card page;
66
- --auto-skip-without skip today if the provided text is not contained in the schedule column
67
- on the Time Card page; by default 裁量労働 is used
65
+ -a, --auto-skip Enable auto-skipping by reading schedule from the Time Card page
66
+ -w [SCHEDULE], Skip today if the provided text is not contained in the schedule
67
+ --auto-skip-without column on the Time Card page of KOT; by default 裁量労働 is used;
68
+ effective only if --auto-skip is passed to enable auto-skipping.
68
69
  -t, --to [TO] Email address to send notification to; by default it is sent to
69
70
  the same self email account used in SMTP config as the sender
70
71
  -n, --notify Enable email notification
data/lib/kobot/config.rb CHANGED
@@ -8,6 +8,7 @@ module Kobot
8
8
  attr_accessor :clock,
9
9
  :loglevel,
10
10
  :skip,
11
+ :auto_skip,
11
12
  :auto_skip_without,
12
13
  :dryrun,
13
14
  :force,
data/lib/kobot/engine.rb CHANGED
@@ -197,6 +197,8 @@ module Kobot
197
197
  )
198
198
  end
199
199
 
200
+ return unless Config.auto_skip
201
+
200
202
  if kot_non_work_schedule?
201
203
  raise KotRecordError, "Today=#{@today} is non-work schedule: #{@kot_data[:today_schedule]}" unless Config.force
202
204
 
data/lib/kobot/mailer.rb CHANGED
@@ -47,7 +47,7 @@ module Kobot
47
47
  To: <#{to}>
48
48
  MIME-Version: 1.0
49
49
  Content-type: text/html
50
- Subject: #{subject}
50
+ Subject: #{subject}
51
51
  Date: #{Time.now.getlocal(Config.kot_timezone_offset)}
52
52
 
53
53
  #{body}
data/lib/kobot/option.rb CHANGED
@@ -27,10 +27,14 @@ module Kobot
27
27
  options[:skip] = skip
28
28
  end
29
29
 
30
- opt.on('-a', '--auto-skip-without [SCHEDULE]',
31
- 'Enable automatic skipping by reading schedule from the Time Card page;',
32
- 'skip today if the provided text is not contained in the schedule column',
33
- 'on the Time Card page; by default 裁量労働 is used') do |schedule|
30
+ opt.on('-a', '--auto-skip', 'Enable auto-skipping by reading schedule from the Time Card page') do |auto_skip|
31
+ options[:auto_skip] = auto_skip
32
+ end
33
+
34
+ opt.on('-w', '--auto-skip-without [SCHEDULE]',
35
+ 'Skip today if the provided text is not contained in the schedule',
36
+ 'column on the Time Card page of KOT; by default 裁量労働 is used;',
37
+ 'effective only if --auto-skip is passed to enable auto-skipping.') do |schedule|
34
38
  options[:auto_skip_without] = schedule
35
39
  end
36
40
 
data/lib/kobot/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kobot
4
- VERSION = '1.3.0'
4
+ VERSION = '2.0.0'
5
5
  end
data/lib/kobot.rb CHANGED
@@ -34,6 +34,7 @@ module Kobot
34
34
  config.dryrun = options[:dryrun]
35
35
  config.force = options[:force]
36
36
  config.skip = options[:skip] || []
37
+ config.auto_skip = options[:auto_skip]
37
38
  config.auto_skip_without = options[:auto_skip_without] || '裁量労働'
38
39
 
39
40
  config.kot_url = 'https://s2.kingtime.jp/independent/recorder/personal/'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kobot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jiang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-08 00:00:00.000000000 Z
11
+ date: 2021-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webdrivers