The following is a guest post by David Manaster and originally appeared on his blog. David is currently a student at The Flatiron School. You can follow her on Twitter here. So Nice uses Sinatra to create a nifty little HTML interface to your desktop music player – iTunes, Spotify, and a few others. So Nice’s UI […]
The following is a guest post by David Manaster and originally appeared on his blog. David is currently a student at The Flatiron School. You can follow her on Twitter here.
So Nice uses Sinatra to create a nifty little HTML interface to your desktop music player – iTunes, Spotify, and a few others.
So Nice’s UI is very simple – it’s a single web page displaying the name of the current song playing, the artist name and the album name. In the background there’s a rotating graphic related to the album, which they pull from Last.fm.
The assignment for this post is to break down the files in the repository to better understand how Sinatra is structured. Here they are:
so-nice/config.ru Does nothing more than require sonice.rb and run Sinatra. Has optional switches to disable controls and voting features.
so-nice/sonice.rb Sets the individual controls that appear on the page and the title, artist and album that are currently playing.
so-nice/Gemfile Tracks the gems currently used by the application. Used by Bundler, along with Gemfile.lock.
so-nice/Gemfile.lock Tracks the versions of the gems thatyou rely on to run your application. Used by Bundler, along with Gemfile.
so-nice/public The directory containing the web site.
so-nice/public/jquery.min.js Something in jQuery that I wish I understood.
so-nice/public/stylesheet.css The CSS stylesheet for all of the HTML on the page.
so-nice/views The directory that holds the code that will generate the HTML for the web site.
so-nice/views/index.haml The sole file that generates the HTML for the app.
Disclaimer: The information in this blog is current as of 25 June 2013. Current policies, offerings, procedures, and programs may differ. For up-to-date information visit FlatironSchool.com.
Posted by Flatiron School / June 25, 2013
Learn to Code Python: Free Lesson for Beginners
From Stuck To Unstoppable: How To Stay Inspired During A Long Job Search
Learning how to stay inspired during a long job search is key to maintaining motivation and ultimately landing an opportunity.