Skip to content

Commit

Permalink
Merge pull request #315 from ardumont/0.7.6
Browse files Browse the repository at this point in the history
0.7.6
  • Loading branch information
ardumont committed Feb 13, 2016
2 parents d301662 + 69a44e8 commit 1ecb8f4
Show file tree
Hide file tree
Showing 16 changed files with 100 additions and 37 deletions.
3 changes: 2 additions & 1 deletion Cask
Expand Up @@ -30,4 +30,5 @@
(depends-on "undercover")
(depends-on "ert")
(depends-on "ert-expectations")
(depends-on "el-mock"))
(depends-on "el-mock")
(depends-on "helm"))
12 changes: 12 additions & 0 deletions TESTS-simple.org
Expand Up @@ -56,6 +56,7 @@
* TODO Programming in scala
:PROPERTIES:
:END:

- [-] chapters
- [ ] introduction
- [ ] Ch. 1 - A scalable language
Expand All @@ -73,7 +74,18 @@
* TODO Functional programming in Haskell
:PROPERTIES:
:END:

* PENDING Questions about life, the universe and everything
:PROPERTIES:
:END:

- [-] How to deal with promotion/demotion?

* IN-PROGRESS blahblah
:PROPERTIES:
:END:
ah blah blah..
- [-] Checklist
- [ ] ⌂ hey ho
- [X] another item
- [-] ἀ ἃ ἄ ἅ ἆ ἇ Ἀ Ἁ Ἂ Ἃ Ἄ Ἅ Ἆ Ἇ
14 changes: 14 additions & 0 deletions TODO.org
Expand Up @@ -32,6 +32,20 @@
- [ ] #245 - Trying to sync a card: orgtrello-buffer/compute-marker: Wrong type argument: numberp, nil
- [ ] #248 - Installing from melpa (unstable) works, but then it errs on an undefined variable "error-messages"
- [ ] #263 - Colors broken in org trello
* DONE 0.7.6 [100%]
CLOSED: [2016-02-13 Sat 19:36]
- [X] Update version
- [X] Support unicode characters in sync - Close #307 Close #309
- [X] Fix parsing username comments - Close #301
- [X] Fix parsing timestamp in superior emacs (api change)
- [X] Update travis-ci scripts to use the new travis infrastructure
- [X] fix broken tests (mock.el unit test library revealed broken tests)
- [X] Fix problem with org-latex-preview when computing checksums - Close #303
- [X] Do not permit empty login when installing access key and token - Close #314
- [X] Upgrade dependencies version
- [X] Pb with labels-tags regarding the grey - Close #310
- [X] Improve documentation about the setup account - #306
- [X] Release notes

* DONE 0.7.5 [100%]
CLOSED: [2015-09-05 Sat 20:21]
Expand Down
5 changes: 3 additions & 2 deletions org-trello-buffer.el
Expand Up @@ -523,7 +523,7 @@ FN-TO-EXECUTE is a function without any parameters."
(orgtrello-buffer-delete-property-from-entry property)
(goto-char (point-min))
(while (re-search-forward " :PROPERTIES: {.*" nil t)
(remove-overlays (point-at-bol) (point-at-eol))
(orgtrello-buffer-remove-overlays (point-at-bol) (point-at-eol))
(replace-match "" nil t))))

