jist 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/jist +54 -0
- data/lib/jist.rb +3 -1
- metadata +51 -33
data/bin/jist
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
|
5
|
+
require 'jist'
|
6
|
+
|
7
|
+
# For the holdings of options.
|
8
|
+
options = {}
|
9
|
+
|
10
|
+
|
11
|
+
opts = OptionParser.new do |opts|
|
12
|
+
executable_name = File.split($0)[1]
|
13
|
+
opts.banner = <<-EOS
|
14
|
+
Jist is a simple command that let's you create new gists from the terminal.
|
15
|
+
|
16
|
+
Usage: #{executable_name} [options] file
|
17
|
+
EOS
|
18
|
+
|
19
|
+
opts.on("-a", "--auth USERNAME,PASSWORD", Array, "Provide a USERNAME and PASSWORD to log in and post an authenticated gist") do |one,two|
|
20
|
+
options[:username] = one
|
21
|
+
options[:password] = two
|
22
|
+
end
|
23
|
+
|
24
|
+
opts.on("-f", "--filename [NAME.EXTENSION]", Array,"Change the syntax highlighting (default is a.rb)") do |filename,b|
|
25
|
+
options[:filename] = filename
|
26
|
+
options[:derp] = b
|
27
|
+
end
|
28
|
+
|
29
|
+
opts.on("-p", "--public", "Add this flag you want your gist to have a guessable url") do |public|
|
30
|
+
options[:public] = public
|
31
|
+
end
|
32
|
+
|
33
|
+
opts.on("-d", "--description DESCRIPTION", "Adds a description to your gist") do |description|
|
34
|
+
options[:description] = description
|
35
|
+
end
|
36
|
+
|
37
|
+
opts.on_tail("-h","--help", "Show this message") do
|
38
|
+
$stdout.puts opts
|
39
|
+
exit
|
40
|
+
end
|
41
|
+
|
42
|
+
opts.on_tail("-v", "--version") do
|
43
|
+
puts "jist v#{Jist::VERSION}" # hardcoded for now
|
44
|
+
exit
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
opts.parse!
|
49
|
+
|
50
|
+
if ARGV.empty?
|
51
|
+
$stdout << opts.help
|
52
|
+
else
|
53
|
+
$stdout.puts Jist.gist(ARGF.read, options)["html_url"]
|
54
|
+
end
|
data/lib/jist.rb
CHANGED
metadata
CHANGED
@@ -1,61 +1,79 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: jist
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
version: "0.2"
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Conrad Irwin
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
date: 2012-06-22 00:00:00 Z
|
18
|
+
dependencies:
|
19
|
+
- !ruby/object:Gem::Dependency
|
15
20
|
name: multi_json
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
23
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 3
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
type: :runtime
|
32
|
+
version_requirements: *id001
|
30
33
|
description: Provides a single function (Jist.gist) that uploads a gist.
|
31
34
|
email: conrad.irwin@gmail.com
|
32
|
-
executables:
|
35
|
+
executables:
|
36
|
+
- jist
|
33
37
|
extensions: []
|
38
|
+
|
34
39
|
extra_rdoc_files: []
|
35
|
-
|
40
|
+
|
41
|
+
files:
|
36
42
|
- lib/jist.rb
|
43
|
+
- bin/jist
|
37
44
|
homepage: https://github.com/ConradIrwin/jist
|
38
45
|
licenses: []
|
46
|
+
|
39
47
|
post_install_message:
|
40
48
|
rdoc_options: []
|
41
|
-
|
49
|
+
|
50
|
+
require_paths:
|
42
51
|
- lib
|
43
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
53
|
none: false
|
45
|
-
requirements:
|
46
|
-
- -
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
|
49
|
-
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
62
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
hash: 3
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
version: "0"
|
55
70
|
requirements: []
|
71
|
+
|
56
72
|
rubyforge_project:
|
57
|
-
rubygems_version: 1.8.
|
73
|
+
rubygems_version: 1.8.21
|
58
74
|
signing_key:
|
59
75
|
specification_version: 3
|
60
76
|
summary: Just allows you to upload gists
|
61
77
|
test_files: []
|
78
|
+
|
79
|
+
has_rdoc:
|