Skip to content

Catalog of My things console app #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 95 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
27d914b
workflow
brhanuhailu May 29, 2023
7377090
rubocop
brhanuhailu May 29, 2023
c3ad0da
Gemfile
brhanuhailu May 29, 2023
464f7ee
app.rb
brhanuhailu May 29, 2023
39f2784
item.rb
brhanuhailu May 29, 2023
8bccb62
main.rb
brhanuhailu May 29, 2023
744b539
Merge pull request #28 from brhanuhailu/set-pu
brhanuhailu May 29, 2023
65c68a2
Add Gemfile.lock and update main.rb
yodit93 May 29, 2023
a11fb38
Merge pull request #29 from brhanuhailu/console_app
yodit93 May 29, 2023
8f88f60
Add a custom setter for label attribute
yodit93 May 30, 2023
8005b9c
create music files
danielmatama May 30, 2023
ad38116
Create label class with attributes and method
yodit93 May 30, 2023
48a0db4
Fix linter errors
yodit93 May 30, 2023
3c7e504
Merge pull request #30 from brhanuhailu/music
danielmatama May 30, 2023
a3d9041
Merge pull request #31 from brhanuhailu/label_class
yodit93 May 30, 2023
b9826ca
authors
brhanuhailu May 30, 2023
ccf7f96
game.rb
brhanuhailu May 30, 2023
8fe6002
Create book class as child of item class
yodit93 May 30, 2023
01ae4f6
Merge pull request #33 from brhanuhailu/game-branch
brhanuhailu May 30, 2023
864675a
Add methods for book and label classes
yodit93 May 30, 2023
dd00944
Update main.rb to include option for creating label
yodit93 May 30, 2023
5b2e79e
Add methods for creating and listing book and label classes
yodit93 May 30, 2023
9190cb1
Update book label property
yodit93 May 30, 2023
a9e13c5
Update item label property
yodit93 May 30, 2023
2971f92
Update main.rb and label.rb
yodit93 May 30, 2023
056cdbb
Fix linter errors
yodit93 May 30, 2023
920e2f1
Merge pull request #34 from brhanuhailu/book_class
brhanuhailu May 30, 2023
6146da5
Create store with preserve_data class
yodit93 May 30, 2023
e50a298
Save created books and labels
yodit93 May 30, 2023
5256767
Fix linter errors
yodit93 May 30, 2023
1aafd5c
readmefile
brhanuhailu May 30, 2023
48c1687
app.rb
brhanuhailu May 30, 2023
8be8871
authors.rb
brhanuhailu May 30, 2023
9395d1e
game.rb
brhanuhailu May 30, 2023
b01c1f1
game
brhanuhailu May 30, 2023
2678fa2
Merge pull request #35 from brhanuhailu/preserve_book_label
yodit93 May 30, 2023
d568607
Merge branch 'dev' into game-author
brhanuhailu May 30, 2023
bd21bd0
Update app.rb
brhanuhailu May 30, 2023
ad65b59
Update author.rb
brhanuhailu May 30, 2023
7b5fbed
Update game.rb
brhanuhailu May 30, 2023
279046b
Merge pull request #36 from brhanuhailu/game-author
brhanuhailu May 30, 2023
3a97de8
app.rb
brhanuhailu May 30, 2023
f797dee
authors.json
brhanuhailu May 30, 2023
6474701
game.json
brhanuhailu May 30, 2023
66e1c99
fix linters
brhanuhailu May 30, 2023
462b857
Merge pull request #37 from brhanuhailu/preserve-game
brhanuhailu May 31, 2023
d26d926
Add unit tests for book class
yodit93 May 31, 2023
ee1eb59
Add unit tests for label class
yodit93 May 31, 2023
30f3193
Import book and label class file to helper file
yodit93 May 31, 2023
79de194
Update the published_date string to be date object
yodit93 May 31, 2023
8a8574f
Merge pull request #38 from brhanuhailu/add_tests
yodit93 May 31, 2023
bd4909f
app.rb
brhanuhailu May 31, 2023
73760bf
spec helper class
brhanuhailu May 31, 2023
e7f4370
authors modification
brhanuhailu May 31, 2023
5864684
game spec.rb
brhanuhailu May 31, 2023
f29b33e
author unit test class
brhanuhailu May 31, 2023
2525ba2
game unit test class
brhanuhailu May 31, 2023
4647e4a
create json
danielmatama May 31, 2023
bd36b0d
Create catalog database
yodit93 May 31, 2023
6c6f8fa
Create label table
yodit93 May 31, 2023
39b1d7f
Create book table
yodit93 May 31, 2023
3aef1d3
Update tests.yml file
yodit93 May 31, 2023
270d1f9
test
brhanuhailu May 31, 2023
9686775
Store music data
danielmatama May 31, 2023
fd1c69e
test fix
brhanuhailu May 31, 2023
38f4647
rubocop
brhanuhailu May 31, 2023
5497640
fixed some tests
brhanuhailu May 31, 2023
1e7c7aa
Fix linters
danielmatama May 31, 2023
d22c03f
Update app to solve linter errors
danielmatama May 31, 2023
c9ddce8
Merge pull request #39 from brhanuhailu/unit_test_game
brhanuhailu May 31, 2023
3242c12
Merge pull request #40 from brhanuhailu/create_book/label_tables
yodit93 May 31, 2023
f32e515
author and game tables
brhanuhailu May 31, 2023
d963a3e
Merge pull request #42 from brhanuhailu/game-schale
brhanuhailu May 31, 2023
94a116e
Merge pull request #41 from brhanuhailu/store-music
danielmatama Jun 1, 2023
50c514f
join everyone one file togther
brhanuhailu Jun 1, 2023
8d56644
Merge pull request #43 from brhanuhailu/join-files
brhanuhailu Jun 1, 2023
e7a9a2f
Create tests for genre and music
danielmatama Jun 1, 2023
cdf2072
fix linters
danielmatama Jun 1, 2023
9f36b23
fix bug
danielmatama Jun 1, 2023
c722997
fix bugs
danielmatama Jun 1, 2023
0979c02
fix tests
danielmatama Jun 1, 2023
05f2e4d
fix linter errors
danielmatama Jun 1, 2023
933c09d
fis tests
danielmatama Jun 1, 2023
4bc9d23
update tests
danielmatama Jun 1, 2023
80525e9
update schema file
danielmatama Jun 1, 2023
7e66989
Merge pull request #44 from brhanuhailu/music-tests
danielmatama Jun 1, 2023
733fe45
Finilized catalog of my things
yodit93 Jun 1, 2023
b2d00f3
Import spec_helper.rb to author_spec.rb
yodit93 Jun 2, 2023
eb223d9
Add video link to readme file
yodit93 Jun 2, 2023
8868f9c
Merge pull request #45 from brhanuhailu/my_catalog
yodit93 Jun 2, 2023
14e206c
Update readme file
yodit93 Jun 2, 2023
c1c5060
Add unit tests for item class methods
yodit93 Jun 2, 2023
71dadbb
Add custom setters for author and genre classes in item
yodit93 Jun 2, 2023
fdfcec1
Check rubocop
yodit93 Jun 2, 2023
cdfa2a0
Merge pull request #47 from brhanuhailu/my_catalog
yodit93 Jun 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BUNDLE_PATH: "ruby-capstone"
20 changes: 20 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Linters

on: pull_request

jobs:
rubocop:
name: Rubocop
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/setup-ruby@v1
with:
ruby-version: ">=3.1.x"
- name: Setup Rubocop
run: |
gem install --no-document rubocop -v '>= 1.0, < 2.0' # https://docs.rubocop.org/en/stable/installation/
[ -f .rubocop.yml ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/ruby/.rubocop.yml
- name: Rubocop Report
run: rubocop --color
19 changes: 19 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Tests

on: pull_request

jobs:
rspec:
name: RSpec
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-ruby@v1
with:
ruby-version: 3.1.x
- name: Setup RSpec
run: |
[ -f Gemfile ] && bundle
gem install --no-document rspec -v '>=3.0, < 4.0'
- name: RSpec Report
run: rspec --force-color --format documentation
54 changes: 54 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
AllCops:
NewCops: enable
Exclude:
- "Guardfile"
- "Rakefile"
- "node_modules/**/*"

DisplayCopNames: true

Layout/LineLength:
Max: 130
Metrics/MethodLength:
Max: 25
Metrics/AbcSize:
Max: 50
Metrics/ClassLength:
Max: 150
Metrics/BlockLength:
IgnoredMethods: ['describe']
Max: 30


Style/Documentation:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/EachForSimpleLoop:
Enabled: false
Style/AndOr:
Enabled: false
Style/DefWithParentheses:
Enabled: false
Style/FrozenStringLiteralComment:
EnforcedStyle: never

Layout/HashAlignment:
EnforcedColonStyle: key
Layout/ExtraSpacing:
AllowForAlignment: false
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
Lint/RaiseException:
Enabled: false
Lint/StructNewOverride:
Enabled: false
Style/HashEachMethods:
Enabled: false
Style/HashTransformKeys:
Enabled: false
Style/HashTransformValues:
Enabled: false
Layout/EndOfLine:
Enabled: False
64 changes: 64 additions & 0 deletions Database/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
-- create catalog of my things database
CREATE DATABASE catalog;

-- create label table

CREATE TABLE label (
id int GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
title VARCHAR(100) NOT NULL,
color VARCHAR(100) NOT NULL
);

-- create book table
CREATE TABLE book (
id int GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
author_id INT REFERENCES author(id),
published_date DATE,
publisher TEXT,
archived BOOLEAN NOT NULL DEFAULT FALSE,
cover_state VARCHAR(5),
label_id INT REFERENCES label(id)
);

-- create game table
CREATE TABLE game (
id int GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
published_date DATE,
multiplayer BOOLEAN NOT NULL DEFAULT FALSE,
last_played_at DATE,
author_id int REFERENCES author(id),
);

-- create author table
CREATE TABLE author (
id int GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
);

-- create genre table
CREATE TABLE Genre(
id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
name VARCHAR(60) NOT NULL
);

-- create item table

CREATE TABLE item(
id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
genre_id INT,
author_id INT,
label_id INT,
publish_date Date,
archived BOOLEAN,
FOREIGN KEY(genre_id) REFERENCES Genre(id) ON UPDATE CASCADE,
FOREIGN KEY(author_id) REFERENCES Author(id) ON UPDATE CASCADE,
FOREIGN KEY(label_id) REFERENCES Label(id) ON UPDATE CASCADE
);

-- create music_album table
CREATE TABLE MusicAlbum(
id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
on_spotify BOOLEAN NOT NULL,
FOREIGN KEY(id) REFERENCES item(id) ON UPDATE CASCADE
);
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gem 'rubocop', '>= 1.0', '< 2.0'
34 changes: 34 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
json (2.6.3)
parallel (1.23.0)
parser (3.2.2.1)
ast (~> 2.4.1)
rainbow (3.1.1)
regexp_parser (2.8.0)
rexml (3.2.5)
rubocop (1.51.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.1)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
unicode-display_width (2.4.2)

PLATFORMS
x86_64-linux

DEPENDENCIES
rubocop (>= 1.0, < 2.0)

BUNDLED WITH
2.4.13
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2023 Brhanu Hailu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2023 Brhanu Hailu, Daniel Matama
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading