attend 0.2.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +2 -2
- data/Gemfile.lock +19 -19
- data/README.md +1 -1
- data/attend.gemspec +2 -2
- data/exe/attend +9 -0
- data/lib/attend.rb +8 -6
- data/lib/attend/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8c87d15b717a5967b362d8adb2134b53ff3f4ca0a35fc99a72d170e5832971a
|
4
|
+
data.tar.gz: d44d47deeb7833218c5846790cb24f24c78bd76d85ca2c8b39e8aa5cce007081
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: def3186735e775c79efec903c214e1fd599ac5da476afd44461f451b33085746a72cf0af75cf380116c93570c6ac65972c7f9f720c1c4dedf3de177a5f2da083
|
7
|
+
data.tar.gz: b8a7606f8080fa777839352078d252ad1727bf046d404bebaa064466dd9e78b8f365b27406f00d196e4436c54276be793f01f10a6d999a2f4ae401569c932949
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.0
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
attend (0.
|
4
|
+
attend (1.0.0)
|
5
5
|
clamp (~> 1.3)
|
6
6
|
http (~> 4.4)
|
7
7
|
|
@@ -10,12 +10,12 @@ GEM
|
|
10
10
|
specs:
|
11
11
|
addressable (2.7.0)
|
12
12
|
public_suffix (>= 2.0.2, < 5.0)
|
13
|
-
ast (2.4.
|
13
|
+
ast (2.4.2)
|
14
14
|
clamp (1.3.2)
|
15
15
|
diff-lcs (1.4.4)
|
16
16
|
domain_name (0.5.20190701)
|
17
17
|
unf (>= 0.0.5, < 1.0.0)
|
18
|
-
ffi (1.
|
18
|
+
ffi (1.15.0)
|
19
19
|
ffi-compiler (1.0.1)
|
20
20
|
ffi (>= 1.0.0)
|
21
21
|
rake
|
@@ -27,15 +27,15 @@ GEM
|
|
27
27
|
http-cookie (1.0.3)
|
28
28
|
domain_name (~> 0.5)
|
29
29
|
http-form_data (2.3.0)
|
30
|
-
http-parser (1.2.
|
30
|
+
http-parser (1.2.3)
|
31
31
|
ffi-compiler (>= 1.0, < 2.0)
|
32
|
-
parallel (1.
|
33
|
-
parser (
|
32
|
+
parallel (1.20.1)
|
33
|
+
parser (3.0.0.0)
|
34
34
|
ast (~> 2.4.1)
|
35
35
|
public_suffix (4.0.6)
|
36
36
|
rainbow (3.0.0)
|
37
|
-
rake (13.0.
|
38
|
-
regexp_parser (1.
|
37
|
+
rake (13.0.3)
|
38
|
+
regexp_parser (2.1.1)
|
39
39
|
rexml (3.2.4)
|
40
40
|
rspec (3.9.0)
|
41
41
|
rspec-core (~> 3.9.0)
|
@@ -50,22 +50,22 @@ GEM
|
|
50
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
51
|
rspec-support (~> 3.9.0)
|
52
52
|
rspec-support (3.9.3)
|
53
|
-
rubocop (
|
53
|
+
rubocop (1.11.0)
|
54
54
|
parallel (~> 1.10)
|
55
|
-
parser (>=
|
55
|
+
parser (>= 3.0.0.0)
|
56
56
|
rainbow (>= 2.2.2, < 4.0)
|
57
|
-
regexp_parser (>= 1.
|
57
|
+
regexp_parser (>= 1.8, < 3.0)
|
58
58
|
rexml
|
59
|
-
rubocop-ast (>=
|
59
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
60
60
|
ruby-progressbar (~> 1.7)
|
61
|
-
unicode-display_width (>= 1.4.0, <
|
62
|
-
rubocop-ast (
|
63
|
-
parser (>= 2.7.1.
|
64
|
-
ruby-progressbar (1.
|
61
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
62
|
+
rubocop-ast (1.4.1)
|
63
|
+
parser (>= 2.7.1.5)
|
64
|
+
ruby-progressbar (1.11.0)
|
65
65
|
unf (0.1.4)
|
66
66
|
unf_ext
|
67
67
|
unf_ext (0.0.7.7)
|
68
|
-
unicode-display_width (
|
68
|
+
unicode-display_width (2.0.0)
|
69
69
|
|
70
70
|
PLATFORMS
|
71
71
|
ruby
|
@@ -74,7 +74,7 @@ DEPENDENCIES
|
|
74
74
|
attend!
|
75
75
|
bundler (~> 2.1)
|
76
76
|
rspec (~> 3.9)
|
77
|
-
rubocop (~>
|
77
|
+
rubocop (~> 1.11)
|
78
78
|
|
79
79
|
BUNDLED WITH
|
80
|
-
2.
|
80
|
+
2.2.13
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Attend [![Build Status](https://travis-ci.org/
|
1
|
+
# Attend [![Build Status](https://travis-ci.org/mckomo/attend.svg?branch=master)](https://travis-ci.org/mckomo/attend)
|
2
2
|
|
3
3
|
Register your attendance at Zoho using CLI.
|
4
4
|
|
data/attend.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.email = ['mckomo@gmail.com']
|
12
12
|
spec.license = 'MIT'
|
13
13
|
|
14
|
-
spec.required_ruby_version = '>= 2.
|
14
|
+
spec.required_ruby_version = '>= 2.7.2'
|
15
15
|
|
16
16
|
spec.summary = 'Register Zoho People attendance using CLI'
|
17
17
|
spec.description = 'Attend is CLI tool that will help you register your Zoho People attendance in fast and easy way'
|
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
31
31
|
spec.add_development_dependency 'rspec', '~> 3.9'
|
32
|
-
spec.add_development_dependency 'rubocop', '~>
|
32
|
+
spec.add_development_dependency 'rubocop', '~> 1.11'
|
33
33
|
end
|
data/exe/attend
CHANGED
@@ -15,8 +15,17 @@ Clamp do
|
|
15
15
|
option '--from', 'FROM', 'date of the first work day', default: Date.today, &parse_date
|
16
16
|
option '--to', 'TO', 'date of the las work day', default: Date.today, &parse_date
|
17
17
|
option '--dry', :flag, 'enables dry run'
|
18
|
+
option '--verbose', :flag, 'print verbose error message'
|
18
19
|
|
19
20
|
def execute
|
20
21
|
Attend.register(email: email, from: from, to: to, check_in: check_in, check_out: check_out, dry_run: dry?)
|
22
|
+
rescue StandardError => e
|
23
|
+
if verbose?
|
24
|
+
puts e.full_message
|
25
|
+
else
|
26
|
+
puts e.message
|
27
|
+
end
|
28
|
+
|
29
|
+
exit 1
|
21
30
|
end
|
22
31
|
end
|
data/lib/attend.rb
CHANGED
@@ -7,12 +7,8 @@ require_relative './attend/get_absent_days'
|
|
7
7
|
require_relative './attend/register_attendances'
|
8
8
|
|
9
9
|
module Attend
|
10
|
-
ZOHO_API = Zoho::People::API.new
|
11
|
-
|
12
|
-
private_constant :ZOHO_API
|
13
|
-
|
14
10
|
def self.register(email:, from:, to:, check_in:, check_out:, dry_run: true)
|
15
|
-
absent_days = GetAbsentDays.new(zoho:
|
11
|
+
absent_days = GetAbsentDays.new(zoho: zoho_api).call(email: email, from: from, to: to)
|
16
12
|
|
17
13
|
if absent_days.empty?
|
18
14
|
puts "No absent days between #{from} and #{to}"
|
@@ -27,6 +23,12 @@ module Attend
|
|
27
23
|
check_out: day_beginning.new_offset("+#{check_out}"))
|
28
24
|
end
|
29
25
|
|
30
|
-
RegisterAttendances.new(zoho:
|
26
|
+
RegisterAttendances.new(zoho: zoho_api, dry_run: dry_run).call(attendances)
|
31
27
|
end
|
28
|
+
|
29
|
+
def self.zoho_api
|
30
|
+
Zoho::People::API.new
|
31
|
+
end
|
32
|
+
|
33
|
+
private_class_method :zoho_api
|
32
34
|
end
|
data/lib/attend/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Komorowski
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '1.11'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '1.11'
|
83
83
|
description: Attend is CLI tool that will help you register your Zoho People attendance
|
84
84
|
in fast and easy way
|
85
85
|
email:
|
@@ -115,7 +115,7 @@ homepage: https://github.com/mckomo/attend
|
|
115
115
|
licenses:
|
116
116
|
- MIT
|
117
117
|
metadata: {}
|
118
|
-
post_install_message:
|
118
|
+
post_install_message:
|
119
119
|
rdoc_options: []
|
120
120
|
require_paths:
|
121
121
|
- lib
|
@@ -123,15 +123,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
123
|
requirements:
|
124
124
|
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
|
-
version:
|
126
|
+
version: 2.7.2
|
127
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
|
-
rubygems_version: 3.
|
134
|
-
signing_key:
|
133
|
+
rubygems_version: 3.2.13
|
134
|
+
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: Register Zoho People attendance using CLI
|
137
137
|
test_files: []
|