gist 1.0.0 → 1.0.1
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/README.markdown +8 -0
- data/Rakefile +6 -2
- data/lib/gist.rb +4 -4
- data/lib/gist/version.rb +1 -1
- metadata +1 -1
data/README.markdown
CHANGED
data/Rakefile
CHANGED
data/lib/gist.rb
CHANGED
@@ -117,11 +117,11 @@ module Gist
|
|
117
117
|
# Tries to copy passed content to the clipboard.
|
118
118
|
def copy(content)
|
119
119
|
cmd = case true
|
120
|
-
when system("which pbcopy
|
120
|
+
when system("which pbcopy &> /dev/null")
|
121
121
|
:pbcopy
|
122
|
-
when system("which xclip
|
122
|
+
when system("which xclip &> /dev/null")
|
123
123
|
:xclip
|
124
|
-
when system("which putclip")
|
124
|
+
when system("which putclip &> /dev/null")
|
125
125
|
:putclip
|
126
126
|
end
|
127
127
|
|
@@ -137,7 +137,7 @@ private
|
|
137
137
|
# an appropriate payload for POSTing to gist.github.com
|
138
138
|
def data(name, ext, content, private_gist)
|
139
139
|
return {
|
140
|
-
'file_ext[gistfile1]' => ext,
|
140
|
+
'file_ext[gistfile1]' => ext ? ext : '.txt',
|
141
141
|
'file_name[gistfile1]' => name,
|
142
142
|
'file_contents[gistfile1]' => content
|
143
143
|
}.merge(private_gist ? { 'action_button' => 'private' } : {}).merge(auth)
|
data/lib/gist/version.rb
CHANGED