flak 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/README.textile +59 -0
  2. data/flak.gemspec +2 -2
  3. data/lib/flak.rb +16 -341
  4. data/lib/flak/rake/base.rb +312 -0
  5. data/lib/flak/{cpp.rb → rake/cpp.rb} +6 -4
  6. data/lib/flak/{delight.rb → rake/delight.rb} +3 -3
  7. data/lib/flak/rake/doc.rb +64 -0
  8. data/lib/flak/{gl.rb → rake/gl.rb} +1 -1
  9. data/lib/flak/{mac.rb → rake/mac.rb} +1 -1
  10. data/lib/flak/{max.rb → rake/max.rb} +1 -1
  11. data/lib/flak/{maya.rb → rake/maya.rb} +7 -7
  12. data/lib/flak/{maya_app.rb → rake/maya_app.rb} +1 -1
  13. data/lib/flak/{maya_plugin.rb → rake/maya_plugin.rb} +1 -1
  14. data/lib/flak/{nuke.rb → rake/nuke.rb} +1 -1
  15. data/lib/flak/{target.rb → rake/target.rb} +9 -19
  16. data/lib/flak/thor/generate.rb +108 -184
  17. data/lib/flak/thor/target_file.rb +62 -0
  18. data/lib/flak/thor/templates/INSTALL.tt +15 -13
  19. data/lib/flak/thor/templates/doc.tt +0 -0
  20. data/lib/flak/thor/templates/doc/Rules +77 -0
  21. data/lib/flak/thor/templates/doc/config.yaml +77 -0
  22. data/lib/flak/thor/templates/doc/content/assets/css/include.scss +14 -0
  23. data/lib/flak/thor/templates/doc/content/assets/css/page.scss +314 -0
  24. data/lib/flak/thor/templates/doc/content/assets/images/.empty_directory +1 -0
  25. data/lib/flak/thor/templates/doc/content/assets/images/screenshot.jpg +0 -0
  26. data/lib/flak/thor/templates/doc/content/assets/movies/.empty_directory +1 -0
  27. data/lib/flak/thor/templates/doc/content/assets/movies/sampleMovie.webm +0 -0
  28. data/lib/flak/thor/templates/doc/content/assets/site_images/array.gif +0 -0
  29. data/lib/flak/thor/templates/doc/content/assets/site_images/connectable.gif +0 -0
  30. data/lib/flak/thor/templates/doc/content/assets/site_images/create.gif +0 -0
  31. data/lib/flak/thor/templates/doc/content/assets/site_images/edit.gif +0 -0
  32. data/lib/flak/thor/templates/doc/content/assets/site_images/hidden.gif +0 -0
  33. data/lib/flak/thor/templates/doc/content/assets/site_images/input.gif +0 -0
  34. data/lib/flak/thor/templates/doc/content/assets/site_images/keyable.gif +0 -0
  35. data/lib/flak/thor/templates/doc/content/assets/site_images/logo.jpg +0 -0
  36. data/lib/flak/thor/templates/doc/content/assets/site_images/maya.png +0 -0
  37. data/lib/flak/thor/templates/doc/content/assets/site_images/miro_logo_bw.png +0 -0
  38. data/lib/flak/thor/templates/doc/content/assets/site_images/multiuse.gif +0 -0
  39. data/lib/flak/thor/templates/doc/content/assets/site_images/nanoc.png +0 -0
  40. data/lib/flak/thor/templates/doc/content/assets/site_images/nuke.png +0 -0
  41. data/lib/flak/thor/templates/doc/content/assets/site_images/output.gif +0 -0
  42. data/lib/flak/thor/templates/doc/content/assets/site_images/prman.png +0 -0
  43. data/lib/flak/thor/templates/doc/content/assets/site_images/python.png +0 -0
  44. data/lib/flak/thor/templates/doc/content/assets/site_images/query.gif +0 -0
  45. data/lib/flak/thor/templates/doc/content/assets/site_images/storable.gif +0 -0
  46. data/lib/flak/thor/templates/doc/content/assets/site_images/vfxoverflow_ribbon.png +0 -0
  47. data/lib/flak/thor/templates/doc/content/assets/site_images/vray.png +0 -0
  48. data/lib/flak/thor/templates/doc/content/index.txt.tt +31 -0
  49. data/lib/flak/thor/templates/doc/content/install_guide.txt.tt +64 -0
  50. data/lib/flak/thor/templates/doc/content/release_notes.txt.tt +44 -0
  51. data/lib/flak/thor/templates/doc/content/scenes/.empty_directory +1 -0
  52. data/lib/flak/thor/templates/doc/content/tutorial.txt.tt +81 -0
  53. data/lib/flak/thor/templates/doc/layouts/default.html +52 -0
  54. data/lib/flak/thor/templates/doc/lib/helpers.rb +147 -0
  55. data/lib/flak/thor/templates/env.tt +29 -1
  56. data/lib/flak/thor/templates/gitignore.tt +3 -0
  57. data/lib/flak/thor/templates/init.mel.tt +22 -0
  58. data/lib/flak/thor/templates/product.mel.tt +15 -10
  59. data/lib/flak/thor/wizard.rb +47 -0
  60. data/lib/flak/version.rb +1 -1
  61. metadata +120 -63
  62. data/lib/flak/doc.rb +0 -259
