spiced_rumby 0.6.0 → 0.7.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 +4 -4
- data/README.md +11 -0
- data/lib/spiced_rumby.rb +5 -0
- data/lib/spiced_rumby/notifier.rb +43 -0
- data/lib/spiced_rumby/version.rb +1 -1
- data/spiced_rumby.gemspec +1 -0
- data/vendor/icons/ic_chat_bubble_black_24dp.png +0 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb00cb95c281626f71cef51eddcec81dfa90de0b
|
4
|
+
data.tar.gz: b6f89d8e311a5201c4fe067ed35fe274c528f60b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab9e63a5350f935066718ba36f56314e9082579f0a2b45f4f0eab7a307f5ad9895496ed92a1190616deee504d36b5b2867991a6128b0eb3a9a0f0791fb047cec
|
7
|
+
data.tar.gz: c2baf5e71547d95d4a0c015bd31ec6adbd0fee3f012050017b697d640ffc01365d245338e5161097cbedafb6bdac151c0cbcccddf24af87f01c15a287dd42953
|
data/README.md
CHANGED
@@ -27,6 +27,13 @@ bundle install # to install ruby dependencies
|
|
27
27
|
|
28
28
|
# Dependencies
|
29
29
|
|
30
|
+
### Gems
|
31
|
+
|
32
|
+
[meshchat](https://github.com/NullVoxPopuli/meshchat) - the core of mesh chat communication / basic functionality
|
33
|
+
[libnotify](https://github.com/splattael/libnotify) - for notifications on unix systems.
|
34
|
+
|
35
|
+
### System
|
36
|
+
|
30
37
|
For sending messages
|
31
38
|
```bash
|
32
39
|
sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev
|
@@ -37,3 +44,7 @@ For encryption and RSA key generation
|
|
37
44
|
```bash
|
38
45
|
sudo apt-get install openssl
|
39
46
|
```
|
47
|
+
|
48
|
+
|
49
|
+
# Credits
|
50
|
+
[Icon by Google](https://www.google.com/design/icons/)
|
data/lib/spiced_rumby.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
# helper gems
|
2
|
+
require 'libnotify'
|
3
|
+
|
1
4
|
# require the core functionality
|
2
5
|
require 'meshchat'
|
3
6
|
|
@@ -5,6 +8,7 @@ require 'meshchat'
|
|
5
8
|
require 'spiced_rumby/version'
|
6
9
|
require 'spiced_rumby/cli_input'
|
7
10
|
require 'spiced_rumby/cli_output'
|
11
|
+
require 'spiced_rumby/notifier'
|
8
12
|
|
9
13
|
module SpicedRumby
|
10
14
|
NAME = 'Spiced Rumby'
|
@@ -17,6 +21,7 @@ module SpicedRumby
|
|
17
21
|
client_version: VERSION,
|
18
22
|
display: CLIOutput,
|
19
23
|
input: CLIInput,
|
24
|
+
notifier: Notifier,
|
20
25
|
on_display_start: ->{ MeshChat::CLI.check_startup_settings }
|
21
26
|
)
|
22
27
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module SpicedRumby
|
2
|
+
# Inherit from base to obtain singletonness
|
3
|
+
#
|
4
|
+
# Meshchat uses singletons for notifications, because an OS
|
5
|
+
# generally only has one notification system
|
6
|
+
class Notifier < MeshChat::Notifier::Base
|
7
|
+
|
8
|
+
# this is the only method that needs to be overwritten
|
9
|
+
def show(*args)
|
10
|
+
libnotify_message.update(*args) do |notify|
|
11
|
+
yield(notify) if block_given?
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def icon_path
|
18
|
+
unless @icon_path
|
19
|
+
relative_path = 'vendor/icons/ic_chat_bubble_black_24dp.png'
|
20
|
+
current_directory = Dir.pwd # should be the gem root
|
21
|
+
@icon_path = current_directory + '/' + relative_path
|
22
|
+
end
|
23
|
+
|
24
|
+
@icon_path
|
25
|
+
end
|
26
|
+
|
27
|
+
def libnotify_message()
|
28
|
+
@message ||= Libnotify.new do |notify|
|
29
|
+
notify.summary = MeshChat::NAME
|
30
|
+
notify.body = ""
|
31
|
+
notify.timeout = 1.5 # 1.5 (s), 1000 (ms), "2", nil, false
|
32
|
+
notify.urgency = :normal # :low, :normal, :critical
|
33
|
+
notify.append = false # default true - append onto existing notification
|
34
|
+
notify.transient = false # default false - keep the notifications around after display
|
35
|
+
# TODO: this will vary on each system - maybe package icons
|
36
|
+
# with the gem
|
37
|
+
notify.icon_path = icon_path
|
38
|
+
end
|
39
|
+
|
40
|
+
@message
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/spiced_rumby/version.rb
CHANGED
data/spiced_rumby.gemspec
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spiced_rumby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- L. Preston Sego III
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: libnotify
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rspec
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -99,12 +113,14 @@ files:
|
|
99
113
|
- lib/spiced_rumby.rb
|
100
114
|
- lib/spiced_rumby/cli_input.rb
|
101
115
|
- lib/spiced_rumby/cli_output.rb
|
116
|
+
- lib/spiced_rumby/notifier.rb
|
102
117
|
- lib/spiced_rumby/version.rb
|
103
118
|
- run
|
104
119
|
- spec/spec_helper.rb
|
105
120
|
- spec/support/display/null/ui.rb
|
106
121
|
- spec/support/utils.rb
|
107
122
|
- spiced_rumby.gemspec
|
123
|
+
- vendor/icons/ic_chat_bubble_black_24dp.png
|
108
124
|
homepage: https://github.com/NullVoxPopuli/spiced_rumby
|
109
125
|
licenses:
|
110
126
|
- MIT
|
@@ -128,7 +144,7 @@ rubyforge_project:
|
|
128
144
|
rubygems_version: 2.4.7
|
129
145
|
signing_key:
|
130
146
|
specification_version: 4
|
131
|
-
summary: SpicedRumby-0.
|
147
|
+
summary: SpicedRumby-0.7.0
|
132
148
|
test_files:
|
133
149
|
- spec/spec_helper.rb
|
134
150
|
- spec/support/display/null/ui.rb
|