gisty 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +0 -1
  2. data/bin/gisty +2 -5
  3. data/lib/gisty.rb +10 -6
  4. metadata +4 -4
data/README.rdoc CHANGED
@@ -10,7 +10,6 @@ yet another command line client for gist
10
10
 
11
11
  === Gem Installation
12
12
 
13
- gem sources -a http://gemcutter.org (you only have to do this once)
14
13
  sudo gem install gisty
15
14
 
16
15
  set environment variable GISTY_DIR.
data/bin/gisty CHANGED
@@ -95,11 +95,8 @@ end
95
95
 
96
96
  if ENV['GISTY_DIR']
97
97
  begin
98
- if ENV['GISTY_SSL_CA']
99
- @g = Gisty.new ENV['GISTY_DIR'], nil, nil, :ssl_ca => ENV['GISTY_SSL_CA']
100
- else
101
- @g = Gisty.new ENV['GISTY_DIR']
102
- end
98
+ @g = Gisty.new ENV['GISTY_DIR'], nil, nil, :ssl_ca => ENV['GISTY_SSL_CA'],
99
+ :ssl_verify => ENV['GISTY_SSL_VERIFY']
103
100
  rescue Gisty::UnsetAuthInfoException => e
104
101
  puts 'Error: set your api token.'
105
102
  puts 'see Global Git Config at https://github.com/account'
data/lib/gisty.rb CHANGED
@@ -7,7 +7,7 @@ require 'nokogiri'
7
7
  require 'net/https'
8
8
 
9
9
  class Gisty
10
- VERSION = '0.0.18'
10
+ VERSION = '0.0.19'
11
11
  GIST_URL = 'https://gist.github.com/'
12
12
  GISTY_URL = 'http://github.com/swdyh/gisty/tree/master'
13
13
 
@@ -41,9 +41,13 @@ class Gisty
41
41
  @auth_query = "login=#{@auth['login']}&token=#{@auth['token']}"
42
42
  @dir = Pathname.pwd.realpath.join path
43
43
  FileUtils.mkdir_p @dir unless @dir.exist?
44
- if opt[:ssl_ca]
45
- @ssl_ca = opt[:ssl_ca]
46
- end
44
+ @ssl_ca = opt[:ssl_ca]
45
+ @ssl_verify = case opt[:ssl_verify]
46
+ when /none/i
47
+ OpenSSL::SSL::VERIFY_NONE
48
+ else
49
+ OpenSSL::SSL::VERIFY_PEER
50
+ end
47
51
  end
48
52
 
49
53
  def next_link str
@@ -158,7 +162,7 @@ class Gisty
158
162
  req.set_form_data params
159
163
  https = Net::HTTP.new(url.host, url.port)
160
164
  https.use_ssl = true
161
- https.verify_mode = OpenSSL::SSL::VERIFY_PEER
165
+ https.verify_mode = @ssl_verify
162
166
  https.verify_depth = 5
163
167
  if @ssl_ca
164
168
  https.ca_file = @ssl_ca
@@ -200,7 +204,7 @@ class Gisty
200
204
  req = Net::HTTP::Get.new url.request_uri
201
205
  https = Net::HTTP.new(url.host, url.port)
202
206
  https.use_ssl = true
203
- https.verify_mode = OpenSSL::SSL::VERIFY_PEER
207
+ https.verify_mode = @ssl_verify
204
208
  https.verify_depth = 5
205
209
  https.ca_file = @ssl_ca
206
210
  res = https.start {|http| http.request(req) }
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: 59
4
+ hash: 57
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 18
10
- version: 0.0.18
9
+ - 19
10
+ version: 0.0.19
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: 2011-01-24 00:00:00 +09:00
18
+ date: 2011-03-01 00:00:00 +09:00
19
19
  default_executable: gisty
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency