Permalink
Browse files

formatting changes, added a post

  • Loading branch information...
1 parent 50f8997 commit b3ac61e0629c52171196157e4952dabdc542ae52 @joelmccracken committed Apr 26, 2012
View
@@ -1,3 +1,4 @@
pygments: true
markdown: maruku
+lessc: /Users/joelmccracken/.rvm/gems/ruby-1.9.3-p125/bin/lessc
View
@@ -14,12 +14,7 @@
<body>
<div class="site">
-
{{ content }}
-
- <div class="footer">
- 2011 Copyright Joel McCracken
- </div>
</div>
View
@@ -7,16 +7,3 @@
<div class="post">
{{ content }}
</div>
-
-<div class="fatfoot">
- <div class="footer_text">
- <h1>Hi, I'm Joel</h1>
- <p>This is a chronicle of my journey to become a modern
- gentleman.</p>
- <p>
- I
- am <a href="http://www.twitter.com/JoelMcCracken">@JoelMcCracken</a>
- on twitter.
- </p>
- </div>
-</div>
View
@@ -1,52 +1,56 @@
-# module Jekyll
+module Jekyll
-# class LessCssFile < StaticFile
-# def write(dest)
-# # do nothing
-# end
-# end
-# # Expects a lessc: key in your _config.yml file with the path to a local less.js/bin/lessc
-# # Less.js will require node.js to be installed
-# class LessJsGenerator < Generator
-# safe true
-# priority :low
+# Expects a lessc: key in your _config.yml file with the path to a local less.js/bin/lessc
+# Less.js will require node.js to be installed
+ class LessJsGenerator < Generator
+ safe true
+ priority :low
-# def generate(site)
-# src_root = site.config['source']
-# dest_root = site.config['destination']
-# less_ext = /\.less$/i
+ def generate(site)
+ src_root = site.config['source']
+ dest_root = site.config['destination']
+ less_ext = /\.less$/i
-# raise "Missing 'lessc' path in site configuration" if !site.config['lessc']
+ raise "Missing 'lessc' path in site configuration" if !site.config['lessc']
-# # static_files have already been filtered against excludes, etc.
-# site.static_files.each do |sf|
-# next if not sf.path =~ less_ext
+ # static_files have already been filtered against excludes, etc.
+ site.static_files.each do |sf|
+ next if not sf.path =~ less_ext
-# less_path = sf.path
-# css_path = less_path.gsub(less_ext, '.css').gsub(src_root, dest_root)
-# css_dir = File.dirname(css_path)
-# css_dir_relative = css_dir.gsub(dest_root, '')
-# css_name = File.basename(css_path)
+ less_path = sf.path
+ css_path = less_path.gsub(less_ext, '.css')#.gsub(src_root, dest_root)
+ css_dir = File.dirname(css_path)
+ css_dir_relative = css_dir.gsub(dest_root, '')
+ css_name = File.basename(css_path)
-# FileUtils.mkdir_p(css_dir)
+ FileUtils.mkdir_p(css_dir)
+
+ if needs_gen?(less_path, css_path)
+ begin
+ command = [site.config['lessc'],
+ less_path,
+ '>',
+ css_path
+ ].join(' ')
+
+ puts 'Compiling LESS: ' + command
+
+ `#{command}`
+
+ raise "LESS compilation error" if $?.to_i != 0
+ end
+ end
-# begin
-# command = [site.config['lessc'],
-# less_path,
-# css_path
-# ].join(' ')
-
-# puts 'Compiling LESS: ' + command
-
-# `#{command}`
-
-# raise "LESS compilation error" if $?.to_i != 0
-# end
-# # Add this output file so it won't be cleaned
-# site.static_files << LessCssFile.new(site, site.source, css_dir_relative, css_name)
-# end
-# end
-# end
-# end
+ # Add this output file so it won't be cleaned
+ #site.static_files << StaticFile.new(site, site.source, css_dir_relative, css_name)
+ end
+ end
+
+ def needs_gen? src, dest
+ return true unless File.exists?(dest)
+ File.stat(src).mtime.to_i > File.stat(dest).mtime.to_i
+ end
+ end
+end
@@ -4,12 +4,6 @@
module Jekyll
require 'slim'
- class SlimFile < StaticFile
-# def write(file)
-# puts "HERE"
-# end
- end
-
class SlimGenerator < Generator
safe true
priority :low
@@ -33,9 +27,6 @@ def generate(site)
if needs_gen?(slim_path, html_path)
out = Slim::Template.new(slim_path).render;
f = File.write(html_path, out)
-
- # Add this output file so it won't be cleaned
-# site.static_files << SlimFile.new(site, site.source, html_dir_relative, html_name)
end
end
end
@@ -0,0 +1,38 @@
+---
+layout: post
+title: An Update
+---
+
+Wow. It has been a little over a year. Time for an update. The last
+year has been pretty crazy, and I have learned quite a bit. I have not
+been living under a rock, but as far as the rest of the world is
+concerned, I may as well have been. Most of my
+personal time has been focused around figuring out the nature of
+programming, test driven development, and language. So, time for some
+reflection.
+
+All code can act as documentation, as long as you know how to read
+it. A program's most authoratative and correct documentation is its
+code. This doesn't help much when a language is hard to read, but
+using higher level languages can be a big help. Bash scripts make
+this pretty cool because the script contents are basically the same
+thing that you would be writing to accomplish the task.
+
+Writing support code for your application is great. This includes
+things like deployment and build scripts, development scripts,
+and environment setup files. Scripts like this provide
+documentation for your application, besides
+
+Tests are a type of support code. They are
+beneficial in that it allows us to test the state of our
+application during development, and thus avoid bugs an enable
+refactoring.
+I learned test driven development in the context of
+functional and unit tests, but I have since learned that the
+discussion of testing than these types.
+Testing the state and behavior of external services,
+for example, would be very wrong in TDD. Should we ignore writing
+code to test these though?
+
+There is more to come, but I really needed to get this out there. I'm
+writing a blog, not a book.
View
@@ -0,0 +1 @@
+*{background-color:#ffffff;}
View
@@ -1,4 +1,7 @@
----
-key: val
----
+@lol: #fff;
+
+*{
+ background-color: @lol;
+}
+

0 comments on commit b3ac61e

Please sign in to comment.