digital-transport 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
 - data/.gitignore +13 -0
 - data/.rubocop.yml +11 -0
 - data/.travis.yml +9 -0
 - data/.yardopts +12 -0
 - data/CODE_OF_CONDUCT.md +49 -0
 - data/Gemfile +3 -0
 - data/LICENSE.txt +21 -0
 - data/README.md +54 -0
 - data/Rakefile +35 -0
 - data/cucumber.yml +24 -0
 - data/digital-transport.gemspec +31 -0
 - data/lib/digital/transport.rb +8 -0
 - data/lib/digital/transport/adapters.rb +50 -0
 - data/lib/digital/transport/adapters/interface.rb +35 -0
 - data/lib/digital/transport/adapters/serial.rb +14 -0
 - data/lib/digital/transport/adapters/tcp.rb +127 -0
 - data/lib/digital/transport/errors.rb +7 -0
 - data/lib/digital/transport/version.rb +5 -0
 - data/script/console +9 -0
 - metadata +195 -0
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA1:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 1669102f928a133acaf1bfb0e6b5840aa6df31e7
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: bba0e0f506afcef5278d0883d7b93f3ac3b42a06
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: fe3002c1b50cb0ff33deda8c28be6f09927d6e9cc9f0396fbe25ba1de3c944d4df63dcaa9ab022c637167838b4ca52aa0fea0e056999f68b108257351a22f8a4
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d57e9dbc17737602bfd7816a76ce65708483b307655a404d0afafa58da5940056bb5ff5834c134c1aca78a2065bc80d4f45959500b6070892fefb4cb718aaa0e
         
     | 
    
        data/.gitignore
    ADDED
    
    
    
        data/.rubocop.yml
    ADDED
    
    
    
        data/.travis.yml
    ADDED
    
    
    
        data/.yardopts
    ADDED
    
    | 
         @@ -0,0 +1,12 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --protected
         
     | 
| 
      
 2 
     | 
    
         
            +
            --no-private
         
     | 
| 
      
 3 
     | 
    
         
            +
            --embed-mixin ClassMethods
         
     | 
| 
      
 4 
     | 
    
         
            +
            --tag yard.signature:"YARD Tag Signature"
         
     | 
| 
      
 5 
     | 
    
         
            +
            --tag valid_values:"Valid values"
         
     | 
| 
      
 6 
     | 
    
         
            +
            --tag default_value:"Default value"
         
     | 
| 
      
 7 
     | 
    
         
            +
            --type-name-tag yard.tag:"YARD Tag"
         
     | 
| 
      
 8 
     | 
    
         
            +
            --type-name-tag yard.directive:"YARD Directive"
         
     | 
| 
      
 9 
     | 
    
         
            +
            --hide-tag yard.tag
         
     | 
| 
      
 10 
     | 
    
         
            +
            --hide-tag yard.directive
         
     | 
| 
      
 11 
     | 
    
         
            +
            --hide-tag yard.signature
         
     | 
| 
      
 12 
     | 
    
         
            +
            -
         
     | 
    
        data/CODE_OF_CONDUCT.md
    ADDED
    
    | 
         @@ -0,0 +1,49 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Contributor Code of Conduct
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            As contributors and maintainers of this project, and in the interest of
         
     | 
| 
      
 4 
     | 
    
         
            +
            fostering an open and welcoming community, we pledge to respect all people who
         
     | 
| 
      
 5 
     | 
    
         
            +
            contribute through reporting issues, posting feature requests, updating
         
     | 
| 
      
 6 
     | 
    
         
            +
            documentation, submitting pull requests or patches, and other activities.
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            We are committed to making participation in this project a harassment-free
         
     | 
| 
      
 9 
     | 
    
         
            +
            experience for everyone, regardless of level of experience, gender, gender
         
     | 
| 
      
 10 
     | 
    
         
            +
            identity and expression, sexual orientation, disability, personal appearance,
         
     | 
| 
      
 11 
     | 
    
         
            +
            body size, race, ethnicity, age, religion, or nationality.
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            Examples of unacceptable behavior by participants include:
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            * The use of sexualized language or imagery
         
     | 
| 
      
 16 
     | 
    
         
            +
            * Personal attacks
         
     | 
| 
      
 17 
     | 
    
         
            +
            * Trolling or insulting/derogatory comments
         
     | 
| 
      
 18 
     | 
    
         
            +
            * Public or private harassment
         
     | 
| 
      
 19 
     | 
    
         
            +
            * Publishing other's private information, such as physical or electronic
         
     | 
| 
      
 20 
     | 
    
         
            +
              addresses, without explicit permission
         
     | 
| 
      
 21 
     | 
    
         
            +
            * Other unethical or unprofessional conduct
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            Project maintainers have the right and responsibility to remove, edit, or
         
     | 
| 
      
 24 
     | 
    
         
            +
            reject comments, commits, code, wiki edits, issues, and other contributions
         
     | 
