forked from timcharper/calendar_date_select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
31 lines (27 loc) · 1011 Bytes
/
Rakefile
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
# -*- ruby -*-
require 'rubygems'
require 'hoe'
$: << File.dirname(__FILE__) + "/lib/"
require "activesupport"
require './lib/calendar_date_select.rb'
Hoe.new('calendar_date_select', CalendarDateSelect::VERSION) do |p|
p.rubyforge_name = 'cds'
p.developer('Tim Harper', 'tim c harper at gmail dot com')
end
desc "Set the current gem version in the code (VERSION=version)"
task :set_version do
["lib/calendar_date_select/calendar_date_select.rb", "public/javascripts/calendar_date_select/calendar_date_select.js"].each do |file|
abs_file = File.dirname(__FILE__) + "/" + file
src = File.read(abs_file);
src = src.map do |line|
case line
when /^ *VERSION/ then " VERSION = '#{ENV['VERSION']}'\n"
when /^\/\/ CalendarDateSelect version / then "// CalendarDateSelect version #{ENV['VERSION']} - a prototype based date picker\n"
else
line
end
end.join
File.open(abs_file, "wb") { |f| f << src }
end
end
# vim: syntax=Ruby