king_of_time 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 878a57145c2809d92159b793058404b4fa853105
4
- data.tar.gz: ee11239ab9eead3b11f01ef0827fd896ed1d309c
3
+ metadata.gz: ae09a1b16156a5bcbc32b869173b2141e6085e4a
4
+ data.tar.gz: 2c8ae6209d4123f1af6cabc9401319fd8b05e31b
5
5
  SHA512:
6
- metadata.gz: 82a9c45d433e101721ba598624766450a5dab4e11fe616d680c5ec750923c8227d666996c6a9a183fe66f882c3c4e9c490421ec49caa3200bab91a68b15a3945
7
- data.tar.gz: 18fdb1248ca1360c32ba39fe882001d3c77246fb34d6c6fe01b64e51eaff7d03ec9e732914553243f69fe442cbf4f923a0b4511064c49a5957d3838f3328f2a3
6
+ metadata.gz: 8e663668448f9fad9b5131ef0bc52cc34eab7636bacc171fd2a37ab4a2012df45922c69027a696d20525cdb7de77f972c3b61ff875336a5ec709d360f08399cc
7
+ data.tar.gz: 357e447dafae37c2749319ccc55420757e5aa33092cea9f7205ac049f309a887163d9cf05bf9b8fe21400d5fbd33e4b75f3b9a963b49ab036a382857df60218e
data/.rubocop.yml ADDED
@@ -0,0 +1,450 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'vendor/**/*'
4
+ DisplayCopNames: true
5
+ TargetRubyVersion: 2.1
6
+
7
+ Style/AccessModifierIndentation:
8
+ Enabled: false
9
+
10
+ Style/AccessorMethodName:
11
+ Enabled: false
12
+
13
+ Style/Alias:
14
+ Enabled: false
15
+
16
+ Style/AlignArray:
17
+ Enabled: false
18
+
19
+ Style/AlignHash:
20
+ Enabled: false
21
+
22
+ Style/AlignParameters:
23
+ Enabled: false
24
+
25
+ Style/AndOr:
26
+ Enabled: true
27
+
28
+ Style/ArrayJoin:
29
+ Enabled: false
30
+
31
+ Style/AsciiComments:
32
+ Enabled: false
33
+
34
+ Style/AsciiIdentifiers:
35
+ Enabled: false
36
+
37
+ Style/Attr:
38
+ Enabled: false
39
+
40
+ Style/BeginBlock:
41
+ Enabled: false
42
+
43
+ Style/BarePercentLiterals:
44
+ Enabled: false
45
+
46
+ Style/BlockComments:
47
+ Enabled: false
48
+
49
+ Style/BlockEndNewline:
50
+ Enabled: false
51
+
52
+ Style/BracesAroundHashParameters:
53
+ Enabled: false
54
+
55
+ Style/CaseEquality:
56
+ Enabled: true
57
+
58
+ Style/CaseIndentation:
59
+ Enabled: false
60
+
61
+ Style/CharacterLiteral:
62
+ Enabled: false
63
+
64
+ Style/ClassAndModuleCamelCase:
65
+ Enabled: false
66
+
67
+ Style/ClassAndModuleChildren:
68
+ Enabled: false
69
+
70
+ Style/ClassCheck:
71
+ Enabled: false
72
+
73
+ Style/ClassMethods:
74
+ Enabled: false
75
+
76
+ Style/ClassVars:
77
+ Enabled: false
78
+
79
+ Style/ColonMethodCall:
80
+ Enabled: false
81
+
82
+ Style/CommentAnnotation:
83
+ Enabled: false
84
+
85
+ Style/CommentIndentation:
86
+ Enabled: false
87
+
88
+ Style/ConstantName:
89
+ Enabled: false
90
+
91
+ Style/DefWithParentheses:
92
+ Enabled: false
93
+
94
+ Style/DeprecatedHashMethods:
95
+ Enabled: false
96
+
97
+ Style/Documentation:
98
+ Enabled: false
99
+
100
+ Style/DotPosition:
101
+ Enabled: false
102
+
103
+ Style/DoubleNegation:
104
+ Enabled: false
105
+
106
+ Style/EachWithObject:
107
+ Enabled: false
108
+
109
+ Style/ElseAlignment:
110
+ Enabled: false
111
+
112
+ Style/EmptyElse:
113
+ Enabled: false
114
+
115
+ Style/EmptyLineBetweenDefs:
116
+ Enabled: false
117
+
118
+ Style/EmptyLines:
119
+ Enabled: false
120
+
121
+ Style/EmptyLinesAroundAccessModifier:
122
+ Enabled: false
123
+
124
+ Style/EmptyLinesAroundBlockBody:
125
+ Enabled: false
126
+
127
+ Style/EmptyLinesAroundClassBody:
128
+ Enabled: false
129
+
130
+ Style/EmptyLinesAroundModuleBody:
131
+ Enabled: false
132
+
133
+ Style/EmptyLinesAroundMethodBody:
134
+ Enabled: false
135
+
136
+ Style/EmptyLiteral:
137
+ Enabled: false
138
+
139
+ Style/EndBlock:
140
+ Enabled: false
141
+
142
+ Style/EndOfLine:
143
+ Enabled: false
144
+
145
+ Style/EvenOdd:
146
+ Enabled: false
147
+
148
+ Style/FileName:
149
+ Enabled: false
150
+
151
+ Style/FirstParameterIndentation:
152
+ Enabled: false
153
+
154
+ Style/FlipFlop:
155
+ Enabled: false
156
+
157
+ Style/For:
158
+ Enabled: false
159
+
160
+ Style/FormatString:
161
+ Enabled: false
162
+
163
+ Style/GlobalVars:
164
+ Enabled: true
165
+
166
+ Style/GuardClause:
167
+ Enabled: false
168
+
169
+ Style/HashSyntax:
170
+ Enabled: false
171
+
172
+ Style/IfUnlessModifier:
173
+ Enabled: false
174
+
175
+ Style/IfWithSemicolon:
176
+ Enabled: false
177
+
178
+ Style/IndentationConsistency:
179
+ Enabled: false
180
+
181
+ Style/IndentationWidth:
182
+ Enabled: false
183
+
184
+ Style/IndentArray:
185
+ Enabled: false
186
+
187
+ Style/IndentHash:
188
+ Enabled: false
189
+
190
+ Style/InfiniteLoop:
191
+ Enabled: false
192
+
193
+ Style/Lambda:
194
+ Enabled: false
195
+
196
+ Style/LambdaCall:
197
+ Enabled: false
198
+
199
+ Style/LeadingCommentSpace:
200
+ Enabled: false
201
+
202
+ Style/LineEndConcatenation:
203
+ Enabled: false
204
+
205
+ Style/MethodCallParentheses:
206
+ Enabled: false
207
+
208
+ Style/MethodDefParentheses:
209
+ Enabled: false
210
+
211
+ Style/MethodName:
212
+ Enabled: false
213
+
214
+ Style/ModuleFunction:
215
+ Enabled: false
216
+
217
+ Style/MultilineBlockChain:
218
+ Enabled: false
219
+
220
+ Style/MultilineBlockLayout:
221
+ Enabled: false
222
+
223
+ Style/MultilineIfThen:
224
+ Enabled: false
225
+
226
+ Style/MultilineOperationIndentation:
227
+ Enabled: false
228
+
229
+ Style/MultilineTernaryOperator:
230
+ Enabled: false
231
+
232
+ Style/NegatedIf:
233
+ Enabled: false
234
+
235
+ Style/NegatedWhile:
236
+ Enabled: false
237
+
238
+ Style/NestedTernaryOperator:
239
+ Enabled: false
240
+
241
+ Style/Next:
242
+ Enabled: false
243
+
244
+ Style/NilComparison:
245
+ Enabled: false
246
+
247
+ Style/NonNilCheck:
248
+ Enabled: false
249
+
250
+ Style/Not:
251
+ Enabled: false
252
+
253
+ Style/NumericLiterals:
254
+ Enabled: false
255
+
256
+ Style/OneLineConditional:
257
+ Enabled: false
258
+
259
+ Style/OpMethod:
260
+ Enabled: false
261
+
262
+ Style/ParenthesesAroundCondition:
263
+ Enabled: false
264
+
265
+ Style/PercentLiteralDelimiters:
266
+ Enabled: false
267
+
268
+ Style/PercentQLiterals:
269
+ Enabled: false
270
+
271
+ Style/PerlBackrefs:
272
+ Enabled: false
273
+
274
+ Style/PredicateName:
275
+ Enabled: false
276
+
277
+ Style/Proc:
278
+ Enabled: false
279
+
280
+ Style/RaiseArgs:
281
+ Enabled: false
282
+
283
+ Style/RedundantBegin:
284
+ Enabled: false
285
+
286
+ Style/RedundantException:
287
+ Enabled: false
288
+
289
+ Style/RedundantReturn:
290
+ Enabled: false
291
+
292
+ Style/RedundantSelf:
293
+ Enabled: false
294
+
295
+ Style/RegexpLiteral:
296
+ Enabled: false
297
+
298
+ Style/RescueModifier:
299
+ Enabled: false
300
+
301
+ Style/SelfAssignment:
302
+ Enabled: false
303
+
304
+ Style/Semicolon:
305
+ Enabled: false
306
+
307
+ Style/SignalException:
308
+ Enabled: false
309
+
310
+ Style/SingleLineBlockParams:
311
+ Enabled: false
312
+
313
+ Style/SingleLineMethods:
314
+ Enabled: false
315
+
316
+ Style/SpaceAfterColon:
317
+ Enabled: false
318
+
319
+ Style/SpaceAfterComma:
320
+ Enabled: false
321
+
322
+ Style/SpaceAfterMethodName:
323
+ Enabled: false
324
+
325
+ Style/SpaceAfterNot:
326
+ Enabled: false
327
+
328
+ Style/SpaceAfterSemicolon:
329
+ Enabled: false
330
+
331
+ Style/SpaceBeforeBlockBraces:
332
+ Enabled: false
333
+
334
+ Style/SpaceBeforeComma:
335
+ Enabled: false
336
+
337
+ Style/SpaceBeforeComment:
338
+ Enabled: false
339
+
340
+ Style/SpaceBeforeSemicolon:
341
+ Enabled: false
342
+
343
+ Style/SpaceInsideBlockBraces:
344
+ Enabled: false
345
+
346
+ Style/SpaceAroundBlockParameters:
347
+ Enabled: false
348
+
349
+ Style/SpaceAroundEqualsInParameterDefault:
350
+ Enabled: false
351
+
352
+ Style/SpaceAroundOperators:
353
+ Enabled: false
354
+
355
+ Style/SpaceInsideBrackets:
356
+ Enabled: false
357
+
358
+ Style/SpaceInsideHashLiteralBraces:
359
+ Enabled: false
360
+
361
+ Style/SpaceInsideParens:
362
+ Enabled: false
363
+
364
+ Style/SpaceInsideRangeLiteral:
365
+ Enabled: false
366
+
367
+ Style/SpecialGlobalVars:
368
+ Enabled: false
369
+
370
+ Style/StringLiterals:
371
+ Enabled: false
372
+
373
+ Style/StringLiteralsInInterpolation:
374
+ Enabled: false
375
+
376
+ Style/StructInheritance:
377
+ Enabled: false
378
+
379
+ Style/SymbolProc:
380
+ Enabled: false
381
+
382
+ Style/Tab:
383
+ Enabled: false
384
+
385
+ Style/TrailingBlankLines:
386
+ Enabled: false
387
+
388
+ Style/TrailingWhitespace:
389
+ Enabled: false
390
+
391
+ Style/TrivialAccessors:
392
+ Enabled: false
393
+
394
+ Style/UnlessElse:
395
+ Enabled: false
396
+
397
+ Style/UnneededCapitalW:
398
+ Enabled: false
399
+
400
+ Style/UnneededPercentQ:
401
+ Enabled: false
402
+
403
+ Style/VariableInterpolation:
404
+ Enabled: false
405
+
406
+ Style/VariableName:
407
+ Enabled: false
408
+
409
+ Style/WhenThen:
410
+ Enabled: false
411
+
412
+ Style/WhileUntilDo:
413
+ Enabled: false
414
+
415
+ Style/WhileUntilModifier:
416
+ Enabled: false
417
+
418
+ Style/WordArray:
419
+ Enabled: false
420
+
421
+ Lint/DeprecatedClassMethods:
422
+ Enabled: false
423
+
424
+ Lint/StringConversionInInterpolation:
425
+ Enabled: false
426
+
427
+ Metrics/AbcSize:
428
+ Enabled: false
429
+
430
+ Metrics/BlockNesting:
431
+ Enabled: false
432
+
433
+ Metrics/ClassLength:
434
+ Enabled: false
435
+
436
+ Metrics/CyclomaticComplexity:
437
+ Enabled: false
438
+
439
+ Metrics/LineLength:
440
+ Enabled: false
441
+
442
+ Metrics/MethodLength:
443
+ Enabled: false
444
+
445
+ Metrics/ParameterLists:
446
+ Enabled: false
447
+
448
+ Metrics/PerceivedComplexity:
449
+ Enabled: false
450
+
data/README.md CHANGED
@@ -1,10 +1,14 @@
1
- # KingOfTime
1
+ # King Of Time
2
2
 
