From e1eb4925352ab046060a57dc3b7f3a6f17897851 Mon Sep 17 00:00:00 2001 From: "koffee.zip" Date: Wed, 15 Jul 2026 17:29:31 -0600 Subject: [PATCH] Initial commit --- .editorconfig | 9 +++++++++ .gitignore | 5 +++++ LICENSE | 17 +++++++++++++++++ README.md | 27 +++++++++++++++++++++++++++ config.txt | 3 +++ shard.lock | 10 ++++++++++ shard.yml | 17 +++++++++++++++++ spec/rete_spec.cr | 9 +++++++++ spec/spec_helper.cr | 2 ++ src/rete.cr | 22 ++++++++++++++++++++++ 10 files changed, 121 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 config.txt create mode 100644 shard.lock create mode 100644 shard.yml create mode 100644 spec/rete_spec.cr create mode 100644 spec/spec_helper.cr create mode 100644 src/rete.cr diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..163eb75 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*.cr] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0bb75ea --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/docs/ +/lib/ +/bin/ +/.shards/ +*.dwarf diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4600f2f --- /dev/null +++ b/LICENSE @@ -0,0 +1,17 @@ +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright (C) 2026 koffee.zip + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..ffe8437 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# rete + +TODO: Write a description here + +## Installation + +TODO: Write installation instructions here + +## Usage + +TODO: Write usage instructions here + +## Development + +TODO: Write development instructions here + +## Contributing + +1. Fork it () +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create a new Pull Request + +## Contributors + +- [koffee.zip](https://github.com/your-github-user) - creator and maintainer diff --git a/config.txt b/config.txt new file mode 100644 index 0000000..371063e --- /dev/null +++ b/config.txt @@ -0,0 +1,3 @@ +403 +200 +301 \ No newline at end of file diff --git a/shard.lock b/shard.lock new file mode 100644 index 0000000..cf0b796 --- /dev/null +++ b/shard.lock @@ -0,0 +1,10 @@ +version: 2.0 +shards: + prop: + git: https://github.com/nicolab/crystal-prop.git + version: 0.7.1 + + validator: + git: https://github.com/nicolab/crystal-validator.git + version: 1.11.0 + diff --git a/shard.yml b/shard.yml new file mode 100644 index 0000000..6905e51 --- /dev/null +++ b/shard.yml @@ -0,0 +1,17 @@ +name: rete +version: 0.1.0 + +authors: + - koffee.zip + +targets: + rete: + main: src/rete.cr + +dependencies: + validator: + github: nicolab/crystal-validator + +crystal: '>= 1.20.3' + +license: GPL diff --git a/spec/rete_spec.cr b/spec/rete_spec.cr new file mode 100644 index 0000000..d93677a --- /dev/null +++ b/spec/rete_spec.cr @@ -0,0 +1,9 @@ +require "./spec_helper" + +describe Rete do + # TODO: Write tests + + it "works" do + false.should eq(true) + end +end diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr new file mode 100644 index 0000000..2cd9baa --- /dev/null +++ b/spec/spec_helper.cr @@ -0,0 +1,2 @@ +require "spec" +require "../src/rete" diff --git a/src/rete.cr b/src/rete.cr new file mode 100644 index 0000000..f162515 --- /dev/null +++ b/src/rete.cr @@ -0,0 +1,22 @@ +require "http/client" +require "validator" + +repeat = 0 + +config = File.read("config.txt") + +while repeat < ARGV.size + if Valid.url? ARGV[repeat] + response = HTTP::Client.get(ARGV[repeat]) + if config.includes?(response.status_code.to_s) + puts "#{ARGV[repeat]} is a valid URL and works. #{response.status_code}" + else + puts "#{ARGV[repeat]} is a valid URL but does not work. #{response.status_code}" + end + elsif + puts "#{ARGV[repeat]} is not a valid URL" + end +repeat += 1 +end + +puts "=======================\nFinished"