| 
      
 25 
     | 
    
         
            +
            that are not aligned to this Code of Conduct, or to ban temporarily or
         
     | 
| 
      
 26 
     | 
    
         
            +
            permanently any contributor for other behaviors that they deem inappropriate,
         
     | 
| 
      
 27 
     | 
    
         
            +
            threatening, offensive, or harmful.
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            By adopting this Code of Conduct, project maintainers commit themselves to
         
     | 
| 
      
 30 
     | 
    
         
            +
            fairly and consistently applying these principles to every aspect of managing
         
     | 
| 
      
 31 
     | 
    
         
            +
            this project. Project maintainers who do not follow or enforce the Code of
         
     | 
| 
      
 32 
     | 
    
         
            +
            Conduct may be permanently removed from the project team.
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
            This code of conduct applies both within project spaces and in public spaces
         
     | 
| 
      
 35 
     | 
    
         
            +
            when an individual is representing the project or its community.
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
            Instances of abusive, harassing, or otherwise unacceptable behavior may be
         
     | 
| 
      
 38 
     | 
    
         
            +
            reported by contacting a project maintainer at roman@lishtaba.com. All
         
     | 
| 
      
 39 
     | 
    
         
            +
            complaints will be reviewed and investigated and will result in a response that
         
     | 
| 
      
 40 
     | 
    
         
            +
            is deemed necessary and appropriate to the circumstances. Maintainers are
         
     | 
| 
      
 41 
     | 
    
         
            +
            obligated to maintain confidentiality with regard to the reporter of an
         
     | 
| 
      
 42 
     | 
    
         
            +
            incident.
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
            This Code of Conduct is adapted from the [Contributor Covenant][homepage],
         
     | 
| 
      
 45 
     | 
    
         
            +
            version 1.3.0, available at
         
     | 
