ppcurses 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,25 +1,28 @@
1
- require "curses"
1
+ require 'ppcurses/actions/BaseAction.rb'
2
2
 
3
+ module PPCurses
3
4
 
4
- class InsertSQLDataAction < GetDataAction
5
+ class InsertSQLDataAction < GetDataAction
5
6
 
6
- def initialize( actions , sql, db )
7
- super(actions)
8
- @sql = sql
9
- @db = db
10
- end
7
+ def initialize( actions, sql, db )
8
+ super(actions)
9
+ @sql = sql
10
+ @db = db
11
+ end
11
12
 
12
- def winHeight()
13
- return 7 + @actions.length
14
- end
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
- def afterActions()
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 "curses"
1
+ require 'ppcurses/actions/BaseAction.rb'
2
2
 
3
- class NulAction < BaseAction
4
- def initialize( )
5
- end
3
+ module PPCurses
4
+ class NulAction < BaseAction
5
+ def initialize( )
6
+ end
6
7
 
7
8
 
8
- def execute()
9
- end
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
 
@@ -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", "another", "menu" ], nil )
8
+ radioMenu = PPCurses::RadioMenu.new( [ "Wow", "two", "menus!" ], nil )
9
9
 
10
10
  mainMenu = PPCurses::CompositeMenu.new(centerMenu, radioMenu)
11
11
 
@@ -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 nme: ");
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: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 14
10
- version: 0.0.14
9
+ - 15
10
+ version: 0.0.15
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matthieu Cormier