fidget 0.0.4 → 0.0.5

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
2
  SHA1:
3
- metadata.gz: ad59e6d764cbf2bc8910fe3905b909f7efb25c1d
4
- data.tar.gz: 675e1df0a3eb686dd15ee958ecd5e82de9c02043
3
+ metadata.gz: 886d0692227eb027e7461841ae2f0b12680e42e5
4
+ data.tar.gz: 4c8b1f9a08d8a94abae42043d453a7c783928586
5
5
  SHA512:
6
- metadata.gz: ec59b3d504006e39b0e881db51b7be974d4897bcb8de11dadc433658773c5d10e5f9cd0b25c80fbdb881586dc55c5ea1f83235211756447a89c02c0c0acac93d
7
- data.tar.gz: e1a8fb990e49593ce2f141a183e7715b570db26b854d601385a28ba89553c4fc0c2f55cbb0b9abd65271ffd2a0997204d453da8fec2f0cdaebfa82254db8f259
6
+ metadata.gz: 63e92d4f812193f4a09ec4e30e10a0b7d1e84097980ff4aebc6e4d4068f4f61798bb056ae69712bdf3228529666e04b48d8e49cb3fb812fbba04b671f30070c3
7
+ data.tar.gz: 816b5ea2e48d93c4597d270881d12b8e4e6799cea3a7f26f241d42fa9505c3fec120b09ce23fe53d33b614e9283362ab06500d90f3d6932a51720a186deff788
@@ -6,8 +6,8 @@ class Fidget
6
6
  when /darwin/
7
7
  require 'fidget/platform/darwin'
8
8
 
9
- when /linux/
10
- require 'fidget/platform/linux'
9
+ when /freebsd|linux/
10
+ require 'fidget/platform/posix'
11
11
 
12
12
  when /cygwin|mswin|mingw|bccwin|wince|emx/
13
13
  require 'fidget/platform/windows'
@@ -1,5 +1,6 @@
1
1
  class Fidget::Platform
2
2
  require "dbus"
3
+ @@cookie = nil
3
4
 
4
5
  def self.current_process(options)
5
6
  return false unless required_binaries
@@ -20,8 +21,6 @@ class Fidget::Platform
20
21
  yield
21
22
  resume(options)
22
23
  end
23
-
24
- pid
25
24
  end
26
25
 
27
26
  def self.allow_sleep
@@ -49,7 +48,7 @@ class Fidget::Platform
49
48
 
50
49
  def self.root_win
51
50
  ids = `xwininfo -root`.each_line.collect do |line|
52
- next unless line =~ /Window id: (0x\d+)/
51
+ next unless line =~ /Window id: (0x\h+)/
53
52
  $1
54
53
  end.compact
55
54
  raise "Parsing xwininfo failed" unless ids.size == 1
@@ -69,7 +68,9 @@ class Fidget::Platform
69
68
  # This is possibly because the inhibit expires when the dbus-session command terminates
70
69
  # I don't know if this will work in other distros though. Yay for consistency. *\o/*
71
70
  begin
72
- @@cookie = dbus_screensaver.Inhibit(root_win, 'Administratively disabled')
71
+ dbus_screensaver.Inhibit(root_win, 'Administratively disabled') do |res|
72
+ @@cookie = res
73
+ end
73
74
  rescue => e
74
75
  STDERR.puts 'Fidget: DBus action failed.'
75
76
  STDERR.puts e.message
@@ -1,3 +1,3 @@
1
1
  class Fidget
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fidget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Ford
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-24 00:00:00.000000000 Z
11
+ date: 2017-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-dbus
@@ -39,16 +39,16 @@ executables:
39
39
  extensions: []
40
40
  extra_rdoc_files: []
41
41
  files:
42
- - README.md
43
42
  - LICENSE
43
+ - README.md
44
44
  - bin/fidget
45
+ - lib/fidget.rb
45
46
  - lib/fidget/logger.rb
46
47
  - lib/fidget/platform/darwin.rb
47
- - lib/fidget/platform/linux.rb
48
48
  - lib/fidget/platform/null.rb
49
+ - lib/fidget/platform/posix.rb
49
50
  - lib/fidget/platform/windows.rb
50
51
  - lib/fidget/version.rb
51
- - lib/fidget.rb
52
52
  homepage: https://github.com/binford2k/fidget
53
53
  licenses:
54
54
  - Apache 2.0
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  version: '0'
70
70
  requirements: []
71
71
  rubyforge_project:
72
- rubygems_version: 2.0.14.1
72
+ rubygems_version: 2.5.2
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: Cross platform tool to prevent your computer from sleeping.