vgcal 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +10 -0
- data/.rubocop_todo.yml +170 -0
- data/Gemfile.lock +21 -12
- data/lib/vgcal/google/authorizer.rb +1 -2
- data/lib/vgcal/handlers/describer.rb +12 -14
- data/lib/vgcal/my_calendar.rb +1 -1
- data/lib/vgcal/version.rb +1 -1
- data/vgcal.gemspec +3 -0
- metadata +33 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb56a54387940745fdd4645f1e6897ed4ddee06a5d61d3baefb016de4477d1c6
|
4
|
+
data.tar.gz: b92316054d45103f99d6d978f63a6cfecee3e8d37ba18c6233baac5b1cd718a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac05e65e1fd0e8a5a8b3e89d692edd80386a4119b7e5576b8b5c9639bea72cc5178b539a0c9d043e9672182e4e53dca537785d708f3e20f3e9e1fba53c555c30
|
7
|
+
data.tar.gz: 48a3cb1ff2e1a8c4e9c00b4cf418bc103975ee557a8911c841cbe1ce6c6d9f285232fb6367338e550e0dc9fb4c9b0c25a5853aef4a4b777ca25276abda28e549
|
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2022-08-07 06:07:33 UTC using RuboCop version 1.18.4.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 2
|
10
|
+
# Cop supports --auto-correct.
|
11
|
+
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
|
12
|
+
# Include: **/*.gemspec
|
13
|
+
Gemspec/OrderedDependencies:
|
14
|
+
Exclude:
|
15
|
+
- 'vgcal.gemspec'
|
16
|
+
|
17
|
+
# Offense count: 1
|
18
|
+
# Cop supports --auto-correct.
|
19
|
+
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
|
20
|
+
Layout/ExtraSpacing:
|
21
|
+
Exclude:
|
22
|
+
- 'vgcal.gemspec'
|
23
|
+
|
24
|
+
# Offense count: 10
|
25
|
+
# Cop supports --auto-correct.
|
26
|
+
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
27
|
+
# SupportedHashRocketStyles: key, separator, table
|
28
|
+
# SupportedColonStyles: key, separator, table
|
29
|
+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
30
|
+
Layout/HashAlignment:
|
31
|
+
Exclude:
|
32
|
+
- 'lib/vgcal/handlers/describer.rb'
|
33
|
+
- 'lib/vgcal/my_calendar.rb'
|
34
|
+
|
35
|
+
# Offense count: 1
|
36
|
+
# Cop supports --auto-correct.
|
37
|
+
# Configuration parameters: Width, IgnoredPatterns.
|
38
|
+
Layout/IndentationWidth:
|
39
|
+
Exclude:
|
40
|
+
- 'vgcal.gemspec'
|
41
|
+
|
42
|
+
# Offense count: 2
|
43
|
+
# Cop supports --auto-correct.
|
44
|
+
Layout/SpaceAfterComma:
|
45
|
+
Exclude:
|
46
|
+
- 'lib/vgcal/handlers/describer.rb'
|
47
|
+
|
48
|
+
# Offense count: 1
|
49
|
+
# Cop supports --auto-correct.
|
50
|
+
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
|
51
|
+
# SupportedStylesForExponentOperator: space, no_space
|
52
|
+
Layout/SpaceAroundOperators:
|
53
|
+
Exclude:
|
54
|
+
- 'vgcal.gemspec'
|
55
|
+
|
56
|
+
# Offense count: 1
|
57
|
+
# Cop supports --auto-correct.
|
58
|
+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
59
|
+
# SupportedStyles: space, no_space
|
60
|
+
# SupportedStylesForEmptyBraces: space, no_space
|
61
|
+
Layout/SpaceInsideBlockBraces:
|
62
|
+
Exclude:
|
63
|
+
- 'Gemfile'
|
64
|
+
|
65
|
+
# Offense count: 2
|
66
|
+
# Cop supports --auto-correct.
|
67
|
+
Lint/ParenthesesAsGroupedExpression:
|
68
|
+
Exclude:
|
69
|
+
- 'lib/vgcal/handlers/describer.rb'
|
70
|
+
|
71
|
+
# Offense count: 6
|
72
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
73
|
+
Metrics/AbcSize:
|
74
|
+
Max: 64
|
75
|
+
|
76
|
+
# Offense count: 4
|
77
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
78
|
+
# IgnoredMethods: refine
|
79
|
+
Metrics/BlockLength:
|
80
|
+
Max: 147
|
81
|
+
|
82
|
+
# Offense count: 1
|
83
|
+
# Configuration parameters: CountComments, CountAsOne.
|
84
|
+
Metrics/ClassLength:
|
85
|
+
Max: 140
|
86
|
+
|
87
|
+
# Offense count: 3
|
88
|
+
# Configuration parameters: IgnoredMethods.
|
89
|
+
Metrics/CyclomaticComplexity:
|
90
|
+
Max: 10
|
91
|
+
|
92
|
+
# Offense count: 8
|
93
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
94
|
+
Metrics/MethodLength:
|
95
|
+
Max: 27
|
96
|
+
|
97
|
+
# Offense count: 3
|
98
|
+
# Configuration parameters: IgnoredMethods.
|
99
|
+
Metrics/PerceivedComplexity:
|
100
|
+
Max: 12
|
101
|
+
|
102
|
+
# Offense count: 9
|
103
|
+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
|
104
|
+
# SupportedStyles: snake_case, normalcase, non_integer
|
105
|
+
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
|
106
|
+
Naming/VariableNumber:
|
107
|
+
Exclude:
|
108
|
+
- 'spec/vgcal_spec.rb'
|
109
|
+
|
110
|
+
# Offense count: 4
|
111
|
+
# Configuration parameters: AllowedChars.
|
112
|
+
# AllowedChars: ©
|
113
|
+
Style/AsciiComments:
|
114
|
+
Exclude:
|
115
|
+
- 'lib/vgcal/my_calendar.rb'
|
116
|
+
|
117
|
+
# Offense count: 1
|
118
|
+
# Configuration parameters: AllowedConstants.
|
119
|
+
Style/Documentation:
|
120
|
+
Exclude:
|
121
|
+
- 'spec/**/*'
|
122
|
+
- 'test/**/*'
|
123
|
+
- 'lib/vgcal/my_calendar.rb'
|
124
|
+
|
125
|
+
# Offense count: 1
|
126
|
+
# Cop supports --auto-correct.
|
127
|
+
Style/ExpandPathArguments:
|
128
|
+
Exclude:
|
129
|
+
- 'vgcal.gemspec'
|
130
|
+
|
131
|
+
# Offense count: 1
|
132
|
+
# Cop supports --auto-correct.
|
133
|
+
# Configuration parameters: EnforcedStyle.
|
134
|
+
# SupportedStyles: always, always_true, never
|
135
|
+
Style/FrozenStringLiteralComment:
|
136
|
+
Exclude:
|
137
|
+
- 'exe/vgcal'
|
138
|
+
|
139
|
+
# Offense count: 2
|
140
|
+
# Cop supports --auto-correct.
|
141
|
+
Style/RedundantInterpolation:
|
142
|
+
Exclude:
|
143
|
+
- 'lib/vgcal/handlers/describer.rb'
|
144
|
+
|
145
|
+
# Offense count: 38
|
146
|
+
# Cop supports --auto-correct.
|
147
|
+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
148
|
+
# SupportedStyles: single_quotes, double_quotes
|
149
|
+
Style/StringLiterals:
|
150
|
+
Exclude:
|
151
|
+
- 'Gemfile'
|
152
|
+
- 'Rakefile'
|
153
|
+
- 'bin/console'
|
154
|
+
- 'exe/vgcal'
|
155
|
+
- 'spec/spec_helper.rb'
|
156
|
+
- 'spec/vgcal_spec.rb'
|
157
|
+
- 'vgcal.gemspec'
|
158
|
+
|
159
|
+
# Offense count: 1
|
160
|
+
# Cop supports --auto-correct.
|
161
|
+
Style/SymbolLiteral:
|
162
|
+
Exclude:
|
163
|
+
- 'lib/vgcal/handlers/describer.rb'
|
164
|
+
|
165
|
+
# Offense count: 1
|
166
|
+
# Cop supports --auto-correct.
|
167
|
+
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
168
|
+
# URISchemes: http, https
|
169
|
+
Layout/LineLength:
|
170
|
+
Max: 121
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
vgcal (0.4.
|
4
|
+
vgcal (0.4.2)
|
5
5
|
dotenv
|
6
6
|
google-api-client
|
7
7
|
thor (~> 1.1)
|
@@ -56,19 +56,20 @@ GEM
|
|
56
56
|
httpclient (2.8.3)
|
57
57
|
i18n (1.12.0)
|
58
58
|
concurrent-ruby (~> 1.0)
|
59
|
+
json (2.6.2)
|
59
60
|
jwt (2.4.1)
|
60
61
|
memoist (0.16.2)
|
61
62
|
mini_mime (1.1.2)
|
62
63
|
minitest (5.16.2)
|
63
64
|
multi_json (1.15.0)
|
64
65
|
os (1.1.4)
|
65
|
-
parallel (1.
|
66
|
-
parser (3.
|
66
|
+
parallel (1.22.1)
|
67
|
+
parser (3.1.2.0)
|
67
68
|
ast (~> 2.4.1)
|
68
69
|
public_suffix (4.0.7)
|
69
|
-
rainbow (3.
|
70
|
+
rainbow (3.1.1)
|
70
71
|
rake (13.0.3)
|
71
|
-
regexp_parser (2.
|
72
|
+
regexp_parser (2.5.0)
|
72
73
|
representable (3.2.0)
|
73
74
|
declarative (< 0.1.0)
|
74
75
|
trailblazer-option (>= 0.1.1, < 0.2.0)
|
@@ -88,17 +89,23 @@ GEM
|
|
88
89
|
diff-lcs (>= 1.2.0, < 2.0)
|
89
90
|
rspec-support (~> 3.10.0)
|
90
91
|
rspec-support (3.10.2)
|
91
|
-
rubocop (1.
|
92
|
+
rubocop (1.33.0)
|
93
|
+
json (~> 2.3)
|
92
94
|
parallel (~> 1.10)
|
93
|
-
parser (>= 3.
|
95
|
+
parser (>= 3.1.0.0)
|
94
96
|
rainbow (>= 2.2.2, < 4.0)
|
95
97
|
regexp_parser (>= 1.8, < 3.0)
|
96
|
-
rexml
|
97
|
-
rubocop-ast (>= 1.
|
98
|
+
rexml (>= 3.2.5, < 4.0)
|
99
|
+
rubocop-ast (>= 1.19.1, < 2.0)
|
98
100
|
ruby-progressbar (~> 1.7)
|
99
101
|
unicode-display_width (>= 1.4.0, < 3.0)
|
100
|
-
rubocop-ast (1.
|
101
|
-
parser (>= 3.
|
102
|
+
rubocop-ast (1.19.1)
|
103
|
+
parser (>= 3.1.1.0)
|
104
|
+
rubocop-performance (1.14.3)
|
105
|
+
rubocop (>= 1.7.0, < 2.0)
|
106
|
+
rubocop-ast (>= 0.4.0)
|
107
|
+
rubocop-rspec (2.12.1)
|
108
|
+
rubocop (~> 1.31)
|
102
109
|
ruby-progressbar (1.11.0)
|
103
110
|
ruby2_keywords (0.0.5)
|
104
111
|
signet (0.17.0)
|
@@ -111,7 +118,7 @@ GEM
|
|
111
118
|
tzinfo (2.0.5)
|
112
119
|
concurrent-ruby (~> 1.0)
|
113
120
|
uber (0.1.0)
|
114
|
-
unicode-display_width (2.
|
121
|
+
unicode-display_width (2.2.0)
|
115
122
|
webrick (1.7.0)
|
116
123
|
|
117
124
|
PLATFORMS
|
@@ -123,6 +130,8 @@ DEPENDENCIES
|
|
123
130
|
rake (~> 13.0)
|
124
131
|
rspec (~> 3.10)
|
125
132
|
rubocop
|
133
|
+
rubocop-performance
|
134
|
+
rubocop-rspec
|
126
135
|
vgcal!
|
127
136
|
|
128
137
|
BUNDLED WITH
|
@@ -23,8 +23,7 @@ module Vgcal
|
|
23
23
|
credentials = authorizer.get_credentials user_id
|
24
24
|
if credentials.nil?
|
25
25
|
url = authorizer.get_authorization_url base_url: @oob_uri
|
26
|
-
puts
|
27
|
-
"resulting code after authorization:\n" + url
|
26
|
+
puts "Open the following URL in the browser and enter the resulting code after authorization:\n#{url}"
|
28
27
|
code = $stdin.gets
|
29
28
|
credentials = authorizer.get_and_store_credentials_from_code(
|
30
29
|
user_id: user_id, code: code, base_url: @oob_uri
|
@@ -16,7 +16,7 @@ module Vgcal
|
|
16
16
|
cred_json = "#{vgcal_dir}/credentials.json"
|
17
17
|
dot_env = "#{vgcal_dir}/.env"
|
18
18
|
gem_root = File.expand_path '../../../', __dir__
|
19
|
-
|
19
|
+
FileUtils.mkdir_p(vgcal_dir, 0o755)
|
20
20
|
FileUtils.cp(File.join(gem_root,'template-credentials.json'), cred_json) unless File.exist?(cred_json)
|
21
21
|
FileUtils.cp(File.join(gem_root,'template.env'), dot_env) unless File.exist?(dot_env)
|
22
22
|
puts "Fix the __FIX_ME__ in #{cred_json} and #{dot_env}"
|
@@ -27,7 +27,7 @@ module Vgcal
|
|
27
27
|
option :'next-week', type: :boolean, aliases: '-n', desc: 'Show next week tasks'
|
28
28
|
option :'start-date', type: :numeric, aliases: '-s', desc: 'Start date. ex.20210701'
|
29
29
|
option :'end-date', type: :numeric, aliases: '-e', desc: 'End date. ex.20210728'
|
30
|
-
option :
|
30
|
+
option :output, type: :string, aliases: '-o', desc: 'Output format. [text|json]'
|
31
31
|
|
32
32
|
desc 'show', 'Show google calendar'
|
33
33
|
|
@@ -39,9 +39,7 @@ module Vgcal
|
|
39
39
|
case options[:output]
|
40
40
|
when 'json'
|
41
41
|
stdout_json(mcal.tasks(events), mcal.invited_meetings(events))
|
42
|
-
when 'text'
|
43
|
-
stdout_default(mcal.tasks(events), mcal.invited_meetings(events))
|
44
|
-
else
|
42
|
+
when 'text', 'output', nil
|
45
43
|
stdout_default(mcal.tasks(events), mcal.invited_meetings(events))
|
46
44
|
end
|
47
45
|
end
|
@@ -56,22 +54,22 @@ module Vgcal
|
|
56
54
|
|
57
55
|
def stdout_json(my_tasks, invited_meetings)
|
58
56
|
hash = {
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
start_date: "#{start_date}",
|
58
|
+
end_date: "#{end_date}",
|
59
|
+
tasks: []
|
62
60
|
}
|
63
61
|
my_tasks.each do |task|
|
64
62
|
hash[:tasks].push ({
|
65
|
-
|
66
|
-
|
67
|
-
|
63
|
+
title: task[0],
|
64
|
+
time: task[1],
|
65
|
+
task_type: 'my_task'
|
68
66
|
})
|
69
67
|
end
|
70
68
|
invited_meetings.each do |meeting|
|
71
69
|
hash[:tasks].push ({
|
72
|
-
|
73
|
-
|
74
|
-
|
70
|
+
title: meeting[0],
|
71
|
+
time: meeting[1],
|
72
|
+
task_type: 'invited_meeting'
|
75
73
|
})
|
76
74
|
end
|
77
75
|
puts hash.to_json
|
data/lib/vgcal/my_calendar.rb
CHANGED
data/lib/vgcal/version.rb
CHANGED
data/vgcal.gemspec
CHANGED
@@ -15,6 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.homepage = "https://github.com/st1t/vgcal"
|
16
16
|
spec.license = "MIT"
|
17
17
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.1")
|
18
|
+
spec.metadata['rubygems_mfa_required'] = "true"
|
18
19
|
|
19
20
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
20
21
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
@@ -27,6 +28,8 @@ Gem::Specification.new do |spec|
|
|
27
28
|
spec.add_development_dependency "rake", "~> 13.0"
|
28
29
|
spec.add_development_dependency "rspec", "~> 3.10"
|
29
30
|
spec.add_development_dependency "rubocop"
|
31
|
+
spec.add_development_dependency "rubocop-performance"
|
32
|
+
spec.add_development_dependency "rubocop-rspec"
|
30
33
|
spec.add_runtime_dependency "thor", "~> 1.1"
|
31
34
|
spec.add_runtime_dependency "google-api-client"
|
32
35
|
spec.add_runtime_dependency "dotenv"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vgcal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Ito
|
@@ -66,6 +66,34 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-performance
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: thor
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -119,6 +147,8 @@ files:
|
|
119
147
|
- ".github/workflows/ruby.yml"
|
120
148
|
- ".gitignore"
|
121
149
|
- ".rspec"
|
150
|
+
- ".rubocop.yml"
|
151
|
+
- ".rubocop_todo.yml"
|
122
152
|
- ".ruby-version"
|
123
153
|
- Gemfile
|
124
154
|
- Gemfile.lock
|
@@ -139,7 +169,8 @@ files:
|
|
139
169
|
homepage: https://github.com/st1t/vgcal
|
140
170
|
licenses:
|
141
171
|
- MIT
|
142
|
-
metadata:
|
172
|
+
metadata:
|
173
|
+
rubygems_mfa_required: 'true'
|
143
174
|
post_install_message:
|
144
175
|
rdoc_options: []
|
145
176
|
require_paths:
|