Le Tue, 30 Jan 2007 21:08:40 +0100,
The Stupid User <[EMAIL PROTECTED]> a _crit :

> Update in /var/git/else/pfe.git/refs/heads/eugenie
> http://git.else-projects.org/?p=else/pfe.git;a=summary
> http://git.else-projects.org/?p=else/pfe.git;a=commit;h=475beb9de4e2240b9bec03488491ae3c87742508
> 
> Commit:  475beb9de4e2240b9bec03488491ae3c87742508
> Author: Sysde <[EMAIL PROTECTED]>
> Date:   Tue Jan 30 21:08:34 2007 +0100
> 
>     Add the begin of reb script.
>     This script get the first param (install, upgrade...) before do
> any actions. There is more than one way to do it. First I choose to
> start in this way. Now I thinking about how to make the install,
> upgrade script. I can make modules or classes.I will test the two
> solutions before make choice.
> 
> ---
> 
>  rimelse/reb/begin_reb.rb |   39
> +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39
> insertions(+), 0 deletions(-) create mode 100755
> rimelse/reb/begin_reb.rb
> 
> diff --git a/rimelse/reb/begin_reb.rb b/rimelse/reb/begin_reb.rb
> new file mode 100755
> index 0000000..728b8df
> --- /dev/null
> +++ b/rimelse/reb/begin_reb.rb
> @@ -0,0 +1,39 @@
> +#!/usr/bin/ruby1.8
> +
> +#This program get the first param
> +#to start another program.
> +#
> +#Auhor : Else-team (Sysde)
> +#
> +
> +#get the first param
> +master_opt = ARGV[0]
> +
> +#flag to know the option started
> +exec_flag = 'none'
> +
> +case master_opt
> +when 'install'
> +     #begin to intall
> +     puts 'reb install'
> +     exec_flag='install'
> +when 'delete'
> +     #begin to delete
> +     puts 'reb delete'
> +     exec_flag='delete'
> +when 'upgrade'
> +     #begin ti upgrade
> +     puts 'reb upgrade'
> +     exec_flag='upgrade'
> +when 'downgrade'
> +     #begin to downgrade
> +     puts 'reb downgrade'
> +     exec_flag='downgrade'
> +end
> +  
> +#test if the first param is correct
> +if exec_flag == 'none'
> +     puts "option invalide taper --help pour voir la liste des
> options" +else
> +     puts exec_flag+" sussecced"
> +end
> 
> Reports bugs or strange things to [EMAIL PROTECTED]
> 
> --
> [email protected]
> Unsubscribe: [EMAIL PROTECTED]
> Archives: http://lists.else-projects.org/archives/commits
> Jabber-MUC: [EMAIL PROTECTED]
> 
> 


Do you have any other way than "Case" ? 

Like func pointer array but in ruby ?


-- 
Philippe Caseiro

--
[email protected]
Unsubscribe: [EMAIL PROTECTED]
Archives: http://lists.else-projects.org/archives/devel
Jabber-MUC: [EMAIL PROTECTED]

Reply via email to