jist 1.1.1.pre.2 → 1.1.1.pre.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/jist +1 -1
  2. data/lib/jist.rb +2 -29
  3. data/spec/clipboard_spec.rb +2 -2
  4. metadata +1 -1
data/bin/jist CHANGED
@@ -99,7 +99,7 @@ opts.parse!
99
99
 
100
100
  begin
101
101
  if options[:paste]
102
- puts Jist.gist(Jist.paste, options)['html_url']
102
+ puts Jist.gist(Clippy.paste, options)['html_url']
103
103
  elsif ARGV.size == 0
104
104
  $stderr.puts "(type a gist. <ctrl-c> to cancel, <ctrl-d> when done)" if $stdin.tty?
105
105
  puts Jist.gist(ARGF.read, options)['html_url']
data/lib/jist.rb CHANGED
@@ -7,15 +7,7 @@ require 'clippy'
7
7
  module Jist
8
8
  extend self
9
9
 
10
- VERSION = '1.1.1.pre.2'
11
-
12
- # A list of clipboard commands with copy and paste support.
13
- CLIPBOARD_COMMANDS = {
14
- 'xclip' => 'xclip -o',
15
- 'xsel' => 'xsel -o',
16
- 'pbcopy' => 'pbpaste',
17
- 'putclip' => 'getclip'
18
- }
10
+ VERSION = '1.1.1.pre.3'
19
11
 
20
12
  # Exception tag for errors raised while gisting.
21
13
  module Error; end
@@ -189,31 +181,12 @@ module Jist
189
181
  def on_success(body, options={})
190
182
  json = JSON.parse(body)
191
183
 
192
- Jist.copy(json['html_url']) if options[:copy]
184
+ Clippy.copy(json['html_url']) if options[:copy]
193
185
  Jist.open(json['html_url']) if options[:open]
194
186
 
195
187
  json
196
188
  end
197
189
 
198
- # Copy a string to the clipboard.
199
- #
200
- # @param [String] content
201
- # @raise [RuntimeError] if no clipboard integration could be found
202
- #
203
- # This method was heavily inspired by defunkt's Gist#copy,
204
- # @see https://github.com/defunkt/gist/blob/bca9b29/lib/gist.rb#L178
205
- def copy(content)
206
- Clippy.copy(content)
207
- end
208
-
209
- # Get a string from the clipboard.
210
- #
211
- # @param [String] content
212
- # @raise [RuntimeError] if no clipboard integration could be found
213
- def paste
214
- Clippy.paste(content)
215
- end
216
-
217
190
  # Find command from PATH environment.
218
191
  #
219
192
  # @param [String] cmd command name to find
@@ -16,7 +16,7 @@ describe '...' do
16
16
  end
17
17
 
18
18
  it 'should try to copy the url when the clipboard option is passed' do
19
- Jist.should_receive(:copy).with(@bobo_url)
19
+ Clippy.should_receive(:copy).with(@bobo_url)
20
20
  ask_for_copy
21
21
  end
22
22
 
@@ -29,6 +29,6 @@ describe '...' do
29
29
  ENV['PATH'] = ''
30
30
  lambda{
31
31
  ask_for_copy
32
- }.should raise_error(/Could not find copy command/)
32
+ }.should raise_error(/Clippy/)
33
33
  end
34
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1.pre.2
4
+ version: 1.1.1.pre.3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: