gisty 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gisty.rb +4 -2
- metadata +4 -4
data/lib/gisty.rb
CHANGED
@@ -7,9 +7,10 @@ require 'rubygems'
|
|
7
7
|
require 'json'
|
8
8
|
|
9
9
|
class Gisty
|
10
|
-
VERSION = '0.2.
|
10
|
+
VERSION = '0.2.4'
|
11
11
|
GIST_URL = 'https://gist.github.com/'
|
12
12
|
GISTY_URL = 'https://github.com/swdyh/gisty'
|
13
|
+
USER_AGENT = "gisty/#{VERSION} #{GISTY_URL}"
|
13
14
|
COMMAND_PATH = Pathname.new(File.join(File.dirname(__FILE__), 'commands')).realpath.to_s
|
14
15
|
|
15
16
|
class UnsetAuthInfoException < Exception
|
@@ -64,7 +65,7 @@ class Gisty
|
|
64
65
|
|
65
66
|
def mygists opt = {}
|
66
67
|
url = opt[:url] || ('https://api.github.com/gists?access_token=%s' % @access_token)
|
67
|
-
open_uri_opt = {}
|
68
|
+
open_uri_opt = { 'User-Agent' => USER_AGENT }
|
68
69
|
if @ssl_ca && OpenURI::Options.key?(:ssl_ca_cer)
|
69
70
|
open_uri_opt[:ssl_ca_cert] = @ssl_ca
|
70
71
|
end
|
@@ -170,6 +171,7 @@ class Gisty
|
|
170
171
|
url = URI.parse('https://api.github.com/gists')
|
171
172
|
req = Net::HTTP::Post.new url.path + '?access_token=' + @access_token
|
172
173
|
req.set_content_type('application/json')
|
174
|
+
req['User-Agent'] = USER_AGENT
|
173
175
|
req.body = params.to_json
|
174
176
|
if ENV['https_proxy']
|
175
177
|
proxy_uri = URI.parse(ENV['https_proxy'])
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gisty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 4
|
10
|
+
version: 0.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- swdyh
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2013-04-27 00:00:00 +09:00
|
19
19
|
default_executable: gisty
|
20
20
|
dependencies: []
|
21
21
|
|