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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rcp.rb +28 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 787b5e1f249310445f9b1eb2056eb3e286ea24ca
4
- data.tar.gz: 986a40875f23820c856f0c686bf9e5a18dbc7d68
3
+ metadata.gz: bb978c595535f9c826c6cc3d0c7ebc6a55527dc5
4
+ data.tar.gz: 0cd5308e6150a6a5b7ac091cf85f98feed1fd9c6
5
5
  SHA512:
6
- metadata.gz: 329f89a525c34883979d20a9451983aa6348d6b43bfe4ef33c091e6e272879a43dc8a064a4627f5898c55abc0e8126fdbd665a53840343d3f80b9a13941beb56
7
- data.tar.gz: 8f15a4f5f7cfc538f3cf52cf4cc3e66b35bcab40ff0928ece487c54cccd75901f94518d1065be5a58de87561e0d573f28e19e97e55d8936e8dad473097dbcb29
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
- open_urls
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 \.-]*)*\/?$/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Vasconcellos