-
Notifications
You must be signed in to change notification settings - Fork 9
/
rubykoans.rb
64 lines (53 loc) · 2.26 KB
/
rubykoans.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
require 'rubygems'
require 'sinatra'
require 'haml'
require 'sass'
not_found do
haml :error
end
get '/' do
@page = 'nix'
@editors = [
{:name => 'Vim', :url => 'http://code.google.com/p/macvim'},
{:name => 'Emacs', :url => 'http://homepage.mac.com/zenitani/emacs-e.html'},
{:name => 'TextMate', :url => 'http://macromates.com'},
{:name => 'RubyMine', :url => 'http://www.jetbrains.com/ruby'},
{:name => 'jEdit', :url => 'http://www.jedit.org'}
]
@blocks = [
{:name => 'introduction', :title => 'вступление'},
{:name => 'structure', :title => 'структура'},
{:name => "installing_ruby_on_#{@page}", :title => 'установка ruby', :id => "installing_ruby"},
{:name => "what_editors_#{@page}", :title => 'редакторы', :id => "what_editors"},
{:name => "the_path_#{@page}", :title => 'путь к просвещению', :id => "the_path"},
{:name => 'authors', :title => 'авторы'},
{:name => 'cc', :title => 'лицензия'},
{:name => 'inspiration', :title => 'вдохновение'},
{:name => 'other_resources', :title => 'дополнительные ресурсы'}
]
haml :index
end
get '/windows' do
@page = 'windows'
@editors = [
{:name => 'E Text Editor', :url => 'http://www.e-texteditor.com'},
{:name => 'RubyMine', :url => 'http://www.jetbrains.com/ruby'},
{:name => 'jEdit', :url => 'http://www.jedit.org'},
]
@blocks = [
{:name => 'introduction', :title => 'вступление'},
{:name => 'structure', :title => 'структура'},
{:name => "installing_ruby_on_#{@page}", :title => 'установка ruby', :id => "installing_ruby"},
{:name => "what_editors_#{@page}", :title => 'редакторы', :id => "what_editors"},
{:name => "the_path_#{@page}", :title => 'путь к просвещению', :id => "the_path"},
{:name => 'authors', :title => 'авторы'},
{:name => 'cc', :title => 'лицензия'},
{:name => 'inspiration', :title => 'вдохновение'},
{:name => 'other_resources', :title => 'дополнительные ресурсы'}
]
haml :windows
end
get '/stylesheets/screen.css' do
scss 'stylesheets/screen'.to_sym
end
#i18 = R18n::I18n.new