wip-cli 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -7
- data/Gemfile.lock +15 -1
- data/exe/wip +5 -0
- data/lib/wip/cli.rb +20 -4
- data/lib/wip/todo.rb +4 -0
- data/lib/wip/version.rb +1 -1
- data/wip-cli.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afa60166355b47b1558e9f0f7a3a9d7e3e1226cef584899abac7be4286f471a3
|
4
|
+
data.tar.gz: f3540c62c2304616726ee38f27d8e7e224e83b23e71542b2291be55bd2903603
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69cb10303ae0f2b0ed1dce87b63d6c0f1e1a60b7c13ca5ffbe9facbb51f12d10ebc8734f0292c293bd64be258438a02f48e68eec3a30b4d173ab8ffd9577a4c9
|
7
|
+
data.tar.gz: fea2800ca42508e40c6438d79e42d189545c25fe3339ebf0a617dfd989f5402015cd94ed46b4115055837b02388a86e00f766a207cce2248a73791e5cc72639a
|
data/CHANGELOG.md
CHANGED
@@ -2,10 +2,18 @@
|
|
2
2
|
|
3
3
|
## [Unreleased]
|
4
4
|
|
5
|
+
## [1.4.0] - 2020-11-20
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
- Interactive mode to toggle todos: `wip todos -i`
|
10
|
+
|
11
|
+
## [1.3.0] - 2020-11-13
|
12
|
+
|
5
13
|
### Added
|
6
14
|
|
7
|
-
-
|
8
|
-
-
|
15
|
+
- Shortcut command to get your profile: `wip me`
|
16
|
+
- Command to get a user profile: `wip user 2051` or `wip user sowenjub`
|
9
17
|
|
10
18
|
### Changed
|
11
19
|
|
@@ -15,11 +23,11 @@
|
|
15
23
|
|
16
24
|
### Added
|
17
25
|
|
18
|
-
-
|
19
|
-
-
|
20
|
-
-
|
21
|
-
-
|
22
|
-
-
|
26
|
+
- Options to uncomplete a todo: `wip complete -u 123 `
|
27
|
+
- Command to delete a todo: `wip delete 123`
|
28
|
+
- Command to get any users todos: `wip todos -u sowenjub`
|
29
|
+
- Command to get viewer todos: `wip todos`
|
30
|
+
- Method to get viewer: `Wip::User.viewer`
|
23
31
|
|
24
32
|
## [1.1.0] - 2020-11-11
|
25
33
|
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
wip-cli (1.
|
4
|
+
wip-cli (1.4.0)
|
5
5
|
thor (~> 1.0)
|
6
|
+
tty-prompt (~> 0.22)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
@@ -10,6 +11,8 @@ GEM
|
|
10
11
|
byebug (11.1.3)
|
11
12
|
concurrent-ruby (1.1.7)
|
12
13
|
diff-lcs (1.4.4)
|
14
|
+
pastel (0.8.0)
|
15
|
+
tty-color (~> 0.5)
|
13
16
|
rake (13.0.1)
|
14
17
|
rspec (3.10.0)
|
15
18
|
rspec-core (~> 3.10.0)
|
@@ -25,8 +28,19 @@ GEM
|
|
25
28
|
rspec-support (~> 3.10.0)
|
26
29
|
rspec-support (3.10.0)
|
27
30
|
thor (1.0.1)
|
31
|
+
tty-color (0.6.0)
|
32
|
+
tty-cursor (0.7.1)
|
33
|
+
tty-prompt (0.22.0)
|
34
|
+
pastel (~> 0.8)
|
35
|
+
tty-reader (~> 0.8)
|
36
|
+
tty-reader (0.8.0)
|
37
|
+
tty-cursor (~> 0.7)
|
38
|
+
tty-screen (~> 0.8)
|
39
|
+
wisper (~> 2.0)
|
40
|
+
tty-screen (0.8.1)
|
28
41
|
tzinfo (2.0.3)
|
29
42
|
concurrent-ruby (~> 1.0)
|
43
|
+
wisper (2.0.1)
|
30
44
|
|
31
45
|
PLATFORMS
|
32
46
|
ruby
|
data/exe/wip
CHANGED
data/lib/wip/cli.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require "date"
|
2
2
|
require "thor"
|
3
|
+
require "tty-prompt"
|
3
4
|
require "tzinfo"
|
4
5
|
require "wip"
|
5
6
|
require "wip/todo"
|
7
|
+
require "byebug"
|
6
8
|
|
7
9
|
class Wip::CLI < Thor
|
8
10
|
class_option :verbose, :type => :boolean, :aliases => "-v"
|
@@ -38,16 +40,30 @@ class Wip::CLI < Thor
|
|
38
40
|
end
|
39
41
|
|
40
42
|
desc "todos", "List viewer todos"
|
41
|
-
method_option :completed, type: :boolean, aliases: '-c'
|
43
|
+
method_option :completed, type: :boolean, aliases: '-c', desc: "Filter by status"
|
42
44
|
method_option :filter, type: :string, aliases: '-f'
|
45
|
+
method_option :interactive, type: :boolean, aliases: '-i', default: false, desc: "Toggle todos statuses by selecting them"
|
43
46
|
method_option :limit, type: :numeric, aliases: '-l', default: 5
|
44
|
-
method_option :order, type: :string, aliases: '-o', default: "
|
47
|
+
method_option :order, type: :string, aliases: '-o', default: "created_at:desc"
|
45
48
|
method_option :username, type: :string, aliases: '-u'
|
46
49
|
def todos
|
47
50
|
todos_options = options.slice("completed", "filter", "limit", "order")
|
48
51
|
user = options.username.nil? ? Wip::User.viewer(todos: todos_options) : Wip::User.find(username: options.username, todos: todos_options)
|
49
|
-
|
50
|
-
|
52
|
+
if options.interactive
|
53
|
+
prompt = TTY::Prompt.new
|
54
|
+
options = user.todos.inject({}) do |h, todo|
|
55
|
+
h[todo.description] = todo.id
|
56
|
+
h
|
57
|
+
end
|
58
|
+
choice = prompt.multi_select("Toggle todos?", options, per_page: todos_options["limit"])
|
59
|
+
puts "No change" if choice.empty?
|
60
|
+
choice.each do |todo_id|
|
61
|
+
todo = user.todos.find { |todo| todo.id == todo_id }
|
62
|
+
todo.toggle
|
63
|
+
puts todo.description
|
64
|
+
end
|
65
|
+
else
|
66
|
+
user.todos.each { |todo| puts todo.description }
|
51
67
|
end
|
52
68
|
end
|
53
69
|
|
data/lib/wip/todo.rb
CHANGED
data/lib/wip/version.rb
CHANGED
data/wip-cli.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wip-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnaud Joubay
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzinfo
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: tty-prompt
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.22'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.22'
|
83
97
|
description: A simple gem to manage wip.co todos from the command line.
|
84
98
|
email:
|
85
99
|
executables:
|