(defun orgtrello-buffer-remove-overlays (&optional start end)
Expand Down Expand Up @@ -840,7 +840,8 @@ ENTITIES and ADJACENCIES provide information on card's structure."
(buffer-name (current-buffer)))
(with-temp-buffer
(apply 'insert-buffer-substring (cons buffer-name region))
(org-mode)
(let ((org-startup-with-latex-preview nil))
(org-mode))
(orgtrello-buffer-delete-property org-trello--label-key-local-checksum)
(when orgtrello-setup-use-position-in-checksum-computation
(goto-char (point-max))
Expand Down
2 changes: 1 addition & 1 deletion org-trello-controller.el
Expand Up @@ -613,7 +613,7 @@ Returns DATA."
(defun orgtrello-controller-do-install-key-and-token ()
"Procedure to install consumer-key and access token as user config-file."
(let* ((user-login
(orgtrello-input-read-string
(orgtrello-input-read-not-empty
"Trello login account (you need to be logged accordingly in trello.com as we cannot check this for you): "))
(user-config-file (orgtrello-controller-config-file user-login))
(prefix-log "Install key and token..."))
Expand Down
5 changes: 4 additions & 1 deletion org-trello-data.el
Expand Up @@ -271,7 +271,10 @@ If TRELLO-CHECKLIST is nil, return ORG-CHECKLIST."
(defun orgtrello-data--labels-hash-to-tags (labels)
"Given a hash map with LABELS entry, return a tag string joined by : separator."
(when labels
(orgtrello-data--labels-to-tags (mapcar 'orgtrello-data-entity-color labels))))
(orgtrello-data--labels-to-tags
(mapcar (lambda (label) (-if-let (l (orgtrello-data-entity-color label))
l
"grey")) labels))))

(defun orgtrello-data--from-tags-to-list (tags)
"Given TAGS, a : string separated string, return a list of non empty string."
Expand Down
16 changes: 10 additions & 6 deletions org-trello-input.el
Expand Up @@ -4,28 +4,32 @@

(require 'org-trello-log)
(require 'ido)
(require 's)

(defalias 'orgtrello-input-read-string 'read-string
"Read input from user which can be null.
:: () -> String")

(defun orgtrello-input-read-not-empty (prompt)
"Read input as long as input is empty.
PROMPT is the prefix string displayed for input.
:: () -> String"
(let ((value nil))
(while (or (null value) (string= "" value))
(setq value (read-string prompt)))
(setq value (-> (orgtrello-input-read-string prompt) s-trim)))
value))

(defalias 'orgtrello-input-read-string 'read-string
"Read input from user which can be null.
:: () -> String")

(defun orgtrello-input-read-string-completion (prompt choices)
"Read input from user with completing mechanism.
PROMPT is the prompt for user to see.
CHOICES is the list of possibilities with completing properties.
:: String -> [a] -> a"
(if (eq 'default org-trello-input-completion-mechanism)
(ido-completing-read prompt choices nil 'do-match)
(helm-comp-read prompt choices)))
(progn ;; Beware, the user needs to install helm first as this is
;; not a runtime dependency on org-trello itself
(require 'helm)
(helm-comp-read prompt choices))))

(provide 'org-trello-input)
;;; org-trello-input.el ends here
10 changes: 5 additions & 5 deletions org-trello-pkg.el
@@ -1,7 +1,7 @@
(define-package "org-trello" "0.7.5" "Minor mode to synchronize org-mode buffer and trello board"
(define-package "org-trello" "0.7.6" "Minor mode to synchronize org-mode buffer and trello board"
'((request-deferred "0.2.0")
(deferred "0.3.2")
(s "1.9.0")
(dash-functional "2.11.0")
(dash "2.11.0")
(deferred "0.4.0")
(s "1.11.0")
(dash-functional "2.12.1")
(dash "2.12.1")
(emacs "24")))
2 changes: 1 addition & 1 deletion org-trello-proxy.el
Expand Up @@ -299,7 +299,7 @@ MAP-DISPATCH-FN is a map of function taking the one parameter ENTITY."

(defun orgtrello-proxy--delete-region (start end)
"Delete a region defined by START and END bound."
(remove-overlays start end) ;; remove overlays on the card region
(orgtrello-buffer-remove-overlays start end) ;; remove overlays on the card region
(delete-region start end))

(defun orgtrello-proxy--delete-card-region ()
Expand Down
4 changes: 2 additions & 2 deletions org-trello-query.el
Expand Up @@ -34,12 +34,12 @@ Simply displays a success message in the minibuffer."
`((key . ,org-trello-consumer-key) (token . ,org-trello-access-token)))

(defun orgtrello-query--decode-as-utf-8 ()
"Permit to decode the buffer's response data as utf-8."
(let ((data (buffer-string)))
(erase-buffer)
(insert (decode-coding-string data 'utf-8))
(goto-char (point-min))
(orgtrello-log-msg orgtrello-log-debug "Decoded data to utf-8")
))
(orgtrello-log-msg orgtrello-log-debug "Decoded data to utf-8")))

(defun orgtrello-query--http-parse ()
"Parse the http response into an org-trello entity."
Expand Down
6 changes: 3 additions & 3 deletions org-trello.el
Expand Up @@ -4,8 +4,8 @@

;; Author: Antoine R. Dumont <eniotna.t AT gmail.com>
;; Maintainer: Antoine R. Dumont <eniotna.t AT gmail.com>
;; Version: 0.7.5
;; Package-Requires: ((emacs "24") (dash "2.11.0") (dash-functional "2.11.0") (s "1.9.0") (deferred "0.3.2") (request-deferred "0.2.0"))
;; Version: 0.7.6
;; Package-Requires: ((emacs "24") (dash "2.12.1") (dash-functional "2.12.1") (s "1.11.0") (deferred "0.4.0") (request-deferred "0.2.0"))
;; Keywords: org-mode trello sync org-trello
;; URL: https://github.com/org-trello/org-trello

Expand Down Expand Up @@ -112,7 +112,7 @@ Please consider upgrading Emacs." emacs-version)
(require 'json)
(require 'parse-time)

(defconst org-trello--version "0.7.5" "Current org-trello version installed.")
(defconst org-trello--version "0.7.6" "Current org-trello version installed.")



Expand Down
15 changes: 15 additions & 0 deletions release-notes.md
@@ -1,3 +1,18 @@
# 0.7.6

- [X] Update version
- [X] Support unicode characters in sync - Close #307 Close #309
- [X] Fix parsing username comments - Close #301
- [X] Fix parsing timestamp in superior emacs (api change)
- [X] Update travis-ci scripts to use the new travis infrastructure
- [X] fix broken tests (mock.el unit test library revealed broken tests)
- [X] Fix problem with org-latex-preview when computing checksums - Close #303
- [X] Do not permit empty login when installing access key and token - Close #314
- [X] Upgrade dependencies version
- [X] Pb with labels-tags regarding the grey - Close #310
- [X] Improve documentation about the setup account - #306
- [X] Release notes

# 0.7.5

- [X] #290 - Toggling users assignments to card
Expand Down
2 changes: 1 addition & 1 deletion test/org-trello-controller-test.el
Expand Up @@ -443,7 +443,7 @@
;; file not existing
(should (eq :result-install
(with-mock
(mock (orgtrello-input-read-string "Trello login account (you need to be logged accordingly in trello.com as we cannot check this for you): ") => "user")
(mock (orgtrello-input-read-not-empty "Trello login account (you need to be logged accordingly in trello.com as we cannot check this for you): ") => "user")
(mock (orgtrello-controller-config-file "user") => :some-file)
(mock (file-exists-p :some-file) => nil)
(mock (orgtrello-deferred-eval-computation
Expand Down
22 changes: 18 additions & 4 deletions test/org-trello-data-test.el
Expand Up @@ -627,12 +627,26 @@
(should (equal '("a" "b" "c") (orgtrello-data--from-tags-to-list ":a:b:c:"))))

(ert-deftest test-orgtrello-data--labels-hash-to-tags ()
(should (equal ":red:" (orgtrello-data--labels-hash-to-tags (list (orgtrello-hash-make-properties '((:color . "red")))))))
(should (equal ":red:yellow:" (orgtrello-data--labels-hash-to-tags (list (orgtrello-hash-make-properties '((:color . "red")))
(orgtrello-hash-make-properties '((:color . "yellow"))))))))
(should (equal ":red:" (orgtrello-data--labels-hash-to-tags (list (orgtrello-hash-make-properties '((:color . "red")))))))
(should (equal ":red:yellow:green:blue:pink:orange:purple:sky:black:lime:" (orgtrello-data--labels-hash-to-tags (list (orgtrello-hash-make-properties '((:color . "red")))
(orgtrello-hash-make-properties '((:color . "yellow")))
(orgtrello-hash-make-properties '((:color . "green")))
(orgtrello-hash-make-properties '((:color . "blue")))
(orgtrello-hash-make-properties '((:color . "pink")))
(orgtrello-hash-make-properties '((:color . "orange")))
(orgtrello-hash-make-properties '((:color . "purple")))
(orgtrello-hash-make-properties '((:color . "sky")))
(orgtrello-hash-make-properties '((:color . "black")))
(orgtrello-hash-make-properties '((:color . "lime")))))))

(should (equal ":red:yellow:grey:" (orgtrello-data--labels-hash-to-tags (list (orgtrello-hash-make-properties '((:color . "red")))
(orgtrello-hash-make-properties '((:color . "yellow")))
(orgtrello-hash-make-properties '((:color))))))))

(ert-deftest test-orgtrello-data--labels-to-tags ()
(should (equal nil (orgtrello-data--labels-to-tags nil)))
(should (equal ":a:b:c:" (orgtrello-data--labels-to-tags '("a" "b" "c")))))
(should (equal ":a:b:c:" (orgtrello-data--labels-to-tags '("a" "b" "c"))))
(should (equal ":a:b:c::" (orgtrello-data--labels-to-tags '("a" "b" "c" nil)))))

(ert-deftest test-orgtrello-data-put-entity-name ()
(should (orgtrello-tests-hash-equal (orgtrello-hash-make-properties '((:name . :value)))
Expand Down
17 changes: 8 additions & 9 deletions test/org-trello-input-test.el
Expand Up @@ -6,18 +6,17 @@
(with-mock
(mock (ido-completing-read :prompt :choices nil 'do-match) => :res-with-ido)
(orgtrello-input-read-string-completion :prompt :choices)))))
;; can't work without requiring helm -> not declared as a dependency on org-trello
;; (should (eq :res-with-helm
;; (let ((org-trello-input-completion-mechanism 'other))
;; (with-mock
;; (mock (helm-comp-read :prompt :choices nil 'do-match) => :res-with-helm)
;; (orgtrello-input-read-string-completion :prompt :choices)))))
)
;; cask declares helm as test dependency
(should (eq :res-with-helm
(let ((org-trello-input-completion-mechanism 'other))
(with-mock
(mock (helm-comp-read :prompt :choices) => :res-with-helm)
(orgtrello-input-read-string-completion :prompt :choices))))))

(ert-deftest test-orgtrello-input-read-not-empty ()
(should (equal :something
(should (equal "something"
(with-mock
(mock (read-string "prompt: ") => :something)
(mock (read-string "prompt: ") => " something ")
(orgtrello-input-read-not-empty "prompt: ")))))

(ert-deftest test-orgtrello-input-read-string ()
Expand Down
2 changes: 1 addition & 1 deletion test/org-trello-proxy-test.el
Expand Up @@ -283,7 +283,7 @@
(ert-deftest test-orgtrello-proxy--delete-region ()
(should (equal :delete-region-done
(with-mock
(mock (remove-overlays :start :end) => :remove-overlays-done)
(mock (orgtrello-buffer-remove-overlays :start :end) => :remove-overlays-done)
(mock (delete-region :start :end) => :delete-region-done)
(orgtrello-proxy--delete-region :start :end)))))

Expand Down

0 comments on commit 1ecb8f4

Please sign in to comment.