public
Description: FixtureReplacement rails plugin (version 2 and on)
Homepage: http://replacefixtures.rubyforge.org/
Clone URL: git://github.com/smtlaissezfaire/fixturereplacement.git
Search Repo:
adding google analytics tracking

git-svn-id: http://thmadb.com/public_svn/plugins/fixture_replacement@95 
6dbbdfbd-06da-443d-8068-b1bdd22a71ef
smt (author)
Fri Nov 23 15:24:33 -0800 2007
commit  e628b76bef4a13b5fe7ea445d839bb22dfc7e93f
tree    fcf6cc78bc2473b7f445d2732841ec6c8c9949ee
parent  0fe4bd1b6d09c500df77e45e3ff9ec36f5b8b2ec
...
16
17
18
19
 
20
21
22
23
24
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
27
28
...
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
0
@@ -16,13 +16,29 @@
0
 end
0
 
0
 desc 'Generate documentation for the fixture_replacement plugin.'
0
-Rake::RDocTask.new(:rdoc) do |rdoc|
0
+Rake::RDocTask.new(:rdoc_without_analytics) do |rdoc|
0
   rdoc.rdoc_dir = doc_directory
0
   rdoc.title = 'FixtureReplacement'
0
   rdoc.options << '--line-numbers' << '--inline-source'
0
   rdoc.rdoc_files.include('README')
0
   rdoc.rdoc_files.include('lib/**/*.rb')
0
 end
0
+
0
+task :rdoc => [:rdoc_without_analytics] do
0
+ google_analytics = File.read(File.dirname(__FILE__) + "/etc/google_analytics")
0
+ rdoc_index = File.dirname(__FILE__) + "/#{doc_directory}/index.html"
0
+
0
+ contents = File.read(rdoc_index)
0
+ contents.gsub!("</head>", "#{google_analytics}\n</head>")
0
+
0
+ File.open(rdoc_index, "r+") do |file|
0
+ file.write(contents)
0
+ end
0
+
0
+end
0
+
0
+task :rerdoc => [:clobber_rdoc, :rdoc]
0
+task :clobber_rdoc => [:clobber_rdoc_without_analytics]
0
 
0
 desc 'Run the specs'
0
 task :spec do
...
 
 
 
 
 
 
...
1
2
3
4
5
6
0
@@ -1 +1,7 @@
0
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
0
+</script>
0
+<script type="text/javascript">
0
+_uacct = "UA-3080808-2";
0
+urchinTracker();
0
+</script>

Comments

    No one has commented yet.