tsks 0.0.6 → 0.0.7

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
  SHA256:
3
- metadata.gz: db9ce658ad547edd5932aef5cf8915bfec4ecf2cffa432fdc9c6682e1626a7de
4
- data.tar.gz: d4bd382ab9592760d95af9e0640518ba811c9a353ca045b9d0a3bffa264479c5
3
+ metadata.gz: 6fccdeb10c81fd73cbe4e0fd79054461347530f1ecedc43b188ea6a399bccf22
4
+ data.tar.gz: c3c82813fe5882c7a2c6b5dfa2a13c23cc2bb1e9fd617baafb9a4812f623564e
5
5
  SHA512:
6
- metadata.gz: 480d699bdc149396e4e1cf716173dda23fb3f0506ceb8a0f911c35f4ed980b4567a7aa18ee6d0153e636d799448c80dac2520fd2d41cd195635197f17f38cbd4
7
- data.tar.gz: e97aae640703c31732a1582d16c65351ef0c1868f9f13ccfdd1cc1397559509330e4023300bc199a30cd40674e57451ee055ef808110787902dd9eac76b95a22
6
+ metadata.gz: e686b61f0a2bc64fd9043b1a3141de4dfd01bbce44cf5b3d6540672bc42193b453cf3af2bd624c909b8264f68af3b9859d09e006ac5be85e85e2f663856677a2
7
+ data.tar.gz: 6f37c91a93ef83854e0efca12e7af0a89c00253907baf79012657582ecff9c93cf739a8b8661cf1701461f599742d970504de30e20d9ae27416f79d3de5efa94
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tsks (0.0.6)
4
+ tsks (0.0.7)
5
5
  httparty
6
6
  sqlite3
7
7
  thor
data/README.md CHANGED
@@ -91,10 +91,8 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
91
91
  prompt that will allow you to experiment.
92
92
 
93
93
  To install this gem onto your local machine, run `bundle exec rake install`
94
- (This command installs the current tsks version **v0.0.2** in your machine
95
- path).
94
+ (This command installs the current tsks version in your machine).
96
95
 
97
96
  ## Contributing
98
97
 
99
- Bug reports and pull requests are welcome on GitHub at
100
- https://github.com/luanrvmood/tsks-cli.
98
+ Bug reports and pull requests are welcome on GitHub at https://github.com/luanrvmood/tsks.
data/lib/tsks/cli.rb CHANGED
@@ -65,13 +65,13 @@ module Tsks
65
65
  tsks = nil
66
66
 
67
67
  if options[:done] && options[:context]
68
- tsks = Tsks::Storage.select_by({done: 1, context: options[:context]})
68
+ tsks = Tsks::Storage.select_by({status: 'done', context: options[:context]})
69
69
  elsif options[:done]
70
- tsks = Tsks::Storage.select_by({done: 1})
70
+ tsks = Tsks::Storage.select_by({status: 'done'})
71
71
  elsif options[:context]
72
72
  tsks = Tsks::Storage.select_by({context: options[:context]})
73
73
  else
74
- tsks = Tsks::Storage.select_by({done: 0})
74
+ tsks = Tsks::Storage.select_by({status: 'todo'})
75
75
  end
76
76
 
77
77
  if tsks.count > 0
data/lib/tsks/storage.rb CHANGED
@@ -10,8 +10,8 @@ module Tsks
10
10
  id VARCHAR PRIMARY KEY UNIQUE NOT NULL,
11
11
  user_id INTEGER DEFAULT 1,
12
12
  tsk VARCHAR NOT NULL,
13
+ status VARCHAR DEFAULT todo,
13
14
  context VARCHAR DEFAULT Inbox,
14
- done BOOLEAN DEFAULT false,
15
15
  created_at VARCHAR NOT NULL,
16
16
  updated_at VARCHAR NOT NULL
17
17
  )
@@ -31,15 +31,15 @@ module Tsks
31
31
 
32
32
  if ctx
