studi-budi 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.1.0
data/lib/studi-budi.rb CHANGED
@@ -5,17 +5,78 @@ class StudiBudi
5
5
  load a previously saved collection?
6
6
  1. Create
7
7
  2. Load"
8
- @action = STDIN.gets.chomp()
8
+ action = gets.chomp
9
9
 
10
- # if @action == "1"
10
+ while action != "1" : "2"
11
+ puts "Please enter '1' to create or '2' to load."
12
+ action = gets.chomp
13
+ ##########################
14
+ if action == "1"
15
+ self.create # Probably no self. on those
16
+ elsif action == "2"
17
+ self.load
18
+ else
19
+ "Please enter '1' to create or '2' to load."
11
20
 
21
+ end
22
+
23
+ def create
24
+ puts "Enter the name of your new collection:"
25
+ @collection_name = gets.chomp
26
+ # something about setting up the collection hash & file here
27
+ @collection_name = File.open("~/Desktop/#{@collection_name}.rb", "r+")
28
+ menu
29
+ end
30
+
31
+ def load
32
+ # so create and load should both lead to either adding_cards or reviewing_cards
12
33
 
13
34
  end
14
35
 
15
- def create_collection
36
+ def menu
37
+ puts "'#{@collection_name}' Collection Menu
38
+ Would you like to add cards to this collection or review cards already in this collection?
39
+ 1. Add cards
40
+ 2. Review cards"
41
+ pref = gets.chomp
42
+ if pref == "1"
43
+ adding_cards
44
+ elsif pref == "2"
45
+ reviewing_cards # need to do same kind of thing as in initialize
46
+
16
47
  end
17
48
 
49
+ def adding_cards
50
+ puts "Type the term you'd like to practice and its matching answer separated by a comma, then hit [enter]. This adds that 'card' to your collection. To "
51
+ if gets.chomp == "review"
52
+ reviewing_cards
53
+ else
54
+ gets.chomp.split(",")
55
+
18
56
  # for key, value in the_gets do
19
57
  # {} << key => value
20
58
  # until gets == "end"
59
+ end
60
+
61
+ def reviewing_cards
62
+ puts "Let's review some of your cards. To exit, simply hit [enter]."
63
+
64
+ while gets.chomp != nil
65
+ cards_correct = 0
66
+ cards_wrong = 0
67
+
68
+ puts current_card = HASHHH[rand]
69
+ user_answer = gets.chomp
70
+ if user_answer == HASHHH[current_card]
71
+ puts "CORRECT"
72
+ cards_correct += 1
73
+ else
74
+ puts "WRONG"
75
+ cards_wrong += 1
76
+ end
77
+ end
78
+
79
+ puts "You got #{cards_correct} flash cards correct. Good job!
80
+ Pst! You also got #{cards_wrong} flash cards wrong."
81
+ end
21
82
  end
@@ -4,4 +4,10 @@ describe "StudiBudi" do
4
4
  it "fails" do
5
5
  fail "hey buddy, you should probably rename this file and start specing for real"
6
6
  end
7
+
8
+
9
+
10
+ # "if I make a card collection called 'Potatos'" do
11
+ # adfld.@collection_name should_eq "Potatos"
12
+ # end
7
13
  end
data/studi-budi.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "studi-budi"
8
- s.version = "0.0.3"
8
+ s.version = "0.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sol W"]
12
- s.date = "2012-12-10"
12
+ s.date = "2012-12-11"
13
13
  s.description = "Allows you to create sets of flash cards and review them"
14
14
  s.email = "capnsol@gmail.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: studi-budi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-10 00:00:00.000000000 Z
12
+ date: 2012-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -95,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  segments:
97
97
  - 0
98
- hash: -2274780375833877047
98
+ hash: 3582475490964877875
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  none: false
101
101
  requirements: