facets 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/task/rdoc DELETED
@@ -1,163 +0,0 @@
1
- #!/usr/bin/env ratch
2
-
3
- # Generate rdocs.
4
- #
5
- # Geneate documentation. This uses the rdoc config entry,
6
- # but only documents one designated target at a time.
7
-
8
- # NOTE: THIS IS SPECIALLY WRITTEN FOR FACETS!!!
9
-
10
- main :rdoc => [ :rdoc_all ] do
11
- puts "RDoc complete."
12
- end
13
-
14
- task :rdoc_all do
15
- # Load RDoc configuration.
16
- configs = configuration['rdoc']
17
- configs = [configs] unless Array===configs
18
-
19
- configs.each do |config|
20
- if config['groups']
21
- rdoc_groups(config)
22
- else
23
- rdoc_target(config)
24
- end
25
- end
26
- end
27
-
28
- # Docuement groups of targets.
29
-
30
- def rdoc_groups(config)
31
- site = config.delete('output') || config.delete('op') || 'doc/rdoc'
32
- tdir = config['chdir']
33
-
34
- groups = config.delete('groups')
35
- groups = TrueClass===groups ? [] : groups
36
-
37
- # the rest
38
- rest = []
39
- chdir(tdir){rest=glob('**/*').select{|f| File.file?(f)}}
40
- rest = rest - groups.flatten
41
- groups.concat(rest.collect{ |r| [r] })
42
-
43
- title = config['title'].to_s
44
-
45
- # rdoc each group
46
- groups.each do |group|
47
- gf1st = File.basename(group.first)
48
- gname = gf1st.chomp(File.extname(gf1st))
49
- gsite = File.join(site,gname)
50
- gtitle = "#{title} #{gname.capitalize}".strip
51
-
52
- gconfig = config.merge('title' => gtitle, 'op' => gsite, 'files' => group)
53
-
54
- rdoc_target(gconfig)
55
- end
56
- end
57
-
58
- # Document target.
59
-
60
- def rdoc_target(config)
61
- config = {
62
- 'template' => 'html',
63
- 'merge' => true,
64
- 'inline-source' => true,
65
- 'files' => '**/*'
66
- }.merge(config)
67
-
68
- site = config.delete('output') || config.delete('op') || 'doc/rdoc'
69
- tgdir = config.delete('chdir')
70
- files = config.delete('files')
71
-
72
- config['op'] = File.expand_path(site)
73
-
74
- config['main'] = File.expand_path(config['main']) if config['main']
75
-
76
- # Helps to ensure we're in the right place.
77
- #dir!(File.dirname(site))
78
-
79
- # Remove all old rdocs.
80
- rm_r(site) if dir?(site) and safe?(site)
81
-
82
- # Prepare command arguments.
83
- vector = [files, config] #.flatten.compact
84
-
85
- # Create Documentation.
86
- cd(tgdir) do
87
- rdoc(vector.to_console)
88
- end
89
-
90
- insert_ads(site)
91
- end
92
-
93
- # Insert ads.
94
-
95
- def insert_ads(site)
96
- adfile = configuration['ad_file'] || 'meta/site_ad.html'
97
- return unless adfile && File.file?(adfile)
98
- adtext = File.read(adfile)
99
- #puts
100
- dirs = Dir.glob(File.join(site,'*/'))
101
- dirs.each do |dir|
102
- files = Dir.glob(File.join(dir, '**/*.html'))
103
- files.each do |file|
104
- html = file_read(file)
105
- bodi = html.index('<body>')
106
- html[bodi + 7] = "\n" + adtext
107
- #print "Augmenting #{file}..."
108
- file_write(file, html) unless dryrun?
109
- #puts "[done]"
110
- end
111
- end
112
- end
113
-
114
-
115
-
116
-
117
- # Build RDoc's for each target,
118
-
119
- # task :rdoc_targets do
120
- #
121
- # #targets.each do |name, files|
122
- # # targets[name] = files.split(/\s+/) if String===files
123
- # #end
124
- #
125
- #
126
- # # single = ARGV[0]
127
- #
128
- # # # Just do the one requested.
129
- # # if targets.keys.include?(single)
130
- # # targets = { single => targets[single] }
131
- # # single_site = File.join(site, single)
132
- # # # Remove just the one doc directory.
133
- # # rm_r(single_site) if dir?(single_site) and safe?(single_site)
134
- # # else
135
- # # # Remove all old rdocs.
136
- # # rm_r(site) if dir?(site) and safe?(site)
137
- # # end
138
- #
139
- # # Document each target.
140
- # targets.each do |name, options|
141
- # tgdir = options.delete('chdir')
142
- # files = options.delete('files')
143
- #
144
- # #files.collect!{|f| "lib/more/facets/#{f}" }
145
- #
146
- # outdir = File.expand_path(File.join(site, name.gsub(' ','')))
147
- # title = "Facets #{name.capitalize}"
148
- #
149
- # config = config.merge(
150
- # 'op' => outdir,
151
- # 'title' => title
152
- # )
153
- #
154
- # # Prepare command arguments.
155
- # vector = [files, config] #.flatten.compact
156
- #
157
- # # Create Documentation.
158
- # cd(tgdir) do
159
- # rdoc(vector.to_params)
160
- # end
161
- # end
162
- #
163
- # end
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env ratch
2
-
3
- # Tag the current version.
4
-
5
- main :svn_tag do
6
-
7
- roll = glob('meta/*.roll')[0]
8
- pkgn = File.basename(roll).chomp('.roll')
9
- indx = pkgn.rindex('-')
10
- name = pkgn[0...indx]
11
- vers = pkgn[indx+1..-1]
12
-
13
- developername = ENV['RUBYFORGE_USERNAME']
14
-
15
- from = "svn+ssh://#{developername}@rubyforge.org/var/svn/facets/trunk"
16
- twrd = "svn+ssh://#{developername}@rubyforge.org/var/svn/facets/tags/#{vers}"
17
- mesg = "TAG #{vers}"
18
-
19
- svn "copy #{from} #{twrd} -m '#{mesg}'"
20
-
21
- end
22
-