goot 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8f0e9129328433d6264e17de3e7c7b157d7ef0e
4
- data.tar.gz: 54efebf6136144e50a4e33d87720e3f95aa28b88
3
+ metadata.gz: a5f445ac7fe3204ee6d80dbcc49badb52d15ecd0
4
+ data.tar.gz: 5d30bc95a6dbe39d3dabf946e17c66ea99ad2b67
5
5
  SHA512:
6
- metadata.gz: d942b9b81bccee83186f986c6ffbda570bbc85881fbdfc2187e007969d7c0bd28c4adc890287acc89c52a6c253a31004085c1ac304fe6e6a4fb3eb467da7969c
7
- data.tar.gz: df88c243fb7705d5f67bbe88020225c5a6c2eb3a8b49786d9388a1662904f81f0f6ea7d8d9cd8eadbe94ce309699308d8bdab8456d55a1b17b6ddccd1b380484
6
+ metadata.gz: e55ed0198d2efef167d59831e931db9df47b12cb8b0818b661e10e63a6cf3854e15ad417ca2074b29ffe9f6b48ee6b072b36c3480ad549aa460d9ed6770ab787
7
+ data.tar.gz: ead0745d04279b33ed7718808f2e854499e0f56632bf2c50d8ad06e9927f7248163426d88d88973b1482f96a19e30b2306c676dedab7f0919467a0cc9c16bb2d
@@ -1,6 +1,7 @@
1
1
  require 'slop'
2
2
  require 'colorize'
3
3
  require 'readline'
4
+ require 'shellwords'
4
5
 
5
6
  require 'goot/version'
6
7
  require 'goot/google_api'
@@ -3,7 +3,7 @@ class Goot::CLI
3
3
  parse ARGV
4
4
  exit unless ARGV.include? '-i' or ARGV.include? '--interactive'
5
5
  while argv = Readline.readline('> ', true)
6
- parse argv.chomp.split(' ')
6
+ parse Shellwords.split(argv)
7
7
  end
8
8
  end
9
9
 
@@ -15,7 +15,7 @@ class Goot::CLI
15
15
  command 'ls' do
16
16
  description 'List tasks, e.g. ls -l1'
17
17
  on :l=, :list=, 'Specify a tasklist', :default => 0
18
- run do |opts|
18
+ run do
19
19
  tab = ' '
20
20
  depths = {}
21
21
 
@@ -50,8 +50,8 @@ class Goot::CLI
50
50
  command 't' do
51
51
  description 'Toggle a task, e.g. t 0 -l1'
52
52
  on :l=, :list=, 'Specify a tasklist', :default => 0
53
- run do |opts, args|
54
- tasklist = API.get_tasklist(opts.to_hash[:list].to_i)
53
+ run do |_, args|
54
+ tasklist = API.get_tasklist(get(:list).to_i)
55
55
  tasks = API.get_tasks(tasklist).map(&:to_hash)
56
56
 
57
57
  # TODO: check to make sure all args are ints
@@ -78,8 +78,8 @@ class Goot::CLI
78
78
  command 'c' do
79
79
  description 'Clear completed tasks'
80
80
  on :l=, :list=, 'Specify a tasklist', :default => 0
81
- run do |opts|
82
- tasklist = API.get_tasklist(opts.to_hash[:list].to_i)
81
+ run do
82
+ tasklist = API.get_tasklist(get(:list).to_i)
83
83
  API.clear_tasks(tasklist)
84
84
  end
85
85
  end
@@ -87,8 +87,8 @@ class Goot::CLI
87
87
  command 'd' do
88
88
  description 'Delete a task'
89
89
  on :l=, :list=, 'Specify a tasklist', :default => 0
90
- run do |opts, args|
91
- tasklist = API.get_tasklist(opts.to_hash[:list].to_i)
90
+ run do |_, args|
91
+ tasklist = API.get_tasklist(get(:list).to_i)
92
92
  tasks = API.get_tasks(tasklist).map(&:to_hash)
93
93
 
94
94
  # TODO: check to make sure all args are ints
@@ -103,12 +103,12 @@ class Goot::CLI
103
103
  on :a=, :after=, 'Move task after specified index'
104
104
  on :p=, :parent=, 'Make task a child of parent index'
105
105
  on :l=, :list=, 'Specify a tasklist', :default => 0
106
- run do |opts, args|
107
- tasklist = API.get_tasklist(opts.to_hash[:list].to_i)
106
+ run do |_, args|
107
+ tasklist = API.get_tasklist(get(:list).to_i)
108
108
  tasks = API.get_tasks(tasklist).map(&:to_hash)
109
109
 
110
- previous = tasks[opts.to_hash[:after].to_i] if !opts.to_hash[:after].nil?
111
- parent = tasks[opts.to_hash[:parent].to_i] if !opts.to_hash[:parent].nil?
110
+ previous = tasks[get(:after).to_i] if !get(:after).nil?
111
+ parent = tasks[get(:parent).to_i] if !get(:parent).nil?
112
112
 
113
113
  API.move_task(tasklist, tasks[args[0].to_i], previous, parent)
114
114
  end
@@ -120,13 +120,13 @@ class Goot::CLI
120
120
  on :p=, :parent=, 'Make task a child of parent index'
121
121
  on :l=, :list=, 'Specify a tasklist', :default => 0
122
122
  run do |opts, args|
123
- tasklist = API.get_tasklist(opts.to_hash[:tasklist].to_i)
123
+ tasklist = API.get_tasklist(get(:list).to_i)
124
124
  tasks = API.get_tasks(tasklist).map(&:to_hash)
125
125
 
126
126
  task = { :title => args[0] }
127
127
 
128
- previous = tasks[opts.to_hash[:after].to_i] if !opts.to_hash[:after].nil?
129
- parent = tasks[opts.to_hash[:parent].to_i] if !opts.to_hash[:parent].nil?
128
+ previous = tasks[get(:after).to_i] if !get(:after).nil?
129
+ parent = tasks[get(:parent).to_i] if !get(:parent).nil?
130
130
 
131
131
  API.insert_task(tasklist, task, previous, parent)
132
132
  end
@@ -1,6 +1,6 @@
1
1
  module Goot
2
2
  APP_NAME = 'goot'
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
 
5
5
  GEM_ROOT = File.expand_path('../../..', __FILE__)
6
6
  CONFIG_DIR = File.join(ENV['HOME'], '.goot')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Conner McDaniel