1
0
Fork 0

Merged with develop

This commit is contained in:
Carlo Sciolla 2017-08-19 19:33:36 +02:00
commit 5a2e8d0dd2
No known key found for this signature in database
GPG key ID: BA5D71E6F3C580C1
8 changed files with 88 additions and 9 deletions

View file

@ -1,12 +1,20 @@
language: emacs-lisp language: emacs-lisp
sudo: false sudo: false
<<<<<<< HEAD
=======
env:
- EVM_EMACS=emacs-25.1-travis
>>>>>>> develop
before_install: before_install:
- curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh
- evm install $EVM_EMACS --use --skip - evm install $EVM_EMACS --use --skip
- cask - cask
<<<<<<< HEAD
env: env:
# - EVM_EMACS=emacs-24.5-travis # - EVM_EMACS=emacs-24.5-travis
- EVM_EMACS=emacs-25.1-travis - EVM_EMACS=emacs-25.1-travis
=======
>>>>>>> develop
script: script:
- emacs --version - emacs --version
- make test - make test

View file

@ -1,5 +1,9 @@
CASK ?= cask CASK ?= cask
EMACS ?= emacs EMACS ?= emacs
<<<<<<< HEAD
=======
CASK_DIR ?= `${CASK} package-directory`
>>>>>>> develop
all: test all: test
@ -15,4 +19,11 @@ unit:
install: install:
${CASK} install ${CASK} install
<<<<<<< HEAD
=======
clean:
rm -Rf .emacs.d
rm -Rf .cask
>>>>>>> develop
.PHONY: all test unit ecukes install .PHONY: all test unit ecukes install

View file

@ -78,7 +78,7 @@ Then you can edit a `plantuml` code block with `plantuml-mode` by hitting `C-'`
```elisp ```elisp
#+BEGIN_SRC plantuml #+BEGIN_SRC plantuml
<hit C-' here to open a plantuml-mode buffer> <hit C-c ' here to open a plantuml-mode buffer>
#+END_SRC #+END_SRC
``` ```

View file

@ -7,7 +7,6 @@
;; Maintainer: Carlo Sciolla (skuro) ;; Maintainer: Carlo Sciolla (skuro)
;; Keywords: uml plantuml ascii ;; Keywords: uml plantuml ascii
;; Version: 1.2.3 ;; Version: 1.2.3
;; Package-Requires: ((emacs "24"))
;; This file is free software; you can redistribute it and/or modify ;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by ;; it under the terms of the GNU General Public License as published by
@ -88,8 +87,9 @@
(defcustom plantuml-java-command "java" (defcustom plantuml-java-command "java"
"The java command used to execute PlantUML.") "The java command used to execute PlantUML.")
(defcustom plantuml-java-args '("-Djava.awt.headless=true" "-jar") (eval-and-compile
"The parameters passed to `plantuml-java-command' when executing PlantUML.") (defcustom plantuml-java-args '("-Djava.awt.headless=true" "-jar")
"The parameters passed to `plantuml-java-command' when executing PlantUML."))
(defcustom plantuml-suppress-deprecation-warning t (defcustom plantuml-suppress-deprecation-warning t
"To silence the deprecation warning when `puml-mode' is found upon loading.") "To silence the deprecation warning when `puml-mode' is found upon loading.")
@ -278,16 +278,17 @@ Uses prefix (as PREFIX) to choose where to display it:
(interactive "p") (interactive "p")
(plantuml-preview-string prefix (buffer-string))) (plantuml-preview-string prefix (buffer-string)))
(defun plantuml-preview-region (prefix) (defun plantuml-preview-region (prefix begin end)
"Preview diagram from the PlantUML sources in the current region. "Preview diagram from the PlantUML sources in from BEGIN to END.
Uses the current region when called interactively.
Uses prefix (as PREFIX) to choose where to display it: Uses prefix (as PREFIX) to choose where to display it:
- 4 (when prefixing the command with C-u) -> new window - 4 (when prefixing the command with C-u) -> new window
- 16 (when prefixing the command with C-u C-u) -> new frame. - 16 (when prefixing the command with C-u C-u) -> new frame.
- else -> new buffer" - else -> new buffer"
(interactive "p") (interactive "p\nr")
(plantuml-preview-string prefix (concat "@startuml\n" (plantuml-preview-string prefix (concat "@startuml\n"
(buffer-substring-no-properties (buffer-substring-no-properties
(region-beginning) (region-end)) begin end)
"\n@enduml"))) "\n@enduml")))
(defun plantuml-preview-current-block (prefix) (defun plantuml-preview-current-block (prefix)
@ -311,7 +312,7 @@ Uses prefix (as PREFIX) to choose where to display it:
- else -> new buffer" - else -> new buffer"
(interactive "p") (interactive "p")
(if mark-active (if mark-active
(plantuml-preview-region prefix) (plantuml-preview-region prefix (region-beginning) (region-end))
(plantuml-preview-buffer prefix))) (plantuml-preview-buffer prefix)))
(defun plantuml-init-once () (defun plantuml-init-once ()

View file

@ -12,6 +12,27 @@
(should (equal (expand-file-name "~/plantuml.jar") (should (equal (expand-file-name "~/plantuml.jar")
plantuml-jar-path))) plantuml-jar-path)))
<<<<<<< HEAD
=======
(ert-deftest can-unload-plantuml ()
(unload-feature 'plantuml-mode t)
(should (eq nil (boundp 'plantuml-jar-path)))
(load-plantuml-mode)
(should (not (eq nil (boundp 'plantuml-jar-path)))))
(ert-deftest debug-install-issues ()
(unload-feature 'plantuml-mode t)
(condition-case nil
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.milkbox.net/packages/"))
(package-install "plantuml-mode")
(unload-feature 'plantuml-mode t))
(load-plantuml-mode))
>>>>>>> develop
(provide 'plantuml-mode-test) (provide 'plantuml-mode-test)
;;; plantuml-mode-test.el ends here ;;; plantuml-mode-test.el ends here

View file

@ -23,6 +23,10 @@
(ert-deftest preview-unicode-test () (ert-deftest preview-unicode-test ()
(setq-local plantuml-jar-path plantuml-test-jar-path) (setq-local plantuml-jar-path plantuml-test-jar-path)
<<<<<<< HEAD
=======
(setq-local plantuml-output-type "utxt")
>>>>>>> develop
(assert-preview "unicode.puml" "unicode.txt")) (assert-preview "unicode.puml" "unicode.txt"))
(provide 'plantuml-mode-preview-test) (provide 'plantuml-mode-preview-test)

27
test/resources/init.el Normal file
View file

@ -0,0 +1,27 @@
;; Used to test `plantuml-mode' installations
(setq user-emacs-directory "./.emacs.d")
(require 'subr-x)
(setq local-repository
(concat
(string-trim (shell-command-to-string "cask package-directory"))
"/../testing"))
(custom-set-variables `(package-archive-upload-base ,local-repository))
(require 'package-x)
(defun -package-upload (file)
(with-temp-buffer
(insert-file-contents file)
(let ((pkg-desc (package-buffer-info)))
(package-upload-buffer-internal pkg-desc "el"))))
(-package-upload "plantuml-mode.el")
(setq package-archives `(("local" . ,local-repository)))
(package-initialize)
(package-install 'plantuml-mode)
(require 'plantuml-mode)
(message
(concat "Successfully installed plantuml-mode v" plantuml-mode-version))

View file

@ -32,6 +32,13 @@
(defun read-test-file (path) (defun read-test-file (path)
(f-read (f-join plantuml-test-resources-path path) 'utf-8)) (f-read (f-join plantuml-test-resources-path path) 'utf-8))
<<<<<<< HEAD
(require 'plantuml-mode (f-expand "plantuml-mode.el" package-code-path)) (require 'plantuml-mode (f-expand "plantuml-mode.el" package-code-path))
=======
(defun load-plantuml-mode ()
(require 'plantuml-mode (f-expand "plantuml-mode.el" package-code-path)))
(load-plantuml-mode)
>>>>>>> develop
;;; test-helper.el ends here ;;; test-helper.el ends here