tsks 0.0.7 → 0.0.9

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: 6fccdeb10c81fd73cbe4e0fd79054461347530f1ecedc43b188ea6a399bccf22
4
- data.tar.gz: c3c82813fe5882c7a2c6b5dfa2a13c23cc2bb1e9fd617baafb9a4812f623564e
3
+ metadata.gz: 5d73c826d7b403aedb18560d1a278b7031bf685379f2a933a566eb2e868132d8
4
+ data.tar.gz: d06f2629e6baf5396d91e732f9aeb1504256a93c984bc560c43c57ffea2baaeb
5
5
  SHA512:
6
- metadata.gz: e686b61f0a2bc64fd9043b1a3141de4dfd01bbce44cf5b3d6540672bc42193b453cf3af2bd624c909b8264f68af3b9859d09e006ac5be85e85e2f663856677a2
7
- data.tar.gz: 6f37c91a93ef83854e0efca12e7af0a89c00253907baf79012657582ecff9c93cf739a8b8661cf1701461f599742d970504de30e20d9ae27416f79d3de5efa94
6
+ metadata.gz: bf19e1134320717d80ea4eb4f1a5bad44e0979ee3cc37adcc3f83e5ffcaf69bde1e5896ab367e61c1210c3a4eb0f03475540bfed1bc46fa8748bb053fc89e9e0
7
+ data.tar.gz: 10f11a8fa09923a383ce3ce61ec3715bd3c7139a5e3411352f6b5985888869b303827585637514990c9cabda0be9aa09fbed5df570f417198c69cd43fec3feaf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tsks (0.0.7)
4
+ tsks (0.0.8)
5
5
  httparty
6
6
  sqlite3
7
7
  thor
data/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # tsks
2
2
 
