hastebin 0.1.0 → 0.2.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/hastebin +40 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ce87c32125e84ea211fff094c00d909395bcf84c716523fc525b52a87f10ebf0
|
|
4
|
+
data.tar.gz: f028e5ddef098f9caa9436101a070dd8583e08d75f084cd0c52a171ab996eccc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1dd2c401feb07a17829dc686be6572e4d9d5dfa5757dd64fdbd4fc4d48adb1419103a9ae48bf77c74ecdaecd025181de849af08dab238210c1127adf8bb70af1
|
|
7
|
+
data.tar.gz: 2bc8d52d34752a845fb5f23c1559858da54a17430189abd9598f6386ec5d85eb657cb6d7123081071c9ac32457d29a0573c35bb57a8729a01ddf0d02271b667d
|
data/bin/hastebin
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'optparse'
|
|
3
|
+
require "uri"
|
|
4
|
+
require "net/http"
|
|
5
|
+
require "hastebin"
|
|
6
|
+
|
|
7
|
+
opts = OptionParser.new do |opts|
|
|
8
|
+
opts.banner = "\n«««««««««««««««««»»»»»»»»»»»»»»»»»»»"
|
|
9
|
+
opts.separator "««««««««««« Hastebin CLI »»»»»»»»»»»"
|
|
10
|
+
opts.separator "«««««««««««««««««»»»»»»»»»»»»»»»»»»»"
|
|
11
|
+
opts.separator ""
|
|
12
|
+
opts.separator 'Usage: hastebin -c "scritp" -> write'
|
|
13
|
+
opts.separator 'Usage: hastebin -r "/path/to/file" -> read file'
|
|
14
|
+
opts.separator ""
|
|
15
|
+
opts.separator "Examples:"
|
|
16
|
+
opts.separator ' hastebin -c "puts("hello")"'
|
|
17
|
+
opts.separator ' hastebin -r "./text.txt"'
|
|
18
|
+
opts.separator ""
|
|
19
|
+
opts.separator "Options:"
|
|
20
|
+
|
|
21
|
+
opts.on("-c script") do |a|
|
|
22
|
+
|
|
23
|
+
puts "View in: https://hasteb.in/#{Hastebin.code(a)}"
|
|
24
|
+
|
|
25
|
+
exit
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
opts.on("-r file") do |a|
|
|
29
|
+
file = File.open(a)
|
|
30
|
+
data = []
|
|
31
|
+
file.each do |line|
|
|
32
|
+
data.push(line)
|
|
33
|
+
$text = data.join("")
|
|
34
|
+
end
|
|
35
|
+
puts "View in: https://hasteb.in/#{Hastebin.code($text)}"
|
|
36
|
+
|
|
37
|
+
exit
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
opts.parse!
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hastebin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Astin
|
|
@@ -27,10 +27,12 @@ dependencies:
|
|
|
27
27
|
description: ''
|
|
28
28
|
email:
|
|
29
29
|
- ''
|
|
30
|
-
executables:
|
|
30
|
+
executables:
|
|
31
|
+
- hastebin
|
|
31
32
|
extensions: []
|
|
32
33
|
extra_rdoc_files: []
|
|
33
34
|
files:
|
|
35
|
+
- bin/hastebin
|
|
34
36
|
- lib/hastebin.rb
|
|
35
37
|
homepage: https://rubygems.org/gems/discloud-status
|
|
36
38
|
licenses:
|