rcp 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rcp.rb +28 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb978c595535f9c826c6cc3d0c7ebc6a55527dc5
|
4
|
+
data.tar.gz: 0cd5308e6150a6a5b7ac091cf85f98feed1fd9c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b3352adbc91abbcb9f04edeaaead13f225e0c738f73681ca1b7a49fd71459dd521dd96807df3f6fb8982f56baa69b64b7c137062524460786f4d83180d21b39
|
7
|
+
data.tar.gz: 1500e7cfdbd3906a6145f05b38533a1915f49d98e47e01d164b5c3ac9327377f117503079f5ed58f4df120d99002053328223ce662d35c0a72c634295a2f7824
|
data/lib/rcp.rb
CHANGED
@@ -3,6 +3,7 @@ require "json"
|
|
3
3
|
require "net/http"
|
4
4
|
require "uri"
|
5
5
|
require "launchy"
|
6
|
+
require "debugger"
|
6
7
|
|
7
8
|
class RemoteCopy
|
8
9
|
def push(content)
|
@@ -24,11 +25,37 @@ class RemoteCopy
|
|
24
25
|
|
25
26
|
@content = response_json["item"]["content"]
|
26
27
|
|
27
|
-
|
28
|
+
prompt_question
|
29
|
+
|
30
|
+
open_urls if should_i_open?
|
31
|
+
|
28
32
|
copy_to_clipboard
|
33
|
+
|
34
|
+
prompt_message
|
29
35
|
end
|
30
36
|
|
31
37
|
private
|
38
|
+
def prompt_message
|
39
|
+
puts ""
|
40
|
+
puts "The content below is now on your clipboard!"
|
41
|
+
puts ""
|
42
|
+
puts "#{@content}"
|
43
|
+
puts ""
|
44
|
+
end
|
45
|
+
|
46
|
+
def should_i_open?
|
47
|
+
gets.chomp == "Y"
|
48
|
+
end
|
49
|
+
|
50
|
+
def prompt_question
|
51
|
+
puts ""
|
52
|
+
|
53
|
+
urls.each { |url| puts url }
|
54
|
+
|
55
|
+
puts ""
|
56
|
+
print "Should I open those url(s) above? [Yn] "
|
57
|
+
end
|
58
|
+
|
32
59
|
def urls
|
33
60
|
@content.split(" ").select do |w|
|
34
61
|
w =~ /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
|