noko_cli 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.overcommit.yml +8 -1
- data/.rubocop.yml +10 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile +4 -1
- data/Gemfile.lock +41 -8
- data/README.md +1 -1
- data/Rakefile +7 -2
- data/exe/noko_cli +2 -0
- data/lib/noko_cli/entries.rb +49 -0
- data/lib/noko_cli/version.rb +1 -1
- data/lib/noko_cli.rb +1 -2
- metadata +47 -4
- data/.standard.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fdba4cde95bf72cc69138f23c21ec72aaf28fe1b9062328ba3873225c2cf8d3
|
4
|
+
data.tar.gz: 1c326257816aed182f7b9f74a974bfc05af5c8912cfc44eb6e2febeef9e6a4e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b00f098d2394e4cd87463ed509d0c4317b82fd1771780469596d0936b90921d89f9d1cb20cd3c47fe720f29ace338564059327524e6159b93f58464d6af39094
|
7
|
+
data.tar.gz: 2d03c7ceecf2dc7ae3cd763d29ab410dbf02db0fe4a5334b171743cf3ccfa3eeccdcfa60ce5ab0e0fa84c51b25f6d0bb5e7c24dc7ba483c4ae485aca44b14330
|
data/.overcommit.yml
CHANGED
@@ -27,8 +27,15 @@ PreCommit:
|
|
27
27
|
enabled: true
|
28
28
|
RuboCop:
|
29
29
|
enabled: true
|
30
|
-
command: ["
|
30
|
+
command: ["bundle", "exec", "rubocop"]
|
31
31
|
|
32
32
|
PrePush:
|
33
33
|
RSpec:
|
34
34
|
enabled: true
|
35
|
+
|
36
|
+
PostCheckout:
|
37
|
+
ALL:
|
38
|
+
quiet: true
|
39
|
+
|
40
|
+
IndexTags:
|
41
|
+
enabled: true
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.1.2](https://github.com/JuanVqz/noko_cli/compare/v0.1.1...v0.1.2) (2022-07-23)
|
4
|
+
|
5
|
+
|
6
|
+
### Miscellaneous
|
7
|
+
|
8
|
+
* Change standard to rubocop ([#27](https://github.com/JuanVqz/noko_cli/issues/27)) ([4a28bd4](https://github.com/JuanVqz/noko_cli/commit/4a28bd400d7f14e7e47016091fa82a399988e86c))
|
9
|
+
* **GitHub-action:** Change name ([#30](https://github.com/JuanVqz/noko_cli/issues/30)) ([e4a1745](https://github.com/JuanVqz/noko_cli/commit/e4a1745c618360c1b4e616ffa3287bf56e958549))
|
10
|
+
* **readme:** Update test status ([5db36b9](https://github.com/JuanVqz/noko_cli/commit/5db36b9b7d1cbb7c0761af9e8503c5ef3fdef8ec))
|
11
|
+
|
3
12
|
## 0.1.1 (2022-07-03)
|
4
13
|
|
5
14
|
|
data/Gemfile
CHANGED
@@ -7,4 +7,7 @@ gemspec
|
|
7
7
|
|
8
8
|
gem "rake", "~> 13.0"
|
9
9
|
gem "rspec", "~> 3.0"
|
10
|
-
gem "
|
10
|
+
gem "rubocop", "~> 1.31.1", require: false
|
11
|
+
gem "rubocop-performance", "~> 1.14.2", require: false
|
12
|
+
gem "rubocop-rake", "~> 0.6.0", require: false
|
13
|
+
gem "rubocop-rspec", "~> 2.12.1", require: false
|
data/Gemfile.lock
CHANGED
@@ -1,16 +1,30 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
noko_cli (0.1.
|
4
|
+
noko_cli (0.1.2)
|
5
|
+
faraday (~> 2.3.0)
|
6
|
+
tty-table (~> 0.12.0)
|
5
7
|
|
6
8
|
GEM
|
7
9
|
remote: https://rubygems.org/
|
8
10
|
specs:
|
9
11
|
ast (2.4.2)
|
12
|
+
coderay (1.1.3)
|
10
13
|
diff-lcs (1.5.0)
|
14
|
+
faraday (2.3.0)
|
15
|
+
faraday-net_http (~> 2.0)
|
16
|
+
ruby2_keywords (>= 0.0.4)
|
17
|
+
faraday-net_http (2.0.3)
|
18
|
+
json (2.6.2)
|
19
|
+
method_source (1.0.0)
|
11
20
|
parallel (1.22.1)
|
12
21
|
parser (3.1.2.0)
|
13
22
|
ast (~> 2.4.1)
|
23
|
+
pastel (0.8.0)
|
24
|
+
tty-color (~> 0.5)
|
25
|
+
pry (0.14.1)
|
26
|
+
coderay (~> 1.1)
|
27
|
+
method_source (~> 1.0)
|
14
28
|
rainbow (3.1.1)
|
15
29
|
rake (13.0.6)
|
16
30
|
regexp_parser (2.5.0)
|
@@ -28,34 +42,53 @@ GEM
|
|
28
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
29
43
|
rspec-support (~> 3.11.0)
|
30
44
|
rspec-support (3.11.0)
|
31
|
-
rubocop (1.
|
45
|
+
rubocop (1.31.1)
|
46
|
+
json (~> 2.3)
|
32
47
|
parallel (~> 1.10)
|
33
48
|
parser (>= 3.1.0.0)
|
34
49
|
rainbow (>= 2.2.2, < 4.0)
|
35
50
|
regexp_parser (>= 1.8, < 3.0)
|
36
51
|
rexml (>= 3.2.5, < 4.0)
|
37
|
-
rubocop-ast (>= 1.
|
52
|
+
rubocop-ast (>= 1.18.0, < 2.0)
|
38
53
|
ruby-progressbar (~> 1.7)
|
39
54
|
unicode-display_width (>= 1.4.0, < 3.0)
|
40
55
|
rubocop-ast (1.18.0)
|
41
56
|
parser (>= 3.1.1.0)
|
42
|
-
rubocop-performance (1.
|
57
|
+
rubocop-performance (1.14.2)
|
43
58
|
rubocop (>= 1.7.0, < 2.0)
|
44
59
|
rubocop-ast (>= 0.4.0)
|
60
|
+
rubocop-rake (0.6.0)
|
61
|
+
rubocop (~> 1.0)
|
62
|
+
rubocop-rspec (2.12.1)
|
63
|
+
rubocop (~> 1.31)
|
45
64
|
ruby-progressbar (1.11.0)
|
46
|
-
|
47
|
-
|
48
|
-
|
65
|
+
ruby2_keywords (0.0.5)
|
66
|
+
strings (0.2.1)
|
67
|
+
strings-ansi (~> 0.2)
|
68
|
+
unicode-display_width (>= 1.5, < 3.0)
|
69
|
+
unicode_utils (~> 1.4)
|
70
|
+
strings-ansi (0.2.0)
|
71
|
+
tty-color (0.6.0)
|
72
|
+
tty-screen (0.8.1)
|
73
|
+
tty-table (0.12.0)
|
74
|
+
pastel (~> 0.8)
|
75
|
+
strings (~> 0.2.0)
|
76
|
+
tty-screen (~> 0.8)
|
49
77
|
unicode-display_width (2.2.0)
|
78
|
+
unicode_utils (1.4.0)
|
50
79
|
|
51
80
|
PLATFORMS
|
52
81
|
ruby
|
53
82
|
|
54
83
|
DEPENDENCIES
|
55
84
|
noko_cli!
|
85
|
+
pry (~> 0.14.1)
|
56
86
|
rake (~> 13.0)
|
57
87
|
rspec (~> 3.0)
|
58
|
-
|
88
|
+
rubocop (~> 1.31.1)
|
89
|
+
rubocop-performance (~> 1.14.2)
|
90
|
+
rubocop-rake (~> 0.6.0)
|
91
|
+
rubocop-rspec (~> 2.12.1)
|
59
92
|
|
60
93
|
BUNDLED WITH
|
61
94
|
2.1.4
|
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -2,9 +2,14 @@
|
|
2
2
|
|
3
3
|
require "bundler/gem_tasks"
|
4
4
|
require "rspec/core/rake_task"
|
5
|
+
require "rubocop/rake_task"
|
5
6
|
|
6
7
|
RSpec::Core::RakeTask.new(:spec)
|
7
8
|
|
8
|
-
|
9
|
+
RuboCop::RakeTask.new do |task|
|
10
|
+
task.requires << "rubocop-performance"
|
11
|
+
task.requires << "rubocop-rake"
|
12
|
+
task.requires << "rubocop-rspec"
|
13
|
+
end
|
9
14
|
|
10
|
-
task default: %i[spec
|
15
|
+
task default: %i[spec rubocop]
|
data/exe/noko_cli
CHANGED
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "faraday"
|
4
|
+
require "tty-table"
|
5
|
+
|
6
|
+
module NokoCli
|
7
|
+
# This is an entry resource, which could be listed
|
8
|
+
class Entries
|
9
|
+
BASE_URL = "https://api.nokotime.com/v2"
|
10
|
+
NOKO_TOKEN = ENV.fetch("NOKO_TOKEN", nil)
|
11
|
+
|
12
|
+
def initialize(adapter: Faraday.default_adapter, stubs: nil)
|
13
|
+
@adapter = adapter
|
14
|
+
@stubs = stubs
|
15
|
+
end
|
16
|
+
|
17
|
+
def list
|
18
|
+
puts TTY::Table.new(headers, rows).render(:ascii, resize: true)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def conn
|
24
|
+
@conn ||= Faraday.new({ url: BASE_URL, params: { noko_token: NOKO_TOKEN } }) do |f|
|
25
|
+
unless @stubs
|
26
|
+
f.request :json
|
27
|
+
f.response :json, content_type: "application/json"
|
28
|
+
end
|
29
|
+
f.adapter @adapter, @stubs
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def current_user_entries
|
34
|
+
conn.get("current_user/entries").body
|
35
|
+
end
|
36
|
+
|
37
|
+
def headers
|
38
|
+
%w[date minutes description]
|
39
|
+
end
|
40
|
+
|
41
|
+
def rows
|
42
|
+
current_user_entries.map { |entry| row(entry) }
|
43
|
+
end
|
44
|
+
|
45
|
+
def row(entry)
|
46
|
+
[entry["date"], entry["minutes"], entry["description"]]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
data/lib/noko_cli/version.rb
CHANGED
data/lib/noko_cli.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noko_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Vasquez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
12
|
-
dependencies:
|
11
|
+
date: 2022-07-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.3.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.3.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: tty-table
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.12.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.12.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.14.1
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.14.1
|
13
55
|
description: 'Noko CLI is the easiest way to add, remove, and view all your entries
|
14
56
|
from your terminal.
|
15
57
|
|
@@ -23,8 +65,8 @@ extra_rdoc_files: []
|
|
23
65
|
files:
|
24
66
|
- ".overcommit.yml"
|
25
67
|
- ".rspec"
|
68
|
+
- ".rubocop.yml"
|
26
69
|
- ".ruby-version"
|
27
|
-
- ".standard.yml"
|
28
70
|
- CHANGELOG.md
|
29
71
|
- CODE_OF_CONDUCT.md
|
30
72
|
- Gemfile
|
@@ -34,6 +76,7 @@ files:
|
|
34
76
|
- Rakefile
|
35
77
|
- exe/noko_cli
|
36
78
|
- lib/noko_cli.rb
|
79
|
+
- lib/noko_cli/entries.rb
|
37
80
|
- lib/noko_cli/version.rb
|
38
81
|
- sig/noko_cli.rbs
|
39
82
|
homepage: https://github.com/juanvqz/noko_cli
|
data/.standard.yml
DELETED