ppcurses 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ppcurses/actions/InsertSQLDataAction.rb +18 -15
- data/lib/ppcurses/actions/NulAction.rb +8 -6
- data/lib/ppcurses.rb +2 -0
- data/test/compositeMenu.rb +1 -1
- data/test/getDataAction.rb +1 -1
- metadata +3 -3
@@ -1,25 +1,28 @@
|
|
1
|
-
require
|
1
|
+
require 'ppcurses/actions/BaseAction.rb'
|
2
2
|
|
3
|
+
module PPCurses
|
3
4
|
|
4
|
-
class InsertSQLDataAction < GetDataAction
|
5
|
+
class InsertSQLDataAction < GetDataAction
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
def initialize( actions, sql, db )
|
8
|
+
super(actions)
|
9
|
+
@sql = sql
|
10
|
+
@db = db
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
def winHeight()
|
14
|
+
return 7 + @actions.length
|
15
|
+
end
|
16
|
+
|
17
|
+
def afterActions()
|
18
|
+
preparedSql = @sql
|
19
|
+
@actions.each do |action|
|
20
|
+
preparedSql = preparedSql.sub("%s", action.data)
|
21
|
+
end
|
15
22
|
|
16
|
-
|
17
|
-
preparedSql = @sql
|
18
|
-
@actions.each do |action|
|
19
|
-
preparedSql = preparedSql.sub("%s", action.data)
|
23
|
+
self.promptToChangeData(preparedSql)
|
20
24
|
end
|
21
25
|
|
22
|
-
self.promptToChangeData(preparedSql)
|
23
26
|
end
|
24
27
|
|
25
28
|
end
|
@@ -1,11 +1,13 @@
|
|
1
|
-
require
|
1
|
+
require 'ppcurses/actions/BaseAction.rb'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
module PPCurses
|
4
|
+
class NulAction < BaseAction
|
5
|
+
def initialize( )
|
6
|
+
end
|
6
7
|
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
def execute()
|
10
|
+
end
|
10
11
|
|
12
|
+
end
|
11
13
|
end
|
data/lib/ppcurses.rb
CHANGED
@@ -12,6 +12,8 @@ module PPCurses
|
|
12
12
|
require 'ppcurses/actions/GetIntegerAction.rb'
|
13
13
|
require 'ppcurses/actions/GetEnumeratedStringAction.rb'
|
14
14
|
require 'ppcurses/actions/GetDataAction.rb'
|
15
|
+
require 'ppcurses/actions/NulAction.rb'
|
16
|
+
require 'ppcurses/actions/InsertSQLDataAction.rb'
|
15
17
|
end
|
16
18
|
|
17
19
|
|
data/test/compositeMenu.rb
CHANGED
@@ -5,7 +5,7 @@ require 'ppcurses'
|
|
5
5
|
|
6
6
|
def displayMenu()
|
7
7
|
centerMenu = PPCurses::Menu.new( [ "Press", "<ESCAPE>", "to Quit" ], nil )
|
8
|
-
radioMenu = PPCurses::RadioMenu.new( [ "Wow", "
|
8
|
+
radioMenu = PPCurses::RadioMenu.new( [ "Wow", "two", "menus!" ], nil )
|
9
9
|
|
10
10
|
mainMenu = PPCurses::CompositeMenu.new(centerMenu, radioMenu)
|
11
11
|
|
data/test/getDataAction.rb
CHANGED
@@ -4,7 +4,7 @@ require 'rubygems'
|
|
4
4
|
require 'ppcurses'
|
5
5
|
|
6
6
|
intAction = PPCurses::GetIntegerAction.new("Input Integer : ");
|
7
|
-
stringAction = PPCurses::GetStringAction.new("Input your
|
7
|
+
stringAction = PPCurses::GetStringAction.new("Input your name: ");
|
8
8
|
|
9
9
|
action = PPCurses::GetDataAction.new( [intAction, stringAction] )
|
10
10
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ppcurses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 15
|
10
|
+
version: 0.0.15
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matthieu Cormier
|