Flash_Cards_Sturdy_Cards_App 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/tests.rb ADDED
@@ -0,0 +1,37 @@
1
+ require_relative 'classes/Deck.rb'
2
+ require_relative 'classes/Card.rb'
3
+ require_relative 'noname.rb'
4
+
5
+ # TESTING METHODS THAT RECEIVE OBJECTS FROM CSV AND PUSH OBJECTS INTO NEW ARRAY VARIABLE
6
+
7
+ test_deck = Deck.new(1,"Test Deck", "Testing")
8
+
9
+ actual = test_deck.to_a # what the method returns
10
+ expected = [1,"Test Deck", "Testing"]
11
+
12
+ if actual == expected
13
+ puts "CSV deck inputs --> new array var PASSED"
14
+ else
15
+ puts "CSV card inputs --> new array var FAILED"
16
+ end
17
+
18
+ test_card = Card.new(1,"Test Card", "Card Name", "Some Description")
19
+
20
+ actual = test_card.to_a
21
+ expected = [1, "Test Card", "Card Name", "Some Description"]
22
+
23
+ if actual == expected
24
+ puts "CSV card inputs --> new array var PASSED"
25
+ else
26
+ puts "CSV card inputs --> new array var FAILED"
27
+ end
28
+
29
+ # TESTS FOR TERMINAL APP
30
+
31
+ # 1. Valid data type view deck
32
+
33
+
34
+
35
+
36
+
37
+
Binary file
@@ -0,0 +1,218 @@
1
+ Prior to code
2
+ - users are required to install the gems required to run the program
3
+ - once installed, ruby run program
4
+
5
+ including a simple card visual using lines and asterisks
6
+
7
+ First interaction
8
+
9
+ # USE CASE STATEMENT FOR ALL OPTIONS RELATED PROBLEMS, INTEGERS FOR OPTIONS
10
+ # IF/ELSE FOR CONFIRMATION OF ACTIONS **
11
+
12
+ 1. Menu (OPTIONS ARE REPRESENTED BY INTEGERS)
13
+ - Decks
14
+ - Learning Mode --> Current Progress
15
+
16
+ the above items are list as "integers" for users to select. Once selected, will move into the folder.
17
+
18
+ 2. Deck - deck's data type is an array consisting of hashes which would be the cards (ARRAY)
19
+
20
+ # USE CASE STATEMENT
21
+
22
+ - View current Decks - will show all decks and also allow option 2, 3 and 4 to be actioned here
23
+ - Edit current Decks - will ask what users would like to update (name)
24
+ - delete Deck **
25
+ - go back to first Menu
26
+
27
+ 3. card (under deck) - this will show all the cards in hashes
28
+ - view card
29
+ - edit card
30
+ - delete card **
31
+ - go back to decks
32
+
33
+ # LOGIC
34
+
35
+ Classes
36
+ Parent = Deck
37
+ - allow deck to be initialized (parameters include "name")
38
+ - remember to implement attr_accessor/etc whenever applicable
39
+ - instance variables
40
+ - deck name y
41
+ - count_deck?? maybe only in class var y
42
+ - count_cards = 0 y
43
+ - count_tests = 0 y
44
+ - familiarity rate = 0 y
45
+ - class variables
46
+ - count deck = 0 y
47
+ - familiarity rate (should be different for each deck created) y
48
+ - methods
49
+ - count deck (self) (class?) y
50
+ - update deck y
51
+ - create deck y
52
+ - view deck y
53
+ - delete deck y
54
+ - LEARNING MODE - class method to calculate if deck familiarity is under "recap" (familiar) or under "unfamiliar"
55
+ - random generator for questions - REVISIT LAST
56
+ - get familiarity rate y
57
+ - get date created y
58
+ - get date modified y
59
+ - back to main menu y
60
+
61
+ Child = Card
62
+ - allow card to be initialized (parameters = "card name", "description")
63
+ - remember to implement attr_accessor/etc whenever applicable
64
+ - instance variables
65
+ - card name y
66
+ - description y
67
+
68
+ - methods
69
+ - add card
70
+ - update card
71
+ - view card
72
+ - delete card
73
+ - back to deck menu
74
+
75
+ card = array.find { |card| card[:name] == incoming_card_name }
76
+ if card
77
+ puts "Duplicate detected"
78
+ else
79
+ # add to array
80
+ end
81
+
82
+ Menu
83
+ 1. Decks
84
+ 2. Learning Mode >> Current Progress
85
+
86
+ users select from {case statement}
87
+ 1. View Deck
88
+ 2. Create Deck
89
+ 3. Update Deck
90
+ 4. Delete Deck
91
+ 5. Go back to menu
92
+
93
+ note: show decks and cards in visual form (if possible)
94
+
95
+ >> Login (not mandatory)
96
+
97
+
98
+ >> Decks
99
+
100
+ >> to process selected deck
101
+
102
+ >> program will asks user to enter the correct name of a deck until the name req is satisfied
103
+ >> LOOP { if "deck name" > deck, else print "deck does not exist, please check name" (write a better error handling message) } LOOP
104
+
105
+ >> if successful, then show deck
106
+
107
+ >> data to show includes:
108
+ - name of the deck
109
+ - familiarity rate
110
+ - topic
111
+ - number of cards
112
+ - number of completed practices
113
+ - number of mastered cards
114
+ - number of unmastered cards
115
+ - date modified (not mandatory)
116
+ - date created (not mandatory)
117
+
118
+ >> show all cards (below deck)
119
+ >> present one card per line (HASH)
120
+
121
+ >> create a deck
122
+ >> LOOP ask for user input "what name youd like for new deck?" LOOP
123
+ {if "deck name" already exist in your collection, choose another name"} - REVISIT
124
+
125
+ >> update a deck
126
+ >> program will asks user to enter the correct name of a deck until the name req is satisfied
127
+ >> LOOP { if "deck name" > deck, else print "deck does not exist, please check name" (write a better error handling message) } LOOP
128
+
129
+ >> Cards
130
+ present users with a menu (case statement)
131
+ 1. view card
132
+ 2. create card
133
+ 3. edit card
134
+ 4. delete card
135
+ 5. go back to deck
136
+
137
+ >> 1 selected
138
+ LOOP { if "card name" , else print "card does not exist within this deck, please check name" (write a better error handling message) } LOOP
139
+ >> card details
140
+ - card name
141
+ - card description
142
+
143
+ >> menu
144
+ 1. edit
145
+ 2. delete
146
+ 3. go back
147
+
148
+ >> 2
149
+ >> LOOP user input "What would you like to name your card?" LOOP {if "card name" already exist within this deck, choose another name"}
150
+ >> "description of the card?"
151
+ >> succeed - "card created"
152
+ >> pause and go back to previous menu
153
+
154
+ >> 3
155
+ >> LOOP "which card would you like to update?" LOOP
156
+ { if "card name" , else print "card does not exist within this deck, please check name"
157
+
158
+ >> current card details:
159
+ - card name
160
+ - card description
161
+
162
+ >> "what would you like to change?
163
+
164
+ 1. name
165
+ 2. description
166
+
167
+ >> case statement "what would be the new name/description?"
168
+ {if "card name" already exist within this deck, choose another name"}
169
+
170
+ >> if new card name == name > error 'same name' or duplicate in the deck >> PROBLEM
171
+ >> else, succeed - "name/description changed"
172
+
173
+ >> pause and go back to previous menu
174
+
175
+ >> 4
176
+ >> list of cards (hashes)
177
+ >> "which card would you like to delete?
178
+ >> confirmation > do you really want to delete {card}?
179
+ Yes/No
180
+ >> succeed - "card deleted"
181
+
182
+ >> 5
183
+ >> go back to previous menu (deck)
184
+
185
+
186
+
187
+ >> Learning Mode
188
+
189
+ "Cards are randomly shuffled"
190
+
191
+ >> options in case statement:
192
+ 1. Recap
193
+ 2. Unfamiliar decks
194
+ 3. New decks
195
+
196
+ >> 1
197
+ >> familiarity threshold == 100%? - set in class?
198
+ >> show decks that == threshold
199
+ >> Q & A:
200
+ >> get from 100% familiarity deck, if no deck found, use default.
201
+ >> answers --> generated by random generator using data from within the deck
202
+ >> BONUS --> generate answers which are similar to each other
203
+ >> 2
204
+ >> familiarity threshold < 100%?
205
+ >> Q & A:
206
+ >> from unfamiliar Decks
207
+ >> answers --> generated by random generator using data from within the deck
208
+ >> BONUS --> generate answers which are similar to each other
209
+
210
+ >> 3
211
+ >> show new decks (recently created)
212
+ >> define recent --> within the last 30 days? set in class?
213
+
214
+
215
+ >> Current Progress
216
+ >> shows progress for all decks
217
+ >> in hash, with percentage
218
+ >> BONUS - show comforting/inspiring messages in deck (if applicable)
@@ -0,0 +1,52 @@
1
+ require_relative 'lib/noname/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "Flash_Cards_Sturdy_Cards_App"
5
+ spec.version = Noname::VERSION
6
+ spec.authors = ["Guan Kuan Lee"]
7
+ spec.email = ["angusl.zanshin@gmail.com"]
8
+
9
+ spec.summary = "something"
10
+ spec.description = "something longer to write"
11
+ spec.homepage = "https://github.com/codebender16?tab=repositories"
12
+ spec.license = "MIT"
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
+
15
+ # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
16
+
17
+ # spec.metadata["homepage_uri"] = spec.homepage
18
+ # spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
19
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ end
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+ spec.add_dependency "colorize", "~> 0.8.1"
30
+ spec.add_dependency "tty-font', '~> 0.5.0"
31
+ end
32
+
33
+ #this will be shown on gem page
34
+
35
+ # to update gem in github
36
+ # git status
37
+ # git add .
38
+ # git commit -m <URL>
39
+ # git remote add origin <URL>
40
+ # git remote -v
41
+ # git push -u origin master
42
+
43
+ # curl -u <gkuanlee16> https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
44
+ # gem signin
45
+
46
+ # building a gem
47
+ # gem build noname.gemspec
48
+
49
+ # udpating the gem
50
+ # rake build --> another version of gem will be created --> move the version file to "pkg"
51
+ # pushing the update
52
+ # gem push pkg/noname-version.gem
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: Flash_Cards_Sturdy_Cards_App
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Guan Kuan Lee
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-03-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: colorize
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.8.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.8.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: tty-font', '~> 0.5.0
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: something longer to write
42
+ email:
43
+ - angusl.zanshin@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".DS_Store"
49
+ - ".gitignore"
50
+ - ".rspec"
51
+ - ".travis.yml"
52
+ - CODE_OF_CONDUCT.md
53
+ - Gemfile
54
+ - LICENSE.txt
55
+ - README.md
56
+ - Rakefile
57
+ - bin/console
58
+ - bin/setup
59
+ - lib/.DS_Store
60
+ - lib/classes/Card.rb
61
+ - lib/classes/Deck.rb
62
+ - lib/database/cards.csv
63
+ - lib/database/decks.csv
64
+ - lib/database/recap.csv
65
+ - lib/database/recent.csv
66
+ - lib/database/unfamiliar.csv
67
+ - lib/noname/README.md
68
+ - lib/noname/version.rb
69
+ - lib/source_code.rb
70
+ - lib/tests.rb
71
+ - resources/UML Sturdy Cards.png
72
+ - software_dev_plan/pseudo_code.txt
73
+ - sturdy_cards.gemspec
74
+ homepage: https://github.com/codebender16?tab=repositories
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 2.3.0
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubygems_version: 3.1.2
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: something
97
+ test_files: []