jist 0.7 → 0.7.1
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.
- data/bin/jist +13 -9
- data/lib/jist.rb +4 -4
- metadata +50 -33
data/bin/jist
CHANGED
@@ -78,14 +78,18 @@ gist.
|
|
78
78
|
end
|
79
79
|
opts.parse!
|
80
80
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
81
|
+
begin
|
82
|
+
if ARGV.size == 0
|
83
|
+
$stderr.puts "(type a gist. <ctrl-c> to cancel, <ctrl-d> when done)" if $stdin.tty?
|
84
|
+
puts Jist.gist(ARGF.read, options)['html_url']
|
85
|
+
else
|
86
|
+
files = {}
|
87
|
+
ARGV.zip(filenames).each do |(file, name)|
|
88
|
+
files[name || file] = File.read(File.expand_path(file))
|
89
|
+
end
|
90
|
+
|
91
|
+
puts Jist.multi_gist(files, options)['html_url']
|
88
92
|
end
|
89
|
-
|
90
|
-
|
93
|
+
rescue Interrupt
|
94
|
+
# bye!
|
91
95
|
end
|
data/lib/jist.rb
CHANGED
@@ -5,7 +5,7 @@ require 'json'
|
|
5
5
|
# It just gists.
|
6
6
|
module Jist
|
7
7
|
|
8
|
-
VERSION = '0.7'
|
8
|
+
VERSION = '0.7.1'
|
9
9
|
|
10
10
|
module_function
|
11
11
|
# Upload a gist to https://gist.github.com
|
@@ -23,14 +23,14 @@ module Jist
|
|
23
23
|
# @raise [Exception] if something went wrong
|
24
24
|
#
|
25
25
|
# @see http://developer.github.com/v3/gists/
|
26
|
-
def gist(content, options={})
|
26
|
+
def gist(content, options = {})
|
27
27
|
filename = options[:filename] || "a.rb"
|
28
28
|
multi_gist({filename => content}, options)
|
29
29
|
end
|
30
30
|
|
31
31
|
# Upload a gist to https://gist.github.com
|
32
32
|
#
|
33
|
-
# @param [Hash] files the code you'd like to gist
|
33
|
+
# @param [Hash] files the code you'd like to gist: filename => content
|
34
34
|
# @param [Hash] options more detailed options
|
35
35
|
#
|
36
36
|
# @option options [String] :description the description
|
@@ -114,7 +114,7 @@ module Jist
|
|
114
114
|
module_function
|
115
115
|
# Run an HTTP operation against api.github.com
|
116
116
|
#
|
117
|
-
# @param [Net::HTTP::Request]
|
117
|
+
# @param [Net::HTTP::Request] request
|
118
118
|
# @return [Net::HTTP::Response]
|
119
119
|
def http(request)
|
120
120
|
connection = Net::HTTP.new("api.github.com", 443)
|
metadata
CHANGED
@@ -1,63 +1,80 @@
|
|
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: 1
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 7
|
9
|
+
- 1
|
10
|
+
version: 0.7.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Conrad Irwin
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2012-06-26 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: 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
22
|
prerelease: false
|
24
|
-
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
30
34
|
description: Provides a single function (Jist.gist) that uploads a gist.
|
31
35
|
email: conrad.irwin@gmail.com
|
32
|
-
executables:
|
36
|
+
executables:
|
33
37
|
- jist
|
34
38
|
extensions: []
|
39
|
+
|
35
40
|
extra_rdoc_files: []
|
36
|
-
|
41
|
+
|
42
|
+
files:
|
37
43
|
- lib/jist.rb
|
38
44
|
- bin/jist
|
39
45
|
homepage: https://github.com/ConradIrwin/jist
|
40
46
|
licenses: []
|
47
|
+
|
41
48
|
post_install_message:
|
42
49
|
rdoc_options: []
|
43
|
-
|
50
|
+
|
51
|
+
require_paths:
|
44
52
|
- lib
|
45
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
54
|
none: false
|
47
|
-
requirements:
|
48
|
-
- -
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
|
51
|
-
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
63
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
hash: 3
|
68
|
+
segments:
|
69
|
+
- 0
|
70
|
+
version: "0"
|
57
71
|
requirements: []
|
72
|
+
|
58
73
|
rubyforge_project:
|
59
|
-
rubygems_version: 1.8.
|
74
|
+
rubygems_version: 1.8.21
|
60
75
|
signing_key:
|
61
76
|
specification_version: 3
|
62
77
|
summary: Just allows you to upload gists
|
63
78
|
test_files: []
|
79
|
+
|
80
|
+
has_rdoc:
|