[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste 7d8e0d4 287/298: wepaste: Add provider paste.rs
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste 7d8e0d4 287/298: wepaste: Add provider paste.rs |
Date: |
Thu, 9 Dec 2021 19:00:31 -0500 (EST) |
branch: elpa/webpaste
commit 7d8e0d47e84580663dbc6cd2b4eb6e8bde0d3dd0
Author: Elis Hirwing <elis@hirwing.se>
Commit: Elis Hirwing <elis@hirwing.se>
wepaste: Add provider paste.rs
This fixes #50
---
README.org | 3 ++-
tests/integration/test-webpaste-providers.el | 7 +++++++
webpaste.el | 13 ++++++++++++-
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/README.org b/README.org
index 563f269..7414417 100644
--- a/README.org
+++ b/README.org
@@ -188,10 +188,11 @@ webpaste first and then just read the documentation by
running this:
(describe-function 'webpaste--provider)
#+end_src
-* TODO Providers to implement [6/13]
+* TODO Providers to implement [7/14]
- [ ] clbin.com
- [ ] 0x0.st
- [X] ix.io
+ - [X] paste.rs
- [X] dpaste.com
- [X] dpaste.org
- [X] gist.github.com
diff --git a/tests/integration/test-webpaste-providers.el
b/tests/integration/test-webpaste-providers.el
index e9273a7..5103582 100644
--- a/tests/integration/test-webpaste-providers.el
+++ b/tests/integration/test-webpaste-providers.el
@@ -26,6 +26,13 @@
(expect (spy-calls-count 'webpaste--return-url) :to-equal 1)
(expect (spy-calls-count 'webpaste--paste-text) :to-equal 0))
+ (it
+ "can paste with paste.rs [ci]"
+
+ (funcall (webpaste--get-provider-by-name "paste.rs") paste-message :sync t)
+
+ (expect (spy-calls-count 'webpaste--return-url) :to-equal 1)
+ (expect (spy-calls-count 'webpaste--paste-text) :to-equal 0))
(it
"can paste with dpaste.com [ci]"
diff --git a/webpaste.el b/webpaste.el
index 1f6d4b8..da89aa0 100644
--- a/webpaste.el
+++ b/webpaste.el
@@ -101,6 +101,11 @@ This uses `browse-url-generic' to open URLs."
(nix-mode . "nix"))
:success-lambda webpaste--providers-success-returned-string)
+ ("paste.rs"
+ :uri "https://paste.rs"
+ :post-field nil
+ :success-lambda webpaste--providers-success-returned-string)
+
("dpaste.com"
:uri "http://dpaste.com/api/v2/"
:post-data (("title" . "")
@@ -287,7 +292,13 @@ This is the default failover hook that we use for most
providers."
;; Append language to the post-data
(cl-pushnew (cons post-lang-field-name language-name)
post-data)))
- post-data)))
+ ;; If there's no defined field
+ (if (equal post-field nil)
+ ;; Just return the plain data
+ text
+
+ ;; Otherwise we return the formatted post data
+ post-data))))
- [nongnu] elpa/webpaste 9c5e921 234/298: WP-25: Add README for raw pastes, (continued)
- [nongnu] elpa/webpaste 9c5e921 234/298: WP-25: Add README for raw pastes, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 3d639f1 256/298: Merge branch 'fix-undercover', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 51b20d9 235/298: Merge branch 'WP-25-raw-pastes', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 22f64b7 255/298: undercover: Fix up undercover reporting, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste a8b682a 239/298: Add toml lang to ptpb.pw default, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 2c399a0 243/298: Tests: Add unit tests for shebangs to override major-mode, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste a3a9a77 251/298: Remove spaces at end of lines, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7345c5f 252/298: [providers] Deprecation of ptpb.pw as a provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 521de6d 247/298: Update copyright year, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 87ea8b1 294/298: workflows: Remove environment variable to force install cask on macos, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7d8e0d4 287/298: wepaste: Add provider paste.rs,
ELPA Syncer <=
- [nongnu] elpa/webpaste a9c4aa4 288/298: Merge branch 'provider-paste-rs', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b47767f 229/298: Prefix integration test names to filter them out easily if they seem, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 356e54f 242/298: Tests: Add unit test for webpaste--get-shebang-lang-mode, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b8e9245 230/298: Add helper function to find buffers language for provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste d6a8771 250/298: Merge branch 'vapniks-patch-1', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 8f9322f 265/298: Merge branch 'tastytea-dpaste.de-new-location', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 2d0f810 268/298: Merge branch 'condy0919-master', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 141376a 264/298: Change dpaste.de to dpaste.org., ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 1a6c0e9 263/298: Bump version number in file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7a30602 274/298: Bump version number in file, ELPA Syncer, 2021/12/09