todo_txt_viewer 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +1 -1
- data/lib/todo_txt_viewer/ui.rb +13 -7
- data/lib/todo_txt_viewer/version.rb +1 -1
- data/lib/todo_txt_viewer.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61ef4f00d28e320d3fa369d40cc73612eac36db581301ac9ff5fac616f4b1225
|
4
|
+
data.tar.gz: f509e6df7459efcc0614d3a335e77706b336cf0abf74623efe7fe7d5595cda1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db0a6970a23392f7ad6ca71dd7dafcdeb9092d29b9c7217daf635bfdbb8fd15fa3ce2c7949a5272704112b46422001803409f87c0a9d20750029e2187c26bde4
|
7
|
+
data.tar.gz: 0d9a15d46674ae26c93c48b66b9368988864211b430d77b94a60672a79db0962fe1a8676f9f527fba740fd3aae2afdbf46dbb78045b665f8ec53d3873554f1dd
|
data/Gemfile
CHANGED
@@ -8,6 +8,5 @@ git_source(:gitlab) {|repo_name| "https://gitlab.com/#{repo_name}" }
|
|
8
8
|
# Specify your gem's dependencies in todo_txt_viewer.gemspec
|
9
9
|
gemspec
|
10
10
|
|
11
|
-
# gem 'fullscreen_tui', path: 'vendor/gems/fullscreen_tui'
|
12
11
|
# gem 'fullscreen_tui', gitlab: 'ThunderKey/fullscreen_tui'
|
13
12
|
gem 'ThunderKey-rubocop'
|
data/Gemfile.lock
CHANGED
data/lib/todo_txt_viewer/ui.rb
CHANGED
@@ -34,12 +34,16 @@ module TodoTxtViewer
|
|
34
34
|
|
35
35
|
def go_up
|
36
36
|
super
|
37
|
-
|
37
|
+
return unless selected_line.is_a? HeaderLine
|
38
|
+
|
39
|
+
selection.zero? ? go_down : super
|
38
40
|
end
|
39
41
|
|
40
42
|
def go_down
|
41
43
|
super
|
42
|
-
|
44
|
+
return unless selected_line.is_a? HeaderLine
|
45
|
+
|
46
|
+
selection == lines.size - 1 ? go_up : super
|
43
47
|
end
|
44
48
|
|
45
49
|
private
|
@@ -100,16 +104,18 @@ module TodoTxtViewer
|
|
100
104
|
def load_lines selected_task: nil
|
101
105
|
self.lines = []
|
102
106
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
lines << HeaderLine.new('# done')
|
107
|
-
@list.by_done.sort.reverse_each {|t| lines << TaskLine.new(t) }
|
107
|
+
add_section_lines '# todo', @list.by_not_done
|
108
|
+
add_section_lines '# done', @list.by_done
|
108
109
|
|
109
110
|
return if selected_task.nil?
|
110
111
|
|
111
112
|
idx = lines.index {|l| l.respond_to?(:task) && l.task.object_id == selected_task.object_id }
|
112
113
|
self.selection = idx if idx
|
113
114
|
end
|
115
|
+
|
116
|
+
def add_section_lines title, data
|
117
|
+
lines << HeaderLine.new(title)
|
118
|
+
data.sort.reverse_each {|t| lines << TaskLine.new(t) }
|
119
|
+
end
|
114
120
|
end
|
115
121
|
end
|
data/lib/todo_txt_viewer.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: todo_txt_viewer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Ganz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fullscreen_tui
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.7.
|
122
|
+
rubygems_version: 2.7.7
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: An interactive viewer for todo.txt
|