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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTg3NGUyOTA3YzMxOWY3ZjZjZDU4N2IwZmZmNjMyOTRhZTNkNjBmMA==
4
+ MzJiYjI2N2YzMjI5ZDJmOGQ0YjM4NDg5YzQzYjFlYjgzNTQ3Yjc5Nw==
5
5
  data.tar.gz: !binary |-
6
- NGJlODgwMzE1Mzk0MjQ1NGI4ZWY0NWRlMjFkZmU4NjkyNmQ1NGY4Zg==
6
+ MThiMDgxYzExOTY1YTk1ZGNlNTc2OTc3MTQ2ZjA4ZDdhMGY5NThlNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWJhOTVhY2IzNWZhNzM5YzNjZDlkYzUzMGZiNzg2OTdkOTZjNTg4ZmRjMjY2
10
- MDg3YzRlMzFkODg3YWJiZjQzMzA0ODNkM2E5ODhmYmJjYTcyZjc1ZjczZDlh
11
- MzgwZjc2YmRmODZjMjUwMGNkYTI0ZjgxYzFjNzAzOWYxNjhjMjk=
9
+ ODhlMWYxZTllZTIzNDA5NTBlZGM1ZmJiMGExZDFmYWMyOTkzNWIzNDA5NTFm
10
+ Y2JiNWVlOThmZGJiNzMwYTE1NWZmOGU3NGU0YzY3ZGRlNGMxYzg0MjUwNjRk
11
+ MDMzYTg2YzdiMTM3NTA5NWZlYTg5Zjg5ZmQxOThlMTVjNTQxMDQ=
12
12
  data.tar.gz: !binary |-
13
- YTFkZDRiNzQzZTU1YzhjN2MwOTMxYTZjNDkxNTQ5M2Y5YzllODgyZjRjMzIx
14
- ZmFlZTBjZTlmMGQyYWNjNmI3OTRmZDc1YmQ4N2M5NGJkZDE2ZmNlMTlhZjM3
15
- MmI0ZjhhMDA5NzM3NTY0YWMwYWU2MjY2NTVjNmE0OTY0YzViM2I=
13
+ NzJkMjFhYzI1YjI2MWIwMTA4ZDc1Y2I2NzhkNzI2ZjBkNDdmNzM3MzM3MDEw
14
+ YWE1ZmZmYWE4NTk0NWM5ZTc4M2ZlMDFmOWI5N2Q2ZjRiNDJhNmVmMGVkNTNh
15
+ N2Q1MGMwMzA0YzkxNTUyNzBhOWZhYzQyMGZmMWFiMjMwNDI3Yzg=
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
  [![Gem Version](https://badge.fury.io/rb/circuits.svg)](https://badge.fury.io/rb/circuits)
3
3
  [![Coverage Status](https://coveralls.io/repos/meringu/circuits/badge.svg?branch=master&service=github)](https://coveralls.io/github/meringu/circuits?branch=master)
4
4
  [![Code Climate](https://codeclimate.com/github/meringu/circuits/badges/gpa.svg)](https://codeclimate.com/github/meringu/circuits)
5
+ [![docs](http://inch-ci.org/github/meringu/circuits.svg?branch=master)](http://inch-ci.org/github/meringu/circuits)
5
6
 
6
7
  # Circuits
7
8
 
@@ -25,8 +25,12 @@ module Circuits
25
25
  def tock
26
26
  outputs.each(&:tock)
27
27
  end
28
-
29
- attr_reader :inputs, :outputs
28
+
29
+ # the inputs of this component
30
+ attr_reader :inputs
31
+
32
+ # the outputs of this component
33
+ attr_reader :outputs
30
34
 
31
35
  private
32
36
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # Circuits allows you to express logical circuits in code
2
2
  module Circuits
3
3
  # The version of the Circuits gem
4
- VERSION = '0.2.5'
4
+ VERSION = '0.2.6'
5
5
  end
@@ -11,8 +11,9 @@ end
11
11
  describe Circuits::Terminal::Input do
12
12
  let(:output) { double('output') }
13
13
 
14
- describe '#output' do
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circuits
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Muru Paenga