gisty 0.2.4 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +4 -0
- data/lib/gisty.rb +5 -3
- metadata +61 -6
data/Rakefile
CHANGED
@@ -59,6 +59,10 @@ spec = Gem::Specification.new do |s|
|
|
59
59
|
|
60
60
|
#s.add_dependency('activesupport', '>=1.3.1')
|
61
61
|
#s.required_ruby_version = '>= 1.8.2'
|
62
|
+
s.add_development_dependency "json"
|
63
|
+
s.add_development_dependency "rake"
|
64
|
+
s.add_development_dependency "rr"
|
65
|
+
s.add_development_dependency "fakeweb"
|
62
66
|
|
63
67
|
s.files = %w(README.rdoc Rakefile) +
|
64
68
|
Dir.glob("{bin,doc,test,lib,templates,generator,extras,website,script}/**/*") +
|
data/lib/gisty.rb
CHANGED
@@ -7,8 +7,9 @@ require 'rubygems'
|
|
7
7
|
require 'json'
|
8
8
|
|
9
9
|
class Gisty
|
10
|
-
VERSION = '0.2.
|
10
|
+
VERSION = '0.2.6'
|
11
11
|
GIST_URL = 'https://gist.github.com/'
|
12
|
+
GIST_API_URL = 'https://api.github.com/gists'
|
12
13
|
GISTY_URL = 'https://github.com/swdyh/gisty'
|
13
14
|
USER_AGENT = "gisty/#{VERSION} #{GISTY_URL}"
|
14
15
|
COMMAND_PATH = Pathname.new(File.join(File.dirname(__FILE__), 'commands')).realpath.to_s
|
@@ -40,6 +41,7 @@ class Gisty
|
|
40
41
|
else
|
41
42
|
OpenSSL::SSL::VERIFY_PEER
|
42
43
|
end
|
44
|
+
@api_url = opt[:api_url] || GIST_API_URL
|
43
45
|
end
|
44
46
|
|
45
47
|
def all_mygists &block
|
@@ -64,7 +66,7 @@ class Gisty
|
|
64
66
|
end
|
65
67
|
|
66
68
|
def mygists opt = {}
|
67
|
-
url = opt[:url] || ('
|
69
|
+
url = opt[:url] || (@api_url + '?access_token=%s' % @access_token)
|
68
70
|
open_uri_opt = { 'User-Agent' => USER_AGENT }
|
69
71
|
if @ssl_ca && OpenURI::Options.key?(:ssl_ca_cer)
|
70
72
|
open_uri_opt[:ssl_ca_cert] = @ssl_ca
|
@@ -168,7 +170,7 @@ class Gisty
|
|
168
170
|
end
|
169
171
|
|
170
172
|
def post params
|
171
|
-
url = URI.parse(
|
173
|
+
url = URI.parse(@api_url)
|
172
174
|
req = Net::HTTP::Post.new url.path + '?access_token=' + @access_token
|
173
175
|
req.set_content_type('application/json')
|
174
176
|
req['User-Agent'] = USER_AGENT
|
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: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 6
|
10
|
+
version: 0.2.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- swdyh
|
@@ -15,10 +15,65 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-07-10 00:00:00 +09:00
|
19
19
|
default_executable: gisty
|
20
|
-
dependencies:
|
21
|
-
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: json
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rake
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rr
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
type: :development
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: fakeweb
|
65
|
+
prerelease: false
|
66
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
type: :development
|
76
|
+
version_requirements: *id004
|
22
77
|
description: yet another command line client for gist. Gisty uses Github API V3 via OAuth2.
|
23
78
|
email: http://mailhide.recaptcha.net/d?k=01AhB7crgrlHptVaYRD0oPwA==&c=L_iqOZrGmo6hcGpPTFg1QYnjr-WpAStyQ4Y8ShfgOHs=
|
24
79
|
executables:
|