notifyor 0.5.9 → 0.6.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82621b2418dfe7998da60778850d744ebf7d55a8
4
- data.tar.gz: 70c0cd2c971869cde053739848d16f63f3d1d9ac
3
+ metadata.gz: a861fe6c36b3592bf74b9afe711ab8de22618cea
4
+ data.tar.gz: ecb693808505195952efaccc89b6a5f96037e2d3
5
5
  SHA512:
6
- metadata.gz: 2699edc877c6efc4ae1a6cd2218cdffc6fdbc0c7bf39257b00c4a4577bae8b9e878dc27d820830548f9d8e90eb90458c0a5838d239c60fec9dc97cadd910f2fb
7
- data.tar.gz: b7633d26c64280ee5ffffbc290737b7a36abb0bd4ecb49c44f4305f4d2b24507f9e69b3f2d1cd8fd35a0baca5d573ef00558585bf108ef77eca3c438dfcbf7ea
6
+ metadata.gz: 16cf82af9309476da346619354c0c494d1716b10eecd01f260340903df8f7f178e7f3f933a0c56f601ae0359fa6b48c185594724d4e1c38c90c9ce2fbb420314
7
+ data.tar.gz: b9c667ad5bef798beacb48b6d403083bdb63bbd134266f2344969f9aaed79e579a0f16b636774719a0d47b2ee98786fbd0d8f12cfb8d8bbb930b30771360143b
@@ -1,10 +1,21 @@
1
+ require 'notifyor/util/os_analyzer'
1
2
  module Notifyor
2
3
  module Growl
3
4
  extend self
4
5
 
5
6
  def adapter
6
7
  return @adapter if @adapter
7
- self.adapter = :terminal_notifier
8
+ self.adapter =
9
+ case ::Notifyor::Util::OSAnalyzer.os
10
+ when :macosx
11
+ :terminal_notifier
12
+ when :linux
13
+ :libnotify_notifier
14
+ when :unix
15
+ :libnotify_notifier
16
+ else
17
+ raise 'Operating system not recognized.'
18
+ end
8
19
  @adapter
9
20
  end
10
21
 
@@ -0,0 +1,14 @@
1
+ module Notifyor
2
+ module Growl
3
+ module Adapters
4
+ module LibnotifyNotifier
5
+ extend self
6
+
7
+ def create_growl(title, message)
8
+ %x(notify-send '#{title}' '#{message}')
9
+ end
10
+
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,23 @@
1
+ require 'rbconfig'
2
+ module Notifyor
3
+ module Util
4
+ module OSAnalyzer
5
+ extend self
6
+ def os
7
+ host_os = RbConfig::CONFIG['host_os']
8
+ case host_os
9
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
10
+ :windows
11
+ when /darwin|mac os/
12
+ :macosx
13
+ when /linux/
14
+ :linux
15
+ when /solaris|bsd/
16
+ :unix
17
+ else
18
+ raise "unknown os: #{host_os.inspect}"
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module Notifyor
2
- VERSION = "0.5.9"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifyor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erwin Schens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-06 00:00:00.000000000 Z
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -124,10 +124,12 @@ files:
124
124
  - lib/notifyor/cli.rb
125
125
  - lib/notifyor/configuration.rb
126
126
  - lib/notifyor/growl.rb
127
+ - lib/notifyor/growl/adapters/libnotify_notifier.rb
127
128
  - lib/notifyor/growl/adapters/terminal_notifier.rb
128
129
  - lib/notifyor/plugin.rb
129
130
  - lib/notifyor/remote/connection.rb
130
131
  - lib/notifyor/util/formatter.rb
132
+ - lib/notifyor/util/os_analyzer.rb
131
133
  - lib/notifyor/version.rb
132
134
  - spec/spec_helper.rb
133
135
  - spec/test_app/README.rdoc