| 
      
 46 
     | 
    
         
            +
            [http://contributor-covenant.org/version/1/3/0/][version]
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
            [homepage]: http://contributor-covenant.org
         
     | 
| 
      
 49 
     | 
    
         
            +
            [version]: http://contributor-covenant.org/version/1/3/0/
         
     | 
    
        data/Gemfile
    ADDED
    
    
    
        data/LICENSE.txt
    ADDED
    
    | 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            The MIT License (MIT)
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Copyright (c) 2016 Roman Lishtaba
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining a copy
         
     | 
| 
      
 6 
     | 
    
         
            +
            of this software and associated documentation files (the "Software"), to deal
         
     | 
| 
      
 7 
     | 
    
         
            +
            in the Software without restriction, including without limitation the rights
         
     | 
| 
      
 8 
     | 
    
         
            +
            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         
     | 
| 
      
 9 
     | 
    
         
            +
            copies of the Software, and to permit persons to whom the Software is
         
     | 
| 
      
 10 
     | 
    
         
            +
            furnished to do so, subject to the following conditions:
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be included in
         
     | 
| 
      
 13 
     | 
    
         
            +
            all copies or substantial portions of the Software.
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         
     | 
| 
      
 16 
     | 
    
         
            +
            IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         
     | 
| 
      
 17 
     | 
    
         
            +
            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         
     | 
| 
      
 18 
     | 
    
         
            +
            AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         
     | 
| 
      
 19 
     | 
    
         
            +
            LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         
     | 
| 
      
 20 
     | 
    
         
            +
            OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         
     | 
| 
      
 21 
     | 
    
         
            +
            THE SOFTWARE.
         
     | 
    
        data/README.md
    ADDED
    
    | 
         @@ -0,0 +1,54 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            [](https://travis-ci.org/rlishtaba/ruby-digital-transport)
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            # Digital::Transport
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Unified interface to TCP, Serial & USB communication adapters.
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            ## Installation
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            Add this line to your application's Gemfile:
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 12 
     | 
    
         
            +
            gem 'digital-transport'
         
     | 
| 
      
 13 
     | 
    
         
            +
            ```
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            And then execute:
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                $ bundle
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            Or install it yourself as:
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                $ gem install digital-transport
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            ## Usage
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 26 
     | 
    
         
            +
                require 'digital/transport'
         
     | 
| 
      
 27 
     | 
    
         
            +
                
         
     | 
| 
      
 28 
     | 
    
         
            +
                include Digital::Transport::Adapters
         
     | 
| 
      
 29 
     | 
    
         
            +
                
         
     | 
| 
      
 30 
     | 
    
         
            +
                connected = -> x {
         
     | 
| 
      
 31 
     | 
    
         
            +
                     x.write("Hello, World!") #=> either monad
         
     | 
| 
      
 32 
     | 
    
         
            +
                     x.read 2                 #=> either monad
         
     | 
| 
      
 33 
     | 
    
         
            +
                }
         
     | 
| 
      
 34 
     | 
    
         
            +
                
         
     | 
| 
      
 35 
     | 
    
         
            +
                failed = -> x {
         
     | 
| 
      
 36 
     | 
    
         
            +
                     # perform exceptional situation handling
         
     | 
| 
      
 37 
     | 
    
         
            +
                     # x will be yielded in to function as an Exception covariant interface.
         
     | 
| 
      
 38 
     | 
    
         
            +
                     puts "Wasn't able to connect due to: #{x.message}. Handling failure."
         
     | 
| 
      
 39 
     | 
    
         
            +
                }
         
     | 
| 
      
 40 
     | 
    
         
            +
                
         
     | 
| 
      
 41 
     | 
    
         
            +
                maybe = new_tcp_adapter('10.0.0.250', 6789).connect
         
     | 
| 
      
 42 
     | 
    
         
            +
                
         
     | 
| 
      
 43 
     | 
    
         
            +
                maybe.either(failed, connected)
         
     | 
| 
      
 44 
     | 
    
         
            +
            ```    
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
            ## Contributing
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
            Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/digital-transport. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
            ## License
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
            The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
    
        data/Rakefile
    ADDED
    
    | 
         @@ -0,0 +1,35 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'bundler/gem_tasks'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'rake/clean'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            CLEAN.include(
         
     | 
| 
      
 5 
     | 
    
         
            +
              'pkg',
         
     | 
| 
      
 6 
     | 
    
         
            +
              'doc',
         
     | 
| 
      
 7 
     | 
    
         
            +
              'coverage',
         
     | 
| 
      
 8 
     | 
    
         
            +
              '*.gem'
         
     | 
| 
      
 9 
     | 
    
         
            +
            )
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            desc 'Run all tests and collect code coverage'
         
     | 
| 
      
 12 
     | 
    
         
            +
            task :cov do
         
     | 
| 
      
 13 
     | 
    
         
            +
              ENV['SIMPLECOV'] = 'features'
         
     | 
| 
      
 14 
     | 
    
         
            +
              Rake::Task['default'].invoke
         
     | 
| 
      
 15 
     | 
    
         
            +
            end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            require 'cucumber/rake/task'
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            Cucumber::Rake::Task.new(:features) do |t|
         
     | 
| 
      
 20 
     | 
    
         
            +
              t.fork = true
         
     | 
| 
      
 21 
     | 
    
         
            +
              t.profile = :default
         
     | 
| 
      
 22 
     | 
    
         
            +
            end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
            task cucumber: :features
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
            require 'rspec/core/rake_task'
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            desc 'Run RSpec'
         
     | 
| 
      
 29 
     | 
    
         
            +
            RSpec::Core::RakeTask.new do |t|
         
     | 
| 
      
 30 
     | 
    
         
            +
              t.fail_on_error = false
         
     | 
| 
      
 31 
     | 
    
         
            +
              t.verbose = true
         
     | 
| 
      
 32 
     | 
    
         
            +
              t.rspec_opts = '--format RspecJunitFormatter  --out rspec.xml --tag ~wip'
         
     | 
| 
      
 33 
     | 
    
         
            +
            end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            task default: [:spec]
         
     | 
    
        data/cucumber.yml
    ADDED
    
    | 
         @@ -0,0 +1,24 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <%
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
         
     | 
| 
      
 4 
     | 
    
         
            +
            rerun_opts = rerun.to_s.strip.empty? ? "--format progress features" : "--format pretty #{rerun}"
         
     | 
| 
      
 5 
     | 
    
         
            +
            std_opts = "--format pretty features --tags ~@wip -r features --strict"
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            wip_opts = "--color -r features --tags @wip:3,@wip-new-core"
         
     | 
| 
      
 9 
     | 
    
         
            +
            wip_opts << ",@wip-jruby:3" if defined?(JRUBY_VERSION)
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            legacy_opts = ''
         
     | 
| 
      
 12 
     | 
    
         
            +
            legacy_opts << " --tags ~@wire" if defined?(JRUBY_VERSION)
         
     | 
| 
      
 13 
     | 
    
         
            +
            legacy_opts << " --tags ~@wip-jruby" if defined?(JRUBY_VERSION)
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            %>
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            default: <%= std_opts %> --tags ~@jruby features
         
     | 
| 
      
 18 
     | 
    
         
            +
            windows_mri: <%= std_opts %> --tags ~@jruby
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            ruby_1_9: <%= std_opts %> --tags ~@jruby
         
     | 
| 
      
 21 
     | 
    
         
            +
            ruby_2_0: <%= std_opts %> --tags ~@jruby
         
     | 
| 
      
 22 
     | 
    
         
            +
            wip: --wip <%= wip_opts %> features
         
     | 
| 
      
 23 
     | 
    
         
            +
            none: --format pretty
         
     | 
| 
      
 24 
     | 
    
         
            +
            rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip --tag ~@wip-new-core
         
     | 
| 
         @@ -0,0 +1,31 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # coding: utf-8
         
     | 
| 
      
 2 
     | 
    
         
            +
            lib = File.expand_path('../lib', __FILE__)
         
     | 
| 
      
 3 
     | 
    
         
            +
            $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'digital/transport/version'
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            Gem::Specification.new do |spec|
         
     | 
| 
      
 7 
     | 
    
         
            +
              spec.name = 'digital-transport'
         
     | 
| 
      
 8 
     | 
    
         
            +
              spec.version = Digital::Transport::VERSION
         
     | 
| 
      
 9 
     | 
    
         
            +
              spec.authors = ['Roman Lishtaba']
         
     | 
| 
      
 10 
     | 
    
         
            +
              spec.email = ['roman@lishtaba.com']
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              spec.summary = %q{interface between multiple transport adapters}
         
     | 
| 
      
 13 
     | 
    
         
            +
              spec.description = %q{Library intended to unify interface between multiple transport adapters}
         
     | 
| 
      
 14 
     | 
    
         
            +
              spec.homepage = 'http://www.lishtaba.com'
         
     | 
| 
      
 15 
     | 
    
         
            +
              spec.license = 'MIT'
         
     | 
| 
      
 16 
     | 
    
         
            +
              spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|bin)/}) }
         
     | 
