Skip to content
Newer
Older
100644 121 lines (97 sloc) 3.05 KB
115af8b @snusnu [all] Use jeweler for rake stuff
snusnu authored Oct 31, 2009
1 require File.expand_path("../merb-core/lib/merb-core/version.rb", __FILE__)
576a681 @ngollan Basic specs for plugin loading
ngollan authored May 11, 2011
2 require File.expand_path("../merb/lib/merb/stack_info.rb", __FILE__)
2838667 @hassox Updates the versions to a new file
hassox authored Oct 13, 2008
3
eb2ddf2 @ivey setup merb-more Rakefile getting ready for 0.9 release
ivey authored Feb 9, 2008
4 require 'fileutils'
5
115af8b @snusnu [all] Use jeweler for rake stuff
snusnu authored Oct 31, 2009
6 ROOT = File.dirname(__FILE__)
7
7b79ea3 @ngollan Fix YARD docs with newer versions of Ruby 1.9
ngollan authored Nov 27, 2010
8 # Global options for YARD.
9 #
10 # Only specify options that are useful for rubydoc.info. Those options
11 # get written to the .yardopts file by the "yardopts" task.
8aa128f @ngollan rubydoc.info integration
ngollan authored Nov 9, 2010
12 yard_options = [
13 ['--output-dir', 'doc/yard' ],
14 ['--tag', 'overridable:Overridable'],
15 ['--markup', 'markdown' ],
4340289 @ngollan Small documentation update
ngollan authored Mar 9, 2011
16 ['--markup-provider', 'kramdown' ],
8aa128f @ngollan rubydoc.info integration
ngollan authored Nov 9, 2010
17 ['--exclude', '/generators/' ],
7b79ea3 @ngollan Fix YARD docs with newer versions of Ruby 1.9
ngollan authored Nov 27, 2010
18 ]
19
20 # Local options for YARD.
21 #
22 # Those options are only applied on the local "doc" and "yard" tasks.
23 yard_local_options = [
24 ['-e', File.join(ROOT, 'yard', 'merbext.rb') ],
25 ['-p', File.join(ROOT, 'yard', 'templates') ],
26 ['--no-yardopts']
8aa128f @ngollan rubydoc.info integration
ngollan authored Nov 9, 2010
27 ]
28
576a681 @ngollan Basic specs for plugin loading
ngollan authored May 11, 2011
29 merb_stack_gems = Merb::STACK_GEMS
c80ef96 don't require 'merb' in the main rakefile
Ezra Zygmuntowicz authored Feb 2, 2008
30
0cb4f96 @ngollan [ALL] Update gemspec to new docs, root rake build task.
ngollan authored Nov 9, 2010
31 def gem_command(command, *args)
32 sh "#{RUBY} -S gem #{command} #{args.join(' ')}"
78af4d0 @ivey merb-more Rakefile now builds merb and merb-more meta gems
ivey authored Feb 9, 2008
33 end
ab75de9 @wycats Leftover files
wycats authored Jan 18, 2008
34
115af8b @snusnu [all] Use jeweler for rake stuff
snusnu authored Oct 31, 2009
35 def rake_command(command)
36 sh "#{RUBY} -S rake #{command}"
78af4d0 @ivey merb-more Rakefile now builds merb and merb-more meta gems
ivey authored Feb 9, 2008
37 end
b7e96fc fix up merb-gen to make a good new merb-core 0.9 app
Ezra Zygmuntowicz authored Jan 31, 2008
38
18a6ed5 @fabien More Rakefile work
fabien authored Sep 26, 2008
39
115af8b @snusnu [all] Use jeweler for rake stuff
snusnu authored Oct 31, 2009
40 desc "Install all merb stack gems"
f07ef79 @wycats 1.0 almost ready
wycats authored Nov 8, 2008
41 task :install do
115af8b @snusnu [all] Use jeweler for rake stuff
snusnu authored Oct 31, 2009
42 merb_stack_gems.each do |gem_info|
576a681 @ngollan Basic specs for plugin loading
ngollan authored May 11, 2011
43 Dir.chdir(File.join(ROOT, gem_info[:path])) { rake_command "install" }
f07ef79 @wycats 1.0 almost ready
wycats authored Nov 8, 2008
44 end
45 end
2a68323 @fabien Rakefile now properly supports install/uninstall (core|more|all)
fabien authored Oct 13, 2008
46
115af8b @snusnu [all] Use jeweler for rake stuff
snusnu authored Oct 31, 2009
47 desc "Uninstall all merb stack gems"
aca0d97 @snusnu Fixed rake uninstall to uninstall everything that got rake install'ed
snusnu authored Oct 2, 2009
48 task :uninstall do
115af8b @snusnu [all] Use jeweler for rake stuff
snusnu authored Oct 31, 2009
49 merb_stack_gems.each do |gem_info|
50 gem_command "uninstall #{gem_info[:name]} --version=#{Merb::VERSION}"
78af4d0 @ivey merb-more Rakefile now builds merb and merb-more meta gems
ivey authored Feb 9, 2008
51 end
ab75de9 @wycats Leftover files
wycats authored Jan 18, 2008
52 end
53
115af8b @snusnu [all] Use jeweler for rake stuff
snusnu authored Oct 31, 2009
54 desc "Build all merb stack gems"
55 task :build do
56 merb_stack_gems.each do |gem_info|
576a681 @ngollan Basic specs for plugin loading
ngollan authored May 11, 2011
57 Dir.chdir(File.join(ROOT, gem_info[:path])) { gem_command "build", "#{gem_info[:name]}.gemspec" }
3079592 @michaelklishin Add release tasks to merb-more sub gems as well as some related fixes…
michaelklishin authored Jul 24, 2008
58 end
59 end
60
115af8b @snusnu [all] Use jeweler for rake stuff
snusnu authored Oct 31, 2009
61 desc "Run specs for all merb stack gems"
e428cdb @michaelklishin Make everything in -more respond to rake spec. Test all the f...ng time!
michaelklishin authored Sep 18, 2008
62 task :spec do
115af8b @snusnu [all] Use jeweler for rake stuff
snusnu authored Oct 31, 2009
63 # Omit the merb metagem, no specs there
64 merb_stack_gems[0..-2].each do |gem_info|
576a681 @ngollan Basic specs for plugin loading
ngollan authored May 11, 2011
65 Dir.chdir(File.join(ROOT, gem_info[:path])) { rake_command "spec" }
e428cdb @michaelklishin Make everything in -more respond to rake spec. Test all the f...ng time!
michaelklishin authored Sep 17, 2008
66 end
67 end
68
7b79ea3 @ngollan Fix YARD docs with newer versions of Ruby 1.9
ngollan authored Nov 27, 2010
69 # Helper to create a parameter list for YARD.
70 #
71 # Returns an array of paths with files relevant to documentation. Since YARD
72 # uses a dash ("-") parameter to separate code files from auxiliary files,
73 # order is important.
74 def docfile_gen(gemlist)
75 paths = gemlist.select {|g| g[:doc] == :yard}
8aa128f @ngollan rubydoc.info integration
ngollan authored Nov 9, 2010
76
77 # add source files to documentation generation
7b79ea3 @ngollan Fix YARD docs with newer versions of Ruby 1.9
ngollan authored Nov 27, 2010
78 doc_files = paths.collect {|g| File.join(g[:name], 'lib', '**', '*.rb')}
8aa128f @ngollan rubydoc.info integration
ngollan authored Nov 9, 2010
79
80 # add auxiliary documentation files (in gems "docs" directory)
81 doc_files << '-'
7b79ea3 @ngollan Fix YARD docs with newer versions of Ruby 1.9
ngollan authored Nov 27, 2010
82
83 paths.each do |g|
8aa128f @ngollan rubydoc.info integration
ngollan authored Nov 9, 2010
84 docs_path = File.join(g[:name], 'docs')
7b79ea3 @ngollan Fix YARD docs with newer versions of Ruby 1.9
ngollan authored Nov 27, 2010
85
86 if File.directory?(docs_path)
87 doc_files << File.join(docs_path, '*.mkd')
469074f @ngollan Merb stack: "root documentation"
ngollan authored Nov 4, 2010
88 end
7b79ea3 @ngollan Fix YARD docs with newer versions of Ruby 1.9
ngollan authored Nov 27, 2010
89 end
469074f @ngollan Merb stack: "root documentation"
ngollan authored Nov 4, 2010
90
7b79ea3 @ngollan Fix YARD docs with newer versions of Ruby 1.9
ngollan authored Nov 27, 2010
91 doc_files
92 end
c246e97 @ngollan Merb stack: YARD formatting
ngollan authored Nov 5, 2010
93
d3d7962 @ngollan Fix typo in root Rakefile
ngollan authored Apr 14, 2011
94 desc "Write .yardopts file for YARD"
7b79ea3 @ngollan Fix YARD docs with newer versions of Ruby 1.9
ngollan authored Nov 27, 2010
95 task :yardopts do
8aa128f @ngollan rubydoc.info integration
ngollan authored Nov 9, 2010
96 File.open(File.join(ROOT, '.yardopts'), 'w') do |yardfile|
97 yard_options.each do |yo|
98 case yo
99 when Array then yardfile.puts yo.join(' ')
100 else yardfile.puts yo
101 end
c246e97 @ngollan Merb stack: YARD formatting
ngollan authored Nov 5, 2010
102 end
8aa128f @ngollan rubydoc.info integration
ngollan authored Nov 9, 2010
103
7b79ea3 @ngollan Fix YARD docs with newer versions of Ruby 1.9
ngollan authored Nov 27, 2010
104 yardfile.puts docfile_gen(merb_stack_gems).join($/)
8aa128f @ngollan rubydoc.info integration
ngollan authored Nov 9, 2010
105 end
106 end
107
108 task :doc => [:yard]
109 begin
110 require 'yard'
111
112 YARD::Rake::YardocTask.new do |t|
7b79ea3 @ngollan Fix YARD docs with newer versions of Ruby 1.9
ngollan authored Nov 27, 2010
113 t.files = docfile_gen(merb_stack_gems)
114 t.options = (yard_options + yard_local_options).flatten
469074f @ngollan Merb stack: "root documentation"
ngollan authored Nov 4, 2010
115 end
116 rescue LoadError
117 # just skip the Rake task if YARD is not installed
118 end
119
e428cdb @michaelklishin Make everything in -more respond to rake spec. Test all the f...ng time!
michaelklishin authored Sep 17, 2008
120 task :default => 'spec'
Something went wrong with that request. Please try again.