sps_messenger 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 20e824e597b3de3992e7c9ca4d3f36dc929d9b6e
4
+ data.tar.gz: 504f751f8ebe22e4cca01219d39c9b0479cf2444
5
+ SHA512:
6
+ metadata.gz: f9419e46a7de4f8cef037cd751321d2050e58c6e3b7325b9a7a0596b1242fc955eebc44101a73995d051f29b89b4231704ea743c19e00b7d50bbd2210eeb2396
7
+ data.tar.gz: 2d7f0cb48ee37e4533bc45b6843aa9f1a1dff6aeb08d484743c55efa3d056f0474f909e885fa9fe0cd892540ebfb659d5ee850d2cf27b7f7061529aa7525435d
checksums.yaml.gz.sig ADDED
Binary file
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env ruby
2
+
3
+
4
+ # file: sps_messenger.rb
5
+
6
+ # description: Subscribes to SPS messages intended for a human.
7
+ #
8
+ # Messages could include:
9
+ #
10
+ # * weather info
11
+ # * reminders (e.g. upcoming events or appointsments, to-do list)
12
+ # * unread important email
13
+ # * local news headlines
14
+ # * price of Bitcoin
15
+ # * latest RSS headlines etc.
16
+
17
+ require 'sps-sub'
18
+ require "curses"
19
+ include Curses
20
+
21
+
22
+
23
+ class SPSMessenger < SPSSub
24
+
25
+ def onmessage(msg)
26
+ clear_screen()
27
+ puts msg
28
+ end
29
+
30
+ def start()
31
+ Curses.init_screen
32
+ #x = Curses.cols / 2 # We will center our text
33
+ x = 0
34
+ y = Curses.lines / 2
35
+ Curses.setpos(y, x) # Move the cursor to the center of the screen
36
+ curs_set(0) # invisible cursor
37
+ start_color
38
+ init_pair(COLOR_GREEN, COLOR_GREEN,COLOR_BLACK)
39
+ init_pair(COLOR_YELLOW,COLOR_YELLOW,COLOR_BLACK)
40
+ attron(color_pair(COLOR_GREEN)|A_NORMAL){ addstr('ready ') }
41
+ refresh()
42
+
43
+ subscribe()
44
+ end
45
+
46
+ private
47
+
48
+
49
+ def subscribe(topic: 'messenger')
50
+
51
+ super(topic: topic) do |msg|
52
+
53
+ clear()
54
+ #x = cols / 2 # We will center our text
55
+ x = 0
56
+ y = lines / 2
57
+ setpos(y, x) # Move the cursor to the center of the screen
58
+
59
+
60
+ begin
61
+ #flash()
62
+ #addstr(msg) # Display the text
63
+ #attron(color_pair(COLOR_YELLOW)|A_NORMAL){ addstr(msg) }
64
+ addstr(msg)
65
+ refresh # Refresh the screen
66
+
67
+ end
68
+
69
+ end
70
+
71
+ end
72
+
73
+ end
74
+
75
+ if __FILE__ == $0 then
76
+ SPSMessenger.new(host: ARGV[0] || 'sps').start
77
+ end
data.tar.gz.sig ADDED
@@ -0,0 +1,4 @@
1
+ nr���um/��+�
2
+ �O`w��k���!�
3
+ G ����.����N�T�z�j6�I�q�a+����q����������Y�^����.M;�6��"�\��g#
4
+ �Jcz�n_��^v�[l�]�v(!��zA���s�6��h7�yG��|�ܺ��Z�m��]����t6
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sps_messenger
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDXjCCAkagAwIBAgIBATANBgkqhkiG9w0BAQUFADAsMSowKAYDVQQDDCFnZW1t
14
+ YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgwMjAyMjA0MzA1WhcN
15
+ MTkwMjAyMjA0MzA1WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
+ cnRzb24vREM9ZXUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDL9utD
17
+ F/tzyXI3I1o4MV4a4HyFSE2j9EAqokPdSDBg7Nino3p/YCrCuQDp94Y2YhF4l70s
18
+ vOhKL1Sk0Nz29IvqqAmQPMaqT94DYdf/EAz8nrX8zO2EKJQ8A4nZs8uVqIlW9bnk
19
+ Aza/La3BnukQq2IYrkd0a8J7rn25sImBKv+m8VSrWooy9E5IyXuekaXQYoPVVr3z
20
+ RIsyRcCK1kqgBEfKszuESNnyp3VS3ZTDpLHdxyV8atAMd1Z6J3v2Ue0p44hBAuvs
21
+ a/w/iAOuscY0hIvWe287MdzCPBcS3GIf21O7b3a0Dck7JwWt/l42/l/KZIftMMET
22
+ pEVwtbQx3HbQP4+hAgMBAAGjgYowgYcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
23
+ HQYDVR0OBBYEFEQyy7ds98ev7BWa3q73c3Itk9ZgMCYGA1UdEQQfMB2BG2dlbW1h
24
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTAmBgNVHRIEHzAdgRtnZW1tYXN0ZXJAamFt
25
+ ZXNyb2JlcnRzb24uZXUwDQYJKoZIhvcNAQEFBQADggEBAH2VhGU/2RruA+kRa9/+
26
+ IeK/8ONnss9UnZWQuZLaIlSGDEeJB7euhopQ9YBlcO2vrZKhvAh3aQtoi+qGDaW0
27
+ yP0lqDMYI6fiJJ9JebNQ6wA7CyrPoxI2fC0Q+sISZzDarVZ6MfO0sL5vwPKcNfRF
28
+ tV9PnFtbgWZi7YlEUMGvvQU8PETbEYrgp319HSGofUH5xefcpWaESqeaxH2803Vs
29
+ UqPDoD7UfBhJ2Iqx0cA2zcZnHNnz2cwmc6cxrWPnezBE7r0olS/YSFzXQVolxElC
30
+ w49j6lo3SYntBH8faZClS/o2IYpidKzYdUljN0rBk2csvAD/Xzhm5Sh6toNo7V7G
31
+ fpc=
32
+ -----END CERTIFICATE-----
33
+ date: 2018-02-02 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: sps-sub
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '0.3'
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: 0.3.6
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - "~>"
50
+ - !ruby/object:Gem::Version
51
+ version: '0.3'
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 0.3.6
55
+ description:
56
+ email: james@jamesrobertson.eu
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - lib/sps_messenger.rb
62
+ homepage: https://github.com/jrobertson/sps_messenger
63
+ licenses:
64
+ - MIT
65
+ metadata: {}
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 2.6.13
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: Subscribes to SPS messages intended for a human.
86
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,5 @@
1
+ �ĺ�(me
2
+ �w��ru��F��E!�?%���U,����:NR�D�9��(#�n�5��/G1u�aFAI|=DF�Vȥ[���O�J�X�)ݩ���=�
3
+ a�-��
4
+ �v�8$-C�J�(K�۝��M��<���-��9��_W����NU���-���t�c�|��ۥO�\6^k� 8�d�
5
+ ��LC>NSI��+�~�۶�-\ٹ���vwpQ��%� /n7OV�f$D���o��:";諆9�N�1rE�f�s>R��