blinky-cloud 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3815abd6e5f56f931584461a97d0c20ebaf95f39
4
+ data.tar.gz: f8e28737cccd2d41c23a2d75e89491bcabe700ef
5
+ SHA512:
6
+ metadata.gz: 54abbd5aab93d284217f391589dab0c30da8d45280c4f94e03250bb708a5765938623837f18ac630ab9d79fe43cfb432b7fb6cab780f375eed953cd4a1bc292f
7
+ data.tar.gz: 1ef2cea7071c61794a1a608ba7140a6df3509ba78d7c6e0c7ed220da54f4be1e6022fb5ed4f5a2e28a7cbed1598bfc9c0d80de2e5879e98ca59a18568578c0f0
@@ -0,0 +1,12 @@
1
+ (lp0
2
+ (S'serial'
3
+ p1
4
+ S'/usr/local/bin/picocom'
5
+ p2
6
+ tp3
7
+ a(S'build_dir'
8
+ p4
9
+ S'.build/uno'
10
+ p5
11
+ tp6
12
+ a.
data/.gitignore ADDED
@@ -0,0 +1,34 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
29
+ # Gemfile.lock
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
3
+
data/Gemfile.lock ADDED
@@ -0,0 +1,26 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ blinky-cloud (1.0.0)
5
+ blinky-tape-test-status
6
+ celluloid-io
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ blinky-tape-test-status (1.1.0)
12
+ serialport
13
+ celluloid (0.15.2)
14
+ timers (~> 1.1.0)
15
+ celluloid-io (0.15.0)
16
+ celluloid (>= 0.15.0)
17
+ nio4r (>= 0.5.0)
18
+ nio4r (1.0.0)
19
+ serialport (1.3.0)
20
+ timers (1.1.0)
21
+
22
+ PLATFORMS
23
+ ruby
24
+
25
+ DEPENDENCIES
26
+ blinky-cloud!
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Resellers
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ blinky-cloud
2
+ ============
3
+
4
+ Beowulf cluster for BlinkyTape
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'bundler/setup'
4
+
5
+ require 'blinky_cloud'
6
+
7
+ broadcaster = BlinkyCloud::Broadcaster.new
8
+ broadcaster.broadcast! ARGV[0]
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'bundler/setup'
4
+ require 'blinky_cloud/listener'
5
+ require 'blinky_tape_test_status'
6
+
7
+ blinky = BlinkyTapeTestStatus::Base.new
8
+ listener = BlinkyCloud::Listener.new
9
+ listener.listen(lambda {|data| blinky.write! data})
@@ -0,0 +1,23 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+ require "blinky_cloud/version"
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'blinky-cloud'
6
+ s.version = BlinkyCloud::VERSION
7
+ s.summary = "blinky-cloud"
8
+ s.description = "A Ruby interface for blinky-cloud"
9
+ s.authors = ["Jade Meskill", "Roy van de Water", "Clayton Lengel-Zigich"]
10
+ s.email = 'dev@integrumtech.com'
11
+
12
+ s.files = `git ls-files`.split("\n")
13
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
15
+ s.require_paths = ["lib"]
16
+
17
+ s.add_runtime_dependency "blinky-tape-test-status"
18
+ s.add_runtime_dependency 'celluloid-io'
19
+
20
+ s.homepage =
21
+ 'http://rubygems.org/gems/blinky-cloud'
22
+ s.license = 'MIT'
23
+ end
@@ -0,0 +1,13 @@
1
+ require 'socket'
2
+
3
+ module BlinkyCloud
4
+ class Base
5
+ MULTICAST_ADDR = "224.0.0.1"
6
+ PORT = 54321
7
+
8
+ def socket
9
+ @socket ||= UDPSocket.open
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ module BlinkyCloud
2
+ class Broadcaster < BlinkyCloud::Base
3
+ def broadcast!(data)
4
+ socket.setsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL, 1)
5
+ socket.send(data, 0, MULTICAST_ADDR, PORT)
6
+ socket.close
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,23 @@
1
+ require "ipaddr"
2
+ require 'blinky_cloud/base'
3
+
4
+ module BlinkyCloud
5
+ class Listener < BlinkyCloud::Base
6
+ BIND_ADDR = "0.0.0.0"
7
+
8
+ def listen(callback)
9
+ socket = UDPSocket.new
10
+ membership = IPAddr.new(MULTICAST_ADDR).hton + IPAddr.new(BIND_ADDR).hton
11
+
12
+ socket.setsockopt(:IPPROTO_IP, :IP_ADD_MEMBERSHIP, membership)
13
+ socket.setsockopt(:SOL_SOCKET, :SO_REUSEPORT, 1)
14
+
15
+ socket.bind(BIND_ADDR, PORT)
16
+
17
+ loop do
18
+ message, _ = socket.recvfrom(255)
19
+ callback.call(message)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ module BlinkyCloud
2
+ VERSION = '1.0.0'
3
+ end
@@ -0,0 +1,2 @@
1
+ require 'blinky_cloud/base'
2
+ require 'blinky_cloud/broadcaster'
data/pre-push ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ blinky-cloud-broadcast fb
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blinky-cloud
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Jade Meskill
8
+ - Roy van de Water
9
+ - Clayton Lengel-Zigich
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2014-04-08 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: blinky-tape-test-status
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: celluloid-io
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ description: A Ruby interface for blinky-cloud
44
+ email: dev@integrumtech.com
45
+ executables:
46
+ - blinky-cloud-broadcast
47
+ - blinky-cloud-listen
48
+ extensions: []
49
+ extra_rdoc_files: []
50
+ files:
51
+ - ".build/environment.pickle"
52
+ - ".gitignore"
53
+ - Gemfile
54
+ - Gemfile.lock
55
+ - LICENSE
56
+ - README.md
57
+ - bin/blinky-cloud-broadcast
58
+ - bin/blinky-cloud-listen
59
+ - blinky-cloud.gemspec
60
+ - lib/blinky_cloud.rb
61
+ - lib/blinky_cloud/base.rb
62
+ - lib/blinky_cloud/broadcaster.rb
63
+ - lib/blinky_cloud/listener.rb
64
+ - lib/blinky_cloud/version.rb
65
+ - pre-push
66
+ homepage: http://rubygems.org/gems/blinky-cloud
67
+ licenses:
68
+ - MIT
69
+ metadata: {}
70
+ post_install_message:
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubyforge_project:
86
+ rubygems_version: 2.0.14
87
+ signing_key:
88
+ specification_version: 4
89
+ summary: blinky-cloud
90
+ test_files: []