@@ -1,15 +1,43 @@
1
+
2
+
3
+ # You can have any number of configurations with names you choose.
4
+ # Set the name here and then set up configuration specific blocks in
5
+ # any yaml config files.
1
6
  configuration: "debug"
2
7
 
8
+ # The name of your product of course.
3
9
  product_name: "<%= name %>"
4
10
 
11
+ # The revision number for your product. You can set it to any string
12
+ # but it is recommended to include the name of the product so it can
13
+ # be recognized when it is deployed.
5
14
  product_revision: "<%= name %>-0.0.1"
6
15
 
7
- target_release_prefix: "bin"
16
+ # set to true if you dont want the os name appended to the release directory.
17
+ # For example, if the module contains only cross platform scripts, there is
18
+ # no need to build for every platform. In that case, set agnostic to true.
19
+ agnostic: false
8
20
 
21
+ # Your full name is used for documentation and also to set plugin vendor
22
+ # information. This is done by adding these fields as compiler options
23
+ # which are then picked up in the plugin code. In the case of a maya plugin
24
+ # this happens in the initialize_plugin function.
9
25
  author_name: "<%= ENV['USER'] %>"
10
26
 
27
+ # Your email address is used for documentation.
11
28
  author_email: "<%= ENV['USER'] %>@example.com"
12
29
 
30
+ # Set the root of the release location here. Notice how specific locations
31
+ # are set for different platforms and named configurations.
32
+ # This mechanism can be used to give os-specific and/or
33
+ # configuration-specific values to nearly any setting key. See the compiler
34
+ # options in the cpp.yml file for example.
35
+ # The exceptions are of course those keys themselves - i.e.
36
+ # :configuration and :os, which means you can't set the configuration based
37
+ # on the OS. For a full list of keys,
38
+ # type in a shell at the project root:
39
+ # rake -T | grep inspect
40
+ # and run one of the rake commands for a tool
13
41
  os_darwin:
14
42
  target_release_path: "/Users/<%= ENV['USER'] %>/tools"
15
43
  os_linux_64:
