forked from timcharper/calendar_date_select
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
38 lines (35 loc) · 1.45 KB
/
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
32
33
34
35
36
37
38
# -*- ruby -*-
begin
require 'rubygems'
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "ginkel-calendar_date_select"
gemspec.version = File.read("VERSION").strip
gemspec.summary = "Calendar date picker for rails"
gemspec.description = "Calendar date picker for rails; fork that allows disabling any date entry"
gemspec.email = "thilo@ginkel.com"
gemspec.homepage = "http://github.com/ginkel/calendar_date_select"
gemspec.authors = ["Thilo-Alexander Ginkel", "Shih-gian Lee", "Enrique Garcia Cota (kikito)", "Tim Charper", "Lars E. Hoeg"]
gemspec.rubyforge_project = "ginkel-calendar_date_select"
end
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install jeweler"
end
desc "Set the current gem version in the code according to the VERSION file"
task :set_version do
VERSION=File.read("VERSION").strip
["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 = '#{VERSION}'\n"
when /^\/\/ CalendarDateSelect version / then "// CalendarDateSelect version #{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