PageRenderTime 56ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/nuclearsandwich.rb

https://bitbucket.org/nuclearsandwich/nuclearsandwich.com
Ruby | 163 lines | 149 code | 10 blank | 4 comment | 4 complexity | f9155997860f34293dc23bb9c4713925 MD5 | raw file
  1. Camping.goes :Nuclearsandwich
  2. module Nuclearsandwich::Controllers
  3. class Index < R '/'
  4. def get
  5. render :home
  6. end
  7. end
  8. class About
  9. def get
  10. @name = "Steven!"
  11. @employer = "NOWBOX" # soon to be For the betterment of all humankind
  12. render :about
  13. end
  14. end
  15. class CSSBootstrap < R '/css/bootstrap.min.css'
  16. def get
  17. headers['Content-Type'] = 'text/css'
  18. @css = File.read 'assets/css/bootstrap.min.css'
  19. end
  20. end
  21. end
  22. module Nuclearsandwich::Helpers
  23. def navigation active_page = nil
  24. div(id: 'navigation', class: 'container') do
  25. ul(class: 'tabs') do
  26. { "Home" => "/", "About" => "/about",
  27. "Blog" => "http://blog.nuclearsandwich.com",
  28. "GitHub"=> "https://github.com/nuclearsandwich",
  29. "BitBucket" => "http://code.nuclearsandwich.com" }.each do |title, uri|
  30. if title == active_page
  31. li(class: 'active') { a(href: uri) { title } }
  32. else
  33. li { a(href: uri) { title } }
  34. end
  35. end
  36. end
  37. end
  38. end
  39. end
  40. module Nuclearsandwich::Views
  41. def layout
  42. html do
  43. head do
  44. title { "Nuclearsandwich!" }
  45. link(rel: 'stylesheet', type: 'text/css', href: '/css/bootstrap.min.css')
  46. end
  47. div(class: 'container span10 offset3') { body { self << yield } }
  48. div(id: 'footer', class: 'container span10 offset3') do
  49. hr
  50. p do
  51. <<EOF
  52. This website was made by Steven! Ragnarok as an experiment with
  53. #{a(href: 'http://camping.rubyforge.org') { "Camping" }} and
  54. #{a(href: 'http://twitter.github.com/bootstrap') { "Bootstrap" }}.
  55. EOF
  56. end
  57. p do
  58. <<EOF
  59. The source code for this page is
  60. #{a(href: 'https://github.com/nuclearsandwich/nuclearsandwich.com'){ "public" }}
  61. however what little content there is here is Copyright #{Time.now.year}.
  62. EOF
  63. end
  64. end
  65. end
  66. end
  67. def home
  68. navigation 'Home'
  69. h1 { "Welcome!" }
  70. p do
  71. <<EOF
  72. You've stumbled upon the front page of Steven! Ragnarok.
  73. From here you can find out more #{a(href: '/about') { "about" }} me or check out
  74. some of my public projects on
  75. #{a(href: 'https://github.com/nuclearsandwich') { "GitHub" }} or
  76. #{a(href: 'https://bitbucket.org/nuclearsandwich') { "BitBucket" }}.
  77. I also write about technical and sundry topics on my
  78. #{a(href: 'http://blog.nuclearsandwich.com') { "blog" }}.
  79. EOF
  80. end
  81. end
  82. def about
  83. navigation 'About'
  84. div(class: 'span10') do
  85. p do
  86. <<EOF
  87. #{@name} is a slightly mad (1) student of computer science and mathematics
  88. currently attending San Jose State University and this is the only sentence in
  89. this bio written in the third person. I like to write software and for the last
  90. two-and-a-bit years have fancied myself a developer. I write chiefly in Ruby
  91. but am interested in a #{a(href: '#langs-by-interest'){ "great" }}
  92. #{a(href: "#langs-by-proficiency") { "many" }} programming languages.
  93. EOF
  94. end
  95. p do
  96. <<EOF
  97. At the moment I work for #{@employer} but I'm always on the lookout for cool and
  98. exciting things. For the time being I can only work part time or by contract
  99. since the one time I tried to maintain a full time position was disasterous for
  100. my studies. I'm most likely to be great for you if you have custodial work such
  101. as upgrading from an older version of Ruby or Rails, porting an MRI app to JRuby
  102. or Rubinius, or getting tests on some legacy code. I point these things out
  103. because they're fine tasks to assign someone who has a wild school schedule. I'm
  104. not above or beneath building your core application, but it's hard to be a
  105. dependable backbone developer when I may need to take a week off to really nail
  106. an asignment and I don't want to put you or I in the position of hurting
  107. schoolwork since it makes me ever so bitter.
  108. EOF
  109. end
  110. end
  111. p(id: 'footnotes') do
  112. <<EOF
  113. (1) Come now, I spell my name with an exclamation mark and study
  114. mathematics, were you truly expecting normal?
  115. EOF
  116. end
  117. h2(id: 'langs-by-interest') do
  118. "Programming Languages in which I am interested"
  119. end
  120. ul do
  121. li { a(href: "http://ruby-lang.org") { "Ruby" } }
  122. li { a(href: "http://fancy-lang.org") { "Fancy" } }
  123. li { a(href: "http://iolanguage.com") { "Io" } }
  124. li { a(href: "http://haskell.org") { "Haskell" } }
  125. li { a(href: "http://clojure.org") { "Clojure" } }
  126. li { a(href: "http://c.learncodetheharday.org") { "C" } }
  127. li { a(href: "http://redline.st") { "Redline Smalltalk" } }
  128. li { a(href: "http://mirah.org") { "Mirah" } }
  129. li { a(href: "http://coffeescript.org") { "CoffeeScript" } }
  130. li { a(href: "http://www.gnu.org/software/mit-scheme/") { "Scheme" } }
  131. li { a(href: "http://ruby-lang.org") { "Ruby" } }
  132. li { a(href: "https://developer.mozilla.org/en/HTML/HTML5") { "HTML5" } }
  133. li { a(href: "https://developer.mozilla.org/en/CSS") { "CSS" } }
  134. end
  135. h2(id: 'langs-by-proficiency') do
  136. "Programming Languages in which I am proficient"
  137. end
  138. ul do
  139. li { a(href: "http://github.com/nuclearsandwich/ruby_koans") { "Ruby" } }
  140. li { a(href: "http://github.com/nuclearsandwich/mancala") { "Java" } }
  141. li { a(href: "http://github.com/nuclearsandwich/clojure-koans") { "Clojure" } }
  142. li { a(href: "http://github.com/nuclearsandwich/lcthw_exercises") { "C" } }
  143. end
  144. end
  145. end