@@ -0,0 +1,3 @@
1
+ build
2
+ .DS_Store
3
+ tmp
@@ -0,0 +1,22 @@
1
+ global proc <%= name %>.init(string $moduleName) {
2
+
3
+ string $moduleMenu = module.menuName( $moduleName );
4
+
5
+ setParent -m $moduleMenu;
6
+
7
+ // make some menu items under the <%= name %> menu
8
+ menuItem -l "Create a menu item" -c "command" ;
9
+ menuItem -l "Create another menu item" -c "command" ;
10
+
11
+ // make some menu items under the menu: <%= name %>->Foo->Bar
12
+ module.subMenu($moduleMenu, "Foo|Bar");
13
+
14
+ menuItem -l "Create a deep menu item" -c "command" ;
15
+ menuItem -l "Create another deep menu item" -c "command" ;
16
+
17
+
18
+ setParent -m $moduleMenu;
19
+
20
+
21
+ }
22
+
@@ -1,13 +1,21 @@
1
- global proc <%= @settings[:product_name] %>() {
1
+ global proc <%= name %>(string $parentUI) {
2
2
 
3
3
 
4
- // To build the <%= @settings[:product_name] %> menu automatically when Maya starts, add the line
5
- // <%= @settings[:product_name] %>;
6
- // to your userSetup.mel (without the // of course)
4
+ // To build the <%= name %> menu automatically
5
+ // when Maya starts, you will need to add the following line to userSetup.mel
6
+ // <%= name %>(<parent>);
7
+ // where <parent> is the name of the UI under which to parent the <%= name %> menu.
8
+ // valid options for <parent> are:
9
+ // The global variable $gMainWindow to place the <%= name %> menu in the main menubar
10
+ // A string such as "RmwTools" to place the <%= name %> menu in a menu called "RmwTools"
11
+ // An empty string "" to ignore menu creation altogether
7
12
 
8
- // This script relies on the jlib mel library for the module creation functions
13
+ // This script relies on the jlib module to initialize <%= name %> as a module
9
14
  source "jlib_module";
10
15
 
16
+
17
+
18
+
11
19
  // global proc module.initialize(
12
20
  // string $initializer,
13
21
  // string $parentUI,
@@ -19,16 +27,13 @@ global proc <%= @settings[:product_name] %>() {
19
27
 
20
28
  // initializer:string The name of the tool/. e.g. solar
21
29
  // parentUI:string The name of the parent menu.
22
- // Use a string such as "RmwTools" to place it in a menu called "RmwTools"
23
- // Use an empty string "" to ignore menu creation
24
- // Use the global variable $gMainWindow to place the menu in the main menubar
25
30
  // firstPlugins:string[] If any plugins should be loaded before others, put them in this array
26
31
  // melSourceExcludes:string[] If any mel scripts should not be sourced, put them in this array
27
32
  // docLocation:string Documentation index URL, can be a relative or absolute path, or a web URL
28
- // If a relative path is used, it will be relative to
33
+ // If a relative path is used, it will be relative to the <%= name %> directory
29
34
  // devMode:int Adds a menu that allows you to reload plugins
30
35
 
31
36
  // global string $gMainWindow;
32
37
 
33
- module.initialize("<%= @settings[:product_name] %>", "<%= File.basename(File.dirname(@settings[:root])).camelize %>",{},{},"<%= self.settings[:product_revision] %>-doc/index.html", 0);
38
+ module.initialize("<%= name %>", $parentUI ,{},{},"<%%= self.settings[:product_revision] %>-doc/index.html", 0);
34
39
  }
@@ -0,0 +1,47 @@
1
+ module Flak
2
+ module Wizard
3
+
4
+
5
+ # include Thor::Shell::Basic
6
+
7
+ def self.project_options
8
+ asker = Thor::Shell::Basic.new
9
+ opts = Hash.new
10
+ asker.say("In order to set up paths, I need to know what will be included in this project")
11
+ opts[:maya_module] = asker.yes?("Will this project contain a Maya module? (y/n)")
12
+ opts[:delight] = asker.yes?("Will this project contain 3delight tools? (y/n)")
13
+ opts[:nuke] = asker.yes?("Will this project contain nuke tools? (y/n)")
14
+ opts
15
+ end
16
+
17
+
18
+
19
+ def self.tool_options
20
+ asker = Thor::Shell::Basic.new
21
+ opts = Hash.new
22
+
23
+ # just determine what the compiled target is, if any:
24
+
25
+ opts[:maya_plugin_target] = false
26
+ opts[:maya_app_target] = false
27
+ opts[:delight_target] = false
28
+ opts[:nuke_target] = false
29
+ opts[:standalone_target] = false
30
+
31
+ finished = false
32
+
33
+ finished = opts[:maya_plugin_target] = asker.yes?("Is this tool a Maya plugin? (y/n)") unless finished
34
+
35
+ finished = opts[:maya_app_target] = asker.yes?("Is this tool a Maya standalone application? (y/n)") unless finished
36
+
37
+ finished = opts[:delight_target] = asker.yes?("Will this tool contain 3delight shaders filters or DSOs? (y/n)") unless finished
38
+
39
+ finished = opts[:nuke_target] = asker.yes?("Will this tool contain Nuke plugins? (y/n)") unless finished
40
+
41
+ finished = opts[:standalone_target] = asker.yes?("Will this tool contain a standalone application? (y/n)") unless finished
42
+
43
+ opts
44
+ end
45
+
46
+ end
47
+ end
data/lib/flak/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Flak
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,87 +1,147 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: flak
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
4
5
  prerelease:
5
- version: 0.0.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Julian Mann
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-02-20 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2012-02-27 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: thor
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70319437889160 !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
24
22
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: awesome_print
28
23
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70319437889160
25
+ - !ruby/object:Gem::Dependency
26
+ name: awesome_print
27
+ requirement: &70319437886500 !ruby/object:Gem::Requirement
30
28
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
35
33
  type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
34
+ prerelease: false
35
+ version_requirements: *70319437886500
36
+ - !ruby/object:Gem::Dependency
38
37
  name: nanoc
38
+ requirement: &70319437886080 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
39
45
  prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
46
+ version_requirements: *70319437886080
47
+ - !ruby/object:Gem::Dependency
48
+ name: RedCloth
49
+ requirement: &70319437885660 !ruby/object:Gem::Requirement
41
50
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
46
55
  type: :runtime
47
- version_requirements: *id003
56
+ prerelease: false
57
+ version_requirements: *70319437885660
58
+ - !ruby/object:Gem::Dependency
59
+ name: sass
60
+ requirement: &70319444337200 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: *70319444337200
48
69
  description: VFX tool build and documentation framework based on rake with thor generators
49
- email:
70
+ email:
50
71
  - julian.mann@gmail.com
51
- executables:
72
+ executables:
52
73
  - flak
53
74
  extensions: []
54
-
55
75
  extra_rdoc_files: []
56
-
57
- files:
76
+ files:
58
77
  - .gitignore
59
78
  - Gemfile
79
+ - README.textile
60
80
  - Rakefile
61
81
  - bin/flak
62
82
  - flak.gemspec
63
83
  - lib/core_ext/string.rb
64
84
  - lib/flak.rb
65
- - lib/flak/cpp.rb
66
- - lib/flak/delight.rb
67
- - lib/flak/doc.rb
68
- - lib/flak/gl.rb
69
- - lib/flak/mac.rb
70
- - lib/flak/max.rb
71
- - lib/flak/maya.rb
72
- - lib/flak/maya_app.rb
73
- - lib/flak/maya_plugin.rb
74
- - lib/flak/nuke.rb
75
- - lib/flak/target.rb
85
+ - lib/flak/rake/base.rb
86
+ - lib/flak/rake/cpp.rb
87
+ - lib/flak/rake/delight.rb
88
+ - lib/flak/rake/doc.rb
89
+ - lib/flak/rake/gl.rb
90
+ - lib/flak/rake/mac.rb
91
+ - lib/flak/rake/max.rb
92
+ - lib/flak/rake/maya.rb
93
+ - lib/flak/rake/maya_app.rb
94
+ - lib/flak/rake/maya_plugin.rb
95
+ - lib/flak/rake/nuke.rb
96
+ - lib/flak/rake/target.rb
76
97
  - lib/flak/thor/cli.rb
77
98
  - lib/flak/thor/generate.rb
78
99
  - lib/flak/thor/junk/junk.rb
100
+ - lib/flak/thor/target_file.rb
79
101
  - lib/flak/thor/templates/INSTALL.tt
80
102
  - lib/flak/thor/templates/Rakefile.tt
81
103
  - lib/flak/thor/templates/cpp.tt
82
104
  - lib/flak/thor/templates/delight.tt
105
+ - lib/flak/thor/templates/doc.tt
106
+ - lib/flak/thor/templates/doc/Rules
107
+ - lib/flak/thor/templates/doc/config.yaml
108
+ - lib/flak/thor/templates/doc/content/assets/css/include.scss
109
+ - lib/flak/thor/templates/doc/content/assets/css/page.scss
110
+ - lib/flak/thor/templates/doc/content/assets/images/.empty_directory
111
+ - lib/flak/thor/templates/doc/content/assets/images/screenshot.jpg
112
+ - lib/flak/thor/templates/doc/content/assets/movies/.empty_directory
113
+ - lib/flak/thor/templates/doc/content/assets/movies/sampleMovie.webm
114
+ - lib/flak/thor/templates/doc/content/assets/site_images/array.gif
115
+ - lib/flak/thor/templates/doc/content/assets/site_images/connectable.gif
116
+ - lib/flak/thor/templates/doc/content/assets/site_images/create.gif
117
+ - lib/flak/thor/templates/doc/content/assets/site_images/edit.gif
118
+ - lib/flak/thor/templates/doc/content/assets/site_images/hidden.gif
119
+ - lib/flak/thor/templates/doc/content/assets/site_images/input.gif
120
+ - lib/flak/thor/templates/doc/content/assets/site_images/keyable.gif
121
+ - lib/flak/thor/templates/doc/content/assets/site_images/logo.jpg
122
+ - lib/flak/thor/templates/doc/content/assets/site_images/maya.png
123
+ - lib/flak/thor/templates/doc/content/assets/site_images/miro_logo_bw.png
124
+ - lib/flak/thor/templates/doc/content/assets/site_images/multiuse.gif
125
+ - lib/flak/thor/templates/doc/content/assets/site_images/nanoc.png
126
+ - lib/flak/thor/templates/doc/content/assets/site_images/nuke.png
127
+ - lib/flak/thor/templates/doc/content/assets/site_images/output.gif
128
+ - lib/flak/thor/templates/doc/content/assets/site_images/prman.png
129
+ - lib/flak/thor/templates/doc/content/assets/site_images/python.png
130
+ - lib/flak/thor/templates/doc/content/assets/site_images/query.gif
131
+ - lib/flak/thor/templates/doc/content/assets/site_images/storable.gif
132
+ - lib/flak/thor/templates/doc/content/assets/site_images/vfxoverflow_ribbon.png
133
+ - lib/flak/thor/templates/doc/content/assets/site_images/vray.png
134
+ - lib/flak/thor/templates/doc/content/index.txt.tt
135
+ - lib/flak/thor/templates/doc/content/install_guide.txt.tt
136
+ - lib/flak/thor/templates/doc/content/release_notes.txt.tt
137
+ - lib/flak/thor/templates/doc/content/scenes/.empty_directory
138
+ - lib/flak/thor/templates/doc/content/tutorial.txt.tt
139
+ - lib/flak/thor/templates/doc/layouts/default.html
140
+ - lib/flak/thor/templates/doc/lib/helpers.rb
83
141
  - lib/flak/thor/templates/env.tt
142
+ - lib/flak/thor/templates/gitignore.tt
84
143
  - lib/flak/thor/templates/gl.tt
144
+ - lib/flak/thor/templates/init.mel.tt
85
145
  - lib/flak/thor/templates/mac.tt
86
146
  - lib/flak/thor/templates/max.tt
87
147
  - lib/flak/thor/templates/maya.tt
@@ -90,33 +150,30 @@ files:
90
150
  - lib/flak/thor/templates/nuke.tt
91
151
  - lib/flak/thor/templates/product.mel.tt
92
152
  - lib/flak/thor/templates/product.sh.tt
153
+ - lib/flak/thor/wizard.rb
93
154
  - lib/flak/version.rb
94
- homepage: ""
155
+ homepage: ''
95
156
  licenses: []
96
-
97
157
  post_install_message:
98
158
  rdoc_options: []
99
-
100
- require_paths:
159
+ require_paths:
101
160
  - lib
102
- required_ruby_version: !ruby/object:Gem::Requirement
161
+ required_ruby_version: !ruby/object:Gem::Requirement
103
162
  none: false
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- version: "0"
108
- required_rubygems_version: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
168
  none: false
110
- requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- version: "0"
169
+ requirements:
170
+ - - ! '>='
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
114
173
  requirements: []
115
-
116
174
  rubyforge_project: flak
117
- rubygems_version: 1.8.15
175
+ rubygems_version: 1.8.10
118
176
  signing_key:
119
177
  specification_version: 3
120
178
  summary: build system for VFX tools
121
179
  test_files: []
122
-
data/lib/flak/doc.rb DELETED
@@ -1,259 +0,0 @@
1
-
2
-
3
- module Flak
4
-
5
- module Doc
6
-
7
- def self.resolve_settings( existing_settings )
8
- f = existing_settings[:root] + '/config/doc.yml'
9
- h =Flak.flatten_settings(f,existing_settings[:configuration], existing_settings[:os] )
10
-
11
- h[:full_site_index_file] = File.join(existing_settings[:root],h[:site_index_file])
12
- # puts "doc_release_root = #{existing_settings[:doc_release_root]}"
13
- # puts "name = #{@settings[:name]}"
14
- # h[:doc_release_path] = File.join( existing_settings[:doc_release_root] , existing_settings[:name])
15
- h
16
- end
17
-
18
- def doc_dir
19
- File.join( @settings[:target_root],"doc")
20
- end
21
- def output_dir()
22
- File.join(doc_dir ,"output")
23
- end
24
-
25
- def content_dir()
26
- File.join(doc_dir ,"content")
27
- end
28
-
29
- #h[:versioned_doc_release_path] = File.join( h[:release_root] , "#{h[:product_revision]}-#{h[:os]}" )
30
-
31
- #def doc_release_path
32
- # File.join( @settings[:doc_release_root] , @settings[:name])
33
- ## File.join(@settings[:release_root], "#{@settings[:product_revision]}-doc")
34
- #end
35
-
36
- def release_dir
37
- File.join( @settings[:doc_release_root] , @settings[:name])
38
- end
39
-
40
- def copy_to_release_dir
41
- r = release_dir
42
- rm_rf r if File.exists? r
43
- Flak.make_dir_for(r)
44
- FileUtils.cp_r output_dir, r if File.exists? output_dir
45
- end
46
-
47
-
48
- # get the header information out of the index file so we can
49
- # build its site index entry
50
- #def index_hash
51
- # h={}
52
- # Dir.chdir(@root) do
53
- # h = YAML::load_file( File.join(self.content_dir,'index.txt') )
54
- # end
55
- # h
56
- #end
57
-
58
-
59
- ######################################################
60
- def site_index_hash
61
- h = {
62
- 'title' => "#{@settings[:product_revision]}",
63
- 'author' => @settings[:author],
64
- 'email' => @settings[:email],
65
- 'created_at' => "#{Date.today.day} #{Date::MONTHNAMES[Date.today.month]} #{Date.today.year}",
66
- 'description' => "#{@settings[:product_revision]} documentation",
67
- 'doc_type' => "Site Index",
68
- 'layout' => "tools_doc",
69
- 'filter' => ['erb', 'textile']
70
- }
71
- end
72
-
73
-
74
-
75
- def write_site_index_header(f)
76
- YAML.dump(site_index_hash, f)
77
- f.puts '---'
78
- f.puts "h3. Projects\n\n"
79
- f.puts "table(d1)."
80
- f.puts "|_(projname). Project Name |_(projauth). Author|_(projdate). Created|\n\n"
81
- end
82
-
83
-
84
-
85
- def write_header_to_site_index(f,hash)
86
- unless hash.nil?
87
- if hash.has_key?('description') && (!hash['description'].nil?)
88
-
89
- doc_link = File.join(hash['title'],'index.html')
90
- f.puts 'table(d1).'
91
- f.puts "|(projname). \"#{hash['title']}\":#{doc_link} |(projauth). \"#{hash['author']}\":mailto:#{hash['email']} |(projdate). #{hash['created_at']}|"
92
- f.puts '|\3(projdesc). '+ hash['description'] +'|'
93
- f.puts "\n\n"
94
- else
95
- "WARNING: Problem with description for #{hash['title']}. Please check header in #{f}"
96
- end
97
- end
98
- end
99
-
100
-
101
- # List of documentation objects
102
- ##############################################
103
- def doc_objects
104
- arr = Array.new
105
- FileList.new('**/target.yml').each do |path|
106
- path = File.join(@settings[:root],path)
107
- h = YAML::load_file(path)
108
- if h.has_key?('templates')
109
- if (h['templates']).kind_of?(Array)
110
- if h['templates'].include?('doc')
111
- index_file = File.join(File.dirname(path) , 'doc/content/index.txt')
112
- if File.exists?(index_file)
113
- arr << YAML::load_file(index_file )
114
- end
115
- end
116
- end
117
- end
118
- end
119
- arr.sort! {|x,y| x['title'] <=> y['title'] }
120
- end
121
- ##############################################
122
-
123
- def write_site_index
124
- File.open(@settings[:full_site_index_file] , 'w') do |f|
125
- self.write_site_index_header(f)
126
- doc_objects.each do |hash|
127
- write_header_to_site_index(f,hash)
128
- end
129
- end
130
- end
131
-
132
- # if a command exists to do the conversion - make a file task for each of icon and out_icon
133
- # that is - one for the hypershade and one for the outliner
134
- def doc_instance_tasks
135
-
136
- namespace @settings[:name].to_sym do
137
- namespace :doc do
138
-
139
- desc "build documentation for #{@settings[:name]}"
140
- task :rebuild do
141
-
142
- write_site_index if @settings[:name] == 'jRelease'
143
- puts "doc_dir #{doc_dir}"
144
- Dir.chdir(doc_dir) do |d|
145
- sh "webby rebuild"
146
- end
147
- end
148
-
149
-
150
- desc "release documentation for #{@settings[:name]}"
151
- task :release => "#{@settings[:name].to_sym}:doc:rebuild" do
152
- # release_doc
153
- Dir.chdir(@settings[:target_dir]) do |d|
154
- self.copy_to_release_dir
155
- end
156
-
157
- if (@settings[:name] == "jRelease" )
158
- index = File.join( self.release_dir, 'site_index.html' )
159
- # rel_notes = File.join(@settings[:versioned_os_release_path], 'doc',@settings[:name],'release_notes.html' )
160
- css = File.join(self.release_dir,'css' )
161
- images = File.join(self.release_dir,'images' )
162
- dest = File.join(@settings[:doc_release_root],'' )
163
- mv index , dest
164
- # mv rel_notes , dest
165
- cp_r css , dest
166
- cp_r images , dest
167
- end
168
-
169
- end
170
-
171
- desc "clobber documentation for #{@settings[:name]}"
172
- task :clobber do
173
- Dir.chdir(doc_dir) do |d|
174
- sh "webby clobber"
175
- end
176
- # d = self.release_dir
177
- rm_rf self.release_dir if File.exists? self.release_dir
178
- end
179
-
180
-
181
-
182
-
183
-
184
-
185
- desc "initialize a project for documenation"
186
- task :init do
187
- doc_dir = File.join(@settings[:target_dir],"doc")
188
- flak_doc_dir = File.join(@settings[:root],"flak","doc")
189
- index_erb_file = File.join(flak_doc_dir,"erb","index.txt.erb")
190
- index_destination_file = File.join(content_dir,"index.txt")
191
-
192
-
193
- FileUtils.mkdir_p doc_dir
194
-
195
- Dir.chdir(doc_dir) do
196
- Flak.copy_over File.join(flak_doc_dir,"Sitefile"), File.join(Dir.pwd, "Sitefile")
197
- Flak.copy_over File.join(flak_doc_dir,"lib"), File.join(Dir.pwd, "lib")
198
- Flak.copy_over File.join(flak_doc_dir,"tasks"), File.join(Dir.pwd, "tasks")
199
- FileUtils.mkdir_p ["content","layouts","output","scenes"]
200
- Dir.chdir("content") do
201
- FileUtils.mkdir_p ["css","images","media"]
202
- Dir.chdir("css") do
203
- Flak.copy_over File.join(flak_doc_dir,"content/css/page.css"), File.join(Dir.pwd, "page.css")
204
- end
205
- Dir.chdir("images") do
206
- [ "array.gif" , "connectable.gif" , "create.gif","edit.gif","forkme_right_red_aa0000.png","hidden.gif","input.gif","jToolsSnapon.jpg" ,"keyable.gif","logo.jpg","multiuse.gif","output.gif","query.gif","storable.gif","vfxoverflow_ribbon.png" ].each do |img|
207
- #puts "******************"
208
- #puts File.exists? File.join(flak_doc_dir,"content/images/",img)
209
- # puts Dir.pwd
210
- # puts File.exists? img
211
-
212
- Flak.copy_over File.join(flak_doc_dir,"content/images/",img) , File.join(Dir.pwd, img)
213
- end
214
- end
215
- end
216
- Dir.chdir("layouts") do
217
- Flak.copy_over File.join(flak_doc_dir,"layouts/tools_doc.html"), File.join(Dir.pwd, "tools_doc.html")
218
- end
219
-
220
- # make the index
221
-
222
- write_erb_template(index_erb_file,index_destination_file, {:no_force => true})
223
-
224
- end
225
- end
226
-
227
- # desc "create index.txt with common textile markup examples"
228
- # task :create_skeleton_index => "#{@settings[:name].to_sym}:doc:create_doc_links" do
229
- # write_erb_template(index_erb_file,index_destination_file)
230
- # end
231
- #
232
- # desc "initialize a project for documenation"
233
- # task :init => "#{@settings[:name].to_sym}:doc:create_skeleton_index"
234
-
235
-
236
- end
237
- end
238
-
239
-
240
- task :doc => "#{@settings[:name].to_sym}:doc:release"
241
-
242
- namespace :doc do
243
- task :clobber => "#{@settings[:name].to_sym}:doc:clobber"
244
- end
245
-
246
- end
247
- ################################################################################
248
-
249
-
250
- desc "release all documentation"
251
- task :doc
252
-
253
- desc "clobber all documentation"
254
- namespace :doc do
255
- task :clobber
256
- end
257
- end
258
- end
259
-