3
3
  Ruby API library for daily check-in/check-out operation.
4
4
 
5
5
  - http://www.kingtime.jp/
6
6
 
7
7
  [![Build Status](https://travis-ci.org/matsubo/king_of_time.svg?branch=master)](https://travis-ci.org/matsubo/king_of_time)
8
+ [![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://opensource.org/licenses/MIT)
9
+ [![Version](https://img.shields.io/gem/v/vcr.svg?style=flat-square)](https://rubygems.org/gems/king_of_time)
10
+ [![Code Climate](https://codeclimate.com/github/matsubo/king_of_time/badges/gpa.svg)](https://codeclimate.com/github/matsubo/king_of_time)
11
+
8
12
 
9
13
 
10
14
  ## Installation
@@ -26,7 +30,7 @@ Or install it yourself as:
26
30
  ## Usage
27
31
 
28
32
 
29
- ```
33
+ ```ruby
30
34
  king_of_time = KingOfTime.new({
31
35
  timerecorder_id: 1111111111,
32
36
  employee_id: 2222222222,
data/king_of_time.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = %q{King of Time HTTP client.}
13
13
  spec.description = %q{King of Time HTTP client.}
14
- spec.homepage = "http://www.kingtime.jp/"
14
+ spec.homepage = "https://github.com/matsubo/king_of_time"
15
15
 
16
16
  # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17
17
  # delete this section to allow pushing this gem to any host.
@@ -32,5 +32,6 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency "pry"
33
33
  spec.add_development_dependency "pry-doc"
34
34
  spec.add_development_dependency "simplecov"
35
+ spec.add_development_dependency "codeclimate-test-reporter"
35
36
 
36
37
  end
data/lib/king_of_time.rb CHANGED
@@ -1,9 +1,10 @@
1
1
  require "king_of_time/version"
2
2
  require 'rest-client'
3
3
 
4
+ # Main class
4
5
  class KingOfTime
5
6
 
6
- END_POINT = 'https://kingoftime-recorder.appspot.com/ajax?function=record_timestamp_and_log'
7
+ END_POINT = 'https://kingoftime-recorder.appspot.com/ajax?function=record_timestamp_and_log'.freeze
7
8
 
8
9
  def initialize(name:, employee_id:, timerecorder_id:)
9
10
  @param = {}
@@ -36,14 +37,14 @@ class KingOfTime
36
37
  checkin: "<font color='#0000FF'>Check-in</font>",
37
38
  checkout: "<font color='#FF0000'>Check-out</font>",
38
39
  start_break: "<font color='#00FF00'>Start break</font>",
39
- end_break: "<font color='#FF00FF'>End-break</font>",
40
+ end_break: "<font color='#FF00FF'>End-break</font>"
40
41
  }
41
42
 
42
43
  codes = {
43
44
  checkin: 1,
44
45
  checkout: 2,
45
46
  start_break: 3,
46
- end_break: 4,
47
+ end_break: 4
47
48
  }
48
49
 
49
50
  params = @param.merge({
@@ -52,7 +53,7 @@ class KingOfTime
52
53
  recording_time: Time.now.strftime('%Y%m%d%H%M%S'),
53
54
  now: Time.now.to_i,
54
55
  kot_url: 'https://s3.kingtime.jp/gateway/gaegateway?page_id=/gaegateway/',
55
- log: Time.now.strftime('%m/%d %H:%M') + ' ' + messages[type] + ' ' + @param[:name],
56
+ log: Time.now.strftime('%m/%d %H:%M') + ' ' + messages[type] + ' ' + @param[:name]
56
57
  # input_password: '', # not necessary
57
58
  })
58
59
 
@@ -60,13 +61,12 @@ class KingOfTime
60
61
  'Accept' => 'application/json, text/javascript, */*; q=0.01',
61
62
  'Content-Type' => 'application/x-www-form-urlencoded',
62
63
  'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36',
63
- 'X-Requested-With' => 'XMLHttpRequest',
64
+ 'X-Requested-With' => 'XMLHttpRequest'
64
65
  }
65
66
 
66
67
  RestClient.post END_POINT, params, headers
67
68
 
68
-
69
69
  end
70
70
 
71
-
72
71
  end
72
+
@@ -1,3 +1,3 @@
1
1
  class KingOfTime
2
- VERSION = "0.1.0"
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: king_of_time
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuki Matsukura
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: codeclimate-test-reporter
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: King of Time HTTP client.
126
140
  email:
127
141
  - matsubokkuri@gmail.com
@@ -131,6 +145,7 @@ extra_rdoc_files: []
131
145
  files:
132
146
  - ".gitignore"
133
147
  - ".rspec"
148
+ - ".rubocop.yml"
134
149
  - ".travis.yml"
135
150
  - Gemfile
136
151
  - README.md
@@ -144,7 +159,7 @@ files:
144
159
  - king_of_time.gemspec
145
160
  - lib/king_of_time.rb
146
161
  - lib/king_of_time/version.rb
147
- homepage: http://www.kingtime.jp/
162
+ homepage: https://github.com/matsubo/king_of_time
148
163
  licenses: []
149
164
  metadata: {}
150
165
  post_install_message: