nicksieger / jsonpretty

Command-line JSON pretty-printer

This URL has Read+Write access

jsonpretty / Rakefile
100644 29 lines (25 sloc) 0.702 kb
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
# -*- ruby -*-
 
require 'rubygems'
require 'hoe'
require './lib/jsonpretty.rb'
 
h = Hoe.new('jsonpretty', Jsonpretty::VERSION) do |p|
  p.rubyforge_name = 'caldersphere'
  p.developer('Nick Sieger', 'nick@nicksieger.com')
  p.url = 'http://github.com/nicksieger/jsonpretty'
  p.extra_deps << ['json', '> 0'] if ENV["VERSION"]
end
spec = h.spec
spec.dependencies.delete_if { |dep| dep.name == "hoe" }
def spec.to_ruby
  additional_src = %{
if defined?(JRUBY_VERSION)
s.add_dependency('json_pure', '> 0')
else
s.add_dependency('json', '> 0')
end
}
  super.sub(/end\n\Z/m, "#{additional_src}\nend\n")
end
 
task :gemspec do
  File.open("jsonpretty.gemspec", "w") {|f| f << spec.to_ruby }
end