NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| #!/bin/sh | |
| # | |
| # Attach or create tmux session named the same as current directory. | |
| session_name="$(basename "$PWD" | tr . -)" | |
| not_in_tmux() { | |
| [ -z "$TMUX" ] | |
| } |
| irb(main):002:0> !!false | |
| => false | |
| irb(main):003:0> !false.nil? | |
| => true | |
| irb(main):004:0> !!true | |
| => true | |
| irb(main):005:0> !true.nil? | |
| => true |
| diff --git a/Gemfile b/Gemfile | |
| index 65641a8..794c14a 100644 | |
| --- a/Gemfile | |
| +++ b/Gemfile | |
| @@ -25,6 +25,7 @@ gem 'sdoc', '~> 0.4.0', group: :doc | |
| # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/sp | |
| gem 'polymer-rails', '~> 0.1.8' | |
| +gem 'haml-rails' | |
| require 'rom' | |
| require 'anima' | |
| class User | |
| include Anima.new(:id, :name, :tasks) | |
| end | |
| class Task | |
| include Anima.new(:title) | |
| end |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| class Kudos < AR | |
| belongs_to :reciver #кто дает | |
| belongs_to :target_user #кому дает | |
| end | |
| class KudosType < Kudos | |
| # тут бует один инклуд, ссылка будет в переписке | |
| def target_user=(user_email) | |
| # найдем или построим пользователя |
| def happy_number2?(num, buffer = []) | |
| return true if num == 1 | |
| num = num.to_s.split(//).inject(0) do |col, item| | |
| item = item.to_i | |
| col +=(item * item) | |
| end | |
| return false if buffer.include?(num) | |
| buffer << num | |
| happy_number? num, buffer | |
| end |
| ruby -run -e httpd . -p 9090 |
Concepts-Techniques-Models-Computer-Programming CMT это известная книжка CMT, за которой слава закрепилась не хуже чем у SICP
это из этой книжки классификация различных парадигм Если присмотришься, то увидишь, что Oz поддерживает большинство вариаций (с этой целью его и конструировали, чтобы можно было наглядно продемонстрировать различные подходы в одном языке)