Tools
Ruby

Gems - Heroku - Rails - Semantic Web - See also - To do
- Ruby in Twenty Minutes
- Conseils pour utiliser Ruby, RVM, Passenger, Rails, Bundler, … en développement by Jérémy Lecour, 2010
- Episode 159: RSpec vs TestUnit, The Ruby Show April 2011
- Behavior Driven Development Using Ruby (Part 1) by Gregory Brown, O'Reilly Media 2007
- Ruby Learning Test #1: Are You There, World? by Mike Clark, Clarkware 2005
- "we used the language as a tool to explore itself. In the same way that a test is better than a specification, the language is better than a description of the language."
- Learning Ruby via Cucumber, Obtiva 2010
- Business Readable DSL by Martin Fowler, 2008
- Cucumber Making BDD fun
- note the quite sarcastic
examples/i18n/fr/scenario - Cucumber-Rails for Rails3
- note the quite sarcastic
- Introduction to Outside-in Development with Cucumber by Charles Maxwood, 2010
- What's in a Story? by Dan North, DanNorth.net 2007
- Metaprogramming - A New Way to Shoot Yourself in the Foot by Brian Muller, SC Ruby Conf 2008
To explore
Gems
- State of the Stack: A Ruby on Rails Benchmarking Report, RailsLab 2010
- Win a Prize by Telling us about Your Top 3 Most Useful Ruby Gems by Satish Talim, RubyLearning 2010
Heroku
Explored
- Getting Started with Heroku
- http://devcenter.heroku.com/articles/read-only-filesystem
- http://devcenter.heroku.com/articles/bundler
- http://devcenter.heroku.com/articles/git
- make sure to make git ignore hg and vice versa
- Programming#Git
- remember that it ignores database.yml
- use
heroku logsto check what went wrong (error 500 is not very expressive) - http://devcenter.heroku.com/articles/taps
- http://devcenter.heroku.com/articles/database#backups
remarks
- make sure to keep on checking for the console and the logs
- locals errors are less "strict" than on the server
- pay attention to specificity of syntax regarding databases, what works locally might not work remotely
Rails
Design
- Dynamic CSS by topfunky, Ruby on Rails for Newbies 2007
- eventually http://guides.rubyonrails.org/layouts_and_rendering.html
- #haml Wikipedia:Haml
- Why use HAML (and SASS)? I already know HTML. me, Patterson 2010
- Blueprint: A CSS Framework | Spend your time innovating, not replicating
- usage of mobile-fu resulting in duplication on several files
Internationalization
- Rails Internationalization (I18n) API, Ruby on Rails Guides
- #138 - I18n, Railscasts 2008
- use
set! intl.accept_languages=fr,en,en-usto quickly switch languages in Vimperator - Chinese zh
- Rails I18n From The Trenches by Clemens Kofler, 2009
- see also #rails-i18n on freenode
- note that the filesystem, the code repository and the push to the other system have to be properly configured and support UTF8
- e.g. problem of Chinese zh.yml on Heroku
- utf-8 file seems to be ignored, falling back to the default locale
- note that this based on the saved file format, not its content
- fixed by saving to UTF-8 encoding without BOM (cf Wikipedia:Byte order mark
)
- e.g. problem of Chinese zh.yml on Heroku
- I18n Backends #256, Railscasts March 2011
A Guide to Testing Rails Applications, Ruby on Rails Guides
- note that I have already previously briefly explored RSpec https://github.com/oggy/rspec_outlines#readme
- see also Cucumber seen in Part 5: AJAX and Testing
-I.to add the current folder to the path- 15 TDD steps to create a Rails application by Andrzej Krzywda, Andrzej on Software 2007
Meet Rails 3, PeepCode
- ri for in-line documentation
- config/developments
- yield passes on the content of the action
- useful to rewrite a layout view for a specific controller rather than the default application one
- recomending to use _path in views and _url in controllers
- active code generation as code generated in memory as the program runs
- e.g. associations (yet working iif foreign_keys are properly set)
- cf http://c2.com/cgi/wiki?ActiveCodeGeneration
- as opposed to passive code generation
- e.g. a scaffold
- cf http://c2.com/cgi/wiki?PassiveCodeGeneration
- correcting a model
rails generate --forceoption to replace files- problematic for migration files
rails generate migration AddThis
- Tablename.where(:column => "Value")
- reload! in rails console to insure that changes are applied
- scope and the proper place to define queries in the model files
- partials
- helpers
- rake db:seed to run
db/seeds.rb- no output, has to be done manually via puts
- that will be rolled-out during production thus practical for initialization
- see
rake -T dbfor more related commands
- defining a rake script in
lib/tasks/app.rake- that must be called manually thus practical for tests as sample data
Ruby on Rails Intensive 1-Day Course
by William Sobel, UC Berkeley RAD Lab 2007
- Part 1: Hello World
- ~min27 table name are singular and with only the first letter capitalized
- not CamelCase
- from learning keywords to learning conventions
- Advice to Rails Beginners: Follow Conventions, Ruby on Rails Help and Discussion Forum by Ryan Bates of RailsCasts
- ~min45 comparing migration to versionning for database schema
- ~min52 1 argument means it is the id (by convention)
- ~min72 on runner to manipulate an application from the command line
- practical for crontab
- ~min27 table name are singular and with only the first letter capitalized
- Part 2: Just Enough Ruby
- ~min2 a programming language is a user interface
- all variable are objects and thus have functions attached to them
- this also applies to classes, useful for metaprogramming
- e.g.
String.instances_of? Classreturns true
- e.g.
object.methodsandClass.methodsdisplay the list of available methods
- this also applies to classes, useful for metaprogramming
- ~min25 every class and method can be overloaded
- ~min28 instances variables are only accessed through their class
- thus required method
- ~min85 detailing the rails stack
- and comparing to the J2EE call stack
- Part 3: Basic Rails
- find_by_attribute_name, find_by_attribute_name_and_other_attribute_name (by convention)
- thus risk of conflict using by_ or and_ in table names
- find_by_attribute_name, find_by_attribute_name_and_other_attribute_name (by convention)
- Part 4: Advanced Active Record
- create = build + save in the DB
- join tables have table name they join ordered by alphabetical order (convention)
- Part 5: AJAX and Testing
- basically using a view through a partial
- with JavaScript encapsulating XHR using form_remote_tag
- with a controller returning just the value to replace value
- based on Prototype
- mention of Scriptaculous in JavaScript used before
- LearningSearch and in Seedea:Site/Search
- LearningSearch and in Seedea:Site/Search
- unit test directly in Ruby
- see also Ajax on Rails - Build Dynamic Web Applications with Ruby by Scott Raymond, O'Reilly Media 2007
- basically using a view through a partial
Discovering OmniSocial by Icelab
- gem install [package name] to fetch and install a library
- bundle install to add it to the path
- gem list --local to display what gems are available locally
- editing GemFile in the application folder
- adding gem '[package name]' to include it
- bundle to fetch all the packages and make it available in the application
- extended the user model
rails generate migration DescOfMyModelModificationvim db\migrate\...DescOfMyModelModification.rbto add or remove fields (withself.up'andself.downto allow rollbacksrake db:migrateto apply it to the development version, test it thencommit,pushandmigrateremotely
Install on Windows
- Ruby installer from http://rubyinstaller.org/downloads/
- without a space in the path, e.g. not
C:\Program Files ruby gems\setup.rbgems install rails- adding sql3lite.dll with the proper version to the
Ruby\bindirectory- hooks for SQLlite comes by default assuming SQLlite library is present
- without a space in the path, e.g. not
- install Git for Windows
- install MinGW
- also with a path without space
- including MSYS with C/C++ and compilation tools
- install DevKit
- make sure Ruby is properly running in MinGW environment
- install gems which do not provide binaries for Windows
- e.g. Cucumber through JSON
- install plugins from github
rails plugin install https://github.com/username/projectname.git(rather thangit@github.com:username/projectname.gitsyntax)- note that this is probably due to restricted Internet access, forcing to use http/https rather than directly Git
Following Getting Started, Ruby on Rails Guides
- creation of the app
rails/bundle/rake
- scaffolding
rails generate scaffold/rails generate view/rails generate controller- M =
.rbActiveRecord and.rbmigration code - C =
.rbcode to process requests - V = HTML templates and partials as
.erbfiles - see also http://stackoverflow.com/questions/60658/rails-model-view-controller-and-helper-what-goes-where
- helpers
- e.g. managing hyperlinks
- routing via
config/routes.rb- check available routes via
rake routes - going further than URLRewrite
- see http://guides.rubyonrails.org/routing.html
- public/ provides the default route "as-is"
- thus useful for static content including stylesheets, libraries and images
- check available routes via
- preparing for an API through routing but also XML rendering
rails consolefor tests- e.g. adding/suppressing items
- see also
rails dbconsolehttp://guides.rubyonrails.org/command_line.html#rails-dbconsole
- partials as a snippet of re-usable code
- part of a template
- see http://guides.rubyonrails.org/layouts_and_rendering.html#using-partials
rails servergives tons of information- classical httpd information (parameters, timestamp, IP, ...)
- query time split by render, view, active record
- DB query used
- link between models
:referencestypebelongs_to/has_many/:dependenthelpers- see http://guides.rubyonrails.org/association_basics.html
- naming convention matters
- item differs from items
Remarks
- objects that are created following a model are not updated as the model is updated
db/schema.rbrepresents the database- yet association are described in
app/models/and are relying on foreign keys- how does
db/schema.rbgets updated knowingrake db:migrateis not run after edition of association in the model file?
- how does
- see Updating the schema section of A Guide to Active Record Associations, Ruby on Rails Guides
- "If you create an association some time after you build the underlying model, you need to remember to create an add_column migration to provide the necessary foreign key."
- yet association are described in
- name should be informative by taking into account their function relative to the other model
- "In any case, Rails will not create foreign key columns for you. You need to explicitly define them as part of your migrations."
- e.g. User can become :author for a blog post
- name must be pluralized, including variable or class names
- e.g. http://guides.rubyonrails.org/association_basics.html with has_many associations
- syntax
- not understood
- ?
- unsure
- => :this pass a hash value
- |f| to define a temporary object available within that scope
- understood
- <% execute the code within this template without displaying the returned value
- <%= execute the code within this template and display the result
- < for class inheritance
- def to define a function
- [...] to define or use an array
- {:minimum => 5} conditional
- @array this.function helper_name
- not understood
- "magic" under the hood makes it powerful yet tricky
- naming convention, when should scaffolding or generate be used, etc
- all efficient helpers *_* with complex name remains unknown
- scope not understood
- what functions is available to which other?
To explore
- http://guides.rubyonrails.org/action_controller_overview.html#filters
- to finish
- Philosophy behind Ruby on Rails by Yehuda Katz, Futurice 2010
- http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
- http://www.vim.org/scripts/script.php?script_id=1567
- http://rubyonrails.org/screencasts
- No Reservations about Keywords in Ruby on Rails by Daniel Butler, 2007
- http://en.wikibooks.org/wiki/Ruby_on_Rails
- http://www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials
- http://www.instiki.org
Semantic Web
- wagn.org RoR semantic wiki
- powering Connectipedia.org
- how are Cards better than PmWiki:IncludeOtherPages and PmWiki:PageListTemplates ?
- development seems active
- but without supporting rails3 and without being able to see if there really is a community ( see http://www.wagn.org/wagn/Wagneer ) behind to can it be sustainable?
- how interoperable is it? it has WQL but does it still provide a SPARQL endpoint?
- activerdf.org library for accessing RDF data from Ruby programs
- RDF.rb Linked Data for Ruby
- RDF.rb, semanticweb.org
- public domain Ruby library for working with RDF data.
- RDF.rb, semanticweb.org
- Getting data from the Semantic Web (Ruby), semanticweb.org
- tutorial is for programmers used to building software on top of non-Semantic-Web data sources: using screen scraping techniques, or using APIs that return XML, JSON, CSV etc.
See also SemanticWeb
See also
- Programming
- apply Cognition#OptimalLearningClosure and refrain from watching a video or reading a chapter of a book without first having used it in code
- my side work at ShanghaiExpat on metaprogramming for a PHP CMS
- french community
- Ruby France site de l’association Ruby France.
- also with #ruby.fr and #rubyonrails.fr on freenode
- Railsfrance.org communauté francophone des utilisateurs de Ruby on Rails
- Ruby France site de l’association Ruby France.
To do
- use code repository to see the list of symbols used over time
- ideally to visualize learning
- should be removed
- personally defined functions related to each app, e.g.
def createand such - code from gems
- personally defined functions related to each app, e.g.
- to move to Programming in general
- yet probably the best dataset I have to far
- find a tool (like an IDE plugin) to underline a piece of code and display explanations about the syntax, prototypes of functions from the doc, similar examples from code repository, etc
- looking up in the doc/stackoverflow/search engines/code repo
- a la http://sourcerer.ics.uci.edu or http://ase.csc.ncsu.edu from Programming
- see also http://ginzametrics.com/how-search-affects-language-design.html
- add an activities session
- link to RailsCampParis3
- BDD
- Behavior Driven Development Using Ruby (Part 3), O'Reilly Media 2007
- ability to respect DRI through RSpec
it_should_behave_like - "It's pretty easy to see which classes were and were not developed using BDD. The neat thing is that RCov does a line-by-line output of your code, highlighting lines that were not run in red"
- ability to respect DRI through RSpec
- many more articles read during WithoutNotesApril11
- Behavior Driven Development Using Ruby (Part 3), O'Reilly Media 2007
- metaprogramming
- Ruby Metaprogramming by Satish Talim, RubyLearning
- Metaprogramming Ruby by Paolo Perrotta, The Pragmatic Bookshelf 2010
- check Wikipedia:Grammatical evolution
tools
- Ruby and Vim
- Vim
- r00k123123's YouTube Channel with several tutorials
- rails.vim by Tim Pope
- Ruby on Rails: easy file navigation, enhanced syntax highlighting, and more
- Sinatra DSL for quickly creating web applications in Ruby with minimal
Note
My notes on Tools gather what I know or want to know. Consequently they are not and will never be complete references. For this, official manuals and online communities provide much better answers.
CONTENT
CONTACT
UPDATES
LAST TWEET
RSS for this page only


