jist 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/jist +4 -0
- data/lib/jist.rb +8 -2
- metadata +6 -4
data/bin/jist
CHANGED
@@ -61,6 +61,10 @@ gist.
|
|
61
61
|
options[:update] = update
|
62
62
|
end
|
63
63
|
|
64
|
+
opts.on("-a", "--anonymous", "Create an anonymous gist.") do
|
65
|
+
options[:anonymous] = true
|
66
|
+
end
|
67
|
+
|
64
68
|
opts.on("-t", "--token OAUTH_TOKEN", "The OAuth2 access_token to use.") do |token|
|
65
69
|
options[:access_token] = token
|
66
70
|
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.
|
8
|
+
VERSION = '0.9.0'
|
9
9
|
|
10
10
|
# Exception tag for errors raised while gisting.
|
11
11
|
module Error; end
|
@@ -19,6 +19,7 @@ module Jist
|
|
19
19
|
# @option options [String] :description the description
|
20
20
|
# @option options [String] :filename ('a.rb') the filename
|
21
21
|
# @option options [Boolean] :public (false) is this gist public
|
22
|
+
# @option options [Boolean] :anonymous (false) is this gist anonymous
|
22
23
|
# @option options [String] :access_token (`File.read("~/.jist")`) The OAuth2 access token.
|
23
24
|
# @option options [String] :update the URL or id of a gist to update
|
24
25
|
#
|
@@ -38,6 +39,7 @@ module Jist
|
|
38
39
|
#
|
39
40
|
# @option options [String] :description the description
|
40
41
|
# @option options [Boolean] :public (false) is this gist public
|
42
|
+
# @option options [Boolean] :anonymous (false) is this gist anonymous
|
41
43
|
# @option options [String] :access_token (`File.read("~/.jist")`) The OAuth2 access token.
|
42
44
|
# @option options [String] :update the URL or id of a gist to update
|
43
45
|
#
|
@@ -58,7 +60,11 @@ module Jist
|
|
58
60
|
end
|
59
61
|
|
60
62
|
existing_gist = options[:update].to_s.split("/").last
|
61
|
-
|
63
|
+
if options[:anonymous]
|
64
|
+
access_token = nil
|
65
|
+
else
|
66
|
+
access_token = (options[:access_token] || File.read(File.expand_path("~/.jist")) rescue nil)
|
67
|
+
end
|
62
68
|
|
63
69
|
url = "/gists"
|
64
70
|
url << "/" << CGI.escape(existing_gist) if existing_gist.to_s != ''
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -35,7 +35,8 @@ extensions: []
|
|
35
35
|
extra_rdoc_files: []
|
36
36
|
files:
|
37
37
|
- lib/jist.rb
|
38
|
-
-
|
38
|
+
- !binary |-
|
39
|
+
YmluL2ppc3Q=
|
39
40
|
homepage: https://github.com/ConradIrwin/jist
|
40
41
|
licenses: []
|
41
42
|
post_install_message:
|
@@ -56,8 +57,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
57
|
version: '0'
|
57
58
|
requirements: []
|
58
59
|
rubyforge_project:
|
59
|
-
rubygems_version: 1.8.
|
60
|
+
rubygems_version: 1.8.19
|
60
61
|
signing_key:
|
61
62
|
specification_version: 3
|
62
63
|
summary: Just allows you to upload gists
|
63
64
|
test_files: []
|
65
|
+
has_rdoc:
|