Skip to content

RubyArtm/notepad_2.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notepad 2.0 📝

A console application for note-taking with SQLite database storage.

Description

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).

Features

The application supports three types of entries:

  • Memo - text notes of arbitrary content
  • Task - tasks with due dates
  • Link - bookmarks with URLs and descriptions

Technologies and Skills Used

Languages and Tools

  • Ruby 3.4.5 - primary development language
  • SQLite3 - database for storing entries

Applied Programming Concepts

  1. OOP (Object-Oriented Programming)

    • Class inheritance (base class Post and subclasses Memo, Task, Link)
    • Data encapsulation
    • Polymorphism through method overriding
  2. Database Operations

    • SQLite3 integration
    • CRUD operations (Create, Read)
    • Parameterized SQL queries
    • Dynamic query building
  3. Command-Line Argument Parsing

    • Using OptionParser library
    • Processing flags: --type, --id, --limit
  4. Date and Time Handling

    • Date formatting
    • User input parsing
    • Using Time and Date classes
  5. Design Patterns

    • Factory Method (the Post.create method)
    • Template Method (base methods in Post)

Usage

Creating a New Entry

ruby new_post.rb

The program will prompt you to select the entry type and enter data in interactive mode.

Reading Entries

Display all entries

ruby read.rb

Display entry by ID

ruby read.rb --id 5

Display last 10 entries

ruby read.rb --limit 10

Display only tasks

ruby read.rb --type Task

Show help for parameters

ruby read.rb -h

Project Structure

notepad_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

Database Schema

The posts table contains the following fields:

  • rowid - unique identifier
  • type - entry type (Memo/Task/Link)
  • created_at - creation date and time
  • text - text content
  • url - URL address (for Link)
  • due_date - due date (for Task)

Author

This project was created for educational purposes to demonstrate Ruby development skills.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages