geek_code 2.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 29

geek_code

A Dart implementation of the Geek Code.

This package is actually a port and cleaned up version of JGeekCode from Java.

Basic ideas

  • This library uses builders to generate the different categories that make up a Geek Code
  • Building a category is done by calling the grade method with a GeekCodeGrade or by calling some of the modifiers (i.e. noKnowledge) instead
  • The geek_code library includes a collection of base classes which are useful for implementing custom Geek Code flavors
  • The geek_code.v312 library is an implementation of the Geek Code v3.12 specification (specified at http://geekcode.com/geek.html), which is useful for generating a personal Geek Code

Generating a Geek Code with geek_code.v312

First you must import the library:

import "package:geek_code/geek_code_312.dart";

Start with a GeekCodeV312 object that will contain all the types and categories:

GeekCodeV312 code = new GeekCodeV312([G312.IT, G312.CS]);

The above constructor receives a list of GeekCodeTypes.

Then add categories to the code object using the addCategory(GeekCodeCategory).

All v3.12 categories are globally defined by their code:

code.addCategory(C.grade(new GeekCodeGrade(2))); // Adds the C category (Computers) with a grade of 2 to the code

Generating a Geek Code block is done by callin generate:

print(code.generate());

Variables and modifiers

As per the v3.12 specification it is possible to set certain modifiers for categories.

code.addCategory(h.living().grade(new GeekCodeGrade(-2))); // Adds the h category (Housing) with a grade of -2 and adds the "living" modifier to the code

Some modifiers are incompatible with each other:

code.addCategory(h.living().noKnowledge()); // Throws a GeekCodeError

Some categories have specific modifiers so be sure to consult the documentation for each builder before using it.

Full example

GeekCodeV312 code = new GeekCodeV312([G312.IT, G312.CS] as List<GeekCodeType>)
  ..addCategory(d.crossover(new GeekCodeGrade(0)).living().grade(new GeekCodeGrade(-1)))
  ..addCategory(s.roundness(new BasicGeekCodeCategoryBuilder().grade(new GeekCodeGrade(-1))).grade(new GeekCodeGrade(3)))
  ..addCategory(a.grade(new GeekCodeGrade(-3)))
  ..addCategory(C.grade(new GeekCodeGrade(2)))
  ..addCategory(U.B().grade(new GeekCodeGrade(2)))
  ..addCategory(P.noKnowledge())
  ..addCategory(E.grade(new GeekCodeGrade(-1)))
  ..addCategory(W.grade(new GeekCodeGrade(3)))
  ..addCategory(N.noKnowledge())
  ..addCategory(o.noKnowledge())
  ..addCategory(K.noKnowledge())
  ..addCategory(w.grade(new GeekCodeGrade(-3)))
  ..addCategory(O.noKnowledge())
  ..addCategory(M.grade(new GeekCodeGrade(2)))
  ..addCategory(V.noKnowledge())
  ..addCategory(PS.grade(new GeekCodeGrade(0)))
  ..addCategory(PE.refuse())
  ..addCategory(Y.grade(new GeekCodeGrade(0)))
  ..addCategory(t.noKnowledge())
  ..addCategory(BABYLON5.noKnowledge())
  ..addCategory(X.noKnowledge())
  ..addCategory(R.refuse())
  ..addCategory(tv.grade(new GeekCodeGrade(1)))
  ..addCategory(b.grade(new GeekCodeGrade(1)))
  ..addCategory(DI.grade(new GeekCodeGrade(0)))
  ..addCategory(D.noKnowledge())
  ..addCategory(GCode.grade(new GeekCodeGrade(2)))
  ..addCategory(e.grade(new GeekCodeGrade(0)))
  ..addCategory(h.grade(new GeekCodeGrade(-2)))
  ..addCategory(r.refuse())
  ..addCategory(z.male().grade(new GeekCodeGrade(0)));
print(code.generate());

Feature requests and bug reports

Please file feature requests and bug reports at the issue tracker.

Changelog

Kindly refer to the Github repo's releases list

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  geek_code: "^2.0.1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:geek_code/geek_code.dart';
        
Version Uploaded Documentation Archive
2.0.1 Apr 12, 2015 Go to the documentation of geek_code 2.0.1 Download geek_code 2.0.1 archive
2.0.0 Apr 12, 2015 Go to the documentation of geek_code 2.0.0 Download geek_code 2.0.0 archive
1.1.0 Apr 12, 2015 Go to the documentation of geek_code 1.1.0 Download geek_code 1.1.0 archive
1.0.1 Apr 8, 2015 Go to the documentation of geek_code 1.0.1 Download geek_code 1.0.1 archive
1.0.0 Apr 8, 2015 Go to the documentation of geek_code 1.0.0 Download geek_code 1.0.0 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
98 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0 / 100
Overall score:
Weighted score of the above. [more]
29
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:geek_code/geek_code.dart.

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 error 19 hints.

    Strong-mode analysis of lib/src/geek_code.dart failed with the following error:

    line: 85 col: 20
    The type 'List<GeekCodeType>' used in the 'for' loop must implement Iterable with a type argument that can be assigned to 'G'.

    Run dartfmt to format lib/geek_code.dart.

    Similar analysis of the following files failed:

    • lib/geek_code_312.dart (hint)
    • lib/src/312/categories/age_geek_code_category.dart (hint)
    • lib/src/312/categories/dress_geek_code_category.dart (hint)
    • lib/src/312/categories/relationships_geek_code_category.dart (hint)
    • lib/src/312/categories/sex_geek_code_category.dart (hint)
    • lib/src/312/categories/shape_geek_code_category.dart (hint)
    • lib/src/312/categories/unix_geek_code_category.dart (hint)
    • lib/src/312/geek_code_types.dart (hint)
    • lib/src/312/geek_code_v312.dart (hint)
    • lib/src/312/geek_code_v312_categories.dart (hint)
    • lib/src/categories/basic_geek_code_category.dart (hint)
    • lib/src/categories/extreme_generic_geek_code_category.dart (hint)
    • lib/src/categories/geek_code_category.dart (hint)
    • lib/src/categories/generic_geek_code_category.dart (hint)
    • lib/src/geek_code_error.dart (hint)
    • lib/src/geek_code_grade.dart (hint)
    • lib/src/geek_code_type.dart (hint)
  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Dev dependencies
unittest any