swdyh-gisty 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/gisty.rb +6 -5
- metadata +4 -4
data/lib/gisty.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
require 'pathname'
|
2
2
|
require 'net/http'
|
3
3
|
require 'open-uri'
|
4
|
+
require 'fileutils'
|
4
5
|
require 'rubygems'
|
5
6
|
require 'nokogiri'
|
6
7
|
|
7
8
|
class Gisty
|
8
|
-
VERSION = '0.0.
|
9
|
+
VERSION = '0.0.13'
|
9
10
|
GIST_URL = 'http://gist.github.com/'
|
10
11
|
GISTY_URL = 'http://github.com/swdyh/gisty/tree/master'
|
11
12
|
|
@@ -34,9 +35,9 @@ class Gisty
|
|
34
35
|
end
|
35
36
|
|
36
37
|
def initialize path, login = nil, token = nil
|
37
|
-
@auth = (login && token) ? {
|
38
|
-
raise UnsetAuthInfoException if @auth[
|
39
|
-
@auth_query = "login=#{@auth[
|
38
|
+
@auth = (login && token) ? { 'login' => login, 'token' => token } : auth
|
39
|
+
raise UnsetAuthInfoException if @auth['login'].nil? || @auth['token'].nil?
|
40
|
+
@auth_query = "login=#{@auth['login']}&token=#{@auth['token']}"
|
40
41
|
@dir = Pathname.pwd.realpath.join path
|
41
42
|
FileUtils.mkdir_p @dir unless @dir.exist?
|
42
43
|
end
|
@@ -144,7 +145,7 @@ class Gisty
|
|
144
145
|
def auth
|
145
146
|
user = `git config --global github.user`.strip
|
146
147
|
token = `git config --global github.token`.strip
|
147
|
-
user.empty? ? {} : {
|
148
|
+
user.empty? ? {} : { 'login' => user, 'token' => token }
|
148
149
|
end
|
149
150
|
|
150
151
|
def post params
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swdyh-gisty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- swdyh
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-10 00:00:00 -07:00
|
13
13
|
default_executable: gisty
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -48,7 +48,7 @@ files:
|
|
48
48
|
- test/gisty_test.rb
|
49
49
|
- test/test_helper.rb
|
50
50
|
- lib/gisty.rb
|
51
|
-
has_rdoc:
|
51
|
+
has_rdoc: false
|
52
52
|
homepage: http://github.com/swdyh/gisty/tree/master
|
53
53
|
post_install_message:
|
54
54
|
rdoc_options:
|
@@ -83,7 +83,7 @@ requirements: []
|
|
83
83
|
rubyforge_project: gisty
|
84
84
|
rubygems_version: 1.2.0
|
85
85
|
signing_key:
|
86
|
-
specification_version:
|
86
|
+
specification_version: 3
|
87
87
|
summary: yet another command line client for gist
|
88
88
|
test_files:
|
89
89
|
- test/gisty_test.rb
|