clipboard 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c91049aa4bbdb688bc936ab74e419a79168565c5
4
- data.tar.gz: 4556c855410c5585d338d9a75bb68e2370beb0b5
2
+ SHA256:
3
+ metadata.gz: 35bf4d71c38e0854369bfedf7b2db272f060ccd4eb6485be03d8935afbcaa200
4
+ data.tar.gz: 54a3a402a33fc33f20e2f12cc0c1969ff419ca3b6d81b331b7e1425959697bb4
5
5
  SHA512:
6
- metadata.gz: 06c1548b9cf38578c899021de84979e85147db85b7bc4909cfcf96dc53b7457368fce3fce9f1cae992c64e21ab60832d5210894a1ee266e73e00105c2187805d
7
- data.tar.gz: 9479f050e48e56f3d3f9c0c0028e7b409b5f5359d37d9249aa16b0accef35368912ce25976ea0d53cd75beeb253cb1fb7eb9a8d0d828965517c7a9090ced1fe9
6
+ metadata.gz: ec0e087dc69c65e32445c2ea89f75f4b2e49578ca37db4cca7d53502004e3f51aee276c97b704d816fbb33cd93dec61940b495a4123b0fbc27b3cf8984dada42
7
+ data.tar.gz: 971fb5dd754b01b350718a2111c9219a7c0af7a8bb5b4d322ddd6b667b6a348b3bc9bdaf9b33722bdb446597590fd2cfe0572052b4178140102791486decac69
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.1.2
4
+
5
+ - linux: Replace calls to `which` with native check (thanks @woodruffw)
6
+
3
7
  ## 1.1.1
4
8
 
5
9
  * Surpress 3rd party processes' STDERR, see #26
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Ruby Clipboard [![version](https://badge.fury.io/rb/clipboard.svg)](https://badge.fury.io/rb/clipboard) [<img src="https://travis-ci.org/janlelis/clipboard.png" />](https://travis-ci.org/janlelis/clipboard)
1
+ # Ruby Clipboard [![version](https://badge.fury.io/rb/clipboard.svg)](https://badge.fury.io/rb/clipboard) [<img src="https://travis-ci.org/janlelis/clipboard.svg" />](https://travis-ci.org/janlelis/clipboard)
2
2
 
3
3
  Lets you access the clipboard on Linux, MacOS, Windows and Cygwin.
4
4
 
@@ -24,7 +24,7 @@ this is: `sudo apt-get install xclip`
24
24
  ### Multiple Clipboards
25
25
 
26
26
  On Linux, you can choose from which clipboard you want to `paste` from by
27
- passing it as an argumument. The default is CLIPBOARD.
27
+ passing it as an argument. The default is CLIPBOARD.
28
28
 
29
29
  `copy` copies to all clipboards in `Clipboard::Linux::CLIPBOARDS`.
30
30
 
@@ -57,7 +57,7 @@ JRuby. On Linux, it always operates only on the CLIPBOARD clipboard.
57
57
  ### blip
58
58
 
59
59
  **blip** is a handy commandline wrapper that lets you quickly copy file
60
- content to your clipboard: [blip](http://rubygems.org/gems/blip)!
60
+ content to your clipboard: [blip](https://gist.github.com/janlelis/781835)!
61
61
 
62
62
  ### Copyright
63
63
 
@@ -1,5 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
1
  $:.unshift File.expand_path("../lib", __FILE__)
4
2
  require 'clipboard/version'
5
3
 
@@ -1,5 +1,7 @@
1
1
  require 'open3'
2
2
 
3
+ require_relative 'utils'
4
+
3
5
  module Clipboard
4
6
  module Linux
5
7
  extend self
@@ -7,11 +9,11 @@ module Clipboard
7
9
  CLIPBOARDS = %w[clipboard primary secondary].freeze
8
10
 
9
11
  # check which backend to use
10
- if system('which xclip >/dev/null 2>&1')
12
+ if Utils.executable_installed?('xclip')
11
13
  WriteCommand = 'xclip'.freeze
12
14
  ReadCommand = 'xclip -o'.freeze
13
15
  Selection = proc{ |x| "-selection #{x}" }.freeze
14
- elsif system('which xsel >/dev/null 2>&1')
16
+ elsif Utils.executable_installed?('xsel')
15
17
  WriteCommand = 'xsel -i'.freeze
16
18
  ReadCommand = 'xsel -o'.freeze
17
19
  Selection = { 'clipboard' => '-b', 'primary' => '-p', 'secondary' => '-s' }.freeze
@@ -0,0 +1,11 @@
1
+ module Clipboard
2
+ module Utils
3
+ extend self
4
+
5
+ def executable_installed?(cmd)
6
+ ENV['PATH'].split(::File::PATH_SEPARATOR).any? do |path|
7
+ ::File.executable?(::File.join(path, cmd))
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Clipboard
2
- VERSION = "1.1.1".freeze
2
+ VERSION = "1.1.2".freeze
3
3
  end
@@ -1,4 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
1
  # Please note: cannot test, if it really accesses your platform clipboard.
3
2
 
4
3
  require File.expand_path('spec/spec_helper')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clipboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-24 00:00:00.000000000 Z
11
+ date: 2018-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -56,6 +56,7 @@ files:
56
56
  - lib/clipboard/java.rb
57
57
  - lib/clipboard/linux.rb
58
58
  - lib/clipboard/mac.rb
59
+ - lib/clipboard/utils.rb
59
60
  - lib/clipboard/version.rb
60
61
  - lib/clipboard/windows.rb
61
62
  - spec/clipboard_spec.rb
@@ -83,7 +84,7 @@ requirements:
83
84
  install xclip'
84
85
  - On Windows, you will need the ffi gem.
85
86
  rubyforge_project:
86
- rubygems_version: 2.4.8
87
+ rubygems_version: 2.7.6
87
88
  signing_key:
88
89
  specification_version: 4
89
90
  summary: Access to the clipboard on Linux, MacOS, Windows, and Cygwin.