Quelques liens
Posted by Karine in Rails Discussions, Rails Resources on February 28th, 2010
5 Chapitres du O’Reilly’s Ruby Best Practices à télécharger
Chapter 1 - Driving Code Through Tests
Chapter 2 - Designing Beautiful APIs
Chapter 3 - Mastering the Dynamic Toolkit
Chapter 4 - Text Processing and File Management
Chapter 5 - Functional Programming Techniques
Yehuda Katz : The Building Blocks of Ruby
Un article de fond sur ce que sont vraiment les blocks en Ruby et comment ils fonctionnent vraiment.
Yehuda Katz : Ruby is NOT a Callable Oriented Language (It’s Object Oriented)
Autre article de fond sur blocks, procs et invocation de méthodes.
Un lien (AppEngine-JRuby)
Posted by Karine in Rails Discussions on February 15th, 2010
Développer en Ruby sur Google App Engine : Antoine Sabourin (Octo Technology) partage ses découvertes sur l’AppEngine-JRuby qui utilise pour l’instant non pas Rails mais Sinatra (en attendant la très prochaine version d’AppEngine-JRuby + Rails3).
21 Ruby Tricks You Should Be Using In Your Own Code
Posted by Karine in Rails Resources on January 21st, 2010
Dans ce long article de Peter Cooper vous retrouverez quelques basiques qui ont l’avantage d’être à peu près tous regroupés ici et qu’il est toujours bon de revoir
1 - Extract regular expression matches quickly
2 - Shortcut for Array#join
3 - Format decimal amounts quickly
4 - Interpolate text quickly
5 - Delete trees of files
6 - Exploding enumerables
7 - Cut down on local variable definitions
8 - Using non-strings or symbols as hash keys
9 - Use ‘and’ and ‘or’ to group operations for single liners
10 - Do something only if the code is being implicitly run, not required
11 - Quick mass assignments
12 - Use ranges instead of complex comparisons for numbers
13 - Use enumerations to cut down repetitive code
14 - The Ternary Operator
15 - Nested Ternary Operators
16 - Fight redundancy with Ruby’s “logic” features
17 - See the whole of an exception’s backtrace
18 - Allow both single items AND arrays to be enumerated against
19 - Rescue blocks don’t need to be tied to a ‘begin’
20 - Block comments
21 - Rescue to the rescue
N’oubliez pas de lire les commentaires qui sont au moins aussi intéressants que le post lui-même (et qui donnent d’autres exemples) !
The unofficial Ruby usage guide
Posted by Karine in Rails Resources on December 6th, 2009
Ian Macdonald publie un document intitulé “The unofficial Ruby usage guide”. Un survol de Ruby en une page web mais qui ne met hélas pas en avant toute la puissance du langage.
“… this document was originally written for internal use in the Operations department at Google. [...] this document will suggest some guidelines for writing Ruby code in such a way that a common stylistic vocabulary may emerge, thereby increasing the ease with which source code may be read and shared.”
Ruby on Rails 2.3.5 Released
Posted by Karine in Rails Resources on December 1st, 2009
Plein de bugfixes dans cette nouvelle version et un fix important de sécurité sur la fonction strip_tags, mais aussi :
- Improved compatibility with Ruby 1.9
- RailsXss plugin availability
- Fixes for the Nokogiri backend for XmlMini
Commentaires récents