{"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":"rubinowy","status":"publish","type":"post","link":"https:\/\/webhosting.de\/pl\/ruby\/","title":{"rendered":"Rubinowy"},"content":{"rendered":"<p>Ruby reprezentuje obiektowy j\u0119zyk programowania, kt\u00f3ry pojawi\u0142 si\u0119 w 1995 roku i jest odpowiednikiem angielskiej dokumentacji z 2000 roku. Zgodnie z tzw. typowaniem kaczek w programowaniu, na pierwszym planie znajduj\u0105 si\u0119 metody dzia\u0142ania obiektu. W por\u00f3wnaniu do innych j\u0119zyk\u00f3w programowania, klasa obiektu odgrywa w Rubimie drugorz\u0119dn\u0105 rol\u0119.<\/p>\n<h3>Pierwsze kroki Ruby w \u015bwiecie informatyki<\/h3>\n<p>J\u0119zyk programowania Ruby zosta\u0142 wydany w 1995 roku i zosta\u0142 opracowany przez Yukihiro Matsumoto, informatyka z wykszta\u0142cenia, od 1993 roku. Ruby jest niezale\u017cny od systemu operacyjnego (niezale\u017cny od platformy), ale pierwotnie istnia\u0142 wy\u0142\u0105cznie w j\u0119zyku japo\u0144skim.<\/p>\n<p>W Japonii j\u0119zyk programowania spotka\u0142 si\u0119 z du\u017cym uznaniem i zwyci\u0119\u017cy\u0142 nad wieloma konkurentami. Z czasem pojawi\u0142y si\u0119 implementacje takie jak JRuby, Rubinius i CRuby (YARV), z kt\u00f3rych CRuby jest najbardziej rozpowszechniony - ale w Europie jego u\u017cycie nie rozprzestrzeni\u0142o si\u0119 pocz\u0105tkowo ze wzgl\u0119du na barier\u0119 j\u0119zykow\u0105. Dopiero pi\u0119\u0107 lat po wydaniu Rubiego zainteresowani u\u017cytkownicy spoza Japonii zacz\u0119li si\u0119 pojawia\u0107, poniewa\u017c dodano dokumentacj\u0119 j\u0119zyka programowania w j\u0119zyku angielskim. Na podstawie tej dokumentacji opracowano dalsze instrukcje i prace referencyjne dla Rubiego.<\/p>\n<p>Chocia\u017c Rubin zosta\u0142 zaprojektowany tak, aby by\u0142 intuicyjny w u\u017cyciu, ta dodatkowa literatura by\u0142a konieczna. Je\u015bli chcia\u0142by\u015b dowiedzie\u0107 si\u0119 wi\u0119cej o Ruby, istniej\u0105 publikacje, kt\u00f3re mog\u0105 Ci pom\u00f3c. Ponadto w Internecie mo\u017cna teraz znale\u017a\u0107 liczne tutoriale, kt\u00f3re krok po kroku wyja\u015bniaj\u0105, jak u\u017cywa\u0107 j\u0119zyka programowania.<\/p>\n<p>Yukihiro Matsumoto stwierdzi\u0142 jako swoj\u0105 motywacj\u0119 do rozwijania w\u0142asnego j\u0119zyka programowania, \u017ce nie jest zadowolony z dost\u0119pnych mu w tym czasie opcji. W zwi\u0105zku z tym, w dwuletniej fazie rozwoju Rubiego, kierowa\u0142 si\u0119 przede wszystkim w\u0142asnymi pomys\u0142ami i zainteresowaniami w dziedzinie informatyki. Podej\u015bcie Rubiego jest w du\u017cej mierze zorientowane obiektowo, ale j\u0119zyk programowania posiada r\u00f3wnie\u017c inne mo\u017cliwo\u015bci.<\/p>\n<p>Nazwa \"Ruby\" jest nawi\u0105zaniem do innego j\u0119zyka programowania, kt\u00f3ry r\u00f3wnie\u017c nosi nazw\u0119 cennego klejnotu: Perl. Ale r\u00f3wnie\u017c <a href=\"https:\/\/webhosting.de\/pl\/javascript\/\">JavaScript<\/a>, Python i inne znane j\u0119zyki programowania wp\u0142yn\u0119\u0142y na prac\u0119 Yukihiro Matsumoto.<\/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=\"Rubin Pleski\" width=\"230\" height=\"63\" \/><\/a>Warunki<\/h3>\n<p>System pakiet\u00f3w Ruby nazywa si\u0119 RubyGems i zarz\u0105dza r\u00f3\u017cnymi programami.<\/p>\n<p>Aby m\u00f3c pracowa\u0107 z Ruby, b\u0119dziesz potrzebowa\u0142 odpowiedniego \u015brodowiska pracy. \u015arodowisko jest dostarczane przez t\u0142umacza wiersza polece\u0144 (CLI), kt\u00f3ry jest dostosowany do konkretnego j\u0119zyka programowania. Razem z t\u0142umaczem Rubiego otrzymujesz Rubiego Interaktywnego, lub w skr\u00f3cie irb. Celem irb jest umo\u017cliwienie ci przetestowania programu, kt\u00f3ry piszesz. U\u017cywasz go za pomoc\u0105 polecenia \"irb(main)\".<\/p>\n<p>RDoc jest narz\u0119dziem, kt\u00f3re s\u0142u\u017cy do dokumentacji oprogramowania. Jednym z jego g\u0142\u00f3wnych zada\u0144 jest opisanie kodu \u017ar\u00f3d\u0142owego programu. W zwi\u0105zku z RDoc, nale\u017cy r\u00f3wnie\u017c wspomnie\u0107 o Indeksie Rubinowym (ri): Narz\u0119dzie wspiera ci\u0119 w <a href=\"https:\/\/webhosting.de\/pl\/datenbank-server\/\">Baza danych<\/a> do przeszukiwania, przez kt\u00f3re RDoc tworzy.<\/p>\n<p>Zar\u00f3wno RubyGems (\"gem\") jak i Indeks Ruby (\"ri\") s\u0105 dost\u0119pne z linii polece\u0144 za pomoc\u0105 odpowiednich komend.<\/p>\n<h3>Sk\u0142adnia Rubinu: Kilka przyk\u0142ad\u00f3w<\/h3>\n<p>W Rubinach mo\u017cliwe jest u\u017cycie blok\u00f3w. Mog\u0105 one zast\u0105pi\u0107 na przyk\u0142ad p\u0119tle. Tak\u0105 blokad\u0119 mo\u017cna te\u017c wywo\u0142a\u0107 kilka razy. Nast\u0119pnie program powt\u00f3rzy odcinek lub blokad\u0119 tyle razy, ile poda\u0142e\u015b - na przyk\u0142ad pi\u0119\u0107 razy dla elementu \"5.razy\". Operacja, kt\u00f3ra ma by\u0107 wykonana przez program, jest wskazywana pomi\u0119dzy dwoma aparatami.<\/p>\n<p>Podobnie jak inne j\u0119zyki programowania, Ruby wymaga deklaracji procedur. Zazwyczaj jest to na pocz\u0105tku programu. Aby zainicjowa\u0107 deklaracj\u0119, nale\u017cy u\u017cy\u0107 znanego polecenia \"def\"; aby j\u0105 zako\u0144czy\u0107, nale\u017cy ustawi\u0107 \"koniec\".<\/p>\n<p>Ruby przestrzega zasady pisania na maszynie, kt\u00f3ra opiera si\u0119 na powiedzeniu Jamesa Whitcomba Rileya: \"Je\u015bli widz\u0119 ptaka, kt\u00f3ry chodzi jak kaczka, p\u0142ywa jak kaczka, a kaczki jak kaczka, nazywam go kaczk\u0105\". Typowanie kaczek ma na celu zwi\u0119kszenie elastyczno\u015bci programowania. W j\u0119zyku niemieckim poj\u0119cie to znane jest jako Ententest. Procedura ta nie ogranicza si\u0119 do Rubinu, ale mo\u017cna j\u0105 r\u00f3wnie\u017c znale\u017a\u0107 w <a href=\"https:\/\/webhosting.de\/pl\/php\/\">PHP<\/a> i aplikacja Pythona.<\/p>\n<p>Mo\u017cesz oznaczy\u0107 koniec komendy w Rubimie \u015brednikiem - lub mo\u017cesz po prostu napisa\u0107 przerw\u0119 w linii (bez \u015brednika).<\/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":"4457","_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\/pl\/wp-json\/wp\/v2\/posts\/4315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhosting.de\/pl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhosting.de\/pl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhosting.de\/pl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webhosting.de\/pl\/wp-json\/wp\/v2\/comments?post=4315"}],"version-history":[{"count":0,"href":"https:\/\/webhosting.de\/pl\/wp-json\/wp\/v2\/posts\/4315\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhosting.de\/pl\/wp-json\/wp\/v2\/media\/935"}],"wp:attachment":[{"href":"https:\/\/webhosting.de\/pl\/wp-json\/wp\/v2\/media?parent=4315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhosting.de\/pl\/wp-json\/wp\/v2\/categories?post=4315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhosting.de\/pl\/wp-json\/wp\/v2\/tags?post=4315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}