diff options
| author | Misko Hevery | 2010-10-27 15:31:10 -0700 |
|---|---|---|
| committer | Igor Minar | 2010-11-03 09:47:22 -0700 |
| commit | 659af29adbd041fbbbaf041ead53266210a61f4e (patch) | |
| tree | 32a9ecff4482ae883321e2975fe74057795b21d1 /Rakefile | |
| parent | 1fe7e3a1302e948a31ab80d02ede6975c3bddd58 (diff) | |
| download | angular.js-659af29adbd041fbbbaf041ead53266210a61f4e.tar.bz2 | |
jsdoc parser + generator + viewer + scenario runner
- parse jsdocs from source code
- generate prerendered (markdown + mustache) partials
- generate json
- generate scenario runner for examples in docs
- basic angular doc viewer
Diffstat (limited to 'Rakefile')
| -rw-r--r-- | Rakefile | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -156,8 +156,14 @@ task :compile => [:init, :compile_scenario, :generate_ie_compat] do end +desc 'Generate docs' +task :docs do + `node docs/collect.js` +end + + desc 'Create angular distribution' -task :package => [:clean, :compile] do +task :package => [:clean, :compile, :docs] do v = YAML::load( File.open( 'version.yaml' ) )['version'] match = v.match(/^([^-]*)(-snapshot)?$/) version = match[1] + (match[2] ? ('-' + %x(git rev-parse HEAD)[0..7]) : '') @@ -178,6 +184,20 @@ task :package => [:clean, :compile] do FileUtils.cp(src, pkg_dir + '/' + dest) end + FileUtils.cp_r path_to('docs'), "#{pkg_dir}/docs-#{version}" + + File.open("#{pkg_dir}/docs-#{version}/index.html", File::RDWR) do |f| + text = f.read + f.rewind + f.write text.sub('angular.min.js', "angular-#{version}.min.js") + end + + File.open("#{pkg_dir}/docs-#{version}/docs-scenario.html", File::RDWR) do |f| + text = f.read + f.rewind + f.write text.sub('angular-scenario.js', "angular-scenario-#{version}.js") + end + %x(tar -czf #{path_to(tarball)} -C #{path_to('pkg')} .) puts "Package created: #{path_to(tarball)}" @@ -256,5 +276,5 @@ end # returns path to the file in the build directory # def path_to(filename) - return File.join(BUILD_DIR, filename) + return File.join(BUILD_DIR, *filename) end |
