gisty 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +2 -2
  2. data/lib/gisty.rb +13 -5
  3. metadata +27 -9
data/README.rdoc CHANGED
@@ -10,8 +10,8 @@ yet another command line client for gist
10
10
 
11
11
  === Gem Installation
12
12
 
13
- gem sources -a http://gems.github.com (you only have to do this once)
14
- sudo gem install swdyh-gisty
13
+ gem sources -a http://gemcutter.org (you only have to do this once)
14
+ sudo gem install gisty
15
15
 
16
16
  set environment variable GISTY_DIR.
17
17
  example .zshrc
data/lib/gisty.rb CHANGED
@@ -4,10 +4,11 @@ require 'open-uri'
4
4
  require 'fileutils'
5
5
  require 'rubygems'
6
6
  require 'nokogiri'
7
+ require 'net/https'
7
8
 
8
9
  class Gisty
9
- VERSION = '0.0.15'
10
- GIST_URL = 'http://gist.github.com/'
10
+ VERSION = '0.0.16'
11
+ GIST_URL = 'https://gist.github.com/'
11
12
  GISTY_URL = 'http://github.com/swdyh/gisty/tree/master'
12
13
 
13
14
  class UnsetAuthInfoException < Exception
@@ -149,9 +150,16 @@ class Gisty
149
150
  end
150
151
 
151
152
  def post params
152
- url = URI.parse('http://gist.github.com/gists')
153
- res = Net::HTTP.post_form(url, params)
154
- if res['Location']
153
+ url = URI.parse('https://gist.github.com/gists')
154
+ req = Net::HTTP::Post.new url.path
155
+ req.set_form_data params
156
+ https = Net::HTTP.new(url.host, url.port)
157
+ https.use_ssl = true
158
+ https.verify_mode = OpenSSL::SSL::VERIFY_PEER
159
+ https.verify_depth = 5
160
+ res = https.start {|http| http.request(req) }
161
+ case res
162
+ when Net::HTTPSuccess, Net::HTTPRedirection
155
163
  res['Location']
156
164
  else
157
165
  raise PostFailureException, res.inspect
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gisty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ hash: 63
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 16
10
+ version: 0.0.16
5
11
  platform: ruby
6
12
  authors:
7
13
  - swdyh
@@ -9,19 +15,25 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-12-08 00:00:00 +09:00
18
+ date: 2010-11-05 00:00:00 +09:00
13
19
  default_executable: gisty
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: nokogiri
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 23
30
+ segments:
31
+ - 1
32
+ - 0
33
+ - 0
23
34
  version: 1.0.0
24
- version:
35
+ type: :runtime
36
+ version_requirements: *id001
25
37
  description: yet another command line client for gist
26
38
  email: http://mailhide.recaptcha.net/d?k=01AhB7crgrlHptVaYRD0oPwA==&c=L_iqOZrGmo6hcGpPTFg1QYnjr-WpAStyQ4Y8ShfgOHs=
27
39
  executables:
@@ -66,21 +78,27 @@ rdoc_options:
66
78
  require_paths:
67
79
  - lib
68
80
  required_ruby_version: !ruby/object:Gem::Requirement
81
+ none: false
69
82
  requirements:
70
83
  - - ">="
71
84
  - !ruby/object:Gem::Version
85
+ hash: 3
86
+ segments:
87
+ - 0
72
88
  version: "0"
73
- version:
74
89
  required_rubygems_version: !ruby/object:Gem::Requirement
90
+ none: false
75
91
  requirements:
76
92
  - - ">="
77
93
  - !ruby/object:Gem::Version
94
+ hash: 3
95
+ segments:
96
+ - 0
78
97
  version: "0"
79
- version:
80
98
  requirements: []
81
99
 
82
100
  rubyforge_project: gisty
83
- rubygems_version: 1.3.5
101
+ rubygems_version: 1.3.7
84
102
  signing_key:
85
103
  specification_version: 3
86
104
  summary: yet another command line client for gist