diff --git a/.gitignore b/.gitignore index fc29f92f..ecbae1b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ tmp -.carton +.cask *.elc *-pkg.el diff --git a/.travis.yml b/.travis.yml index 898c6872..aa8941e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ matrix: - env: EMACS=emacs23 script: - make ecukes - - curl -fsSkL https://raw.github.com/rejeep/carton/master/go | sh + - curl -fsSkL https://raw.github.com/rejeep/cask/master/go | sh after_failure: - cat tmp/server.log after_script: diff --git a/Carton b/Cask similarity index 86% rename from Carton rename to Cask index dea59ceb..df37c2d7 100644 --- a/Carton +++ b/Cask @@ -1,6 +1,6 @@ (source melpa) -(package-file "carton.el") +(package-file "cask.el") (development (depends-on "f") diff --git a/Makefile b/Makefile index 77e18fda..90f3554c 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,20 @@ # Use ?= to respect environment variable (if set): EMACS ?= emacs TAGS ?= -CARTON ?= ${PWD}/bin/carton +CASK ?= ${PWD}/bin/cask ECUKES = $(shell find ${PKG_DIR}/ecukes-*/ecukes | tail -1) ECUKES_ARGS = --script features ${TAGS} -SERVER = ${CARTON} exec ${EMACS} --load server/app.el -Q +SERVER = ${CASK} exec ${EMACS} --load server/app.el -Q -PKG_DIR := $(shell ${CARTON} package-directory) +PKG_DIR := $(shell ${CASK} package-directory) export EMACS -export CARTON +export CASK all: ecukes ecukes: elpa - ${CARTON} exec ${ECUKES} ${ECUKES_ARGS} + ${CASK} exec ${ECUKES} ${ECUKES_ARGS} start-server: elpa tmp ${SERVER} --batch > tmp/server.log 2>&1 & @@ -26,10 +26,10 @@ server: elpa ${SERVER} -nw elpa: ${PKG_DIR} -${PKG_DIR}: Carton - ${CARTON} install +${PKG_DIR}: Cask + ${CASK} install touch $@ -# NOTE: `touch` is called here since `carton install` does not update +# NOTE: `touch` is called here since `cask install` does not update # timestamp of ${PKG_DIR} directory. tmp: diff --git a/README.md b/README.md index 06148e13..26fdc3d8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Carton [![Build Status](https://api.travis-ci.org/rejeep/carton.png?branch=master)](http://travis-ci.org/rejeep/carton) +# Cask [![Build Status](https://api.travis-ci.org/rejeep/cask.png?branch=master)](http://travis-ci.org/rejeep/cask) -![Carton](https://raw.github.com/rejeep/carton/master/carton.png) +![Cask](https://raw.github.com/rejeep/cask/master/cask.png) -Carton for Emacs is what Bundler is to Ruby. It aims to make ELPA +Cask for Emacs is what Bundler is to Ruby. It aims to make ELPA dependency management in Emacs painless (as painless as it can be). This includes both your local Emacs installation and Emacs package development. @@ -11,71 +11,71 @@ package development. ## Installation -To automatically install Carton, run this command: +To automatically install Cask, run this command: - curl -fsSkL https://raw.github.com/rejeep/carton/master/go | sh + curl -fsSkL https://raw.github.com/rejeep/cask/master/go | sh You can also clone the repository. - $ git clone https://github.com/rejeep/carton.git + $ git clone https://github.com/rejeep/cask.git -Don't forget to add Carton's bin to your `PATH`. +Don't forget to add Cask's bin to your `PATH`. - $ export PATH="/path/to/code/carton/bin:$PATH" + $ export PATH="/path/to/code/cask/bin:$PATH" ## Usage -Create a file called `Carton` in your project root and specify +Create a file called `Cask` in your project root and specify dependencies: - $ carton init [--dev] + $ cask init [--dev] _(Use `--dev` if the project is for package development)_ To install all dependencies, run: - $ carton [install] + $ cask [install] -This will create a directory called `.carton`, containing all dependencies. +This will create a directory called `.cask`, containing all dependencies. To update package version, run: - $ carton update + $ cask update To list all dependencies, run: - $ carton list + $ cask list ### Emacs configuration Add this to your `.emacs` file. - (require 'carton "~/.carton/carton.el") - (carton-initialize) + (require 'cask "~/.cask/cask.el") + (cask-initialize) #### Tips -To automatically keep the `Carton` file up to date with what you +To automatically keep the `Cask` file up to date with what you install from ELPA, check out . ### Package development To create a `-pkg.el` file, run: - $ carton package + $ cask package To run some Emacs Lisp code with ELPA load paths all set up for you, use: - $ carton exec [COMMAND] + $ cask exec [COMMAND] Example: - $ carton exec make test + $ cask exec make test To print info about the current project: - $ carton info + $ cask info ## DSL @@ -123,7 +123,7 @@ Example: Define this package and its runtime dependencies from the package headers of a file (used only for package development). The name of the file is relative to -the directory containing the `Carton` file. +the directory containing the `Cask` file. (package-file FILENAME) @@ -169,11 +169,11 @@ Example: To install ZSH completion add the following to your `~/.zshrc`: - source /path/to/code/carton/etc/carton_completion.zsh + source /path/to/code/cask/etc/cask_completion.zsh ## I still don't get it, give me some real examples -These are some projects using Carton: +These are some projects using Cask: * [rejeep/emacs](https://github.com/rejeep/emacs) * [drag-stuff](https://github.com/rejeep/drag-stuff) diff --git a/bin/carton b/bin/carton index de220fc5..363240bd 100755 --- a/bin/carton +++ b/bin/carton @@ -1,7 +1,5 @@ #!/usr/bin/env bash -if [[ "$1" == "exec" ]]; then - EMACSLOADPATH="$($0 load-path)" PATH="$($0 path)" exec "${@:2}" -else - exec "${EMACS:-emacs}" --script "$(dirname $(dirname $0))/carton-cli.el" -- "$@" -fi +echo "[DEPRECATION WARNING] The binary carton is deprecated in favour of cask" + +"$(dirname $0)/cask" "$@" diff --git a/bin/cask b/bin/cask new file mode 100755 index 00000000..0b7fa453 --- /dev/null +++ b/bin/cask @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if [[ "$1" == "exec" ]]; then + EMACSLOADPATH="$($0 load-path)" PATH="$($0 path)" exec "${@:2}" +else + exec "${EMACS:-emacs}" --script "$(dirname $(dirname $0))/cask-cli.el" -- "$@" +fi diff --git a/carton-cli.el b/carton-cli.el deleted file mode 100644 index 1fae5fe8..00000000 --- a/carton-cli.el +++ /dev/null @@ -1,142 +0,0 @@ -;;; carton-cli.el --- Cli interface to Carton - -;; Avoid "Loading vc-git..." messages -(remove-hook 'find-file-hooks 'vc-find-file-hook) - - -(eval-and-compile - (defconst carton-cli-directory - (file-name-directory - (cond - (load-in-progress load-file-name) - ((and (boundp 'byte-compile-current-file) byte-compile-current-file) - byte-compile-current-file) - (:else (buffer-file-name)))) - "Path to Carton root.")) - -(require 'carton (expand-file-name "carton" carton-cli-directory)) - -;; Bootstrap the dependencies of the CLI wrapper -(defconst carton-bootstrap-dir - (carton-resource-path (format ".carton/%s/bootstrap" emacs-version)) - "Path to Carton ELPA dir.") - -(defconst carton-bootstrap-packages '(commander) - "List of bootstrap packages required by this file.") - -(unwind-protect - (progn - (epl-change-package-dir carton-bootstrap-dir) - (epl-initialize) - (condition-case nil - (mapc 'require carton-bootstrap-packages) - (error - (epl-add-archive "melpa" "http://melpa.milkbox.net/packages/") - (epl-refresh) - (mapc 'epl-package-install carton-bootstrap-packages) - (mapc 'require carton-bootstrap-packages)))) - (epl-reset)) - -(defvar carton-cli--dev-mode nil - "If Carton should run in dev mode or not.") - -(defun carton-cli--setup () - (carton-setup default-directory)) - -(defun carton-cli--print-dependency (dependency) - (let ((name (carton-dependency-name dependency)) - (version (carton-dependency-version dependency))) - (princ - (if version - (format " - %s (%s)" name version) - (format " - %s" name))) - (princ "\n"))) - -(defun carton-cli/package () - (carton-cli--setup) - (with-temp-file carton-package-file - (insert (carton-package)))) - -(defun carton-cli/install () - (carton-cli--setup) - (carton-install)) - -(defun carton-cli/update () - (carton-cli--setup) - (let ((upgrades (carton-update))) - (when upgrades - (princ "Updated packages:\n") - (dolist (upgrade upgrades) - (princ - (format - "%s %s -> %s\n" - (epl-package-name (epl-upgrade-installed upgrade)) - (epl-package-version-string (epl-upgrade-installed upgrade)) - (epl-package-version-string (epl-upgrade-available upgrade)))))))) - -(defun carton-cli/init () - (carton-init default-directory carton-cli--dev-mode)) - -(defun carton-cli/list () - (carton-cli--setup) - (princ "### Dependencies ###\n\n") - (princ (format "Runtime [%s]:\n" (length carton-runtime-dependencies))) - (mapc 'carton-cli--print-dependency carton-runtime-dependencies) - (if (> (length carton-runtime-dependencies) 0) - (princ "\n")) - (princ (format "Development [%s]:\n" (length carton-development-dependencies))) - (mapc 'carton-cli--print-dependency carton-development-dependencies)) - -(defun carton-cli/version () - (carton-cli--setup) - (princ (carton-version))) - -(defun carton-cli/info () - (carton-cli--setup) - (let* ((info (carton-info)) - (name (carton-package-name info)) - (version (carton-package-version info)) - (description (carton-package-description info))) - (princ (format "### %s (%s) ###" name version)) - (princ "\n\n") - (princ description) - (princ "\n"))) - -(defun carton-cli/help () - (commander-print-usage) - (kill-emacs 0)) - -(defun carton-cli/load-path () - (princ (carton-load-path))) - -(defun carton-cli/path () - (princ (carton-path))) - -(defun carton-cli/package-directory () - (princ (carton-elpa-dir))) - -(defun carton-cli/dev () - (setq carton-cli--dev-mode t)) - -(defun carton-cli/debug () - (setq debug-on-error t) - (setq debug-on-entry t)) - -(commander - (name "carton") - (command "package" "Create -pkg.el file" 'carton-cli/package) - (command "install" "Install dependencies" 'carton-cli/install) - (command "update" "Update dependencies" 'carton-cli/update) - (command "exec [*]" "Execute command with correct dependencies" 'ignore) - (command "init" "Create basic Carton file" 'carton-cli/init) - (command "version" "Show the package version" 'carton-cli/version) - (command "list" "List dependencies" 'carton-cli/list) - (command "info" "Show info about this project" 'carton-cli/info) - (command "help" "Display this help message" 'carton-cli/help) - (command "load-path" "Print Emacs load-path (including package dependencies)" 'carton-cli/load-path) - (command "path" "Print Emacs exec-path (including package bin path)" 'carton-cli/path) - (command "package-directory" "Print package installation directory" 'carton-cli/package-directory) - (option "-h, --help" "Display this help message" 'carton-cli/help) - (option "--dev" "Run in dev mode" 'carton-cli/dev) - (option "--debug" "Turn on debug output" 'carton-cli/debug) - (default "install")) diff --git a/cask-cli.el b/cask-cli.el new file mode 100644 index 00000000..aba1dba8 --- /dev/null +++ b/cask-cli.el @@ -0,0 +1,142 @@ +;;; cask-cli.el --- Cli interface to Cask + +;; Avoid "Loading vc-git..." messages +(remove-hook 'find-file-hooks 'vc-find-file-hook) + + +(eval-and-compile + (defconst cask-cli-directory + (file-name-directory + (cond + (load-in-progress load-file-name) + ((and (boundp 'byte-compile-current-file) byte-compile-current-file) + byte-compile-current-file) + (:else (buffer-file-name)))) + "Path to Cask root.")) + +(require 'cask (expand-file-name "cask" cask-cli-directory)) + +;; Bootstrap the dependencies of the CLI wrapper +(defconst cask-bootstrap-dir + (cask-resource-path (format ".cask/%s/bootstrap" emacs-version)) + "Path to Cask ELPA dir.") + +(defconst cask-bootstrap-packages '(commander) + "List of bootstrap packages required by this file.") + +(unwind-protect + (progn + (epl-change-package-dir cask-bootstrap-dir) + (epl-initialize) + (condition-case nil + (mapc 'require cask-bootstrap-packages) + (error + (epl-add-archive "melpa" "http://melpa.milkbox.net/packages/") + (epl-refresh) + (mapc 'epl-package-install cask-bootstrap-packages) + (mapc 'require cask-bootstrap-packages)))) + (epl-reset)) + +(defvar cask-cli--dev-mode nil + "If Cask should run in dev mode or not.") + +(defun cask-cli--setup () + (cask-setup default-directory)) + +(defun cask-cli--print-dependency (dependency) + (let ((name (cask-dependency-name dependency)) + (version (cask-dependency-version dependency))) + (princ + (if version + (format " - %s (%s)" name version) + (format " - %s" name))) + (princ "\n"))) + +(defun cask-cli/package () + (cask-cli--setup) + (with-temp-file cask-package-file + (insert (cask-package)))) + +(defun cask-cli/install () + (cask-cli--setup) + (cask-install)) + +(defun cask-cli/update () + (cask-cli--setup) + (let ((upgrades (cask-update))) + (when upgrades + (princ "Updated packages:\n") + (dolist (upgrade upgrades) + (princ + (format + "%s %s -> %s\n" + (epl-package-name (epl-upgrade-installed upgrade)) + (epl-package-version-string (epl-upgrade-installed upgrade)) + (epl-package-version-string (epl-upgrade-available upgrade)))))))) + +(defun cask-cli/init () + (cask-init default-directory cask-cli--dev-mode)) + +(defun cask-cli/list () + (cask-cli--setup) + (princ "### Dependencies ###\n\n") + (princ (format "Runtime [%s]:\n" (length cask-runtime-dependencies))) + (mapc 'cask-cli--print-dependency cask-runtime-dependencies) + (if (> (length cask-runtime-dependencies) 0) + (princ "\n")) + (princ (format "Development [%s]:\n" (length cask-development-dependencies))) + (mapc 'cask-cli--print-dependency cask-development-dependencies)) + +(defun cask-cli/version () + (cask-cli--setup) + (princ (cask-version))) + +(defun cask-cli/info () + (cask-cli--setup) + (let* ((info (cask-info)) + (name (cask-package-name info)) + (version (cask-package-version info)) + (description (cask-package-description info))) + (princ (format "### %s (%s) ###" name version)) + (princ "\n\n") + (princ description) + (princ "\n"))) + +(defun cask-cli/help () + (commander-print-usage) + (kill-emacs 0)) + +(defun cask-cli/load-path () + (princ (cask-load-path))) + +(defun cask-cli/path () + (princ (cask-path))) + +(defun cask-cli/package-directory () + (princ (cask-elpa-dir))) + +(defun cask-cli/dev () + (setq cask-cli--dev-mode t)) + +(defun cask-cli/debug () + (setq debug-on-error t) + (setq debug-on-entry t)) + +(commander + (name "cask") + (command "package" "Create -pkg.el file" 'cask-cli/package) + (command "install" "Install dependencies" 'cask-cli/install) + (command "update" "Update dependencies" 'cask-cli/update) + (command "exec [*]" "Execute command with correct dependencies" 'ignore) + (command "init" "Create basic Cask file" 'cask-cli/init) + (command "version" "Show the package version" 'cask-cli/version) + (command "list" "List dependencies" 'cask-cli/list) + (command "info" "Show info about this project" 'cask-cli/info) + (command "help" "Display this help message" 'cask-cli/help) + (command "load-path" "Print Emacs load-path (including package dependencies)" 'cask-cli/load-path) + (command "path" "Print Emacs exec-path (including package bin path)" 'cask-cli/path) + (command "package-directory" "Print package installation directory" 'cask-cli/package-directory) + (option "-h, --help" "Display this help message" 'cask-cli/help) + (option "--dev" "Run in dev mode" 'cask-cli/dev) + (option "--debug" "Turn on debug output" 'cask-cli/debug) + (default "install")) diff --git a/carton.el b/cask.el similarity index 55% rename from carton.el rename to cask.el index f106837c..2b264428 100644 --- a/carton.el +++ b/cask.el @@ -1,4 +1,4 @@ -;;; carton.el --- Emacs dependency management made easy +;;; cask.el --- Emacs dependency management made easy ;; Copyright (C) 2012, 2013 Johan Andersson ;; Copyright (C) 2013 Sebastian Wiesner @@ -8,7 +8,7 @@ ;; Maintainer: Johan Andersson ;; Version: 0.3.1 ;; Keywords: speed, convenience -;; URL: http://github.com/rejeep/carton +;; URL: http://github.com/rejeep/cask.el ;; This file is NOT part of GNU Emacs. @@ -37,7 +37,7 @@ (require 'cl)) (eval-and-compile - (defconst carton-directory + (defconst cask-directory ;; Fall back to buffer file name to handle M-x eval-buffer (file-name-directory (cond @@ -45,81 +45,81 @@ ((and (boundp 'byte-compile-current-file) byte-compile-current-file) byte-compile-current-file) (:else (buffer-file-name)))) - "The directory to which Carton is installed.") + "The directory to which Cask is installed.") - (defun carton-resource-path (name) - "Get the path of a Carton resource with NAME." - (expand-file-name name carton-directory))) + (defun cask-resource-path (name) + "Get the path of a Cask resource with NAME." + (expand-file-name name cask-directory))) -(require 'epl (carton-resource-path "epl")) +(require 'epl (cask-resource-path "epl")) -(defstruct carton-package name version description) -(defstruct carton-dependency name version) -(defstruct carton-source name url) +(defstruct cask-package name version description) +(defstruct cask-dependency name version) +(defstruct cask-source name url) -(defvar carton-project-path nil +(defvar cask-project-path nil "Path to project.") -(defvar carton-project-name nil +(defvar cask-project-name nil "Name of project.") -(defvar carton-file nil - "Path to `Carton` file.") +(defvar cask-file nil + "Path to `Cask` file.") -(defvar carton-package-file nil +(defvar cask-package-file nil "Path to project package (`-pkg.el`) file.") -(defvar carton-development-dependencies nil +(defvar cask-development-dependencies nil "List of development dependencies.") -(defvar carton-runtime-dependencies nil +(defvar cask-runtime-dependencies nil "List of runtime dependencies.") -(defvar carton-package nil +(defvar cask-package nil "Project package information.") -(defvar carton-source-mapping +(defvar cask-source-mapping '((gnu . "http://elpa.gnu.org/packages/") (melpa . "http://melpa.milkbox.net/packages/") (marmalade . "http://marmalade-repo.org/packages/") (SC . "http://joseito.republika.pl/sunrise-commander/") (org . "http://orgmode.org/elpa/") - (carton-test . "http://127.0.0.1:9191/packages/")) + (cask-test . "http://127.0.0.1:9191/packages/")) "Mapping of source name and url.") -(defun carton-read (filename) - "Read a carton file from FILENAME. +(defun cask-read (filename) + "Read a cask file from FILENAME. -Return all directives in the Carton file as list." +Return all directives in the Cask file as list." (with-temp-buffer (insert-file-contents-literally filename) (read (format "(%s)" (buffer-string))))) -(defun carton-get-dep-list-for-scope (scope) +(defun cask-get-dep-list-for-scope (scope) "Get the dependency list symbol for SCOPE." (if (eq scope :development) - 'carton-development-dependencies - 'carton-runtime-dependencies)) + 'cask-development-dependencies + 'cask-runtime-dependencies)) -(defun carton-add-dependency (name &optional version scope) +(defun cask-add-dependency (name &optional version scope) "Add the dependency NAME with VERSION in SCOPE." (let* ((name (if (stringp name) (intern name) name)) - (dependency (make-carton-dependency :name name :version version)) - (dep-list (carton-get-dep-list-for-scope scope))) + (dependency (make-cask-dependency :name name :version version)) + (dep-list (cask-get-dep-list-for-scope scope))) (add-to-list dep-list dependency t))) -(defun carton-parse-epl-package (package) +(defun cask-parse-epl-package (package) "Parse an EPL PACKAGE." - (setq carton-package - (make-carton-package :name (epl-package-name package) + (setq cask-package + (make-cask-package :name (epl-package-name package) :version (epl-package-version-string package) :description (epl-package-summary package))) (dolist (req (epl-package-requirements package)) - (carton-add-dependency (epl-requirement-name req) + (cask-add-dependency (epl-requirement-name req) (epl-requirement-version-string req)))) -(defun carton-eval (forms &optional scope) - "Evaluate carton FORMS in SCOPE. +(defun cask-eval (forms &optional scope) + "Evaluate cask FORMS in SCOPE. SCOPE may be nil or :development." (dolist (form forms) @@ -127,7 +127,7 @@ SCOPE may be nil or :development." (source (destructuring-bind (_ name-or-alias &optional url) form (unless url - (let ((mapping (assq name-or-alias carton-source-mapping))) + (let ((mapping (assq name-or-alias cask-source-mapping))) (unless mapping (error "Unknown package archive: %s" name-or-alias)) (setq name-or-alias (symbol-name (car mapping))) @@ -135,55 +135,55 @@ SCOPE may be nil or :development." (epl-add-archive name-or-alias url))) (package (destructuring-bind (_ name version description) form - (setq carton-package (make-carton-package :name name + (setq cask-package (make-cask-package :name name :version version :description description)))) (package-file (destructuring-bind (_ filename) form - (carton-parse-epl-package + (cask-parse-epl-package (epl-package-from-file - (expand-file-name filename carton-project-path))))) + (expand-file-name filename cask-project-path))))) (depends-on (destructuring-bind (_ name &optional version) form - (carton-add-dependency name version scope))) + (cask-add-dependency name version scope))) (development (destructuring-bind (_ . body) form - (carton-eval body :development))) + (cask-eval body :development))) (t (error "Unknown directive: %S" form))))) -(defun carton-elpa-dir () - "Return full path to `carton-project-path'/.carton/elpa/`emacs-version'." - (expand-file-name (format ".carton/%s/elpa" emacs-version) - carton-project-path)) - -(defun carton-setup (project-path) - "Setup carton for project at PROJECT-PATH." - (setq carton-project-path (directory-file-name project-path)) - (setq carton-project-name (file-name-nondirectory carton-project-path)) - (setq carton-file (expand-file-name "Carton" carton-project-path)) - (setq carton-package-file (expand-file-name (concat carton-project-name "-pkg.el") carton-project-path)) +(defun cask-elpa-dir () + "Return full path to `cask-project-path'/.cask/elpa/`emacs-version'." + (expand-file-name (format ".cask/%s/elpa" emacs-version) + cask-project-path)) + +(defun cask-setup (project-path) + "Setup cask for project at PROJECT-PATH." + (setq cask-project-path (directory-file-name project-path)) + (setq cask-project-name (file-name-nondirectory cask-project-path)) + (setq cask-file (expand-file-name "Cask" cask-project-path)) + (setq cask-package-file (expand-file-name (concat cask-project-name "-pkg.el") cask-project-path)) (when (equal (epl-package-dir) (epl-default-package-dir)) - (epl-change-package-dir (carton-elpa-dir))) - (unless (file-exists-p carton-file) - (error "Could not locate `Carton` file")) - (carton-eval (carton-read carton-file))) + (epl-change-package-dir (cask-elpa-dir))) + (unless (file-exists-p cask-file) + (error "Could not locate `Cask` file")) + (cask-eval (cask-read cask-file))) -(defun carton-initialize () +(defun cask-initialize () "Initialize packages under \"~/.emacs.d/\". Setup `package-user-dir' appropriately and then call `package-initialize'." - (carton-setup user-emacs-directory) + (cask-setup user-emacs-directory) (epl-initialize)) -(defun carton--template-get (name) +(defun cask--template-get (name) "Return content of template with NAME." - (let* ((templates-dir (carton-resource-path "templates")) + (let* ((templates-dir (cask-resource-path "templates")) (template-file (expand-file-name name templates-dir))) (with-temp-buffer (insert-file-contents-literally template-file) (buffer-string)))) -(defun carton-update () +(defun cask-update () "Update dependencies. Return a list of updated packages." @@ -191,83 +191,83 @@ Return a list of updated packages." (epl-initialize) (epl-upgrade)) -(defun carton-install () +(defun cask-install () "Install dependencies." - (let ((carton-dependencies (append carton-development-dependencies carton-runtime-dependencies))) - (when carton-dependencies + (let ((cask-dependencies (append cask-development-dependencies cask-runtime-dependencies))) + (when cask-dependencies (epl-refresh) (epl-initialize) - (dolist (dependency carton-dependencies) - (epl-package-install (carton-dependency-name dependency)))))) + (dolist (dependency cask-dependencies) + (epl-package-install (cask-dependency-name dependency)))))) -(defun carton-init (path &optional dev-mode) +(defun cask-init (path &optional dev-mode) "Create new project at PATH with optional DEV-MODE." (let ((init-content - (carton--template-get + (cask--template-get (if dev-mode "init-dev.tpl" "init.tpl"))) - (carton-file-path (expand-file-name "Carton" path))) - (if (file-exists-p carton-file-path) - (error "Carton file already exists.") + (cask-file-path (expand-file-name "Cask" path))) + (if (file-exists-p cask-file-path) + (error "Cask file already exists.") (with-temp-buffer (insert init-content) - (write-file carton-file-path))))) + (write-file cask-file-path))))) -(defun carton-info () +(defun cask-info () "Return info about this project." (or - carton-package + cask-package (error "Missing `package` or `package-file` directive"))) -(defun carton-version () +(defun cask-version () "Return the version of this project." - (if carton-package - (carton-package-version carton-package) + (if cask-package + (cask-package-version cask-package) (error "Missing `package` or `package-file` directive"))) -(defun carton-package () +(defun cask-package () "Package this project." - (if carton-package - (carton-define-package-string) + (if cask-package + (cask-define-package-string) (error "Missing `package` or `package-file` directive"))) -(defun carton-load-path () +(defun cask-load-path () "Return Emacs load-path (including package dependencies)." (mapconcat 'identity (append - (file-expand-wildcards (concat (carton-elpa-dir) "/*") t) + (file-expand-wildcards (concat (cask-elpa-dir) "/*") t) load-path) path-separator)) -(defun carton-path () +(defun cask-path () "Return Emacs exec-path (including package dependencies)." (mapconcat 'identity (append - (file-expand-wildcards (concat (carton-elpa-dir) "/*/bin") t) + (file-expand-wildcards (concat (cask-elpa-dir) "/*/bin") t) exec-path) path-separator)) -(defun carton-define-package-string () +(defun cask-define-package-string () "Return `define-package' string." (format "(define-package \"%s\" \"%s\"\n \"%s\"%s)\n" - (carton-package-name carton-package) - (carton-package-version carton-package) - (carton-package-description carton-package) - (let ((dependency-string (carton-dependency-string))) + (cask-package-name cask-package) + (cask-package-version cask-package) + (cask-package-description cask-package) + (let ((dependency-string (cask-dependency-string))) (if (equal dependency-string "") "" (format "\n '(%s)" dependency-string))))) -(defun carton-dependency-string () +(defun cask-dependency-string () "Return dependencies as string." (mapconcat (lambda (package) - (let ((name (carton-dependency-name package)) - (version (carton-dependency-version package))) + (let ((name (cask-dependency-name package)) + (version (cask-dependency-version package))) (format "(%s \"%s\")" name (or version "")))) - carton-runtime-dependencies " ")) + cask-runtime-dependencies " ")) -(provide 'carton) +(provide 'cask) -;;; carton.el ends here +;;; cask.el ends here diff --git a/carton.png b/cask.png similarity index 100% rename from carton.png rename to cask.png diff --git a/epl-legacy.el b/epl-legacy.el index 771fa172..4997059b 100644 --- a/epl-legacy.el +++ b/epl-legacy.el @@ -5,7 +5,7 @@ ;; Author: Sebastian Wiesner ;; Maintainer: Johan Andersson ;; Keywords: convenience -;; URL: http://github.com/rejeep/carton +;; URL: http://github.com/rejeep/cask.el ;; This file is NOT part of GNU Emacs. @@ -195,7 +195,7 @@ already installed." "Delete a PACKAGE. PACKAGE is a package object to delete." - ;; Never trash packages deleted by Carton + ;; Never trash packages deleted by Cask (let ((delete-by-moving-to-trash nil)) (package-delete (symbol-name (epl-package-name package)) (epl-package-version-string package)))) diff --git a/epl-package-desc.el b/epl-package-desc.el index e80f28a1..0956f004 100644 --- a/epl-package-desc.el +++ b/epl-package-desc.el @@ -5,7 +5,7 @@ ;; Author: Sebastian Wiesner ;; Maintainer: Johan Andersson ;; Keywords: convenience -;; URL: http://github.com/rejeep/carton +;; URL: http://github.com/rejeep/cask.el ;; This file is NOT part of GNU Emacs. diff --git a/epl.el b/epl.el index 5c856344..dad13e77 100644 --- a/epl.el +++ b/epl.el @@ -5,7 +5,7 @@ ;; Author: Sebastian Wiesner ;; Maintainer: Johan Andersson ;; Keywords: convenience -;; URL: http://github.com/rejeep/carton +;; URL: http://github.com/rejeep/cask.el ;; This file is NOT part of GNU Emacs. diff --git a/etc/carton_completion.zsh b/etc/cask_completion.zsh similarity index 83% rename from etc/carton_completion.zsh rename to etc/cask_completion.zsh index c9ac5d15..507a5e69 100644 --- a/etc/carton_completion.zsh +++ b/etc/cask_completion.zsh @@ -1,4 +1,4 @@ -function _carton_commands() { +function _cask_commands() { local ret=1 state _arguments \ ':subcommand:->subcommand' \ @@ -13,13 +13,13 @@ function _carton_commands() { "info:Show info about this project" "list:List dependencies" "version:Show the package version" - "init:Create basic Carton file" + "init:Create basic Cask file" "exec:Execute command with correct dependencies" "update:Update dependencies" "install:Install dependencies" "package:Create -pkg.el file" ) - _describe -t subcommands 'carton subcommands' subcommands && ret=0 + _describe -t subcommands 'cask subcommands' subcommands && ret=0 esac case "$words[1]" in @@ -34,4 +34,4 @@ function _carton_commands() { return ret } -compdef _carton_commands carton +compdef _cask_commands cask diff --git a/features/alias.feature b/features/alias.feature index 1f93e7fe..58a6fbf2 100644 --- a/features/alias.feature +++ b/features/alias.feature @@ -1,56 +1,56 @@ Feature: Source Alias In order to type less - As a Carton user + As a Cask user I want source alias Background: Given I create a project called "alias" And I go to the project called "alias" - Scenario: Carton test - Given this Carton file: + Scenario: Cask test + Given this Cask file: """ - (source carton-test) + (source cask-test) (depends-on "foo" "0.0.1") """ - When I run carton "install" + When I run cask "install" Then there should exist a package directory called "foo-0.0.1" Scenario: Invalid alias (quote) - Given this Carton file: + Given this Cask file: """ - (source 'carton-test) + (source 'cask-test) (depends-on "foo" "0.0.1") """ - When I run carton "install" + When I run cask "install" Then I should see command error: """ - Unknown package archive: (quote carton-test) + Unknown package archive: (quote cask-test) """ Scenario: Invalid alias (string) - Given this Carton file: + Given this Cask file: """ - (source "carton-test") + (source "cask-test") (depends-on "foo" "0.0.1") """ - When I run carton "install" + When I run cask "install" Then I should see command error: """ - Unknown package archive: carton-test + Unknown package archive: cask-test """ Scenario: Non existing alias - Given this Carton file: + Given this Cask file: """ (source invalid) (depends-on "foo" "0.0.1") """ - When I run carton "install" + When I run cask "install" Then I should see command error: """ Unknown package archive: invalid diff --git a/features/exec.feature b/features/exec.feature index 8fe978e6..94f95911 100644 --- a/features/exec.feature +++ b/features/exec.feature @@ -1,52 +1,52 @@ Feature: Exec In order to run with correct dependencies - As a Carton user + As a Cask user I want to setup the correct load path Background: Given I create a project called "exec" And I go to the project called "exec" - Scenario: No Carton file - When I run carton "exec echo foo" + Scenario: No Cask file + When I run cask "exec echo foo" Then I should see command output: """ foo """ Scenario: No dependencies - Given this Carton file: + Given this Cask file: """ """ - When I run carton "exec echo foo" + When I run cask "exec echo foo" Then I should see command output: """ foo """ Scenario: With dependency - Given this Carton file: + Given this Cask file: """ (source "localhost" "http://127.0.0.1:9191/packages/") (depends-on "baz" "0.0.3") """ - When I run carton "install" - When I run carton "exec {{EMACS}} --script .carton/{{EMACS-VERSION}}/elpa/baz-0.0.3/baz.el -Q --funcall hello" + When I run cask "install" + When I run cask "exec {{EMACS}} --script .cask/{{EMACS-VERSION}}/elpa/baz-0.0.3/baz.el -Q --funcall hello" Then I should see command output: """ Hello from QUX, which is a BAZ dependency """ Scenario: Binary in local package - Given this Carton file: + Given this Cask file: """ (source "localhost" "http://127.0.0.1:9191/packages/") (depends-on "hey" "0.0.5") """ - When I run carton "install" - When I run carton "exec hey" + When I run cask "install" + When I run cask "exec hey" Then I should see command output: """ Hello from HEY diff --git a/features/help.feature b/features/help.feature index 9ebdc18a..be9fc57e 100644 --- a/features/help.feature +++ b/features/help.feature @@ -1,14 +1,14 @@ Feature: Help In order to quickly get help - As a Carton user + As a Cask user I want to get usage infomartion Background: Given I create a project called "help" And I go to the project called "help" - Scenario Outline: No Carton file - When I run carton "" + Scenario Outline: No Cask file + When I run cask "" Then I should see usage information Examples: @@ -17,11 +17,11 @@ Feature: Help | -h | | --help | - Scenario Outline: With Carton file - Given this Carton file: + Scenario Outline: With Cask file + Given this Cask file: """ """ - When I run carton "" + When I run cask "" Then I should see usage information Examples: diff --git a/features/info.feature b/features/info.feature index e81ecfa3..a6771d58 100644 --- a/features/info.feature +++ b/features/info.feature @@ -1,35 +1,35 @@ Feature: List In order to quickly get an overview of the current project - As a Carton user + As a Cask user I want all the details Background: Given I create a project called "info" And I go to the project called "info" - Scenario: No Carton file - When I run carton "info" + Scenario: No Cask file + When I run cask "info" Then I should see command error: """ - Could not locate `Carton` file + Could not locate `Cask` file """ - Scenario: Empty Carton file - Given this Carton file: + Scenario: Empty Cask file + Given this Cask file: """ """ - When I run carton "info" + When I run cask "info" Then I should see command error: """ Missing `package` or `package-file` directive """ Scenario: Using package directive - Given this Carton file: + Given this Cask file: """ (package "super-project" "0.0.1" "Super project.") """ - When I run carton "info" + When I run cask "info" Then I should see command output: """ ### super-project (0.0.1) ### @@ -38,7 +38,7 @@ Feature: List """ Scenario: Using package-file directive - Given this Carton file: + Given this Cask file: """ (package-file "super-project.el") """ @@ -87,7 +87,7 @@ Feature: List ;;; super-project.el ends here """ - And I run carton "info" + And I run cask "info" Then I should see command output: """ ### super-project (0.0.1) ### diff --git a/features/init.feature b/features/init.feature index 0affdc6c..efc7bea9 100644 --- a/features/init.feature +++ b/features/init.feature @@ -1,25 +1,25 @@ Feature: Init In order to quickly get going - As a Carton user - I want to create a Carton file automatically + As a Cask user + I want to create a Cask file automatically Background: Given I create a project called "init" And I go to the project called "init" - Scenario: With Carton file - Given this Carton file: + Scenario: With Cask file + Given this Cask file: """ """ - When I run carton "init" + When I run cask "init" Then I should see command error: """ - Carton file already exists. + Cask file already exists. """ - Scenario: No Carton file - development - When I run carton "init --dev" - Then there should exist a file called "Carton" with this content: + Scenario: No Cask file - development + When I run cask "init --dev" + Then there should exist a file called "Cask" with this content: """ (source melpa) @@ -33,13 +33,13 @@ Feature: Init (depends-on "espuds")) """ - Scenario: No Carton file - When I run carton "init" - Then there should exist a file called "Carton" with this content: + Scenario: No Cask file + When I run cask "init" + Then there should exist a file called "Cask" with this content: """ (source melpa) - (depends-on "carton") + (depends-on "cask") (depends-on "dash") (depends-on "drag-stuff") (depends-on "expand-region") diff --git a/features/install.feature b/features/install.feature index 17da684d..d9ab6f7c 100644 --- a/features/install.feature +++ b/features/install.feature @@ -1,50 +1,50 @@ Feature: Install In order to satisfy dependencies - As a Carton user + As a Cask user I want to install them Background: Given I create a project called "install" And I go to the project called "install" - Scenario: No Carton file - When I run carton "install" + Scenario: No Cask file + When I run cask "install" Then I should see command error: """ - Could not locate `Carton` file + Could not locate `Cask` file """ Scenario: No dependencies - Given this Carton file: + Given this Cask file: """ """ - When I run carton "install" + When I run cask "install" Then package directory should not exist Scenario: Single dependency - Given this Carton file: + Given this Cask file: """ (source "localhost" "http://127.0.0.1:9191/packages/") (depends-on "foo" "0.0.1") """ - When I run carton "install" + When I run cask "install" Then there should exist a package directory called "foo-0.0.1" Scenario: Multiple dependencies - Given this Carton file: + Given this Cask file: """ (source "localhost" "http://127.0.0.1:9191/packages/") (depends-on "foo" "0.0.1") (depends-on "bar" "0.0.2") """ - When I run carton "install" + When I run cask "install" Then there should exist a package directory called "foo-0.0.1" And there should exist a package directory called "bar-0.0.2" Scenario: Using package-file directive - Given this Carton file: + Given this Cask file: """ (source "localhost" "http://127.0.0.1:9191/packages/") @@ -95,16 +95,16 @@ Feature: Install ;;; super-project.el ends here """ - And I run carton "install" + And I run cask "install" Then there should exist a package directory called "foo-0.0.1" And there should exist a package directory called "bar-0.0.2" Scenario: No argument to binary is same as install - Given this Carton file: + Given this Cask file: """ (source "localhost" "http://127.0.0.1:9191/packages/") (depends-on "foo" "0.0.1") """ - When I run carton "" + When I run cask "" Then there should exist a package directory called "foo-0.0.1" diff --git a/features/list.feature b/features/list.feature index 422d2783..17a715c1 100644 --- a/features/list.feature +++ b/features/list.feature @@ -1,24 +1,24 @@ Feature: List In order to quickly get an overview of all dependencies - As a Carton user + As a Cask user I want to list them Background: Given I create a project called "list" And I go to the project called "list" - Scenario: No Carton file - When I run carton "list" + Scenario: No Cask file + When I run cask "list" Then I should see command error: """ - Could not locate `Carton` file + Could not locate `Cask` file """ Scenario: No dependencies - Given this Carton file: + Given this Cask file: """ """ - When I run carton "list" + When I run cask "list" Then I should see command output: """ ### Dependencies ### @@ -28,11 +28,11 @@ Feature: List """ Scenario: Single runtime dependency - Given this Carton file: + Given this Cask file: """ (depends-on "foo" "0.1.2") """ - When I run carton "list" + When I run cask "list" Then I should see command output: """ ### Dependencies ### @@ -44,12 +44,12 @@ Feature: List """ Scenario: Single development dependency - Given this Carton file: + Given this Cask file: """ (development (depends-on "baz")) """ - When I run carton "list" + When I run cask "list" Then I should see command output: """ ### Dependencies ### @@ -60,12 +60,12 @@ Feature: List """ Scenario: Multiple runtime dependencies - Given this Carton file: + Given this Cask file: """ (depends-on "foo" "0.1.2") (depends-on "bar" "0.2.1") """ - When I run carton "list" + When I run cask "list" Then I should see command output: """ ### Dependencies ### @@ -78,13 +78,13 @@ Feature: List """ Scenario: Multiple development dependencies - Given this Carton file: + Given this Cask file: """ (development (depends-on "baz") (depends-on "qux")) """ - When I run carton "list" + When I run cask "list" Then I should see command output: """ ### Dependencies ### @@ -96,7 +96,7 @@ Feature: List """ Scenario: Multiple runtime and development dependencies - Given this Carton file: + Given this Cask file: """ (depends-on "foo" "0.1.2") (depends-on "bar" "0.2.1") @@ -105,7 +105,7 @@ Feature: List (depends-on "baz") (depends-on "qux")) """ - When I run carton "list" + When I run cask "list" Then I should see command output: """ ### Dependencies ### diff --git a/features/package-directory.feature b/features/package-directory.feature index aa65e25b..74b0aa9f 100644 --- a/features/package-directory.feature +++ b/features/package-directory.feature @@ -1,5 +1,5 @@ Feature: Package directory - As a Carton user + As a Cask user I want to be able to print the package directory Background: @@ -7,11 +7,11 @@ Feature: Package directory And I go to the project called "package-directory" Scenario: Package directory - Given this Carton file: + Given this Cask file: """ """ - When I run carton "package-directory" + When I run cask "package-directory" Then I should see command output: """ - {{PROJECT-PATH}}/.carton/{{EMACS-VERSION}}/elpa + {{PROJECT-PATH}}/.cask/{{EMACS-VERSION}}/elpa """ diff --git a/features/package.feature b/features/package.feature index f435d71e..616f839b 100644 --- a/features/package.feature +++ b/features/package.feature @@ -1,35 +1,35 @@ Feature: Package In order to quickly create a -pkg.el file - As a Carton user + As a Cask user I want to create it automatically Background: Given I create a project called "package" And I go to the project called "package" - Scenario: No Carton file - When I run carton "package" + Scenario: No Cask file + When I run cask "package" Then I should see command error: """ - Could not locate `Carton` file + Could not locate `Cask` file """ - Scenario: Empty Carton file - Given this Carton file: + Scenario: Empty Cask file + Given this Cask file: """ """ - When I run carton "package" + When I run cask "package" Then I should see command error: """ Missing `package` or `package-file` directive """ Scenario: Using package directive no dependencies - Given this Carton file: + Given this Cask file: """ (package "super-project" "0.0.1" "Super project.") """ - When I run carton "package" + When I run cask "package" Then there should exist a file called "package-pkg.el" with this content: """ (define-package "super-project" "0.0.1" @@ -37,14 +37,14 @@ Feature: Package """ Scenario: Using package directive with dependencies - Given this Carton file: + Given this Cask file: """ (package "super-project" "0.0.1" "Super project.") (depends-on "foo" "0.1.2") (depends-on "bar" "0.2.1") """ - When I run carton "package" + When I run cask "package" Then there should exist a file called "package-pkg.el" with this content: """ define-package "super-project" "0.0.1" @@ -53,7 +53,7 @@ Feature: Package """ Scenario: Using package-file directive - Given this Carton file: + Given this Cask file: """ (package-file "super-project.el") """ @@ -102,7 +102,7 @@ Feature: Package ;;; super-project.el ends here """ - And I run carton "package" + And I run cask "package" Then there should exist a file called "package-pkg.el" with this content: """ (define-package "super-project" "0.0.1" diff --git a/features/step-definitions/carton-steps.el b/features/step-definitions/cask-steps.el similarity index 51% rename from features/step-definitions/carton-steps.el rename to features/step-definitions/cask-steps.el index 5dab7e18..20112069 100644 --- a/features/step-definitions/carton-steps.el +++ b/features/step-definitions/cask-steps.el @@ -1,100 +1,100 @@ -(defun carton-test/elpa-dir () +(defun cask-test/elpa-dir () (expand-file-name - (format ".carton/%s/elpa" emacs-version) carton-current-project)) + (format ".cask/%s/elpa" emacs-version) cask-current-project)) -(defun carton-test/create-project-file (filename content) +(defun cask-test/create-project-file (filename content) (with-temp-buffer (insert content) - (let ((filepath (expand-file-name filename carton-current-project))) + (let ((filepath (expand-file-name filename cask-current-project))) (write-file filepath nil)))) -(defun carton-test/template (command) +(defun cask-test/template (command) (let* ((command (s-replace "{{EMACS-VERSION}}" emacs-version command)) (command (s-replace "{{EMACS}}" (getenv "EMACS") command)) - (command (s-replace "{{PROJECT-PATH}}" carton-current-project command))) + (command (s-replace "{{PROJECT-PATH}}" cask-current-project command))) command)) -(Given "^this Carton file:$" +(Given "^this Cask file:$" (lambda (content) - (carton-test/create-project-file "Carton" content))) + (cask-test/create-project-file "Cask" content))) (Given "^I create a file called \"\\([^\"]+\\)\" with content:$" (lambda (filename content) - (carton-test/create-project-file filename content))) + (cask-test/create-project-file filename content))) -(When "^I run carton \"\\([^\"]*\\)\"$" +(When "^I run cask \"\\([^\"]*\\)\"$" (lambda (command) - (setq command (carton-test/template command)) - (let* ((buffer (get-buffer-create "*carton-output*")) - (default-directory (file-name-as-directory carton-current-project)) + (setq command (cask-test/template command)) + (let* ((buffer (get-buffer-create "*cask-output*")) + (default-directory (file-name-as-directory cask-current-project)) (args (unless (equal command "") (s-split " " command))) (exit-code (apply 'call-process - (append (list carton-bin-command nil buffer nil) args)))) + (append (list cask-bin-command nil buffer nil) args)))) (with-current-buffer buffer (let ((content (buffer-string))) (cond ((= exit-code 0) - (setq carton-output content)) + (setq cask-output content)) (t - (setq carton-error content)))))))) + (setq cask-error content)))))))) (Given "^I create a project called \"\\([^\"]+\\)\"$" (lambda (project-name) - (let ((project-path (expand-file-name project-name carton-projects-path))) + (let ((project-path (expand-file-name project-name cask-projects-path))) (make-directory project-path)))) (When "^I go to the project called \"\\([^\"]+\\)\"$" (lambda (project-name) - (let ((project-path (expand-file-name project-name carton-projects-path))) - (setq carton-current-project project-path)))) + (let ((project-path (expand-file-name project-name cask-projects-path))) + (setq cask-current-project project-path)))) (Then "^I should see command output:$" (lambda (output) - (should (s-contains? (carton-test/template output) carton-output)))) + (should (s-contains? (cask-test/template output) cask-output)))) (Then "^I should see command error:$" (lambda (output) - (should (s-contains? (carton-test/template output) carton-error)))) + (should (s-contains? (cask-test/template output) cask-error)))) (Then "^I should see usage information$" (lambda () (Then "I should see command output:" - "USAGE: carton COMMAND [OPTIONS]"))) + "USAGE: cask COMMAND [OPTIONS]"))) (Then "^there should exist a file called \"\\([^\"]+\\)\" with this content:$" (lambda (filename content) - (let ((filepath (expand-file-name filename carton-current-project))) + (let ((filepath (expand-file-name filename cask-current-project))) (with-temp-buffer (insert-file-contents-literally filepath) (Then "I should see:" content))))) (Then "^there should exist a directory called \"\\([^\"]+\\)\"$" (lambda (dirname) - (let ((dirpath (expand-file-name dirname carton-current-project))) + (let ((dirpath (expand-file-name dirname cask-current-project))) (should (file-directory-p dirpath))))) (Then "^there should not exist a directory called \"\\([^\"]+\\)\"$" (lambda (dirname) - (let ((dirpath (expand-file-name dirname carton-current-project))) + (let ((dirpath (expand-file-name dirname cask-current-project))) (should-not (file-directory-p dirpath))))) (Then "^there should exist a package directory called \"\\([^\"]+\\)\"$" (lambda (dirname) - (let* ((carton-project-path carton-current-project) - (dirpath (expand-file-name dirname (carton-test/elpa-dir)))) + (let* ((cask-project-path cask-current-project) + (dirpath (expand-file-name dirname (cask-test/elpa-dir)))) (should (file-directory-p dirpath))))) (Then "^there should not exist a package directory called \"\\([^\"]+\\)\"$" (lambda (dirname) - (let* ((carton-project-path carton-current-project) - (dirpath (expand-file-name dirname (carton-test/elpa-dir)))) + (let* ((cask-project-path cask-current-project) + (dirpath (expand-file-name dirname (cask-test/elpa-dir)))) (should-not (file-directory-p dirpath))))) (Then "^package directory should not exist$" (lambda () - (let ((carton-project-path carton-current-project)) - (should-not (file-directory-p (carton-test/elpa-dir)))))) + (let ((cask-project-path cask-current-project)) + (should-not (file-directory-p (cask-test/elpa-dir)))))) diff --git a/features/support/env.el b/features/support/env.el index 382dd5d9..5b53d64b 100644 --- a/features/support/env.el +++ b/features/support/env.el @@ -4,43 +4,43 @@ (require 'espuds) (require 'ansi) -(defvar carton-features-path +(defvar cask-features-path (f-parent (f-parent load-file-name))) -(defvar carton-vendor-path - (f-expand "vendor" carton-features-path)) +(defvar cask-vendor-path + (f-expand "vendor" cask-features-path)) -(defvar carton-root-path - (f-parent carton-features-path)) +(defvar cask-root-path + (f-parent cask-features-path)) -(defvar carton-projects-path - (f-expand "projects" carton-features-path)) +(defvar cask-projects-path + (f-expand "projects" cask-features-path)) -(defvar carton-bin-command - (f-expand (f-join "bin" "carton") carton-root-path)) +(defvar cask-bin-command + (f-expand (f-join "bin" "cask") cask-root-path)) -(defvar carton-error nil) -(defvar carton-output nil) -(defvar carton-current-project nil) +(defvar cask-error nil) +(defvar cask-output nil) +(defvar cask-current-project nil) -(add-to-list 'load-path carton-root-path) +(add-to-list 'load-path cask-root-path) (unless (require 'ert nil t) - (require 'ert (expand-file-name "ert" carton-vendor-path))) + (require 'ert (expand-file-name "ert" cask-vendor-path))) (Before - (setq carton-error nil) - (setq carton-output nil) - (setq carton-current-project nil) + (setq cask-error nil) + (setq cask-output nil) + (setq cask-current-project nil) (--map (f-delete it t) - (f-directories carton-projects-path))) + (f-directories cask-projects-path))) (Fail - (when carton-output - (princ "==================== CARTON OUTPUT ====================\n") - (princ carton-output)) - (when carton-error - (princ "==================== CARTON ERROR ====================\n") - (princ (ansi-red "%s" carton-error)))) + (when cask-output + (princ "==================== CASK OUTPUT ====================\n") + (princ cask-output)) + (when cask-error + (princ "==================== CASK ERROR ====================\n") + (princ (ansi-red "%s" cask-error)))) diff --git a/features/update.feature b/features/update.feature index 2640c8cc..28ccb4a8 100644 --- a/features/update.feature +++ b/features/update.feature @@ -1,35 +1,35 @@ Feature: Update In order to stay tuned - As a Carton user + As a Cask user I want to update packages Background: Given I create a project called "update" And I go to the project called "update" - Scenario: No Carton file - When I run carton "update" + Scenario: No Cask file + When I run cask "update" Then I should see command error: """ - Could not locate `Carton` file + Could not locate `Cask` file """ Scenario: With dependency - Given this Carton file: + Given this Cask file: """ (source "localhost" "http://127.0.0.1:9191/packages/") (depends-on "foo" "0.0.1") """ - When I run carton "install" + When I run cask "install" Then there should exist a package directory called "foo-0.0.1" - Given this Carton file: + Given this Cask file: """ (source "localhost" "http://127.0.0.1:9191/new-packages/") (depends-on "foo" "0.0.1") """ - When I run carton "update" + When I run cask "update" Then there should not exist a package directory called "foo-0.0.1" But there should exist a package directory called "foo-0.0.2" And I should see command output: diff --git a/features/version.feature b/features/version.feature index b468c280..946f8210 100644 --- a/features/version.feature +++ b/features/version.feature @@ -1,42 +1,42 @@ Feature: Version In order to quickly get the project version - As a Carton user + As a Cask user I want to print it Background: Given I create a project called "version" And I go to the project called "version" - Scenario: No Carton file - When I run carton "version" + Scenario: No Cask file + When I run cask "version" Then I should see command error: """ - Could not locate `Carton` file + Could not locate `Cask` file """ - Scenario: Empty Carton file - Given this Carton file: + Scenario: Empty Cask file + Given this Cask file: """ """ - When I run carton "version" + When I run cask "version" Then I should see command error: """ Missing `package` or `package-file` directive """ Scenario: Using package directive - Given this Carton file: + Given this Cask file: """ (package "super-project" "0.0.1" "Super project.") """ - When I run carton "version" + When I run cask "version" Then I should see command output: """ 0.0.1 """ Scenario: Using package-file directive - Given this Carton file: + Given this Cask file: """ (package-file "super-project.el") """ @@ -85,7 +85,7 @@ Feature: Version ;;; super-project.el ends here """ - And I run carton "version" + And I run cask "version" Then I should see command output: """ 0.0.1 diff --git a/go b/go index 3d173018..0564ac21 100755 --- a/go +++ b/go @@ -1,16 +1,16 @@ #!/bin/sh -CARTON_DIR="$HOME/.carton" +CASK_DIR="$HOME/.cask" -if [ -d "$CARTON_DIR" ]; then - echo "Carton is already installed at '$CARTON_DIR'" +if [ -d "$CASK_DIR" ]; then + echo "Cask is already installed at '$CASK_DIR'" exit 1 else - git clone https://github.com/rejeep/carton.git $CARTON_DIR 2> /dev/null + git clone https://github.com/rejeep/cask.el.git $CASK_DIR 2> /dev/null - echo "Successfully installed Carton! Now, add the carton binary to your PATH." - echo ' export PATH="'${CARTON_DIR}'/bin:$PATH"' + echo "Successfully installed Cask! Now, add the cask binary to your PATH." + echo ' export PATH="'${CASK_DIR}'/bin:$PATH"' exit 0 fi diff --git a/templates/init.tpl b/templates/init.tpl index 82d9c50c..f8bc01fc 100644 --- a/templates/init.tpl +++ b/templates/init.tpl @@ -1,6 +1,6 @@ (source melpa) -(depends-on "carton") +(depends-on "cask") (depends-on "dash") (depends-on "drag-stuff") (depends-on "expand-region")