shutter3_morsecode 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 +7 -0
- checksums.yaml.gz.sig +0 -0
- data/lib/shutter3_morsecode.rb +83 -0
- data.tar.gz.sig +1 -0
- metadata +108 -0
- metadata.gz.sig +1 -0
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: '0446285ca4986f22a398c2690dc49141cb1ba7e4'
         | 
| 4 | 
            +
              data.tar.gz: c879cb4c0f35b20a39cc57b0040a95b5b9c19150
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: 5ba26522eebaef7e3578d26b577b35862383f02acc88ed0fbaf21057d24766f7b4d4f2442c66995b2c33f5f6677399c69ff8e5415c5a164cc5bfe66391623c22
         | 
| 7 | 
            +
              data.tar.gz: 70e9d68b02b2795c804ba817c60217115329a17405cecfd0754df336fe4d1b68e506c7ade91b553b2f21a328623862dca5ee7f22648eeb34202f7f25682deb28
         | 
    
        checksums.yaml.gz.sig
    ADDED
    
    | Binary file | 
| @@ -0,0 +1,83 @@ | |
| 1 | 
            +
            #!/usr/bin/env ruby
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            # file: shutter3_morsecode.rb
         | 
| 4 | 
            +
             | 
| 5 | 
            +
             | 
| 6 | 
            +
            require 'morsecode'
         | 
| 7 | 
            +
            require 'shutter3_sps'
         | 
| 8 | 
            +
             | 
| 9 | 
            +
             | 
| 10 | 
            +
            class Shutter3MorseCode < Shutter3Sps
         | 
| 11 | 
            +
             | 
| 12 | 
            +
              def initialize(bdid, topic: 'shutter3', sps_address: nil, 
         | 
| 13 | 
            +
                   sps_port: 59000, debug: false)
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                super(bdid, sps_address: sps_address, sps_port: sps_port)
         | 
| 16 | 
            +
                @mc = ''
         | 
| 17 | 
            +
                @t = Time.now
         | 
| 18 | 
            +
                @debug = debug
         | 
| 19 | 
            +
             | 
| 20 | 
            +
              end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
              def on_android_keypress()
         | 
| 23 | 
            +
             | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
              def on_android_keydown()
         | 
| 27 | 
            +
                @t = Time.now
         | 
| 28 | 
            +
                puts '@t: ' + @t.inspect if @debug
         | 
| 29 | 
            +
              end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
              def on_android_keyup()
         | 
| 32 | 
            +
                keyup(1)
         | 
| 33 | 
            +
                puts '@t2: ' + (Time.now - @t).inspect if @debug
         | 
| 34 | 
            +
              end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
              def on_connect()
         | 
| 37 | 
            +
                super()
         | 
| 38 | 
            +
              end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
              def on_disconnect()
         | 
| 41 | 
            +
                super()
         | 
| 42 | 
            +
              end
         | 
| 43 | 
            +
             | 
| 44 | 
            +
              def on_ios_keypress()
         | 
| 45 | 
            +
             | 
| 46 | 
            +
              end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
              def on_ios_keydown()
         | 
| 49 | 
            +
                @t = Time.now
         | 
| 50 | 
            +
                puts '@t: ' + @t.inspect if @debug
         | 
| 51 | 
            +
              end
         | 
| 52 | 
            +
             | 
| 53 | 
            +
              def on_ios_keyup()
         | 
| 54 | 
            +
                keyup(2)
         | 
| 55 | 
            +
                puts '@t2: ' + (Time.now - @t).inspect if @debug
         | 
| 56 | 
            +
              end
         | 
| 57 | 
            +
             | 
| 58 | 
            +
              private
         | 
| 59 | 
            +
             | 
| 60 | 
            +
              def keyup(key)
         | 
| 61 | 
            +
             | 
| 62 | 
            +
                if @t + 0.5 > Time.now then
         | 
| 63 | 
            +
                  @mc += key.to_s
         | 
| 64 | 
            +
                else
         | 
| 65 | 
            +
                  if Time.now > @t + 1.2 then
         | 
| 66 | 
            +
                    notify MorseCode.new(@mc).to_s
         | 
| 67 | 
            +
                    @mc = ''
         | 
| 68 | 
            +
                  elsif @mc[-1] == '4'
         | 
| 69 | 
            +
                    @mc[-1] = '5'
         | 
| 70 | 
            +
                  elsif @mc[-1] == '5'
         | 
| 71 | 
            +
                    notify MorseCode.new(@mc).to_s
         | 
| 72 | 
            +
                    @mc = ''
         | 
| 73 | 
            +
                  else
         | 
| 74 | 
            +
                    @mc += '4'
         | 
| 75 | 
            +
                  end
         | 
| 76 | 
            +
                end
         | 
| 77 | 
            +
             | 
| 78 | 
            +
                puts '@mc: '  + @mc.inspect if @debug
         | 
| 79 | 
            +
             | 
| 80 | 
            +
              end
         | 
| 81 | 
            +
             | 
| 82 | 
            +
            end
         | 
| 83 | 
            +
             | 
    
        data.tar.gz.sig
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            %�u����&��yulU��O��A	��)�!f����	Ս�7�p�G��y�:Pt�¶4�(-��=jP�s`yF4g���%����l9��'�V=%t��T�Mv���+�k�N�,/�}�r��M�������Ƕ`���K�����KHr��.O�:�������V÷��L���$T<�O���:�� �&�w�'�z�}�&Hàd�x�ʄ��Y�0�,��N��8�	�<����!�	��Yu���E6�FW��:�
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,108 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: shutter3_morsecode
         | 
| 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 | 
            +
              MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
         | 
| 14 | 
            +
              YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
         | 
| 15 | 
            +
              8ixkARkWAmV1MB4XDTE3MDYxNjEyMTYzMVoXDTE4MDYxNjEyMTYzMVowSDESMBAG
         | 
| 16 | 
            +
              A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
         | 
| 17 | 
            +
              EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
         | 
| 18 | 
            +
              ggEBAJrjb/uhWJhuvVpGGWrz29oJOt8gP6vgWj2FI7LUTn8RKADnNQ5wjy5GE6bL
         | 
| 19 | 
            +
              MrzjwBvtH1qu+bC6xrfSEnWsVn+FwWAMHmV1wWIckUAGpxzNen3CORpd8xfyIwGn
         | 
| 20 | 
            +
              roRhlNxFY6ZdVJx4CGg/kdjK5MRwfVkOYK8BCIN8QShoblZOkt04FsoSXE4dhQFi
         | 
| 21 | 
            +
              of62lOA3ha2jYIUlJE/MnRfPFlpE2FgA+3Xnr7v/I0PA4U7OG8yxenwXA5RnH0LD
         | 
| 22 | 
            +
              l3IEcgTk+DFTpeAl2eCU8g/TEOB/VYWE/b11WidHO+yxyfuzu5wjyFR0/Fv+iYBC
         | 
| 23 | 
            +
              Y1Tokf5GZOElrCJwjm8f3eBtvpECAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
         | 
| 24 | 
            +
              DwQEAwIEsDAdBgNVHQ4EFgQU7YbJwhyt/7ezxefYDW9gjxrZmWMwJgYDVR0RBB8w
         | 
| 25 | 
            +
              HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
         | 
| 26 | 
            +
              c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAhGRHKdXA
         | 
| 27 | 
            +
              48Ap2A9+cHLfC3qPxa6TaNbgMabGSiukp67BkX1usNizJ13EqL84349PZPxWQmL2
         | 
| 28 | 
            +
              M7YmASddxnUVTevFvTyREe7UqpERpS13zCNUl0RtjdFokQm3hifh8kKxgAWYKma1
         | 
| 29 | 
            +
              aT/S8cCdRBKs1V73rQEonSwqdkShFa9IJ3+9lIaqTQpspBD3s+mIKtTa/W7C9Cd1
         | 
| 30 | 
            +
              o0XPZY572+YgxjKr9iA6hzkfDhWmYokIuTsPlxsgtggJeyFD9rz9akFJREayTx0p
         | 
| 31 | 
            +
              uvruq7VEIFfxTznp43tqCTmpJUwWqZ3fzXpF4xjR1Ta7ayBMp5ayJ/7M0RXxwCGH
         | 
| 32 | 
            +
              79yfHEOYeT7HXg==
         | 
| 33 | 
            +
              -----END CERTIFICATE-----
         | 
| 34 | 
            +
            date: 2017-06-16 00:00:00.000000000 Z
         | 
| 35 | 
            +
            dependencies:
         | 
| 36 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 37 | 
            +
              name: shutter3_sps
         | 
| 38 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 39 | 
            +
                requirements:
         | 
| 40 | 
            +
                - - "~>"
         | 
| 41 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 42 | 
            +
                    version: '0.1'
         | 
| 43 | 
            +
                - - ">="
         | 
| 44 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 45 | 
            +
                    version: 0.1.1
         | 
| 46 | 
            +
              type: :runtime
         | 
| 47 | 
            +
              prerelease: false
         | 
| 48 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 49 | 
            +
                requirements:
         | 
| 50 | 
            +
                - - "~>"
         | 
| 51 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 52 | 
            +
                    version: '0.1'
         | 
| 53 | 
            +
                - - ">="
         | 
| 54 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 55 | 
            +
                    version: 0.1.1
         | 
| 56 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 57 | 
            +
              name: morsecode`
         | 
| 58 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 59 | 
            +
                requirements:
         | 
| 60 | 
            +
                - - "~>"
         | 
| 61 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 62 | 
            +
                    version: '0.2'
         | 
| 63 | 
            +
                - - ">="
         | 
| 64 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 65 | 
            +
                    version: 0.2.1
         | 
| 66 | 
            +
              type: :runtime
         | 
| 67 | 
            +
              prerelease: false
         | 
| 68 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 69 | 
            +
                requirements:
         | 
| 70 | 
            +
                - - "~>"
         | 
| 71 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 72 | 
            +
                    version: '0.2'
         | 
| 73 | 
            +
                - - ">="
         | 
| 74 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            +
                    version: 0.2.1
         | 
| 76 | 
            +
            description: 
         | 
| 77 | 
            +
            email: james@jamesrobertson.eu
         | 
| 78 | 
            +
            executables: []
         | 
| 79 | 
            +
            extensions: []
         | 
| 80 | 
            +
            extra_rdoc_files: []
         | 
| 81 | 
            +
            files:
         | 
| 82 | 
            +
            - lib/shutter3_morsecode.rb
         | 
| 83 | 
            +
            homepage: https://github.com/jrobertson/shutter3_morsecode
         | 
| 84 | 
            +
            licenses:
         | 
| 85 | 
            +
            - MIT
         | 
| 86 | 
            +
            metadata: {}
         | 
| 87 | 
            +
            post_install_message: 
         | 
| 88 | 
            +
            rdoc_options: []
         | 
| 89 | 
            +
            require_paths:
         | 
| 90 | 
            +
            - lib
         | 
| 91 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 92 | 
            +
              requirements:
         | 
| 93 | 
            +
              - - ">="
         | 
| 94 | 
            +
                - !ruby/object:Gem::Version
         | 
| 95 | 
            +
                  version: '0'
         | 
| 96 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 97 | 
            +
              requirements:
         | 
| 98 | 
            +
              - - ">="
         | 
| 99 | 
            +
                - !ruby/object:Gem::Version
         | 
| 100 | 
            +
                  version: '0'
         | 
| 101 | 
            +
            requirements: []
         | 
| 102 | 
            +
            rubyforge_project: 
         | 
| 103 | 
            +
            rubygems_version: 2.6.8
         | 
| 104 | 
            +
            signing_key: 
         | 
| 105 | 
            +
            specification_version: 4
         | 
| 106 | 
            +
            summary: Uses a Shutter3 bluetooth device to publish SimplePubSub (SPS) messages using
         | 
| 107 | 
            +
              morse code.
         | 
| 108 | 
            +
            test_files: []
         | 
    
        metadata.gz.sig
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            v�P����1͛������Kc�J2���Ģ����_K6�rHB�����f�O	j��
         |