commit 102f2cff1acf04ef68ed412f0faa7d7a8ce75f1f
parent 97188539648fba10f120be9ef12ae3cb182aa1e2
Author: Jackson G. Kaindume <seestem@merely.tech>
Date: Tue, 23 Aug 2022 17:36:32 +0200
Add cyrto
Diffstat:
12 files changed, 259 insertions(+), 0 deletions(-)
diff --git a/cyrto/.gitignore b/cyrto/.gitignore
@@ -0,0 +1,10 @@
+# Files and directories created by pub.
+.dart_tool/
+.packages
+
+# Conventional directory for build outputs.
+build/
+
+# Omit committing pubspec.lock for library packages; see
+# https://dart.dev/guides/libraries/private-files#pubspeclock.
+pubspec.lock
diff --git a/cyrto/CHANGELOG.md b/cyrto/CHANGELOG.md
@@ -0,0 +1,3 @@
+## 1.0.0
+
+- Initial version.
diff --git a/cyrto/README.md b/cyrto/README.md
@@ -0,0 +1 @@
+# cyrtophora client
diff --git a/cyrto/analysis_options.yaml b/cyrto/analysis_options.yaml
@@ -0,0 +1,30 @@
+# This file configures the static analysis results for your project (errors,
+# warnings, and lints).
+#
+# This enables the 'recommended' set of lints from `package:lints`.
+# This set helps identify many issues that may lead to problems when running
+# or consuming Dart code, and enforces writing Dart using a single, idiomatic
+# style and format.
+#
+# If you want a smaller set of lints you can change this to specify
+# 'package:lints/core.yaml'. These are just the most critical lints
+# (the recommended set includes the core lints).
+# The core lints are also what is used by pub.dev for scoring packages.
+
+include: package:lints/recommended.yaml
+
+# Uncomment the following section to specify additional rules.
+
+# linter:
+# rules:
+# - camel_case_types
+
+# analyzer:
+# exclude:
+# - path/to/excluded/files/**
+
+# For more information about the core and recommended set of lints, see
+# https://dart.dev/go/core-lints
+
+# For additional information about configuring this file, see
+# https://dart.dev/guides/language/analysis-options
diff --git a/cyrto/example/cyrtophora_example.dart b/cyrto/example/cyrtophora_example.dart
@@ -0,0 +1,6 @@
+import 'package:cyrtophora/cyrtophora.dart';
+
+void main() {
+ var awesome = Awesome();
+ print('awesome: ${awesome.isAwesome}');
+}
diff --git a/cyrto/lib/cyrtophora.dart b/cyrto/lib/cyrtophora.dart
@@ -0,0 +1,6 @@
+/// cyrtophora client
+
+library cyrtophora;
+
+export 'src/cyrtophora_base.dart';
+export 'src/utils.dart';
diff --git a/cyrto/lib/src/cyrtophora_base.dart b/cyrto/lib/src/cyrtophora_base.dart
@@ -0,0 +1,8 @@
+/// Cyrtophora client public facing types in this file.
+
+import "package:cyrtophora/src/utils.dart";
+
+/// Checks if you are awesome. Spoiler: you are.
+class Cyrtophora {
+ bool get isAwesome => true;
+}
diff --git a/cyrto/lib/src/utils.dart b/cyrto/lib/src/utils.dart
@@ -0,0 +1,75 @@
+/// utilities -- cyrtophora utility functions
+
+/// Check if a character is alphanumeric
+bool isAlphanumeric(String char) {
+ final alphanumeric = [
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9",
+ "0"
+ ];
+
+ if (alphanumeric.contains(char)) {
+ return true;
+ } else {
+ return false;
+ }
+}
diff --git a/cyrto/lib/src/validate.dart b/cyrto/lib/src/validate.dart
@@ -0,0 +1 @@
+
diff --git a/cyrto/pubspec.yaml b/cyrto/pubspec.yaml
@@ -0,0 +1,14 @@
+name: cyrtophora
+description: A starting point for Dart libraries or applications.
+version: 1.0.0
+# homepage: https://www.example.com
+
+environment:
+ sdk: '>=2.17.0-227.0.dev <3.0.0'
+
+# dependencies:
+# path: ^1.8.0
+
+dev_dependencies:
+ lints: ^2.0.0
+ test: ^1.16.0
diff --git a/cyrto/test/cyrtophora_test.dart b/cyrto/test/cyrtophora_test.dart
@@ -0,0 +1,5 @@
+import 'package:test/test.dart';
+
+void main() {
+ group('Tests for cyrtophora utilities', () {});
+}
diff --git a/cyrto/test/utils_test.dart b/cyrto/test/utils_test.dart
@@ -0,0 +1,100 @@
+import 'package:cyrtophora/cyrtophora.dart';
+import 'package:test/test.dart';
+
+void main() {
+ group('Tests for cyrtophora utilities', () {
+ test('Test isAlphaNumeric function', () {
+ expect(isAlphanumeric("a"), isTrue);
+ expect(isAlphanumeric("b"), isTrue);
+ expect(isAlphanumeric("c"), isTrue);
+ expect(isAlphanumeric("d"), isTrue);
+ expect(isAlphanumeric("e"), isTrue);
+ expect(isAlphanumeric("f"), isTrue);
+ expect(isAlphanumeric("g"), isTrue);
+ expect(isAlphanumeric("h"), isTrue);
+ expect(isAlphanumeric("i"), isTrue);
+ expect(isAlphanumeric("j"), isTrue);
+ expect(isAlphanumeric("k"), isTrue);
+ expect(isAlphanumeric("l"), isTrue);
+ expect(isAlphanumeric("m"), isTrue);
+ expect(isAlphanumeric("n"), isTrue);
+ expect(isAlphanumeric("o"), isTrue);
+ expect(isAlphanumeric("p"), isTrue);
+ expect(isAlphanumeric("q"), isTrue);
+ expect(isAlphanumeric("r"), isTrue);
+ expect(isAlphanumeric("s"), isTrue);
+ expect(isAlphanumeric("t"), isTrue);
+ expect(isAlphanumeric("u"), isTrue);
+ expect(isAlphanumeric("v"), isTrue);
+ expect(isAlphanumeric("w"), isTrue);
+ expect(isAlphanumeric("x"), isTrue);
+ expect(isAlphanumeric("y"), isTrue);
+ expect(isAlphanumeric("z"), isTrue);
+ expect(isAlphanumeric("A"), isTrue);
+ expect(isAlphanumeric("B"), isTrue);
+ expect(isAlphanumeric("C"), isTrue);
+ expect(isAlphanumeric("D"), isTrue);
+ expect(isAlphanumeric("E"), isTrue);
+ expect(isAlphanumeric("F"), isTrue);
+ expect(isAlphanumeric("G"), isTrue);
+ expect(isAlphanumeric("H"), isTrue);
+ expect(isAlphanumeric("I"), isTrue);
+ expect(isAlphanumeric("J"), isTrue);
+ expect(isAlphanumeric("K"), isTrue);
+ expect(isAlphanumeric("L"), isTrue);
+ expect(isAlphanumeric("M"), isTrue);
+ expect(isAlphanumeric("N"), isTrue);
+ expect(isAlphanumeric("O"), isTrue);
+ expect(isAlphanumeric("P"), isTrue);
+ expect(isAlphanumeric("Q"), isTrue);
+ expect(isAlphanumeric("R"), isTrue);
+ expect(isAlphanumeric("S"), isTrue);
+ expect(isAlphanumeric("T"), isTrue);
+ expect(isAlphanumeric("U"), isTrue);
+ expect(isAlphanumeric("V"), isTrue);
+ expect(isAlphanumeric("W"), isTrue);
+ expect(isAlphanumeric("X"), isTrue);
+ expect(isAlphanumeric("Y"), isTrue);
+ expect(isAlphanumeric("Z"), isTrue);
+ expect(isAlphanumeric("1"), isTrue);
+ expect(isAlphanumeric("2"), isTrue);
+ expect(isAlphanumeric("3"), isTrue);
+ expect(isAlphanumeric("4"), isTrue);
+ expect(isAlphanumeric("5"), isTrue);
+ expect(isAlphanumeric("6"), isTrue);
+ expect(isAlphanumeric("7"), isTrue);
+ expect(isAlphanumeric("8"), isTrue);
+ expect(isAlphanumeric("9"), isTrue);
+ expect(isAlphanumeric("0"), isTrue);
+
+ expect(isAlphanumeric("!"), isFalse);
+ expect(isAlphanumeric("@"), isFalse);
+ expect(isAlphanumeric("#"), isFalse);
+ expect(isAlphanumeric("\$"), isFalse);
+ expect(isAlphanumeric("%"), isFalse);
+ expect(isAlphanumeric("^"), isFalse);
+ expect(isAlphanumeric("&"), isFalse);
+ expect(isAlphanumeric("*"), isFalse);
+ expect(isAlphanumeric("("), isFalse);
+ expect(isAlphanumeric(")"), isFalse);
+ expect(isAlphanumeric("-"), isFalse);
+ expect(isAlphanumeric("="), isFalse);
+ expect(isAlphanumeric("+"), isFalse);
+ expect(isAlphanumeric("\\"), isFalse);
+ expect(isAlphanumeric("]"), isFalse);
+ expect(isAlphanumeric("}"), isFalse);
+ expect(isAlphanumeric("["), isFalse);
+ expect(isAlphanumeric("{"), isFalse);
+ expect(isAlphanumeric(":"), isFalse);
+ expect(isAlphanumeric(";"), isFalse);
+ expect(isAlphanumeric("'"), isFalse);
+ expect(isAlphanumeric("\""), isFalse);
+ expect(isAlphanumeric("<"), isFalse);
+ expect(isAlphanumeric(">"), isFalse);
+ expect(isAlphanumeric("/"), isFalse);
+ expect(isAlphanumeric("?"), isFalse);
+ expect(isAlphanumeric("."), isFalse);
+ expect(isAlphanumeric(","), isFalse);
+ });
+ });
+}