forked from formtastic/formtastic
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
127 lines (109 loc) · 4.09 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# coding: utf-8
require 'rubygems'
require 'rake'
require 'rake/rdoctask'
begin
gem 'rspec', '>= 1.2.6'
gem 'rspec-rails', '>= 1.2.6'
require 'spec'
require 'spec/rake/spectask'
rescue LoadError
begin
require 'rspec/core/rake_task.rb'
require 'rspec/core/version'
rescue LoadError
puts "[formtastic:] RSpec - or one of it's dependencies - is not available. Install it with: sudo gem install rspec-rails"
end
end
begin
GEM = "formtastic"
AUTHOR = "Justin French"
EMAIL = "[email protected]"
SUMMARY = "A Rails form builder plugin/gem with semantically rich and accessible markup"
HOMEPAGE = "http://github.com/justinfrench/formtastic/tree/master"
INSTALL_MESSAGE = %q{
========================================================================
Thanks for installing Formtastic!
------------------------------------------------------------------------
You can now (optionally) run the generator to copy some stylesheets and
a config initializer into your application:
rails generator formastic:install # Rails 3
./script/generate formtastic # Rails 2
To generate some semantic form markup for your existing models, just run:
rails generate formtastic:form MODEL_NAME # Rails 3
./script/generate form MODEL_NAME # Rails 2
Find out more and get involved:
http://github.com/justinfrench/formtastic
http://groups.google.com.au/group/formtastic
========================================================================
}
gem 'jeweler', '>= 1.0.0'
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = GEM
s.summary = SUMMARY
s.email = EMAIL
s.homepage = HOMEPAGE
s.description = SUMMARY
s.author = AUTHOR
s.post_install_message = INSTALL_MESSAGE
s.require_path = 'lib'
s.files = %w(MIT-LICENSE README.textile Rakefile init.rb) + Dir.glob("{rails,lib,generators,spec}/**/*")
# Runtime dependencies: When installing Formtastic these will be checked if they are installed.
# Will be offered to install these if they are not already installed.
s.add_dependency 'activesupport', '>= 2.3.0'
s.add_dependency 'actionpack', '>= 2.3.0'
s.add_dependency 'i18n', '>= 0.4.0'
# Development dependencies. Not installed by default.
# Install with: sudo gem install formtastic --development
s.add_development_dependency 'rspec-rails', '>= 1.2.6'
s.add_development_dependency 'rspec_tag_matchers', '>= 1.0.0'
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "[formtastic:] Jeweler - or one of its dependencies - is not available. Install it with: sudo gem install jeweler -s http://gemcutter.org"
end
desc 'Default: run unit specs.'
task :default => :spec
desc 'Generate documentation for the formtastic plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Formtastic'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README.textile')
rdoc.rdoc_files.include('lib/**/*.rb')
end
if defined?(Spec)
desc 'Test the formtastic plugin.'
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ["-c"]
end
desc 'Test the formtastic plugin with specdoc formatting and colors'
Spec::Rake::SpecTask.new('specdoc') do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ["--format specdoc", "-c"]
end
desc "Run all examples with RCov"
Spec::Rake::SpecTask.new('examples_with_rcov') do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.rcov = true
t.rcov_opts = ['--exclude', 'spec,Library']
end
end
if defined?(RSpec)
desc 'Test the formtastic plugin.'
RSpec::Core::RakeTask.new('spec') do |t|
t.pattern = FileList['spec/**/*_spec.rb']
end
desc 'Test the formtastic plugin with specdoc formatting and colors'
RSpec::Core::RakeTask.new('specdoc') do |t|
t.pattern = FileList['spec/**/*_spec.rb']
end
desc "Run all examples with RCov"
RSpec::Core::RakeTask.new('examples_with_rcov') do |t|
t.pattern = FileList['spec/**/*_spec.rb']
t.rcov = true
t.rcov_opts = ['--exclude', 'spec,Library']
end
end