[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste 26f089e 201/298: Rename webpaste-paste-text and w
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste 26f089e 201/298: Rename webpaste-paste-text and webpaste-paste-text-to-provider to be in "private scope" |
Date: |
Thu, 9 Dec 2021 19:00:14 -0500 (EST) |
branch: elpa/webpaste
commit 26f089e0720e127fe259450862940e930e89a74e
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>
Rename webpaste-paste-text and webpaste-paste-text-to-provider to be in
"private scope"
---
tests/integration/test-webpaste-providers.el | 16 ++++++++--------
tests/unit/test-webpaste-error-lambdas.el | 6 +++---
tests/unit/test-webpaste-paste-region-and-buffer.el | 18 +++++++++---------
tests/unit/test-webpaste-paste-text.el | 12 ++++++------
webpaste.el | 18 ++++++++----------
5 files changed, 34 insertions(+), 36 deletions(-)
diff --git a/tests/integration/test-webpaste-providers.el
b/tests/integration/test-webpaste-providers.el
index 7763015..a0db749 100644
--- a/tests/integration/test-webpaste-providers.el
+++ b/tests/integration/test-webpaste-providers.el
@@ -11,7 +11,7 @@
(before-each
;; Block requests
- (spy-on 'webpaste-paste-text)
+ (spy-on 'webpaste--paste-text)
(spy-on 'webpaste--return-url))
(it
@@ -24,7 +24,7 @@
:sync t)
(expect (spy-calls-count 'webpaste--return-url) :to-equal 1)
- (expect (spy-calls-count 'webpaste-paste-text) :to-equal 0)
+ (expect (spy-calls-count 'webpaste--paste-text) :to-equal 0)
(expect (spy-calls-most-recent 'webpaste--return-url)
:to-equal
@@ -43,7 +43,7 @@
:sync t)
(expect (spy-calls-count 'webpaste--return-url) :to-equal 1)
- (expect (spy-calls-count 'webpaste-paste-text) :to-equal 0)
+ (expect (spy-calls-count 'webpaste--paste-text) :to-equal 0)
(expect (spy-calls-most-recent 'webpaste--return-url)
:to-equal
@@ -62,7 +62,7 @@
:sync t)
(expect (spy-calls-count 'webpaste--return-url) :to-equal 1)
- (expect (spy-calls-count 'webpaste-paste-text) :to-equal 0)))
+ (expect (spy-calls-count 'webpaste--paste-text) :to-equal 0)))
(it
@@ -75,7 +75,7 @@
:sync t)
(expect (spy-calls-count 'webpaste--return-url) :to-equal 1)
- (expect (spy-calls-count 'webpaste-paste-text) :to-equal 0)))
+ (expect (spy-calls-count 'webpaste--paste-text) :to-equal 0)))
(it
@@ -88,7 +88,7 @@
:sync t)
(expect (spy-calls-count 'webpaste--return-url) :to-equal 1)
- (expect (spy-calls-count 'webpaste-paste-text) :to-equal 0)))
+ (expect (spy-calls-count 'webpaste--paste-text) :to-equal 0)))
(it
@@ -104,7 +104,7 @@
:sync t)
(expect (spy-calls-count 'webpaste--return-url) :to-equal 1)
- (expect (spy-calls-count 'webpaste-paste-text) :to-equal 0)))
+ (expect (spy-calls-count 'webpaste--paste-text) :to-equal 0)))
(it
@@ -117,7 +117,7 @@
:sync t)
(expect (spy-calls-count 'webpaste--return-url) :to-equal 1)
- (expect (spy-calls-count 'webpaste-paste-text) :to-equal 0))))
+ (expect (spy-calls-count 'webpaste--paste-text) :to-equal 0))))
;;; test-webpaste-providers.el ends here
diff --git a/tests/unit/test-webpaste-error-lambdas.el
b/tests/unit/test-webpaste-error-lambdas.el
index 2e23070..3364f19 100644
--- a/tests/unit/test-webpaste-error-lambdas.el
+++ b/tests/unit/test-webpaste-error-lambdas.el
@@ -10,7 +10,7 @@
"Create lambdas to use on failures, "
(before-each
- (spy-on 'webpaste-paste-text)
+ (spy-on 'webpaste--paste-text)
(spy-on 'message))
(it
@@ -24,7 +24,7 @@
"Got error: %S"
"my error")
- (expect 'webpaste-paste-text
+ (expect 'webpaste--paste-text
:to-have-been-called-with
"my text")))
@@ -38,7 +38,7 @@
"Got error: %S"
"my error")
- (expect 'webpaste-paste-text
+ (expect 'webpaste--paste-text
:not :to-have-been-called))))
diff --git a/tests/unit/test-webpaste-paste-region-and-buffer.el
b/tests/unit/test-webpaste-paste-region-and-buffer.el
index fb28f9d..715dbe1 100644
--- a/tests/unit/test-webpaste-paste-region-and-buffer.el
+++ b/tests/unit/test-webpaste-paste-region-and-buffer.el
@@ -10,7 +10,7 @@
"Don't to paste region or buffer because of wrong answer to question"
(before-each
- (spy-on 'webpaste-paste-text)
+ (spy-on 'webpaste--paste-text)
(spy-on 'yes-or-no-p :and-return-value nil)
(setq webpaste-paste-confirmation t))
@@ -22,18 +22,18 @@
;; Paste buffer
(webpaste-paste-buffer)
- (expect 'webpaste-paste-text :not :to-have-been-called)
+ (expect 'webpaste--paste-text :not :to-have-been-called)
;; Paste region
(webpaste-paste-region 10 100)
- (expect 'webpaste-paste-text :not :to-have-been-called)))
+ (expect 'webpaste--paste-text :not :to-have-been-called)))
(describe
"Paste region or buffer because of correct answer to question"
(before-each
- (spy-on 'webpaste-paste-text)
+ (spy-on 'webpaste--paste-text)
(spy-on 'yes-or-no-p :and-return-value t)
(setq webpaste-paste-confirmation t))
@@ -49,11 +49,11 @@
;; Paste buffer
(webpaste-paste-buffer)
- (expect 'webpaste-paste-text :to-have-been-called-with (buffer-string))
+ (expect 'webpaste--paste-text :to-have-been-called-with (buffer-string))
;; Paste region
(webpaste-paste-region 10 100)
- (expect 'webpaste-paste-text
+ (expect 'webpaste--paste-text
:to-have-been-called-with
(buffer-substring 10 100)))))
@@ -62,7 +62,7 @@
"Paste region and buffer without question being asked"
(before-each
- (spy-on 'webpaste-paste-text))
+ (spy-on 'webpaste--paste-text))
(it
"can paste entire buffers or regions"
@@ -72,11 +72,11 @@
;; Paste buffer
(webpaste-paste-buffer)
- (expect 'webpaste-paste-text :to-have-been-called-with (buffer-string))
+ (expect 'webpaste--paste-text :to-have-been-called-with (buffer-string))
;; Paste region
(webpaste-paste-region 10 100)
- (expect 'webpaste-paste-text
+ (expect 'webpaste--paste-text
:to-have-been-called-with
(buffer-substring 10 100)))))
diff --git a/tests/unit/test-webpaste-paste-text.el
b/tests/unit/test-webpaste-paste-text.el
index 51b00d5..e70aa72 100644
--- a/tests/unit/test-webpaste-paste-text.el
+++ b/tests/unit/test-webpaste-paste-text.el
@@ -17,7 +17,7 @@
'("provider1" "provider2"))
;; Don't allow it to try to paste, just fake it
- (spy-on 'webpaste-paste-text-to-provider)
+ (spy-on 'webpaste--paste-text-to-provider)
;; And let tested list be resetted for each test
(setq webpaste-tested-providers nil))
@@ -27,19 +27,19 @@
"can paste text to provider and try second provider if called again"
;; Let's paste to first provider
- (webpaste-paste-text "my test text")
+ (webpaste--paste-text "my test text")
;; And check it was to first provider
- (expect 'webpaste-paste-text-to-provider
+ (expect 'webpaste--paste-text-to-provider
:to-have-been-called-with
"my test text"
"provider1")
;; Let's paste to second provider
- (webpaste-paste-text "my test text")
+ (webpaste--paste-text "my test text")
;; And check it was to second provider
- (expect 'webpaste-paste-text-to-provider
+ (expect 'webpaste--paste-text-to-provider
:to-have-been-called-with
"my test text"
"provider2")
@@ -59,7 +59,7 @@
(it
"can get the lambda for the specified provider and run it"
- (expect (webpaste-paste-text-to-provider "my test text" "provider2")
+ (expect (webpaste--paste-text-to-provider "my test text" "provider2")
:to-equal
"my test text")))
diff --git a/webpaste.el b/webpaste.el
index 38c378e..6ed18a6 100644
--- a/webpaste.el
+++ b/webpaste.el
@@ -196,7 +196,7 @@ precalculated, and also available both for pre and post
request access.")
"Predefined error callback for providers that always does failover."
(cl-function (lambda (&key error-thrown &allow-other-keys)
(message "Got error: %S" error-thrown)
- (webpaste-paste-text text))))
+ (webpaste--paste-text text))))
(cl-defun webpaste-providers-error-lambda-no-failover (&key text)
@@ -422,18 +422,15 @@ Optional params:
;; Return URL instead of nil
returned-url)
-
-;;;###autoload
-(cl-defun webpaste-paste-text-to-provider (text provider-name)
+(cl-defun webpaste--paste-text-to-provider (text provider-name)
"Paste TEXT to specific PROVIDER-NAME.
This function sends a paste to a spacific provider. This function is created
to
-make `webpaste-paste-text' do less magic things all at once."
+make `webpaste--paste-text' do less magic things all at once."
(funcall (webpaste--get-provider-by-name provider-name) text))
-;;;###autoload
-(cl-defun webpaste-paste-text (text)
+(cl-defun webpaste--paste-text (text)
"Paste TEXT to some paste service.
If ‘webpaste-provider-priority’ isn't populated, it will populate it with the
default providers.
@@ -459,8 +456,9 @@ When we run out of providers to try, it will restart since
(setq webpaste--tested-providers (cdr webpaste--tested-providers))
;; Run pasting function
- (webpaste-paste-text-to-provider text provider-name)))
+ (webpaste--paste-text-to-provider text provider-name)))
+
;;;###autoload
(cl-defun webpaste-paste-region (point mark)
@@ -473,7 +471,7 @@ Argument MARK Current mark."
(unless (and webpaste-paste-confirmation
(not (yes-or-no-p "paste entire region?")))
;; Extract the buffer contents with buffer-substring and paste it
- (webpaste-paste-text (buffer-substring point mark))))
+ (webpaste--paste-text (buffer-substring point mark))))
;;;###autoload
@@ -485,7 +483,7 @@ Argument MARK Current mark."
(unless (and webpaste-paste-confirmation
(not (yes-or-no-p "paste entire buffer?")))
;; Extract the buffer contents with buffer-substring and paste it
- (webpaste-paste-text (buffer-substring (point-min) (point-max)))))
+ (webpaste--paste-text (buffer-substring (point-min) (point-max)))))
- [nongnu] elpa/webpaste 95de0b8 169/298: Remove sync as a provider parameter on creation and add it on execution, (continued)
- [nongnu] elpa/webpaste 95de0b8 169/298: Remove sync as a provider parameter on creation and add it on execution, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste fd4332a 172/298: Merge branch 'test-providers-on-travis', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 60c0a98 167/298: Added printing of travis event type, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste d0442ad 168/298: Renamed all unit tests to make it easier for integration tests, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste cac4979 173/298: Added option to send returned URL to clpboard, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste db393a1 175/298: Merge branch 'naclander-copy-to-clipboard', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 92f309e 188/298: Added a contributing guidelines file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste ddd2fca 186/298: Added tests for success lambdas, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 2a05d02 194/298: Added supports for custom hooks when returning URLs. This fixes #22., ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b96e411 204/298: Moved the paste message to be a variable used for all integration tests, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 26f089e 201/298: Rename webpaste-paste-text and webpaste-paste-text-to-provider to be in "private scope",
ELPA Syncer <=
- [nongnu] elpa/webpaste 90a96d2 199/298: Change emacs-lisp-mode from elisp to clojure for sprunge.us, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 4b32baa 203/298: Rename all the lambdas to private scopes, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste cc9ba3d 202/298: Begin autoloading of the webpaste group, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste aed3e00 210/298: Bump version for new release, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b8f300f 209/298: Add pattern for buttercup to not run gists.github.com on travis, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 4bd15f8 227/298: Add a nix-shell file for some development utils, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f047313 219/298: Update the custom hook example to actually need to be a lambda, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste ac24701 214/298: Merge branch 'DamienCassou-simplify-travis', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 6a02ff9 185/298: Added tests for error lambdas and failovers, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste bf08207 211/298: Update my name due to legal namechange, ELPA Syncer, 2021/12/09