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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f667da074d888593c6021802728a4dd1a1bd7163729bce0c2f262475ab0d81dd
4
- data.tar.gz: 4932b96b8b66e668fc35a70cf73dd35b176743b3ecfa1dd3c894a1a413cca280
3
+ metadata.gz: 61ef4f00d28e320d3fa369d40cc73612eac36db581301ac9ff5fac616f4b1225
4
+ data.tar.gz: f509e6df7459efcc0614d3a335e77706b336cf0abf74623efe7fe7d5595cda1d
5
5
  SHA512:
6
- metadata.gz: 61cbab6f9f4156282de7bb6d2a2edcdb749ca45ecd08eae3e00c000473ab23ad909670b12e10c68af184387d3a4861d2f2e9905db7f28ef19d5615c0b649bdc8
7
- data.tar.gz: b9399be63dcd9a01610314dc7e30c225914a44fb5e9eb566d975bc6b9e1e2e72026f02161196b18123b98c584d1da57f617d0f408f57858f5961309b1a8def60
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- todo_txt_viewer (0.1.1)
4
+ todo_txt_viewer (0.1.2)
5
5
  fullscreen_tui (>= 0.1.1, < 1)
6
6
  todo-txt (~> 0.12)
7
7
 
@@ -34,12 +34,16 @@ module TodoTxtViewer
34
34
 
35
35
  def go_up
36
36
  super
37
- selection.zero? ? go_down : super if selected_line.is_a? HeaderLine
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
- selection == lines.size - 1 ? go_up : super if selected_line.is_a? HeaderLine
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
- lines << HeaderLine.new('# todo')
104
- @list.by_not_done.sort.reverse_each {|t| lines << TaskLine.new(t) }
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TodoTxtViewer
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'pathname'
4
+
3
5
  require_relative 'todo_txt_viewer/version'
4
6
  require_relative 'todo_txt_viewer/ui'
5
7
 
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.2
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: 2018-12-28 00:00:00.000000000 Z
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.6
122
+ rubygems_version: 2.7.7
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: An interactive viewer for todo.txt