33
33
  storage.execute("
34
- INSERT INTO tsks (id, tsk, context, created_at, updated_at)
35
- VALUES (?, ?, ?, ?, ?)",
36
- [uuid, tsk, ctx, now, now]
34
+ INSERT INTO tsks (id, tsk, status, context, created_at, updated_at)
35
+ VALUES (?, ?, ?, ?, ?, ?)",
36
+ [uuid, tsk, 'todo', ctx, now, now]
37
37
  )
38
38
  else
39
39
  storage.execute("
40
- INSERT INTO tsks (id, tsk, created_at, updated_at)
41
- VALUES (?, ?, ?, ?)",
42
- [uuid, tsk, now, now]
40
+ INSERT INTO tsks (id, tsk, status, created_at, updated_at)
41
+ VALUES (?, ?, ?, ?, ?)",
42
+ [uuid, tsk, 'todo', now, now]
43
43
  )
44
44
  end
45
45
  end
@@ -50,13 +50,13 @@ module Tsks
50
50
  for tsk in tsks
51
51
  storage.execute("
52
52
  INSERT INTO tsks
53
- (id, user_id, tsk, context, done, created_at, updated_at) VALUES
53
+ (id, user_id, tsk, status, context, created_at, updated_at) VALUES
54
54
  (?, ?, ?, ?, ?, ?, ?)",
55
55
  [tsk[:id],
56
56
  tsk[:user_id],
57
57
  tsk[:tsk],
58
+ tsk[:status],
58
59
  tsk[:context],
59
- tsk[:done],
60
60
  tsk[:created_at],
61
61
  tsk[:updated_at]]
62
62
  )
@@ -77,7 +77,7 @@ module Tsks
77
77
  "WHERE rowid=?",
78
78
  [params.values.first, local_id])
79
79
  else
80
- storage.execute "UPDATE tsks SET done=true WHERE rowid=?", local_id
80
+ storage.execute "UPDATE tsks SET status='done' WHERE rowid=?", local_id
81
81
  end
82
82
  end
83
83
 
@@ -154,16 +154,16 @@ module Tsks
154
154
  t[:id] = tsk[1]
155
155
  t[:user_id] = tsk[2]
156
156
  t[:tsk] = tsk[3]
157
- t[:context] = tsk[4]
158
- t[:done] = tsk[5]
157
+ t[:status] = tsk[4]
158
+ t[:context] = tsk[5]
159
159
  t[:created_at] = tsk[6]
160
160
  t[:updated_at] = tsk[7]
161
161
  else
162
162
  t[:id] = tsk[0]
163
163
  t[:user_id] = tsk[1]
164
164
  t[:tsk] = tsk[2]
165
- t[:context] = tsk[3]
166
- t[:done] = tsk[4]
165
+ t[:status] = tsk[3]
166
+ t[:context] = tsk[4]
167
167
  t[:created_at] = tsk[5]
168
168
  t[:updated_at] = tsk[6]
169
169
  end
data/lib/tsks/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tsks
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tsks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luan F. R. Vicente
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-25 00:00:00.000000000 Z
11
+ date: 2022-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description:
83
+ description:
84
84
  email:
85
85
  - luanrvmood@gmail.com
86
86
  executables:
@@ -112,7 +112,7 @@ metadata:
112
112
  allowed_push_host: https://rubygems.org
113
113
  homepage_uri: https://github.com/luanrvmood/tsks
114
114
  source_code_uri: https://github.com/luanrvmood/tsks
115
- post_install_message:
115
+ post_install_message:
116
116
  rdoc_options: []
117
117
  require_paths:
118
118
  - lib
@@ -127,8 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
- rubygems_version: 3.1.2
131
- signing_key:
130
+ rubygems_version: 3.3.7
131
+ signing_key:
132
132
  specification_version: 4
133
133
  summary: A stateful command line interface to help you handle your daily tsks (with
134
134
  synchronisation and contexts!)