Пак ли този Rails?

884 views
821 views

Published on

Презентация от OpenFest 2009

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
884
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Пак ли този Rails?

  1. 1. Пак ли този ? Стефан Кънев OpenFest http://skanev.com/ 07 ноември 2009 @skanev Tuesday, April 27, 2010
  2. 2. Tuesday, April 27, 2010
  3. 3. Tuesday, April 27, 2010
  4. 4. Tuesday, April 27, 2010
  5. 5. Аз ползвам Windows 7 Tuesday, April 27, 2010
  6. 6. Пак ли този ? Стефан Кънев OpenFest http://skanev.com/ 07 ноември 2009 @skanev Tuesday, April 27, 2010
  7. 7. Защо "пак"? Пак ли този ? Стефан Кънев OpenFest http://skanev.com/ 07 ноември 2009 @skanev Tuesday, April 27, 2010
  8. 8. Tuesday, April 27, 2010
  9. 9. 2 причини Tuesday, April 27, 2010
  10. 10. Причина №1 ❤ Tuesday, April 27, 2010
  11. 11. Продуктивност "Фън" Java PHP Python Haskell Rails Lolcats Tuesday, April 27, 2010
  12. 12. PHP Perl • CakePHP • Catalyst • CodeIgniter • "чист" Perl • "чисто" PHP Python Java • Servlet & JSP • Django • Struts (+ Hibernate) • TurboGears • Wicket (+ Spring) • JSF Tuesday, April 27, 2010
  13. 13. Причина №2 ...по-късно Tuesday, April 27, 2010
  14. 14. За какво ще говоря? Tuesday, April 27, 2010
  15. 15. Introduction Tuesday, April 27, 2010
  16. 16. Планът 1. За Rails накратко 2. Няколко интересни неща 3. Обществото около Rails Tuesday, April 27, 2010
  17. 17. Планът 1. За Rails накратко 2. Няколко интересни неща 3. Обществото около Rails Tuesday, April 27, 2010
  18. 18. Ruby on Rails Език за Web framework програмиране Tuesday, April 27, 2010
  19. 19. duck typing ала Perl и Python интерпретира се general purpose динамичен обектно-ориентиран Tuesday, April 27, 2010
  20. 20. Model View Controller Tuesday, April 27, 2010
  21. 21. Rails е... ...като: ...различен от: • CakePHP • Wicket • CodeIgniter • Google Web Tookit • Struts • Java Server Faces • Catalyst • TurboGears Django Tuesday, April 27, 2010
  22. 22. agile Tuesday, April 27, 2010
  23. 23. Планът 1. За Rails накратко 2. Няколко интересни неща 3. Обществото около Rails Tuesday, April 27, 2010
  24. 24. 2. Малки интересни неща • Конзола Tuesday, April 27, 2010
  25. 25. >> a, b = 2, 8 => [2, 8] >> a ** b => 256 >> ["Interactive", "shell"].join(" ") => "Interactive shell" Tuesday, April 27, 2010
  26. 26. >> u = User.find_by_email 'paul@example.org' >> u.password = 'larodi' >> u.password_confirmation = 'larodi' >> u.save Tuesday, April 27, 2010
  27. 27. начин да научите rails Tuesday, April 27, 2010
  28. 28. server debugging Tuesday, April 27, 2010
  29. 29. 2. Малки интересни неща • Конзола • Debugger Tuesday, April 27, 2010
  30. 30. 2. Малки интересни неща • Конзола • Debugger • HAML Tuesday, April 27, 2010
  31. 31. HTML <h1>Cheese</h1> <ul id="cheese"> <li>Red Leicester</li> <li class="selected">Lancashire</li> <li>Danish Blue</li> <li>Gouda</li> </ul> Tuesday, April 27, 2010
  32. 32. HTML <h1>Cheese</h1> <ul id="cheese"> <li>Red Leicester</li> <li class="selected">Lancashire</li> <li>Danish Blue</li> <li>Gouda</li> </ul> HAML %h1 Cheese %ul#cheese %li Red Leicester %li.selected Lancashire %li Danish Blue %li Gouda Tuesday, April 27, 2010
  33. 33. OMG! Супер! Tuesday, April 27, 2010
  34. 34. OMG! Ужас! Tuesday, April 27, 2010
  35. 35. HTML <h1>Cheese</h1> <ul id="cheese"> <li>Red Leicester</li> <li class="selected">Lancashire</li> <li>Danish Blue</li> <li>Gouda</li> </ul> HAML %h1 Cheese %ul#cheese %li Red Leicester %li.selected Lancashire %li Danish Blue %li Gouda Tuesday, April 27, 2010
  36. 36. ERB <h1>Cheese</h1> <% unless @cheese.empty? %> <ul id="cheese"> <% @cheese.each do |name| %> <li><%= name %></li> <% end %> </ul> <% else %> <p>Sorry sir, we don't have any cheese.</p> <% end %> Tuesday, April 27, 2010
  37. 37. ERB <h1>Cheese</h1> <% unless @cheese.empty? %> <ul id="cheese"> <% @cheese.each do |name| %> <li><%= name %></li> <% end %> </ul> <% else %> <p>Sorry sir, we don't have any cheese.</p> <% end %> HAML %h1 Cheese - unless @cheese.empty? %ul#cheese - @cheese.each do |name| %li= name - else %p Sorry sir, we don't have any cheese Tuesday, April 27, 2010
  38. 38. 2. Малки интересни неща • Конзола • Debugger • HAML • SASS Tuesday, April 27, 2010
  39. 39. Прост пример SASS CSS h1 h1 { height: 118px height: 118px; margin-top: 1em margin-top: 1em; } .tagline font-size: 26px .tagline { text-align: right font-size: 26px; text-align: right; } Tuesday, April 27, 2010
  40. 40. Влагане SASS CSS table.hl table.hl { margin: 2em 0 margin: 2em 0; td.ln } text-align: right table.hl td.ln { text-align: right; li } font: family: serif li { weight: bold font-family: serif; size: 1.2em font-weight: bold; font-size: 1.2em; } Tuesday, April 27, 2010
  41. 41. Константи SASS CSS !blue = #3bbfce .content_navigation { !margin = 16px border-color: #3bbfce; color: #2aaebd; .content_navigation } border-color = !blue color = !blue - #111 .border { padding: 8px; .border margin: 8px; padding = !margin / 2 border-color: #3bbfce; margin = !margin / 2 } border-color = !blue Tuesday, April 27, 2010
  42. 42. Mix-ins SASS CSS =rounded-corners(!size) #data { -moz-border-radius = !size -moz-border-radius: 5px; -webkit-border-radius = !size -webkit-border-radius: 5px; border-radius = !size border-radius: 5px; } #data +rounded-corners(5px) Tuesday, April 27, 2010
  43. 43. http://lesscss.org/ Tuesday, April 27, 2010
  44. 44. 2. Малки интересни неща • Конзола • Миграции • Debugger • HAML • SASS Tuesday, April 27, 2010
  45. 45. schema.sql Tuesday, April 27, 2010
  46. 46. Автоматични промени @Entity class User { @Basic String name; @Basic int age; @ManyToOne City city; } Tuesday, April 27, 2010
  47. 47. id title category_name 1 Dune Fiction 2 War & Peace Drama 3 Lord of the Rings Fiction id title category_id id name 1 Dune 1 1 Fiction 2 War & Peace 2 2 Drama 3 Lord of the Rings 1 Tuesday, April 27, 2010
  48. 48. class NormalizeCategories < ActiveRecord::Migration def self.up create_table :categories do |t| t.string :name end add_column :books, :category_id, :integer Book.all.each do |book| category = Category.find_or_create_by_name book.category_name book.category_id = category.id book.save! end drop_column :categories, :category_name end end Tuesday, April 27, 2010
  49. 49. 2. Малки интересни неща • Конзола • Миграции • Debugger • Webrat • HAML • SASS Tuesday, April 27, 2010
  50. 50. Selenium Tuesday, April 27, 2010
  51. 51. 1. труден за поддръжка Tuesday, April 27, 2010
  52. 52. 2. бавен Tuesday, April 27, 2010
  53. 53. Webrat Tuesday, April 27, 2010
  54. 54. fill_in "Сума", :with => '1000' fill_in "Данък", :with => "20%" click_button "Изчисли" response.should include_text("1200 лв") Tuesday, April 27, 2010
  55. 55. 2. Малки интересни неща • Конзола • Миграции • Debugger • Webrat • HAML • Cucumber • SASS Tuesday, April 27, 2010
  56. 56. business domain Tuesday, April 27, 2010
  57. 57. business analyst Tuesday, April 27, 2010
  58. 58. use cases user stories Tuesday, April 27, 2010
  59. 59. Feature: Purchasing things In order for us to make money the user should be allowed to easily purchase our products Scenario: Purchases for more than 2500 should offer 20% Given there are these products: | Name | Price | | MacBook Pro | 2000 | | ThinkPad | 1000 | When I add 1 "MacBook Pro" to my basket And I add 1 "ThinkPad" to my basket Then the final price should be 2600 Tuesday, April 27, 2010
  60. 60. Изпълнимо Feature: Purchasing things In order for us to make money the user should be allowed to easily purchase our products Scenario: Purchases for more than 2500 should offer 20% Given there are these products: | Name | Price | | MacBook Pro | 2000 | | ThinkPad | 1000 | When I add 1 "MacBook Pro" to my basket And I add 1 "ThinkPad" to my basket Then the final price should be 2600 Tuesday, April 27, 2010
  61. 61. Feature: Purchasing things In order for us to make money the user should be allowed to easily purchase our products Scenario: Purchases for more than 2500 should offer 20% Given there are these products: | Name | Price | | MacBook Pro | 2000 | | ThinkPad | 1000 | When I add 1 "MacBook Pro" to my basket And I add 1 "ThinkPad" to my basket Then the final price should be 2600 Given /^there are these products$/ do |table| ... end When /^I add (d+) "(.*?)" to my basket$/ do |count, name| ... end Then /^the final price should be (d+)$/ do |price| ... end Tuesday, April 27, 2010
  62. 62. Tuesday, April 27, 2010
  63. 63. Краставицата ми говори български Функционалност: Купуване на продукти За да печелим пари потребителят трябва да може лесно да пазарува продукти Сценарий: Поръчките за повече от 2000 трябва да имат 20% отстъпка Дадено че има следните три продукта: | Име | Price | | MacBook Air | 2000 | | ThinkPad | 1000 | Когато добавя 1 "MacBook Air" в кошницата си И добавя 2 "ThinkPad" в кошницата си То цената трябва да е 2600 Tuesday, April 27, 2010
  64. 64. Краставицата ми говори lolspeak OH HAI: I CAN BAI STUFF SO WE CAN HAZ MONEYZ N00BZ SHOULD BAI STUFF MISHUN: BAI STUFF CHEAPER I CAN HAS CHEEZEBURGERS: | NAME | MONEYZ | | MacBook Air | 2000 | | ThinkPad | 1000 | WEN I AD 1 "MacBook Air" TO MAI BASKET AN I AD 1 "ThinkPad" TO MAI BASKET DEN I SHOULD PAY 2600 Tuesday, April 27, 2010
  65. 65. 2. Малки интересни неща • Конзола • Миграции • Debugger • Webrat • HAML • Cucumber • SASS • Test-Driven Tuesday, April 27, 2010
  66. 66. unit tests test-driven development Tuesday, April 27, 2010
  67. 67. behavior-driven development Tuesday, April 27, 2010
  68. 68. Test-Driven Development is not about testing. Tuesday, April 27, 2010
  69. 69. Tuesday, April 27, 2010
  70. 70. ruby е гъвкав: stubs & mocks Tuesday, April 27, 2010
  71. 71. Планът 1. За Rails накратко 2. Няколко интересни неща 3. Обществото около Rails Tuesday, April 27, 2010
  72. 72. хората Tuesday, April 27, 2010
  73. 73. jQuery Tuesday, April 27, 2010
  74. 74. Yehuda Katz Tuesday, April 27, 2010
  75. 75. Yehuda Katz jQuery Rails 3 Tuesday, April 27, 2010
  76. 76. JavaScript Tuesday, April 27, 2010
  77. 77. prototype.js Tuesday, April 27, 2010
  78. 78. Rails is about less code. - David Heinemeier Hansson Tuesday, April 27, 2010
  79. 79. Tuesday, April 27, 2010
  80. 80. Tuesday, April 27, 2010
  81. 81. много колоритни хора Tuesday, April 27, 2010
  82. 82. Giles Bowkett Tuesday, April 27, 2010
  83. 83. _why the lucky stiff Tuesday, April 27, 2010
  84. 84. Zed Shaw Tuesday, April 27, 2010
  85. 85. Има и компании Tuesday, April 27, 2010
  86. 86. Tuesday, April 27, 2010
  87. 87. Tuesday, April 27, 2010
  88. 88. блогове Tuesday, April 27, 2010
  89. 89. Tuesday, April 27, 2010
  90. 90. Екосистема Tuesday, April 27, 2010
  91. 91. Най-хубавото нещо: Общността Tuesday, April 27, 2010
  92. 92. Отворен (OS) модел за: код методи принципи Tuesday, April 27, 2010
  93. 93. ? Tuesday, April 27, 2010
  94. 94. http://skanev.com/ @skanev Tuesday, April 27, 2010
  95. 95. The happy programmer 2 Nikolay Bachiyski & Stefan Kanev Sunday, 10:00, OpenFest Tuesday, April 27, 2010

×