| 
      
 17 
     | 
    
         
            +
              spec.bindir = 'exe'
         
     | 
| 
      
 18 
     | 
    
         
            +
              spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
         
     | 
| 
      
 19 
     | 
    
         
            +
              spec.require_paths = ['lib']
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              spec.add_development_dependency 'bundler', '~> 1.11'
         
     | 
| 
      
 22 
     | 
    
         
            +
              spec.add_development_dependency 'rake', '~> 10.0'
         
     | 
| 
      
 23 
     | 
    
         
            +
              spec.add_development_dependency 'cucumber', '=1.3.20'
         
     | 
| 
      
 24 
     | 
    
         
            +
              spec.add_development_dependency 'rspec_junit_formatter'
         
     | 
| 
      
 25 
     | 
    
         
            +
              spec.add_development_dependency 'simplecov', '=0.9.0'
         
     | 
| 
      
 26 
     | 
    
         
            +
              spec.add_development_dependency 'rubocop'
         
     | 
| 
      
 27 
     | 
    
         
            +
              spec.add_development_dependency 'rspec', '~> 3.4'
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
              spec.add_dependency 'functional-ruby'
         
     | 
| 
      
 30 
     | 
    
         
            +
              spec.add_dependency 'rs_232', '~> 2.0', '>= 2.0.5' unless RUBY_PLATFORM === /java/
         
     | 
| 
      
 31 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,50 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'functional'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Digital
         
     | 
| 
      
 4 
     | 
    
         
            +
              module Transport
         
     | 
| 
      
 5 
     | 
    
         
            +
                # @example
         
     | 
| 
      
 6 
     | 
    
         
            +
                #
         
     | 
| 
      
 7 
     | 
    
         
            +
                # require 'digital/transport'
         
     | 
| 
      
 8 
     | 
    
         
            +
                #
         
     | 
| 
      
 9 
     | 
    
         
            +
                # include Digital::Transport::Adapters
         
     | 
| 
      
 10 
     | 
    
         
            +
                #
         
     | 
| 
      
 11 
     | 
    
         
            +
                # @see Proc#new
         
     | 
| 
      
 12 
     | 
    
         
            +
                # connected = -> x {
         
     | 
| 
      
 13 
     | 
    
         
            +
                #      x.write("Hello, World!") #=> either monad
         
     | 
| 
      
 14 
     | 
    
         
            +
                #      x.read 2                 #=> either monad
         
     | 
| 
      
 15 
     | 
    
         
            +
                # }
         
     | 
| 
      
 16 
     | 
    
         
            +
                #
         
     | 
| 
      
 17 
     | 
    
         
            +
                # @see Proc#new
         
     | 
| 
      
 18 
     | 
    
         
            +
                # failed = -> x {
         
     | 
| 
      
 19 
     | 
    
         
            +
                #      # perform exceptional situation handling
         
     | 
| 
      
 20 
     | 
    
         
            +
                #      # x will be yielded in to function as an Exception covariant interface.
         
     | 
| 
      
 21 
     | 
    
         
            +
                #      puts "Wasn't able to connect due to: #{x.message}. Handling failure."
         
     | 
| 
      
 22 
     | 
    
         
            +
                # }
         
     | 
| 
      
 23 
     | 
    
         
            +
                #
         
     | 
| 
      
 24 
     | 
    
         
            +
                # @see Tcp#connect
         
     | 
| 
      
 25 
     | 
    
         
            +
                # maybe = new_tcp_adapter('10.0.0.250', 6789).connect
         
     | 
| 
      
 26 
     | 
    
         
            +
                #
         
     | 
| 
      
 27 
     | 
    
         
            +
                # @see Either#either
         
     | 
| 
      
 28 
     | 
    
         
            +
                # maybe.either(failed, connected)
         
     | 
