Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ruby on the Web
Search
Diego Guerra Suárez
March 06, 2015
Programming
72
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby on the Web
Slides from the second day of the ruby@uniovi workshop
Diego Guerra Suárez
March 06, 2015
More Decks by Diego Guerra Suárez
See All by Diego Guerra Suárez
Reruby: Automated refactoring with Ruby
dgsuarez
0
170
Programas que se entienden a sí mismos
dgsuarez
0
92
Curando el bacilo enmiequipus funcionabilis
dgsuarez
1
180
Ruby Basics
dgsuarez
0
81
Other Decks in Programming
See All in Programming
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
110
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
1k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
150
AIとRubyの静的型付け
ukin0k0
0
550
LLM Plugin for Node-REDの利用方法と開発について
404background
0
160
JavaDoc 再入門
nagise
0
300
Swiftのレキシカルスコープ管理
kntkymt
0
220
Inside Stream API
skrb
1
650
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
280
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
260
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.6k
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
770
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
620
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
GraphQLとの向き合い方2022年版
quramy
50
15k
Marketing to machines
jonoalderson
1
5.4k
Design in an AI World
tapps
1
230
Building Adaptive Systems
keathley
44
3k
The Invisible Side of Design
smashingmag
302
52k
Why Our Code Smells
bkeepers
PRO
340
58k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
400
Mobile First: as difficult as doing things right
swwweet
225
10k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Transcript
Ruby on the web Ruby: from 0 to 100 in
14400 seconds (2) ruby@uniovi: Introducing the Ruby programming language School of Computer Sciences University of Oviedo March 2015
Git
git clone REPO_URL # make changes… git status git commit
-am “Commit message” git push
cd /vagrant/projects/jukebox-sinatra git pull #updates repo state git checkout workshop
#switches branch Let’s type!
git config --global user.email "
[email protected]
" git config --global user.name "user
random"
TIP: Use it in your thesis always ;) https://education.github.com
Tests
“Code without tests is bad code. ” - Michael C.
Feathers Working Effectively with Legacy Code
Unit Tests Integration Tests Acceptance Tests Smoke / Mutation /
Stress TDD / BDD
TIP: Use it in your thesis always ;) http://betterspecs.org/
Web Dev
None
None
None
Blocks
some_method do |param| param * 2 end
Sinatra
Time to code! Exercise #0 Hello, world! @ Sinatra https://trello.com/b/ziGtcloe/day-2-user-stories
None
ERB
<ul> <% @artists.each do |artist| %> <li><%= artist.name %></li> <%
end %> </ul>
html = “<ul>” @artists.each do |artist| html << “<li>” html
<< artist.name html << “</li>” end html << “</ul>”
get “/” do erb :”home/show” end
None
None
None
Persistence
None
class Artist include Mongoid::Document field :name, :type => String embeds_many
:songs end
> a = Artist.create(:name => “Billy Strayhorn”) #=> #<Artist …
name: “Billy Strayhorn”>
> Artist.where(:name => “Duke Ellington”).first #=> #<Artist … name: “Duke
Ellington”>
post “/artist” do artist = Artist.create(params) redirect “/artists” end
None
Heroku
None
$ heroku login $ heroku create $ bin/set_mongolab_in_heroku $ git
push heroku workshop:master $ heroku logs -t
& Rails?
To learn more...
None
https://github.com/ruby-uniovi
Happy hacking! :-) Tw: @pablorc @varezhh @dg_suarez @dcarral