rcp 1.1.5 → 1.3.0
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/bin/rcp +12 -7
- data/lib/rcp.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeb5b54d9b9a456b722bcd47ba1fe6131f030fa2
|
4
|
+
data.tar.gz: afa2a1db16962126d2b7578d415e585d2a863857
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50a6de671a0de192b8a2438e9611466985028d023a92d951180ce3f5ef42bea32dafa7a094c11135bd5a96acd8a7a6e7aa7df207847dcd459161520434f2ffea
|
7
|
+
data.tar.gz: a4c5cf6062ff05494acf04d265b387b01d2e95e00b253228d98fedca08a8459b30372230a38f5e755ed5158bb5293ddc3b55204b7cab1a340233434991d35403
|
data/bin/rcp
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'rcp'
|
3
|
+
require './lib/rcp'
|
4
|
+
require 'debugger'
|
5
|
+
require 'optparse'
|
4
6
|
|
5
7
|
rcp = RemoteCopy.new
|
6
|
-
content = ARGV.join(' ')
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
OptionParser.new do |opts|
|
10
|
+
opts.on('-p', '--post CONTENT', String) do |content|
|
11
|
+
rcp.push(content)
|
12
|
+
end
|
13
|
+
|
14
|
+
opts.on('-g', '--get') do
|
15
|
+
rcp.pull
|
16
|
+
end
|
17
|
+
end.parse!
|
data/lib/rcp.rb
CHANGED
@@ -25,9 +25,9 @@ class RemoteCopy
|
|
25
25
|
|
26
26
|
@content = response_json["item"]["content"]
|
27
27
|
|
28
|
-
prompt_question
|
28
|
+
prompt_question if urls.any?
|
29
29
|
|
30
|
-
open_urls if should_i_open?
|
30
|
+
open_urls if urls.any? && should_i_open?
|
31
31
|
|
32
32
|
copy_to_clipboard
|
33
33
|
|
@@ -57,7 +57,7 @@ class RemoteCopy
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def urls
|
60
|
-
@content.split(" ").select do |w|
|
60
|
+
@urls ||= @content.split(" ").select do |w|
|
61
61
|
w =~ /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
|
62
62
|
end
|
63
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis Vasconcellos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clipboard
|