A console application for note-taking with SQLite database storage.
Notepad 2.0 is a multifunctional command-line notebook that allows you to create and manage different types of entries: notes, tasks with deadlines, and bookmarks (links).
The application supports three types of entries:
- Memo - text notes of arbitrary content
- Task - tasks with due dates
- Link - bookmarks with URLs and descriptions
- Ruby 3.4.5 - primary development language
- SQLite3 - database for storing entries
-
OOP (Object-Oriented Programming)
- Class inheritance (base class
Postand subclassesMemo,Task,Link) - Data encapsulation
- Polymorphism through method overriding
- Class inheritance (base class
-
Database Operations
- SQLite3 integration
- CRUD operations (Create, Read)
- Parameterized SQL queries
- Dynamic query building
-
Command-Line Argument Parsing
- Using
OptionParserlibrary - Processing flags:
--type,--id,--limit
- Using
-
Date and Time Handling
- Date formatting
- User input parsing
- Using
TimeandDateclasses
-
Design Patterns
- Factory Method (the
Post.createmethod) - Template Method (base methods in
Post)
- Factory Method (the
ruby new_post.rbThe program will prompt you to select the entry type and enter data in interactive mode.
ruby read.rbruby read.rb --id 5ruby read.rb --limit 10ruby read.rb --type Taskruby read.rb -hnotepad_2.0/
├── post.rb # Base class for all entry types
├── memo.rb # Class for text notes
├── task.rb # Class for tasks with deadlines
├── link.rb # Class for bookmarks
├── new_post.rb # Script for creating new entries
├── read.rb # Script for reading entries
└── notepad.sqlite # SQLite database
The posts table contains the following fields:
rowid- unique identifiertype- entry type (Memo/Task/Link)created_at- creation date and timetext- text contenturl- URL address (for Link)due_date- due date (for Task)
This project was created for educational purposes to demonstrate Ruby development skills.