3
- A stateful command line interface to help you handle your daily tsks (with
4
- synchronisation and contexts!).
3
+ [![build](https://app.travis-ci.com/luanramosvicente/tsks.svg?branch=main)](https://travis-ci.com/luanrvmood/tsks)
5
4
 
6
- [![build](https://travis-ci.com/luanrvmood/tsks.svg?branch=master)](https://travis-ci.com/luanrvmood/tsks)
5
+ A stateful command line interface to help you handle your daily tsks (with
6
+ synchronisation and contexts!).
7
7
 
8
8
  ## Features
9
9
 
10
- * Add tsks, check what is already done and list active or archived tsks
11
- * Synchronise your tsks and access them from all your terminals!
10
+ - Add tsks, check what is already done and list active or archived tsks
11
+ - Synchronise your tsks and access them from all your terminals!
12
12
  (soon accessible from a webapp as well)
13
- * Increase your daily tsks management with contexts using
13
+ - Increase your daily tsks management with contexts using
14
14
  `tsks add tsk --context=today` (see `tsks help add` for more info)
15
15
 
16
16
  ## Installation
@@ -21,9 +21,9 @@ gem install tsks
21
21
 
22
22
  ## Usage
23
23
 
24
- After follow the step above you should be able to run `tsks` from your terminal.
24
+ After follow the step above you should be able to run `tsks` from your terminal.
25
25
 
26
- _It's important to notice that you will need to run `tsks init` to setup stuffs
26
+ _It's important to notice that you will need to run `tsks init` to setup stuffs
27
27
  like the storage before any other command._
28
28
 
29
29
  ### Adding new tsks
@@ -38,7 +38,7 @@ tsks add "My first tsk"
38
38
  tsks add "Bootstraps my pet project environment" --context=Today
39
39
  ```
40
40
 
41
- ### Marking tsks as done
41
+ ### Marking tsks as done
42
42
 
43
43
  ```sh
44
44
  tsks done 2 # Where 2 is the tsk id
@@ -57,17 +57,18 @@ tsks list --context=Today
57
57
  ```
58
58
 
59
59
  **Or tsks already done**
60
+
60
61
  ```sh
61
62
  tsks list --done
62
63
  ```
63
64
 
64
- **Tip:** It's possible to combine the flags `--done` and `--context` when
65
+ **Tip:** It's possible to combine the flags `--done` and `--context` when
65
66
  listing.
66
67
 
67
68
  ### Synchronising your tsks
68
69
 
69
- As easy as running `tsks sync`. This command will fetch your tsks from the API,
70
- then filter what is not synchronised yet from local, then update both
70
+ As easy as running `tsks sync`. This command will fetch your tsks from the API,
71
+ then filter what is not synchronised yet from local, then update both
71
72
  remote and local tsks with most recent data.
72
73
 
73
74
  #### To be able to sync you will need to login or register an account
data/lib/tsks/actions.rb CHANGED
@@ -19,5 +19,17 @@ module Tsks
19
19
  end
20
20
  end
21
21
  end
22
+
23
+ def self.get_tsk_status status
24
+ available_status = {
25
+ todo: '+',
26
+ done: '-',
27
+ doing: '*',
28
+ freezed: '||',
29
+ archived: 'x',
30
+ }
31
+
32
+ available_status[status.to_sym]
33
+ end
22
34
  end
23
35
  end
data/lib/tsks/cli.rb CHANGED
@@ -76,7 +76,8 @@ module Tsks
76
76
 
77
77
  if tsks.count > 0
78
78
  for tsk in tsks
79
- puts "#{tsk[:local_id]} @#{tsk[:context]} #{tsk[:tsk]}"
79
+ tsk_status = Tsks::Actions.get_tsk_status tsk[:status]
80
+ puts "#{tsk_status} | #{tsk[:local_id]} #{tsk[:tsk]} @#{tsk[:context]}"
80
81
  end
81
82
  else
82
83
  puts "No tsks found."
@@ -92,11 +93,11 @@ module Tsks
92
93
  end
93
94
 
94
95
  begin
95
- res = Tsks::Request.post "/register", {email: options[:email],
96
+ res = Tsks::Request.post "/signup", {email: options[:email],
96
97
  password: options[:password]}
97
98
 
98
99
  if res && res[:ok] == true
99
- File.write File.join(CLI.setup_folder, "token"), res[:token]
100
+ File.write File.join(CLI.setup_folder, "token"), res[:auth_token]
100
101
  File.write File.join(CLI.setup_folder, "user_id"), res[:user_id]
101
102
  Tsks::Actions.update_tsks_with_uuid res[:user_id]
102
103
  puts "Succesfully registered."
@@ -119,11 +120,11 @@ module Tsks
119
120
  end
120
121
 
121
122
  begin
122
- res = Tsks::Request.post "/login", {email: options[:email],
123
+ res = Tsks::Request.post "/signin", {email: options[:email],
123
124
  password: options[:password]}
124
125
 
125
126
  if res && res[:ok] == true
126
- File.write File.join(CLI.setup_folder, "token"), res[:token]
127
+ File.write File.join(CLI.setup_folder, "token"), res[:auth_token]
127
128
  File.write File.join(CLI.setup_folder, "user_id"), res[:user_id]
128
129
  Tsks::Actions.update_tsks_with_uuid res[:user_id]
129
130
  puts "Succesfully logged in."
@@ -167,7 +168,9 @@ module Tsks
167
168
  if get_res[:ok] == true
168
169
  local_tsks_to_post = local_tsks - remote_tsks
169
170
  if local_tsks_to_post.count > 0
170
- Tsks::Request.post "/tsks", token, {tsks: local_tsks_to_post}
171
+ for tsk in local_tsks_to_post
172
+ Tsks::Request.post "/tsks", token, {tsk: tsk}
173
+ end
171
174
  end
172
175
 
173
176
  remote_tsks_to_storage = remote_tsks - local_tsks
data/lib/tsks/request.rb CHANGED
@@ -2,7 +2,9 @@ require "httparty"
2
2
 
3
3
  module Tsks
4
4
  class Request
5
- @base_uri = "https://tsks-api.herokuapp.com/v1"
5
+ #@base_uri = "https://tsks-api.herokuapp.com/v1"
6
+ # TODO: tmp for dev purposes
7
+ @base_uri = "http://localhost:3000/v1"
6
8
 
7
9
  def self.base_uri
8
10
  @base_uri
data/lib/tsks/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tsks
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.9"
3
3
  end
data/tsks.gemspec CHANGED
@@ -3,10 +3,10 @@ require_relative 'lib/tsks/version'
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "tsks"
5
5
  spec.version = Tsks::VERSION
6
- spec.authors = ["Luan F. R. Vicente"]
6
+ spec.authors = ["Luan Ramos Vicente"]
7
7
  spec.email = ["luanrvmood@gmail.com"]
8
- spec.summary = "A stateful command line interface to help you handle your daily tsks (with synchronisation and contexts!)"
9
- spec.homepage = "https://github.com/luanrvmood/tsks"
8
+ spec.summary = "A stateful command line interface to help you handle your daily tsks (with synchronisation and contexts)"
9
+ spec.homepage = "https://github.com/luanrv/tsks"
10
10
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
11
11
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
12
12
  spec.metadata["homepage_uri"] = spec.homepage
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.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
- - Luan F. R. Vicente
7
+ - Luan Ramos Vicente
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-16 00:00:00.000000000 Z
11
+ date: 2022-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -106,12 +106,12 @@ files:
106
106
  - lib/tsks/storage.rb
107
107
  - lib/tsks/version.rb
108
108
  - tsks.gemspec
109
- homepage: https://github.com/luanrvmood/tsks
109
+ homepage: https://github.com/luanrv/tsks
110
110
  licenses: []
111
111
  metadata:
112
112
  allowed_push_host: https://rubygems.org
113
- homepage_uri: https://github.com/luanrvmood/tsks
114
- source_code_uri: https://github.com/luanrvmood/tsks
113
+ homepage_uri: https://github.com/luanrv/tsks
114
+ source_code_uri: https://github.com/luanrv/tsks
115
115
  post_install_message:
116
116
  rdoc_options: []
117
117
  require_paths:
@@ -131,5 +131,5 @@ rubygems_version: 3.3.7
131
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
- synchronisation and contexts!)
134
+ synchronisation and contexts)
135
135
  test_files: []