public
Fork of timcharper/calendar_date_select
Description: A popular and flexible JavaScript DatePicker for RubyOnRails (and others)
Homepage: http://code.google.com/p/calendardateselect/
Clone URL: git://github.com/edwinmoss/calendar_date_select.git
100644 32 lines (26 sloc) 0.964 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
30
31
32
# -*- 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 = 'calendar_date_select'
  p.developer('Tim Harper', 'tim c harper at gmail dot com')
end
 
 
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