circuits 0.2.5 → 0.2.6
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 +8 -8
- data/README.md +1 -0
- data/lib/circuits/component.rb +6 -2
- data/lib/circuits/terminal/input.rb +2 -1
- data/lib/circuits/terminal/output.rb +3 -0
- data/lib/circuits/version.rb +1 -1
- data/spec/unit/circuits/terminal/input_spec.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzJiYjI2N2YzMjI5ZDJmOGQ0YjM4NDg5YzQzYjFlYjgzNTQ3Yjc5Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MThiMDgxYzExOTY1YTk1ZGNlNTc2OTc3MTQ2ZjA4ZDdhMGY5NThlNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODhlMWYxZTllZTIzNDA5NTBlZGM1ZmJiMGExZDFmYWMyOTkzNWIzNDA5NTFm
|
10
|
+
Y2JiNWVlOThmZGJiNzMwYTE1NWZmOGU3NGU0YzY3ZGRlNGMxYzg0MjUwNjRk
|
11
|
+
MDMzYTg2YzdiMTM3NTA5NWZlYTg5Zjg5ZmQxOThlMTVjNTQxMDQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzJkMjFhYzI1YjI2MWIwMTA4ZDc1Y2I2NzhkNzI2ZjBkNDdmNzM3MzM3MDEw
|
14
|
+
YWE1ZmZmYWE4NTk0NWM5ZTc4M2ZlMDFmOWI5N2Q2ZjRiNDJhNmVmMGVkNTNh
|
15
|
+
N2Q1MGMwMzA0YzkxNTUyNzBhOWZhYzQyMGZmMWFiMjMwNDI3Yzg=
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
[](https://badge.fury.io/rb/circuits)
|
3
3
|
[](https://coveralls.io/github/meringu/circuits?branch=master)
|
4
4
|
[](https://codeclimate.com/github/meringu/circuits)
|
5
|
+
[](http://inch-ci.org/github/meringu/circuits)
|
5
6
|
|
6
7
|
# Circuits
|
7
8
|
|
data/lib/circuits/component.rb
CHANGED
@@ -11,12 +11,13 @@ module Circuits
|
|
11
11
|
@output = opts[:output] || Circuits::Terminal::Output.new
|
12
12
|
end
|
13
13
|
|
14
|
+
# The output the input reads from
|
14
15
|
attr_accessor :output
|
15
16
|
|
16
17
|
# Forward get to the output
|
17
18
|
# @return [Boolean] The state of the output
|
18
19
|
def get
|
19
|
-
output.get
|
20
|
+
@output.get
|
20
21
|
end
|
21
22
|
|
22
23
|
# Create a new output to use
|
@@ -4,6 +4,9 @@ module Circuits
|
|
4
4
|
module Terminal
|
5
5
|
# Belongs to a single component, gets set for reading by inputs
|
6
6
|
class Output
|
7
|
+
# Creates the output
|
8
|
+
# @param opts [Hash] Options to create the Output with
|
9
|
+
# @option opts [Boolean] :state The initial state of the Output
|
7
10
|
def initialize(opts = {})
|
8
11
|
@next_state = opts[:state] || false
|
9
12
|
@state = opts[:state] || false
|
data/lib/circuits/version.rb
CHANGED
@@ -11,8 +11,9 @@ end
|
|
11
11
|
describe Circuits::Terminal::Input do
|
12
12
|
let(:output) { double('output') }
|
13
13
|
|
14
|
-
describe '#
|
14
|
+
describe '#initialize' do
|
15
15
|
context 'when given an output' do
|
16
|
+
|
16
17
|
subject { Circuits::Terminal::Input.new(output: output) }
|
17
18
|
|
18
19
|
it 'sets the output' do
|