logicuit 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0dad7e6a6e7b924c46183e5ef4bfc6e4647fee1d8bc64b10792569664a6c4b80
4
+ data.tar.gz: a5c316448fc8b3019488131b53ad8115e11da5151fddc6f1d40d821f2b9862b8
5
+ SHA512:
6
+ metadata.gz: e5b4c0ea5bf5922c99a6ed7ee0d1a0eafe388c481bd1c54995645f01498adb9979c8967e1f70bcbbc7327b9c6ed2b43bd06fef326b25b73bd24beca3705a0fcc
7
+ data.tar.gz: f37bec9789e8292558fd8cf58d4aa29a1765ba6d82826315afe1f4d11a24d2bb99d92ba88bdd52f52ff0e74c160ca552ebc99067f7c20151c127f7f756eee593
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.1
3
+
4
+ Style/StringLiterals:
5
+ EnforcedStyle: double_quotes
6
+
7
+ Style/StringLiteralsInInterpolation:
8
+ EnforcedStyle: double_quotes
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Koji NAKAMURA
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,42 @@
1
+ # Logicuit
2
+
3
+ logi(c cir)cuit -> logicuit
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ ```bash
10
+ bundle add logicuit
11
+ ```
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ ```bash
16
+ gem install logicuit
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```
22
+ Logicuit::And.new(1, 1).signal # [1]
23
+ Logicuit::And.new(1, 0).signal # [0]
24
+ Logicuit::And.new(0, 1).signal # [0]
25
+ Logicuit::And.new(0, 0).signal # [0]
26
+ ```
27
+
28
+ This is all for now :)
29
+
30
+ ## Development
31
+
32
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
33
+
34
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
35
+
36
+ ## Contributing
37
+
38
+ Bug reports and pull requests are welcome on GitHub at https://github.com/kozy4324/logicuit.
39
+
40
+ ## License
41
+
42
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[test rubocop]
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Logicuit
4
+ # AND circuit
5
+ class And
6
+ def initialize(a, b) # rubocop:disable Naming/MethodParameterName
7
+ @a = a
8
+ @b = b
9
+ end
10
+
11
+ def signal
12
+ [@a == 1 && @b == 1 ? 1 : 0]
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Logicuit
4
+ VERSION = "0.1.0"
5
+ end
data/lib/logicuit.rb ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "logicuit/version"
4
+ require_relative "logicuit/and"
data/sig/logicuit.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Logicuit
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logicuit
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Koji NAKAMURA
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 2025-02-05 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: logi(c cir)cuit -> logicuit
13
+ email:
14
+ - kozy4324@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - ".rubocop.yml"
20
+ - LICENSE.txt
21
+ - README.md
22
+ - Rakefile
23
+ - lib/logicuit.rb
24
+ - lib/logicuit/and.rb
25
+ - lib/logicuit/version.rb
26
+ - sig/logicuit.rbs
27
+ homepage: https://github.com/kozy4324/logicuit
28
+ licenses:
29
+ - MIT
30
+ metadata:
31
+ allowed_push_host: https://rubygems.org
32
+ homepage_uri: https://github.com/kozy4324/logicuit
33
+ source_code_uri: https://github.com/kozy4324/logicuit
34
+ changelog_uri: https://github.com/kozy4324/logicuit/releases
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 3.1.0
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirements: []
49
+ rubygems_version: 3.6.2
50
+ specification_version: 4
51
+ summary: logi(c cir)cuit -> logicuit
52
+ test_files: []