thyme_habitica 1.0.0 → 1.1.1
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 +4 -4
- data/lib/thyme_habitica.rb +8 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1bace39803f66cb6cbdcaface4202876ad76d036e3029f18379daeeab2bfa1a
|
4
|
+
data.tar.gz: a78242a5cfa15c37572dbbd6c1228c8dfd40e3c2f91beeec9b8203373425c3d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fba135d2d8696c451567f84c203a6bb1779b332c3ef6fd51e90a97cca8e1eab3df06db6216cf75749ea4bdf9d99d085470ee12724d2a780e57e0cff23e6905c
|
7
|
+
data.tar.gz: 2808c9b396bee4735bdd01a4370a7c4f912bdb876cdf52c639b3f7a2071db9054025622564c27b1f0a3174b88c7e25bed0481a3b02f7e3ee0d03be94efedc906
|
data/lib/thyme_habitica.rb
CHANGED
@@ -5,6 +5,7 @@ class ThymePluginHabitica
|
|
5
5
|
def initialize(thyme, options={})
|
6
6
|
@thyme = thyme
|
7
7
|
@task_ids = options[:task_ids]
|
8
|
+
@silent = options[:silent]
|
8
9
|
@api_url_base = "https://habitica.com/api/v3"
|
9
10
|
@api_headers = {'x-api-user': options[:api_user],
|
10
11
|
'x-api-key': options[:api_key]}
|
@@ -16,7 +17,13 @@ class ThymePluginHabitica
|
|
16
17
|
return if @thyme.break or seconds_left > 0
|
17
18
|
|
18
19
|
for task_id in @task_ids
|
19
|
-
|
20
|
+
task = get_task(task_id)
|
21
|
+
if task['completed']
|
22
|
+
puts "Habitica task \"#{task['text']}\" was already completed" unless @silent
|
23
|
+
next
|
24
|
+
end
|
25
|
+
score_task(task_id)
|
26
|
+
puts "Habitica task \"#{task['text']}\" has been scored up" unless @silent
|
20
27
|
end
|
21
28
|
end
|
22
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thyme_habitica
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Shmygol
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|