jist 1.1.1.pre.1 → 1.1.1.pre.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/jist.gemspec +1 -0
  2. data/lib/jist.rb +4 -4
  3. metadata +17 -1
data/jist.gemspec CHANGED
@@ -13,6 +13,7 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.executables << 'jist'
15
15
 
16
+ s.add_dependency 'clippy'
16
17
  s.add_dependency 'json'
17
18
  %w(rake rspec).each do |gem|
18
19
  s.add_development_dependency gem
data/lib/jist.rb CHANGED
@@ -1,12 +1,13 @@
1
1
  require 'net/https'
2
2
  require 'cgi'
3
3
  require 'json'
4
+ require 'clippy'
4
5
 
5
6
  # It just gists.
6
7
  module Jist
7
8
  extend self
8
9
 
9
- VERSION = '1.1.1.pre.1'
10
+ VERSION = '1.1.1.pre.2'
10
11
 
11
12
  # A list of clipboard commands with copy and paste support.
12
13
  CLIPBOARD_COMMANDS = {
@@ -202,8 +203,7 @@ module Jist
202
203
  # This method was heavily inspired by defunkt's Gist#copy,
203
204
  # @see https://github.com/defunkt/gist/blob/bca9b29/lib/gist.rb#L178
204
205
  def copy(content)
205
- IO.popen(clipboard_command(:copy), 'r+') { |clip| clip.print content }
206
- raise "Copying to clipboard failed" unless paste == content
206
+ Clippy.copy(content)
207
207
  end
208
208
 
209
209
  # Get a string from the clipboard.
@@ -211,7 +211,7 @@ module Jist
211
211
  # @param [String] content
212
212
  # @raise [RuntimeError] if no clipboard integration could be found
213
213
  def paste
214
- `#{clipboard_command(:paste)}`
214
+ Clippy.paste(content)
215
215
  end
216
216
 
217
217
  # Find command from PATH environment.
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.1
4
+ version: 1.1.1.pre.2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -11,6 +11,22 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2012-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: clippy
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: json
16
32
  requirement: !ruby/object:Gem::Requirement