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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a34b69b2e209344f4c98a064fbc4987ba3c9a8dcb871bb8653b9b610a336c01
4
- data.tar.gz: 2e2ff463a58a98bb96865dbea49dcada014ef00d2e9365610ec34942ff522d22
3
+ metadata.gz: d8c87d15b717a5967b362d8adb2134b53ff3f4ca0a35fc99a72d170e5832971a
4
+ data.tar.gz: d44d47deeb7833218c5846790cb24f24c78bd76d85ca2c8b39e8aa5cce007081
5
5
  SHA512:
6
- metadata.gz: e6d1bdb568c87d289d3bde4cb7fd23fb834c78f7b9dcae50454ed5f3e6c30979520e3f184d40970d22980034340c8db2f97a9de67608d0fc00548dd98c018c55
7
- data.tar.gz: bb2a25d4221d267db22949e87d0da8a4f765b81de9c314c29ec8bb3f8313a7103a32c3b4f9b4fdc5dcc8e33a717089c5b3c84aa7cadb84b656ec1b6a7ad7c5ca
6
+ metadata.gz: def3186735e775c79efec903c214e1fd599ac5da476afd44461f451b33085746a72cf0af75cf380116c93570c6ac65972c7f9f720c1c4dedf3de177a5f2da083
7
+ data.tar.gz: b8a7606f8080fa777839352078d252ad1727bf046d404bebaa064466dd9e78b8f365b27406f00d196e4436c54276be793f01f10a6d999a2f4ae401569c932949
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.1
1
+ 3.0.0
data/.travis.yml CHANGED
@@ -2,5 +2,5 @@ sudo: false
2
2
  language: ruby
3
3
  script: bundle exec rspec
4
4
  rvm:
5
- - 2.6
6
- - 2.7
5
+ - 2.7.2
6
+ - 3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- attend (0.2.1)
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.1)
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.13.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.1)
30
+ http-parser (1.2.3)
31
31
  ffi-compiler (>= 1.0, < 2.0)
32
- parallel (1.19.2)
33
- parser (2.7.1.4)
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.1)
38
- regexp_parser (1.7.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 (0.91.0)
53
+ rubocop (1.11.0)
54
54
  parallel (~> 1.10)
55
- parser (>= 2.7.1.1)
55
+ parser (>= 3.0.0.0)
56
56
  rainbow (>= 2.2.2, < 4.0)
57
- regexp_parser (>= 1.7)
57
+ regexp_parser (>= 1.8, < 3.0)
58
58
  rexml
59
- rubocop-ast (>= 0.4.0, < 1.0)
59
+ rubocop-ast (>= 1.2.0, < 2.0)
60
60
  ruby-progressbar (~> 1.7)
61
- unicode-display_width (>= 1.4.0, < 2.0)
62
- rubocop-ast (0.4.1)
63
- parser (>= 2.7.1.4)
64
- ruby-progressbar (1.10.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 (1.7.0)
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 (~> 0.91)
77
+ rubocop (~> 1.11)
78
78
 
79
79
  BUNDLED WITH
80
- 2.1.4
80
+ 2.2.13
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Attend [![Build Status](https://travis-ci.org/SponsorPay/stack-retrace.svg?branch=master)](https://travis-ci.org/SponsorPay/stack-retrace)
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.6'
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', '~> 0.91'
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: ZOHO_API).call(email: email, from: from, to: to)
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: ZOHO_API, dry_run: dry_run).call(attendances)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Attend
4
- VERSION = '0.2.1'
4
+ VERSION = '1.0.0'
5
5
  end
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.2.1
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: 2020-09-23 00:00:00.000000000 Z
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: '0.91'
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: '0.91'
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: '2.6'
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.1.4
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: []