Skip to content

Instantly share code, notes, and snippets.

GRABS.merge!({
'W-k' => lambda{ focus_next },
'W-j' => lambda{ focus_previous },
})
module Subtlext
class Subtle
def move_focus(step)
i = current_view.clients.index{|c| c.id == current_client.id} + step
(current_view.clients[i] || current_view.clients.first).focus
> xprop
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified location: 152, 176
program specified size: 720 by 416
program specified minimum size: 4 by 4
program specified minimum aspect ratio: 720/416
program specified maximum aspect ratio: 720/416
program specified base size: 0 by 0
window gravity: Static
WM_ICON_NAME(STRING) = "MPlayer"
> rake
(in /home/kiko/projects/testing/abs/subtle-hg/src/subtle-build)
CC build/shared.wm.o
CC build/array.o
CC build/client.o
CC build/display.o
CC build/event.o
CC build/ewmh.o
CC build/grab.o
CC build/panel.o
require 'ramaze'
class TestController < Ramaze::Controller
provide :html => :haml
def index
%(= render_template('foo', {:bar => {:a => 1, :b => 2}}))
end
def foo
diff --git a/model/page.rb b/model/page.rb
index f31c90c..0609aa0 100644
--- a/model/page.rb
+++ b/model/page.rb
@@ -96,6 +96,7 @@ class Page
File.open(file, 'w+'){|i|
i.puts content.gsub(/\r\n|\r/, "\n")
}
+ G.add(File.join(language, "#{@name}#{EXT}")) unless @revision
message = G.better_commit(comment, :files => [repo_file], :author => author)
index a0bb57b..8fd9de9 100644
--- a/lib/ramaze/controller.rb
+++ b/lib/ramaze/controller.rb
@@ -14,7 +14,7 @@ module Ramaze
def self.inherited(into)
Innate::Node.included(into)
- into.engine(:Nagoro) if LIST.empty?
+ into.provide(:html => :nagoro) if LIST.empty?
LIST << into
--- a/lib/innate/helper/partial.rb
+++ b/lib/innate/helper/partial.rb
@@ -72,15 +72,15 @@ module Innate
ext = File.extname(path)
basename = File.basename(path, ext)
- ext = ext[1..-1]
-
+ ext = ext[1..-1] || action.node.provide[action.wish].to_s
+
require 'innate'
class Main
Innate.node '/'
def index
render_template('hi.erb')
end
end
require 'innate'
class Main
Innate.node '/'
def index
render_template('title')
end
def title
> ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
> cat validate_test.rb
require 'not_naughty'
Person = Struct.new(:name) do
extend NotNaughty
validates(:name) { presence and length :minimum => 4 }
end