copy_to_clipboard 0.0.1 → 0.0.2
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/README.md +16 -0
- data/bin/copy_to_clipboard +18 -0
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9a05ba8831728c43410edbd421cd53c75c43142
|
4
|
+
data.tar.gz: 997c7dffb75e85648ff13657d44c4a9a4ea05c37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a27bafdea9ebf9abc9a66e451005668c72bb74b44422035faea23531bc5cf943cd622b1158829aaaa860e31bd26b5975c9d4fc25de215fe964918ba96e889c9
|
7
|
+
data.tar.gz: 8648e1a87b90395296467d537966f72257852ff3bd7e6e3a0dade29e2fb6d40fa5b6bd867cf090f68cd7f2a515ac80f6c645d084c20f73326bcfb8f27408b08a
|
data/README.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# copy_to_clipboard
|
2
|
+
A command-line program to copy the contents of any file to the clipboard
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
To install `copy_to_clipboard`, simply run:
|
6
|
+
|
7
|
+
```shell
|
8
|
+
gem install copy_to_clipboard
|
9
|
+
```
|
10
|
+
|
11
|
+
## How does it work?
|
12
|
+
You just need to run the `copy_to_clipboard` command in your terminal passing the file you would like to copy the content to the clipboard, such as the bellow example, and the magic happens =P
|
13
|
+
|
14
|
+
```shell
|
15
|
+
copy_to_clipboard my_file.txt
|
16
|
+
```
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
def colorize(text, color_code)
|
4
|
+
"\e[#{color_code}m#{text}\e[0m"
|
5
|
+
end
|
6
|
+
|
7
|
+
def red(text); colorize(text, 31); end
|
8
|
+
def green(text); colorize(text, 32); end
|
9
|
+
|
10
|
+
file_path = ARGV[0]
|
11
|
+
|
12
|
+
abort(red('You should pass a file as parameter!')) if ARGV.empty?
|
13
|
+
abort(red("File doesn't exist!")) unless File.exist?(file_path)
|
14
|
+
|
15
|
+
file = File.open(file_path, 'rb')
|
16
|
+
IO.popen('pbcopy', 'w') { |pipe| pipe.puts file.read }
|
17
|
+
|
18
|
+
puts green('Content copied! :)')
|
metadata
CHANGED
@@ -1,21 +1,24 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: copy_to_clipboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- EvandroLG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A command-line program to copy the contents of any file to the clipboard
|
14
14
|
email: evandrolgoncalves@gmail.com
|
15
|
-
executables:
|
15
|
+
executables:
|
16
|
+
- copy_to_clipboard
|
16
17
|
extensions: []
|
17
18
|
extra_rdoc_files: []
|
18
|
-
files:
|
19
|
+
files:
|
20
|
+
- README.md
|
21
|
+
- bin/copy_to_clipboard
|
19
22
|
homepage: https://github.com/EvandroLG/copy_to_clipboard
|
20
23
|
licenses:
|
21
24
|
- MIT
|