{"id":4315,"date":"2020-10-30T20:42:42","date_gmt":"2020-10-30T19:42:42","guid":{"rendered":"https:\/\/webhosting.de\/ruby\/"},"modified":"2020-10-30T20:42:42","modified_gmt":"2020-10-30T19:42:42","slug":"ruby","status":"publish","type":"post","link":"https:\/\/webhosting.de\/fr\/ruby\/","title":{"rendered":"Ruby"},"content":{"rendered":"<p>Ruby est un langage de programmation orient\u00e9 objet qui est apparu en 1995 et qui est \u00e9quivalent \u00e0 la documentation anglaise en 2000. Selon le \"Duck Typing\" de la programmation, les m\u00e9thodes d'un objet sont au premier plan. Par rapport aux autres langages de programmation, la classe de l'objet joue un r\u00f4le secondaire dans Ruby.<\/p>\n<h3>Les premiers pas de Ruby dans le monde de l'informatique<\/h3>\n<p>Le langage de programmation Ruby est sorti en 1995 et a \u00e9t\u00e9 d\u00e9velopp\u00e9 par Yukihiro Matsumoto, un informaticien de formation, \u00e0 partir de 1993. Ruby est ind\u00e9pendant du syst\u00e8me d'exploitation (ind\u00e9pendant de la plate-forme), mais existait \u00e0 l'origine exclusivement en japonais.<\/p>\n<p>Au Japon, le langage de programmation a \u00e9t\u00e9 tr\u00e8s bien accueilli et s'est impos\u00e9 face \u00e0 de nombreux concurrents. Au fil du temps, des applications telles que JRuby, Rubinius et CRuby (YARV) ont vu le jour, dont CRuby est le plus courant - mais en Europe, son utilisation ne s'est pas r\u00e9pandue au d\u00e9part en raison de la barri\u00e8re linguistique. Ce n'est que cinq ans apr\u00e8s la sortie de Ruby que des utilisateurs int\u00e9ress\u00e9s en dehors du Japon ont commenc\u00e9 \u00e0 se manifester, car la documentation du langage de programmation en anglais a \u00e9t\u00e9 ajout\u00e9e. \u00c0 partir de cette documentation, d'autres instructions et ouvrages de r\u00e9f\u00e9rence pour Ruby ont \u00e9t\u00e9 \u00e9tablis.<\/p>\n<p>Bien que Ruby ait \u00e9t\u00e9 con\u00e7u pour \u00eatre intuitif \u00e0 utiliser, cette litt\u00e9rature suppl\u00e9mentaire \u00e9tait n\u00e9cessaire. Si vous souhaitez en savoir plus sur Ruby, il existe des publications qui peuvent vous aider. En outre, vous pouvez d\u00e9sormais trouver sur Internet de nombreux tutoriels qui expliquent \u00e9tape par \u00e9tape comment utiliser le langage de programmation.<\/p>\n<p>Yukihiro Matsumoto a d\u00e9clar\u00e9, comme motivation pour d\u00e9velopper son propre langage de programmation, qu'il n'\u00e9tait pas satisfait des options qui s'offraient \u00e0 lui \u00e0 l'\u00e9poque. Par cons\u00e9quent, pendant les deux ann\u00e9es de d\u00e9veloppement de Ruby, il a \u00e9t\u00e9 guid\u00e9 principalement par ses propres id\u00e9es et int\u00e9r\u00eats dans le domaine de l'informatique. L'approche de Ruby est largement orient\u00e9e vers l'objet, mais le langage de programmation int\u00e8gre \u00e9galement d'autres possibilit\u00e9s.<\/p>\n<p>Le nom \"Ruby\" est une r\u00e9f\u00e9rence \u00e0 un autre langage de programmation, qui porte \u00e9galement le nom d'un joyau pr\u00e9cieux : Perl. Mais aussi <a href=\"https:\/\/webhosting.de\/fr\/javascript\/\">JavaScript<\/a>Le langage Python et d'autres langages de programmation bien connus ont influenc\u00e9 Yukihiro Matsumoto dans son travail.<\/p>\n<h3><a href=\"https:\/\/webhosting.de\/wp-content\/uploads\/2017\/02\/plesk_icons_ruby.png\"><img decoding=\"async\" class=\"size-full wp-image-2156 aligncenter\" src=\"https:\/\/webhosting.de\/wp-content\/uploads\/2017\/02\/plesk_icons_ruby.png\" alt=\"Plesk Ruby\" width=\"230\" height=\"63\" \/><\/a>Termes<\/h3>\n<p>Le syst\u00e8me de paquets Ruby est appel\u00e9 RubyGems et g\u00e8re les diff\u00e9rents programmes.<\/p>\n<p>Pour travailler avec Ruby, vous aurez besoin d'un environnement de travail appropri\u00e9. L'environnement est fourni par l'interpr\u00e8te en ligne de commande (CLI), qui est adapt\u00e9 \u00e0 un langage de programmation particulier. Avec l'interpr\u00e8te de Ruby, vous obtenez Interactive Ruby, ou irb pour faire court. Le but de l'irb est de vous donner un moyen de tester le programme que vous \u00e9crivez. Vous l'utilisez avec la commande \"irb(main)\".<\/p>\n<p>RDoc est un outil qui sert \u00e0 la documentation des logiciels. L'une de ses principales t\u00e2ches consiste \u00e0 d\u00e9crire le code source du programme. En ce qui concerne le RDoc, il convient \u00e9galement de mentionner l'indice Ruby (ri) : L'outil vous aide \u00e0 <a href=\"https:\/\/webhosting.de\/fr\/datenbank-server\/\">Base de donn\u00e9es<\/a> pour rechercher par quel RDoc cr\u00e9e.<\/p>\n<p>RubyGems (\"gem\") et Ruby Index (\"ri\") sont tous deux accessibles en ligne de commande avec les commandes appropri\u00e9es.<\/p>\n<h3>Syntaxe de Ruby : quelques exemples<\/h3>\n<p>En Ruby, l'utilisation de blocs est possible. Ceux-ci peuvent remplacer les boucles For, par exemple. Vous pouvez \u00e9galement appeler un tel bloc plusieurs fois. Le programme r\u00e9p\u00e9tera ensuite la section ou le bloc autant de fois que vous l'aurez sp\u00e9cifi\u00e9 - par exemple, cinq fois pour l'\u00e9l\u00e9ment \"5.times\". L'op\u00e9ration \u00e0 r\u00e9aliser par le programme est indiqu\u00e9e entre deux bagues.<\/p>\n<p>Comme d'autres langages de programmation, Ruby n\u00e9cessite une d\u00e9claration de proc\u00e9dures. C'est g\u00e9n\u00e9ralement au d\u00e9but du programme. Pour lancer la d\u00e9claration, utilisez la commande famili\u00e8re \"def\" ; pour la compl\u00e9ter, d\u00e9finissez une \"fin\".<\/p>\n<p>Ruby suit le principe de la dactylographie du canard, qui est bas\u00e9 sur un dicton de James Whitcomb Riley : \"Si je vois un oiseau qui marche comme un canard, qui nage comme un canard et qui fait du charlatan comme un canard, j'appelle cet oiseau un canard\". Duck Typing est con\u00e7u pour rendre la programmation plus flexible. En allemand, ce concept est connu sous le nom d'Ententest. La proc\u00e9dure n'est pas limit\u00e9e \u00e0 Ruby, mais peut \u00e9galement \u00eatre consult\u00e9e dans <a href=\"https:\/\/webhosting.de\/fr\/php\/\">PHP<\/a> et l'application Python.<\/p>\n<p>Vous pouvez marquer la fin d'une commande en Ruby avec un point-virgule - ou vous pouvez simplement \u00e9crire un retour \u00e0 la ligne (sans point-virgule).<\/p>","protected":false},"excerpt":{"rendered":"<p>Ruby repr\u00e4sentiert eine objektorientierte Programmiersprache, die 1995 erschien und sei 2000 auch eine englische Dokumentation entspricht. Entsprechend des sogenannten Duck Typings der Programmierung stehen die Methoden eines Objekts im Vordergrund. Im Vergleich zu anderen Programmiersprachen spielt die Klasse des Objekts bei Ruby hingegen eher eine untergeordnete Rolle. Rubys erste Schritte in der Welt der Informatik [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":935,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_crdt_document":"","inline_featured_image":false,"footnotes":""},"categories":[732],"tags":[340],"class_list":["post-4315","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lexikon","tag-ruby"],"acf":[],"_wp_attached_file":null,"_wp_attachment_metadata":null,"litespeed-optimize-size":null,"litespeed-optimize-set":null,"_elementor_source_image_hash":null,"_wp_attachment_image_alt":null,"stockpack_author_name":null,"stockpack_author_url":null,"stockpack_provider":null,"stockpack_image_url":null,"stockpack_license":null,"stockpack_license_url":null,"stockpack_modification":null,"color":null,"original_id":null,"original_url":null,"original_link":null,"unsplash_location":null,"unsplash_sponsor":null,"unsplash_exif":null,"unsplash_attachment_metadata":null,"_elementor_is_screenshot":null,"surfer_file_name":null,"surfer_file_original_url":null,"envato_tk_source_kit":null,"envato_tk_source_index":null,"envato_tk_manifest":null,"envato_tk_folder_name":null,"envato_tk_builder":null,"envato_elements_download_event":null,"_menu_item_type":null,"_menu_item_menu_item_parent":null,"_menu_item_object_id":null,"_menu_item_object":null,"_menu_item_target":null,"_menu_item_classes":null,"_menu_item_xfn":null,"_menu_item_url":null,"_trp_menu_languages":null,"rank_math_primary_category":null,"rank_math_title":null,"inline_featured_image":null,"_yoast_wpseo_primary_category":null,"rank_math_schema_blogposting":null,"rank_math_schema_videoobject":null,"_oembed_049c719bc4a9f89deaead66a7da9fddc":null,"_oembed_time_049c719bc4a9f89deaead66a7da9fddc":null,"_yoast_wpseo_focuskw":"","_yoast_wpseo_linkdex":null,"_oembed_27e3473bf8bec795fbeb3a9d38489348":null,"_oembed_c3b0f6959478faf92a1f343d8f96b19e":null,"_trp_translated_slug_en_us":null,"_wp_desired_post_slug":null,"_yoast_wpseo_title":null,"tldname":null,"tldpreis":null,"tldrubrik":null,"tldpolicylink":null,"tldsize":null,"tldregistrierungsdauer":null,"tldtransfer":null,"tldwhoisprivacy":null,"tldregistrarchange":null,"tldregistrantchange":null,"tldwhoisupdate":null,"tldnameserverupdate":null,"tlddeletesofort":null,"tlddeleteexpire":null,"tldumlaute":null,"tldrestore":null,"tldsubcategory":null,"tldbildname":null,"tldbildurl":null,"tldclean":null,"tldcategory":null,"tldpolicy":null,"tldbesonderheiten":null,"tld_bedeutung":null,"_oembed_d167040d816d8f94c072940c8009f5f8":null,"_oembed_b0a0fa59ef14f8870da2c63f2027d064":null,"_oembed_4792fa4dfb2a8f09ab950a73b7f313ba":null,"_oembed_33ceb1fe54a8ab775d9410abf699878d":null,"_oembed_fd7014d14d919b45ec004937c0db9335":null,"_oembed_21a029d076783ec3e8042698c351bd7e":null,"_oembed_be5ea8a0c7b18e658f08cc571a909452":null,"_oembed_a9ca7a298b19f9b48ec5914e010294d2":null,"_oembed_f8db6b27d08a2bb1f920e7647808899a":null,"_oembed_168ebde5096e77d8a89326519af9e022":null,"_oembed_cdb76f1b345b42743edfe25481b6f98f":null,"_oembed_87b0613611ae54e86e8864265404b0a1":null,"_oembed_27aa0e5cf3f1bb4bc416a4641a5ac273":null,"_oembed_time_27aa0e5cf3f1bb4bc416a4641a5ac273":null,"_tldname":null,"_tldclean":null,"_tldpreis":null,"_tldcategory":null,"_tldsubcategory":null,"_tldpolicy":null,"_tldpolicylink":null,"_tldsize":null,"_tldregistrierungsdauer":null,"_tldtransfer":null,"_tldwhoisprivacy":null,"_tldregistrarchange":null,"_tldregistrantchange":null,"_tldwhoisupdate":null,"_tldnameserverupdate":null,"_tlddeletesofort":null,"_tlddeleteexpire":null,"_tldumlaute":null,"_tldrestore":null,"_tldbildname":null,"_tldbildurl":null,"_tld_bedeutung":null,"_tldbesonderheiten":null,"_oembed_ad96e4112edb9f8ffa35731d4098bc6b":null,"_oembed_8357e2b8a2575c74ed5978f262a10126":null,"_oembed_3d5fea5103dd0d22ec5d6a33eff7f863":null,"_eael_widget_elements":null,"_oembed_0d8a206f09633e3d62b95a15a4dd0487":null,"_oembed_time_0d8a206f09633e3d62b95a15a4dd0487":null,"_aioseo_description":null,"_eb_attr":null,"_eb_data_table":null,"_oembed_819a879e7da16dd629cfd15a97334c8a":null,"_oembed_time_819a879e7da16dd629cfd15a97334c8a":null,"_acf_changed":null,"_wpcode_auto_insert":null,"_edit_last":null,"_edit_lock":null,"_oembed_e7b913c6c84084ed9702cb4feb012ddd":null,"_oembed_bfde9e10f59a17b85fc8917fa7edf782":null,"_oembed_time_bfde9e10f59a17b85fc8917fa7edf782":null,"_oembed_03514b67990db061d7c4672de26dc514":null,"_oembed_time_03514b67990db061d7c4672de26dc514":null,"rank_math_news_sitemap_robots":"index","rank_math_robots":["index"],"_eael_post_view_count":"4454","_trp_automatically_translated_slug_ru_ru":null,"_trp_automatically_translated_slug_et":"rubiin","_trp_automatically_translated_slug_lv":"rubins","_trp_automatically_translated_slug_fr_fr":null,"_trp_automatically_translated_slug_en_us":null,"_wp_old_slug":null,"_trp_automatically_translated_slug_da_dk":null,"_trp_automatically_translated_slug_pl_pl":null,"_trp_automatically_translated_slug_es_es":null,"_trp_automatically_translated_slug_hu_hu":null,"_trp_automatically_translated_slug_fi":"rubiini","_trp_automatically_translated_slug_ja":"%e3%83%ab%e3%83%93%e3%83%bc","_trp_automatically_translated_slug_lt_lt":null,"_elementor_edit_mode":null,"_elementor_template_type":null,"_elementor_version":null,"_elementor_pro_version":null,"_wp_page_template":"default","_elementor_page_settings":null,"_elementor_data":null,"_elementor_css":null,"_elementor_conditions":null,"_happyaddons_elements_cache":null,"_oembed_75446120c39305f0da0ccd147f6de9cb":null,"_oembed_time_75446120c39305f0da0ccd147f6de9cb":null,"_oembed_3efb2c3e76a18143e7207993a2a6939a":null,"_oembed_time_3efb2c3e76a18143e7207993a2a6939a":null,"_oembed_59808117857ddf57e478a31d79f76e4d":null,"_oembed_time_59808117857ddf57e478a31d79f76e4d":null,"_oembed_965c5b49aa8d22ce37dfb3bde0268600":null,"_oembed_time_965c5b49aa8d22ce37dfb3bde0268600":null,"_oembed_81002f7ee3604f645db4ebcfd1912acf":null,"_oembed_time_81002f7ee3604f645db4ebcfd1912acf":null,"_elementor_screenshot":null,"_oembed_7ea3429961cf98fa85da9747683af827":null,"_oembed_time_7ea3429961cf98fa85da9747683af827":null,"_elementor_controls_usage":null,"_elementor_page_assets":[],"_elementor_screenshot_failed":null,"theplus_transient_widgets":["tp-video-player"],"_eael_custom_js":null,"_wp_old_date":null,"_trp_automatically_translated_slug_it_it":null,"_trp_automatically_translated_slug_pt_pt":null,"_trp_automatically_translated_slug_zh_cn":null,"_trp_automatically_translated_slug_nl_nl":null,"_trp_automatically_translated_slug_pt_br":null,"_trp_automatically_translated_slug_sv_se":null,"rank_math_analytic_object_id":"979","rank_math_internal_links_processed":null,"_trp_automatically_translated_slug_ro_ro":null,"_trp_automatically_translated_slug_sk_sk":null,"_trp_automatically_translated_slug_bg_bg":null,"_trp_automatically_translated_slug_sl_si":null,"litespeed_vpi_list":["webhostinglogo.png"],"litespeed_vpi_list_mobile":["webhostinglogo.png"],"rank_math_seo_score":null,"rank_math_contentai_score":null,"ilj_limitincominglinks":null,"ilj_maxincominglinks":null,"ilj_limitoutgoinglinks":null,"ilj_maxoutgoinglinks":null,"ilj_limitlinksperparagraph":null,"ilj_linksperparagraph":null,"ilj_blacklistdefinition":null,"ilj_linkdefinition":["ruby"],"_eb_reusable_block_ids":null,"rank_math_focus_keyword":null,"rank_math_og_content_image":null,"_yoast_wpseo_metadesc":"","_yoast_wpseo_content_score":null,"_yoast_wpseo_focuskeywords":null,"_yoast_wpseo_keywordsynonyms":null,"_yoast_wpseo_estimated-reading-time-minutes":null,"rank_math_description":null,"surfer_last_post_update":null,"surfer_last_post_update_direction":null,"surfer_keywords":null,"surfer_location":null,"surfer_draft_id":null,"surfer_permalink_hash":null,"surfer_scrape_ready":null,"_thumbnail_id":"935","footnotes":null,"_links":{"self":[{"href":"https:\/\/webhosting.de\/fr\/wp-json\/wp\/v2\/posts\/4315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhosting.de\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhosting.de\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhosting.de\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webhosting.de\/fr\/wp-json\/wp\/v2\/comments?post=4315"}],"version-history":[{"count":0,"href":"https:\/\/webhosting.de\/fr\/wp-json\/wp\/v2\/posts\/4315\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhosting.de\/fr\/wp-json\/wp\/v2\/media\/935"}],"wp:attachment":[{"href":"https:\/\/webhosting.de\/fr\/wp-json\/wp\/v2\/media?parent=4315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhosting.de\/fr\/wp-json\/wp\/v2\/categories?post=4315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhosting.de\/fr\/wp-json\/wp\/v2\/tags?post=4315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}