ppcurses 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- metadata +1 -2
- data/lib/ppcurses/actions/LiftAction.rb +0 -46
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ppcurses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.18
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -24,7 +24,6 @@ files:
|
|
24
24
|
- lib/ppcurses/actions/GetIntegerAction.rb
|
25
25
|
- lib/ppcurses/actions/GetStringAction.rb
|
26
26
|
- lib/ppcurses/actions/InsertSQLDataAction.rb
|
27
|
-
- lib/ppcurses/actions/LiftAction.rb
|
28
27
|
- lib/ppcurses/actions/NulAction.rb
|
29
28
|
- lib/ppcurses/actions/PromptAction.rb
|
30
29
|
- lib/ppcurses/actions/ShowMenuAction.rb
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require "curses"
|
2
|
-
|
3
|
-
class LiftAction < GetDataAction
|
4
|
-
|
5
|
-
def initialize(nameMenu, repMenu, db)
|
6
|
-
@nameMenu = nameMenu
|
7
|
-
@repMenu = repMenu
|
8
|
-
@db = db
|
9
|
-
|
10
|
-
@prompt = GetIntegerAction.new("Weight (pounds) : ")
|
11
|
-
super( [ @prompt ] )
|
12
|
-
|
13
|
-
@sql = "INSERT into LIFTS(name, weight, reps) values ('%s', %s, %s)"
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
def winHeight()
|
18
|
-
return 9
|
19
|
-
end
|
20
|
-
|
21
|
-
def liftName()
|
22
|
-
@nameMenu.getSelectedMenuName()
|
23
|
-
end
|
24
|
-
|
25
|
-
def repsName()
|
26
|
-
@repMenu.getSelectedMenuName()
|
27
|
-
end
|
28
|
-
|
29
|
-
def repsInteger()
|
30
|
-
return Integer(repsName().chars.first).to_s
|
31
|
-
end
|
32
|
-
|
33
|
-
def beforeActions()
|
34
|
-
self.printLine("Input data for " + repsName() + " " + liftName() )
|
35
|
-
end
|
36
|
-
|
37
|
-
def afterActions()
|
38
|
-
preparedSql = @sql.sub("%s", liftName() )
|
39
|
-
preparedSql = preparedSql.sub("%s", @prompt.data() )
|
40
|
-
preparedSql = preparedSql.sub("%s", repsInteger() )
|
41
|
-
|
42
|
-
self.promptToChangeData(preparedSql)
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
46
|
-
|