| 
      
 29 
     | 
    
         
            +
                #
         
     | 
| 
      
 30 
     | 
    
         
            +
                module Adapters
         
     | 
| 
      
 31 
     | 
    
         
            +
                  require 'digital/transport/adapters/interface'
         
     | 
| 
      
 32 
     | 
    
         
            +
                  autoload :Tcp, 'digital/transport/adapters/tcp'
         
     | 
| 
      
 33 
     | 
    
         
            +
                  autoload :Serial, 'digital/transport/adapters/serial'
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                  private_constant :Tcp, :Serial
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                  def new_tcp_adapter(ip, port)
         
     | 
| 
      
 38 
     | 
    
         
            +
                    Tcp.new(ip.dup.freeze, port)
         
     | 
| 
      
 39 
     | 
    
         
            +
                  end
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                  def new_serial_adapter(_port, _opts = {})
         
     | 
| 
      
 42 
     | 
    
         
            +
                    raise NotImplementedError
         
     | 
| 
      
 43 
     | 
    
         
            +
                  end
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                  def new_usb_adapter(_port, _opts = {})
         
     | 
| 
      
 46 
     | 
    
         
            +
                    raise NotImplementedError
         
     | 
| 
      
 47 
     | 
    
         
            +
                  end
         
     | 
| 
      
 48 
     | 
    
         
            +
                end
         
     | 
| 
      
 49 
     | 
    
         
            +
              end
         
     | 
| 
      
 50 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,35 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'functional'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Digital
         
     | 
| 
      
 4 
     | 
    
         
            +
              module Transport
         
     | 
| 
      
 5 
     | 
    
         
            +
                module Adapters
         
     | 
| 
      
 6 
     | 
    
         
            +
                  module Interface
         
     | 
| 
      
 7 
     | 
    
         
            +
                    def open?
         
     | 
| 
      
 8 
     | 
    
         
            +
                      not_implemented __method__
         
     | 
| 
      
 9 
     | 
    
         
            +
                    end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                    def write(_message)
         
     | 
| 
      
 12 
     | 
    
         
            +
                      not_implemented __method__
         
     | 
| 
      
 13 
     | 
    
         
            +
                    end
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                    def read(_bytes, _should_block = false)
         
     | 
| 
      
 16 
     | 
    
         
            +
                      not_implemented __method__
         
     | 
| 
      
 17 
     | 
    
         
            +
                    end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                    def close
         
     | 
| 
      
 20 
     | 
    
         
            +
                      not_implemented __method__
         
     | 
| 
      
 21 
     | 
    
         
            +
                    end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                    def connect(_opts = {})
         
     | 
| 
      
 24 
     | 
    
         
            +
                      not_implemented __method__
         
     | 
| 
      
 25 
     | 
    
         
            +
                    end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                    private
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                    def not_implemented(message)
         
     | 
| 
      
 30 
     | 
    
         
            +
                      Functional::Either.left(NotImplementedError.new(message))
         
     | 
| 
      
 31 
     | 
    
         
            +
                    end
         
     | 
| 
      
 32 
     | 
    
         
            +
                  end
         
     | 
| 
      
 33 
     | 
    
         
            +
                end
         
     | 
| 
      
 34 
     | 
    
         
            +
              end
         
     | 
| 
      
 35 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,127 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'socket'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'functional'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            module Digital
         
     | 
| 
      
 5 
     | 
    
         
            +
              module Transport
         
     | 
| 
      
 6 
     | 
    
         
            +
                module Adapters
         
     | 
| 
      
 7 
     | 
    
         
            +
                  class Tcp
         
     | 
| 
      
 8 
     | 
    
         
            +
                    include Functional
         
     | 
| 
      
 9 
     | 
    
         
            +
                    include Socket::Constants
         
     | 
| 
      
 10 
     | 
    
         
            +
                    include Digital::Transport::Errors
         
     | 
| 
      
 11 
     | 
    
         
            +
                    include Digital::Transport::Adapters::Interface
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                    DEFAULTS = { timeout: 10 }.freeze
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                    def initialize(ip, port)
         
     | 
| 
      
 16 
     | 
    
         
            +
                      @ip = ip
         
     | 
| 
      
 17 
     | 
    
         
            +
                      @port = port
         
     | 
| 
      
 18 
     | 
    
         
            +
                      @io = nil
         
     | 
| 
      
 19 
     | 
    
         
            +
                      yield self if block_given?
         
     | 
| 
      
 20 
     | 
    
         
            +
                    end
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                    # @return [Either] either monad representing a value of one of two possible types
         
     | 
| 
      
 23 
     | 
    
         
            +
                    # 1. Exception covariant
         
     | 
| 
      
 24 
     | 
    
         
            +
                    # 2. Adapter interface invariant
         
     | 
| 
      
 25 
     | 
    
         
            +
                    #
         
     | 
| 
      
 26 
     | 
    
         
            +
                    # @example
         
     | 
| 
      
 27 
     | 
    
         
            +
                    #
         
     | 
| 
      
 28 
     | 
    
         
            +
                    # include Digital::Transport::Adapters
         
     | 
| 
      
 29 
     | 
    
         
            +
                    #
         
     | 
| 
      
 30 
     | 
    
         
            +
                    # on_success = -> x {
         
     | 
| 
      
 31 
     | 
    
         
            +
                    #      puts "connection open? -> #{x.open?}"
         
     | 
| 
      
 32 
     | 
    
         
            +
                    #      x.write("Hello, World!") =>
         
     | 
| 
      
 33 
     | 
    
         
            +
                    #      x.read 2 #=>
         
     | 
| 
      
 34 
     | 
    
         
            +
                    # }
         
     | 
| 
      
 35 
     | 
    
         
            +
                    # on_failure = -> x { puts "Wasn't able to connect due to: #{x.message}" }
         
     | 
| 
      
 36 
     | 
    
         
            +
                    #
         
     | 
| 
      
 37 
     | 
    
         
            +
                    # maybe = new_tcp_adapter('10.0.0.250', 12000).connect
         
     | 
| 
      
 38 
     | 
    
         
            +
                    # maybe.either(on_failure, on_success)
         
     | 
| 
      
 39 
     | 
    
         
            +
                    #
         
     | 
| 
      
 40 
     | 
    
         
            +
                    def connect(opt = { timeout: 10, tcp_no_delay: 1 })
         
     | 
| 
      
 41 
     | 
    
         
            +
                      return open? if open?
         
     | 
| 
      
 42 
     | 
    
         
            +
                      map = opt.dup.freeze
         
     | 
| 
      
 43 
     | 
    
         
            +
                      Socket.new(AF_INET, SOCK_STREAM, 0).tap do |socket|
         
     | 
| 
      
 44 
     | 
    
         
            +
                        socket.setsockopt(IPPROTO_TCP, TCP_NODELAY, map[:tcp_nodelay].to_i)
         
     | 
| 
      
 45 
     | 
    
         
            +
                        return connect_nonblock(
         
     | 
| 
      
 46 
     | 
    
         
            +
                            socket,
         
     | 
| 
      
 47 
     | 
    
         
            +
                            Socket.pack_sockaddr_in(@port, @ip),
         
     | 
| 
      
 48 
     | 
    
         
            +
                            map[:timeout].to_i.nonzero? || DEFAULTS[:timeout])
         
     | 
| 
      
 49 
     | 
    
         
            +
                      end
         
     | 
| 
      
 50 
     | 
    
         
            +
                    end
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
                    # @raise [Errno::ECONNRESET] if connection reset by peer
         
     | 
| 
      
 53 
     | 
    
         
            +
                    #
         
     | 
| 
      
 54 
     | 
    
         
            +
                    # @return [Boolean] representing operation state
         
     | 
| 
      
 55 
     | 
    
         
            +
                    def close
         
     | 
| 
      
 56 
     | 
    
         
            +
                      return !open? unless open?
         
     | 
| 
      
 57 
     | 
    
         
            +
                      flush
         
     | 
| 
      
 58 
     | 
    
         
            +
                      @io && @io.close
         
     | 
| 
      
 59 
     | 
    
         
            +
                      @io = nil
         
     | 
| 
      
 60 
     | 
    
         
            +
                      !open?
         
     | 
| 
      
 61 
     | 
    
         
            +
                    end
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
                    # @raise [Errno::ECONNRESET] if connection reset by peer
         
     | 
| 
      
 64 
     | 
    
         
            +
                    # @return [Ethernet] it self
         
     | 
| 
      
 65 
     | 
    
         
            +
                    def flush
         
     | 
| 
      
 66 
     | 
    
         
            +
                      @io && @io.flush
         
     | 
| 
      
 67 
     | 
    
         
            +
                    end
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
                    # @param [String] string
         
     | 
| 
      
 70 
     | 
    
         
            +
                    # @return [Fixnum] representing amount of bytes written
         
     | 
| 
      
 71 
     | 
    
         
            +
                    def write(string)
         
     | 
| 
      
 72 
     | 
    
         
            +
                      raise NotConnected unless open?
         
     | 
| 
      
 73 
     | 
    
         
            +
                      written = 0
         
     | 
| 
      
 74 
     | 
    
         
            +
                      while 0 < string.bytesize
         
     | 
| 
      
 75 
     | 
    
         
            +
                        begin
         
     | 
| 
      
 76 
     | 
    
         
            +
                          written = @io.write_nonblock(string)
         
     | 
| 
      
 77 
     | 
    
         
            +
                        rescue IO::WaitReadable
         
     | 
| 
      
 78 
     | 
    
         
            +
                          IO.select([@io])
         
     | 
| 
      
 79 
     | 
    
         
            +
                          retry
         
     | 
| 
      
 80 
     | 
    
         
            +
                        rescue IO::WaitWritable
         
     | 
| 
      
 81 
     | 
    
         
            +
                          IO.select(nil, [@io])
         
     | 
| 
      
 82 
     | 
    
         
            +
                          retry
         
     | 
| 
      
 83 
     | 
    
         
            +
                        end
         
     | 
| 
      
 84 
     | 
    
         
            +
                        string = string.byteslice(written..-1)
         
     | 
| 
      
 85 
     | 
    
         
            +
                      end
         
     | 
| 
      
 86 
     | 
    
         
            +
                      Either.right(written)
         
     | 
| 
      
 87 
     | 
    
         
            +
                    rescue => ex
         
     | 
| 
      
 88 
     | 
    
         
            +
                      Either.left(ex)
         
     | 
| 
      
 89 
     | 
    
         
            +
                    end
         
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
      
 91 
     | 
    
         
            +
                    # @param [Fixnum] count how many bytes to read
         
     | 
| 
      
 92 
     | 
    
         
            +
                    # @param [Boolean] should_block which will simulate blocking function
         
     | 
| 
      
 93 
     | 
    
         
            +
                    # @return [String, nil] the String which was received or nil otherwise
         
     | 
| 
      
 94 
     | 
    
         
            +
                    def read(count, should_block = false)
         
     | 
| 
      
 95 
     | 
    
         
            +
                      raise NotConnected unless open?
         
     | 
| 
      
 96 
     | 
    
         
            +
                      Either.right @io.read_nonblock(count).tap
         
     | 
| 
      
 97 
     | 
    
         
            +
                    rescue IO::WaitReadable
         
     | 
| 
      
 98 
     | 
    
         
            +
                      if should_block
         
     | 
| 
      
 99 
     | 
    
         
            +
                        IO.select [@io]
         
     | 
| 
      
 100 
     | 
    
         
            +
                        retry
         
     | 
| 
      
 101 
     | 
    
         
            +
                      end
         
     | 
| 
      
 102 
     | 
    
         
            +
                      Either.right(nil)
         
     | 
| 
      
 103 
     | 
    
         
            +
                    rescue => ex
         
     | 
| 
      
 104 
     | 
    
         
            +
                      Either.left(ex)
         
     | 
| 
      
 105 
     | 
    
         
            +
                    end
         
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
                    # @return [Boolean] connection state predicate
         
     | 
| 
      
 108 
     | 
    
         
            +
                    def open?
         
     | 
| 
      
 109 
     | 
    
         
            +
                      @io && !@io.closed?
         
     | 
| 
      
 110 
     | 
    
         
            +
                    end
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
                    private
         
     | 
| 
      
 113 
     | 
    
         
            +
             
     | 
| 
      
 114 
     | 
    
         
            +
                    def connect_nonblock(io_like, endpoint, timeout)
         
     | 
| 
      
 115 
     | 
    
         
            +
                      io_like.connect_nonblock(endpoint)
         
     | 
| 
      
 116 
     | 
    
         
            +
                    rescue Errno::EINPROGRESS # connection in progress, wait a bit.
         
     | 
| 
      
 117 
     | 
    
         
            +
                      IO.select(nil, [io_like], nil, timeout) ? retry : nil
         
     | 
| 
      
 118 
     | 
    
         
            +
                    rescue Errno::EISCONN # The socket is already connected.
         
     | 
| 
      
 119 
     | 
    
         
            +
                      @io = io_like
         
     | 
| 
      
 120 
     | 
    
         
            +
                      Either.right(self)
         
     | 
| 
      
 121 
     | 
    
         
            +
                    rescue => ex
         
     | 
| 
      
 122 
     | 
    
         
            +
                      Either.left(ex)
         
     | 
| 
      
 123 
     | 
    
         
            +
                    end
         
     | 
| 
      
 124 
     | 
    
         
            +
                  end
         
     | 
| 
      
 125 
     | 
    
         
            +
                end
         
     | 
| 
      
 126 
     | 
    
         
            +
              end
         
     | 
| 
      
 127 
     | 
    
         
            +
            end
         
     | 
    
        data/script/console
    ADDED
    
    
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,195 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: digital-transport
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.0
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - Roman Lishtaba
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: exe
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-06-20 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: bundler
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '1.11'
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '1.11'
         
     | 
| 
      
 27 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 28 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 29 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 30 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 31 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 33 
     | 
    
         
            +
                    version: '10.0'
         
     | 
| 
      
 34 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 35 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 36 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 37 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 38 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 39 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 40 
     | 
    
         
            +
                    version: '10.0'
         
     | 
| 
      
 41 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 42 
     | 
    
         
            +
              name: cucumber
         
     | 
| 
      
 43 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 44 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 45 
     | 
    
         
            +
                - - '='
         
     | 
| 
      
 46 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 47 
     | 
    
         
            +
                    version: 1.3.20
         
     | 
| 
      
 48 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 49 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 50 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 51 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 52 
     | 
    
         
            +
                - - '='
         
     | 
