<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>No One Is Perfect &#187; ruby</title>
	<atom:link href="http://watchitlater.com/blog/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://watchitlater.com/blog</link>
	<description>A reluctant foray into the world of blogging.</description>
	<lastBuildDate>Tue, 08 Nov 2011 12:32:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Kramdown and Webby</title>
		<link>http://watchitlater.com/blog/2011/08/kramdown-and-webby/</link>
		<comments>http://watchitlater.com/blog/2011/08/kramdown-and-webby/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 12:23:19 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[My Code]]></category>
		<category><![CDATA[kramdown]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[static]]></category>
		<category><![CDATA[webby]]></category>

		<guid isPermaLink="false">http://watchitlater.com/blog/?p=335</guid>
		<description><![CDATA[A number of the sites that I manage for fun are simply static web pages. The dynamic nature is handled by javascript classes and plugins. This means that I really don&#8217;t need or want an application server to serve these sites, but I do want to still use some of the practices that I apply [...]]]></description>
			<content:encoded><![CDATA[<p>A number of the sites that I manage for fun are simply static web pages. The dynamic nature is handled by javascript classes and plugins. This means that I really don&#8217;t need or want an application server to serve these sites, but I do want to still use some of the practices that I apply to web application development. Enter <a href="http://webby.rubyforge.org/">webby</a> &#8211; it works by combining the contents of a page with a layout to produce HTML. Awesomely simple and powerful. It can use the rdiscount gem to process files in markdown format into html pages, but I prefer to use the <a href="http://kramdown.rubyforge.org/">kramdown</a> library. No problem, here is how you can add kramdown support to your webby project.</p>
<pre name="code" class="ruby:nogutter">
if try_require('kramdown', 'kramdown')
  Webby::Filters.register :kramdown do |input|
    Kramdown::Document.new(input, :parse_block_html => true).to_html
  end
else
  Webby::Filters.register :kramdown do |input|
    raise Webby::Error, "'kramdown' must be installed to use the kramdown filter"
  end
end
</pre>
<p>Simply paste the above into a file called <code>kramdown.rb</code> in your project&#8217;s lib directory and then you can specify <code>filter: kramdown</code> in your webby templates.</p>
]]></content:encoded>
			<wfw:commentRss>http://watchitlater.com/blog/2011/08/kramdown-and-webby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RubyGems in a JAR</title>
		<link>http://watchitlater.com/blog/2011/08/rubygems-in-a-jar/</link>
		<comments>http://watchitlater.com/blog/2011/08/rubygems-in-a-jar/#comments</comments>
		<pubDate>Sat, 20 Aug 2011 12:39:10 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[fpm]]></category>
		<category><![CDATA[jar]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[rake]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubygems]]></category>
		<category><![CDATA[sass]]></category>
		<category><![CDATA[scp]]></category>

		<guid isPermaLink="false">http://watchitlater.com/blog/?p=291</guid>
		<description><![CDATA[On a few projects now I&#8217;ve used jruby with rake. I know that I can use rvm and just fetch the gems per project, but for developers stuck on windows that way is a little more than difficult. So here&#8217;s how I package up rubygems in a JAR. #!/bin/bash mkdir gemjar java -jar jruby-complete-1.6.3.jar -S [...]]]></description>
			<content:encoded><![CDATA[<p>On a few projects now I&#8217;ve used jruby with rake. I know that I can use rvm and just fetch the gems per project, but for developers stuck on windows that way is a little more than difficult. So here&#8217;s how I package up rubygems in a JAR.</p>
<pre name="code" class="ruby:nogutter">#!/bin/bash
mkdir gemjar
java -jar jruby-complete-1.6.3.jar -S gem install -i ./gemjar haml --version 3.1.2 --no-rdoc --no-ri
java -jar jruby-complete-1.6.3.jar -S gem install -i ./gemjar net-scp --version 1.0.4 --no-rdoc --no-ri
java -jar jruby-complete-1.6.3.jar -S gem install -i ./gemjar jruby-openssl --version 0.7.4 --no-rdoc --no-ri
java -jar jruby-complete-1.6.3.jar -S gem install -i ./gemjar fpm --version 0.3.7 --no-rdoc --no-ri
jar cf ruby-gems.jar -C gemjar .
rm -rf gemjar
</pre>
<p>You then invoke jruby rake via:</p>
<pre name="code" class="ruby:nogutter">#!/bin/bash
java -jar jruby-complete-1.6.3.jar -rruby-gems.jar -S rake build.rb $@
</pre>
<p>This means that you can then invoke the following useful little nuggets:</p>
<pre name="code" class="ruby:nogutter">task :list_gems do
  require "rubygems/gem_runner"
  Gem::GemRunner.new.run ["list"]
end

task :sass_watch do
  require 'haml'
  require 'haml/exec'
  opts = Haml::Exec::Sass.new ['--watch', 'src/main/sass:src/main/webapp/static/css']
  opts.parse!
end

task :ssh_copy, :file do |t, args|
  require "net/ssh"
  require "net/scp"
  Net::SSH.start("repository.remote", "user") do |ssh|
    ssh.scp.upload!(args.file, "/tmp/files/")
  end
end

task :make_rpm =&gt; :make_war do
  fail "Please install rpm-build to make RPMs!" unless system("rpmbuild --version")

  require "fpm"
  require "fpm/program"
  exit_code = FPM::Program.new.run([
    "-s", "dir", "-t", "rpm", "-n", APPLICATION_NAME, "-v", RPM_VERSION_NUMBER, "-a", "all",
    "--post-install", "target/rpmbuild/opt/application/bin/post_install.sh",
    "--pre-uninstall", "target/rpmbuild/opt/application/bin/pre_uninstall.sh",
    "-C", "target/rpmbuild", "opt"
  ])

  fail "Build failed" if exit_code != 0
end
</pre>
<p>How awesome is this?</p>
]]></content:encoded>
			<wfw:commentRss>http://watchitlater.com/blog/2011/08/rubygems-in-a-jar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JRuby Rake and Ivy</title>
		<link>http://watchitlater.com/blog/2011/08/jruby-rake-and-ivy/</link>
		<comments>http://watchitlater.com/blog/2011/08/jruby-rake-and-ivy/#comments</comments>
		<pubDate>Sat, 20 Aug 2011 12:05:44 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[ivy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[rake]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://watchitlater.com/blog/?p=284</guid>
		<description><![CDATA[Here&#8217;s a neat way of using ivy with jruby, rake &#38; ant. task :ivy_retrieve do ant.taskdef :resource =&#62; "org/apache/ivy/ant/antlib.xml" do classpath :location =&#62; "ivy/ivy-2.2.0.jar" end ant.configure :file =&#62; "ivy/ivysettings.xml" ant.resolve :file =&#62; "ivy/ivy.xml" ant.retrieve :pattern =&#62; "lib/[conf]/[type]/[artifact]-[revision].[ext]", :sync =&#62; "true" puts end Still using ant, still angle bracket free (except for ivy, sigh). Read my [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a neat way of using <a href="http://ant.apache.org/ivy/">ivy</a> with jruby, rake &amp; ant.</p>
<pre name="code" class="ruby:nogutter">task :ivy_retrieve do
  ant.taskdef :resource =&gt; "org/apache/ivy/ant/antlib.xml" do
    classpath :location =&gt; "ivy/ivy-2.2.0.jar"
  end
  ant.configure :file =&gt; "ivy/ivysettings.xml"
  ant.resolve :file =&gt; "ivy/ivy.xml"
  ant.retrieve :pattern =&gt; "lib/[conf]/[type]/[artifact]-[revision].[ext]", :sync =&gt; "true"
  puts
end</pre>
<p>Still using ant, still angle bracket free (except for ivy, sigh). Read my <a href="/blog/2011/03/jruby-rake-vs-ant/" title="JRuby Rake Vs Ant">previous post</a> if you want to know more about jruby, rake and ant.<br />
]]></content:encoded>
			<wfw:commentRss>http://watchitlater.com/blog/2011/08/jruby-rake-and-ivy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

