RUBY
exempleS en RUBY:
-
Ruby on Rails , proposé sur le site Powerruby.com
Ruby est un langage Il fonctionne un peu sur le principe de php, , interprété, multiplateforme.
Mais ici tout est objet, même les constantes !
Initiez vous au langage ici : http://tryruby.org/levels/1/challenges/0 (sympa pour tester sans installer)
Rails est un Framework, Voyez ces deux didactitiels, particulièrement bien faits :
- http://blog.humancoders.com/comment-debuter-en-ruby-on-rails-153/
- Plus complet : http://french.railstutorial.org/chapters/beginning
Pour le faire tourner sur IBM i, il vous faut :
- Apache (57xxDG1)
- et PASE (57xxSS1 option 33)
- ensuite, Aller chercher la distribution pour IBM i sur http://powerruby.com/
- ensuite, Aller chercher la distribution pour IBM i sur http://powerruby.com/
- Dans tous les cas une bonne connaissance d'Apache
de PASE et de la structure IFS sera un atout.
- Pour créer le serveur, nous avons passé la commande :
===> RAILSNEW VRM(*V200) PLACE(*WWW) RAILSAPP(RUBY) DBUSR(XXXXXXXX) DBPASS(YYYY
YYYY) DBROOT(RUBYDB) HTTPSRV(RUBY) EXTPORT(2222) INTPORT (2202)
Notre serveur Apache a été configuré avec les directives suivantes :
|
- et voici le premier test (suite à installation, comme indiqué ici : https://powerruby.worketc.com/kb?id=11
Le serveur d'application est démarré avec la commande :
RAILSSVR ACTION(*START) APP('/www/RUBY/htdocs/RUBY') VRM(*V200) PORT(2202)
- Création de la première application, comme indiqué ici : https://powerruby.worketc.com/kb?id=22
Nous avons donc fait notre propre version
rails generate model Producteur code:integer nom:string tel:string appellation:string puis la table est créé, enfin : rails g scaffold_controller Producteur code:integer nom:string tel:string appellation:string /PowerRuby/prV2R0M0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime... le code est généré, Il faut pour terminer, ajouter une route dans routes.rb resources :producteurs |
Voyez en plus ici : http://iprodeveloper.com/application-development/discover-power-rails-ibm-i