| 
      
 53 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 54 
     | 
    
         
            +
                    version: 1.3.20
         
     | 
| 
      
 55 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 56 
     | 
    
         
            +
              name: rspec_junit_formatter
         
     | 
| 
      
 57 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 58 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 59 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 60 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 61 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 62 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 63 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 64 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 65 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 66 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 67 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 68 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 69 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 70 
     | 
    
         
            +
              name: simplecov
         
     | 
| 
      
 71 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 72 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 73 
     | 
    
         
            +
                - - '='
         
     | 
| 
      
 74 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 75 
     | 
    
         
            +
                    version: 0.9.0
         
     | 
| 
      
 76 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 77 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 78 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 79 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 80 
     | 
    
         
            +
                - - '='
         
     | 
| 
      
 81 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 82 
     | 
    
         
            +
                    version: 0.9.0
         
     | 
| 
      
 83 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 84 
     | 
    
         
            +
              name: rubocop
         
     | 
| 
      
 85 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 86 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 87 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 88 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 89 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 90 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 91 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 92 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 93 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 94 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 95 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 96 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 97 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 98 
     | 
    
         
            +
              name: rspec
         
     | 
| 
      
 99 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 100 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 101 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 102 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 103 
     | 
    
         
            +
                    version: '3.4'
         
     | 
| 
      
 104 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 105 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 106 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 107 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 108 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 109 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 110 
     | 
    
         
            +
                    version: '3.4'
         
     | 
| 
      
 111 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 112 
     | 
    
         
            +
              name: functional-ruby
         
     | 
| 
      
 113 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 114 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 115 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 116 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 117 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 118 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 119 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 120 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 121 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 122 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 123 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 124 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 125 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 126 
     | 
    
         
            +
              name: rs_232
         
     | 
| 
      
 127 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 128 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 129 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 130 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 131 
     | 
    
         
            +
                    version: '2.0'
         
     | 
| 
      
 132 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 133 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 134 
     | 
    
         
            +
                    version: 2.0.5
         
     | 
| 
      
 135 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 136 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 137 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 138 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 139 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 140 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 141 
     | 
    
         
            +
                    version: '2.0'
         
     | 
| 
      
 142 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 143 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 144 
     | 
    
         
            +
                    version: 2.0.5
         
     | 
| 
      
 145 
     | 
    
         
            +
            description: Library intended to unify interface between multiple transport adapters
         
     | 
| 
      
 146 
     | 
    
         
            +
            email:
         
     | 
| 
      
 147 
     | 
    
         
            +
            - roman@lishtaba.com
         
     | 
| 
      
 148 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 149 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 150 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 151 
     | 
    
         
            +
            files:
         
     | 
| 
      
 152 
     | 
    
         
            +
            - ".gitignore"
         
     | 
| 
      
 153 
     | 
    
         
            +
            - ".rubocop.yml"
         
     | 
| 
      
 154 
     | 
    
         
            +
            - ".travis.yml"
         
     | 
| 
      
 155 
     | 
    
         
            +
            - ".yardopts"
         
     | 
| 
      
 156 
     | 
    
         
            +
            - CODE_OF_CONDUCT.md
         
     | 
| 
      
 157 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 158 
     | 
    
         
            +
            - LICENSE.txt
         
     | 
| 
      
 159 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 160 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 161 
     | 
    
         
            +
            - cucumber.yml
         
     | 
| 
      
 162 
     | 
    
         
            +
            - digital-transport.gemspec
         
     | 
| 
      
 163 
     | 
    
         
            +
            - lib/digital/transport.rb
         
     | 
| 
      
 164 
     | 
    
         
            +
            - lib/digital/transport/adapters.rb
         
     | 
| 
      
 165 
     | 
    
         
            +
            - lib/digital/transport/adapters/interface.rb
         
     | 
| 
      
 166 
     | 
    
         
            +
            - lib/digital/transport/adapters/serial.rb
         
     | 
| 
      
 167 
     | 
    
         
            +
            - lib/digital/transport/adapters/tcp.rb
         
     | 
| 
      
 168 
     | 
    
         
            +
            - lib/digital/transport/errors.rb
         
     | 
| 
      
 169 
     | 
    
         
            +
            - lib/digital/transport/version.rb
         
     | 
| 
      
 170 
     | 
    
         
            +
            - script/console
         
     | 
| 
      
 171 
     | 
    
         
            +
            homepage: http://www.lishtaba.com
         
     | 
| 
      
 172 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 173 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 174 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
      
 175 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 176 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 177 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 178 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 179 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 180 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 181 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 182 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 183 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 184 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 185 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 186 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 187 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 188 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 189 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 190 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 191 
     | 
    
         
            +
            rubygems_version: 2.2.2
         
     | 
| 
      
 192 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 193 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 194 
     | 
    
         
            +
            summary: interface between multiple transport adapters
         
     | 
| 
      
 195 
     | 
    
         
            +
            test_files: []
         
     |