public
Description: Rails plugin that posts bugs to a FogBugz installation via BugzScout.
Clone URL: git://github.com/kch/railz_scout.git
Search Repo:
make installer work with older rails versions
kch (author)
Wed Apr 16 16:27:39 -0700 2008
commit  d56db6a5928a882a3a71f53668929b44611fd1de
tree    485c14b7caff49b599feea83a29f884687eea580
parent  74c005552043395b229ad19a224324790603518e
...
1
 
2
3
 
 
 
 
4
5
6
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
...
 
1
2
 
3
4
5
6
7
8
 
 
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
0
@@ -1,8 +1,24 @@
0
-this_path = File.dirname(__FILE__)
0
+require 'pathname'
0
 
0
-require this_path + '/../../../config/boot'
0
+def path(s); Pathname.new(s).cleanpath.to_s end
0
+
0
+this_path = path File.dirname(__FILE__)
0
+require path(this_path + '/../../../config/boot')
0
 require 'fileutils'
0
 
0
-initializer_template_path = this_path + "/install/initializer.rb"
0
-initializer_destination = RAILS_ROOT + "/config/initializers/railz_scout.rb"
0
+config_path = path("#{RAILS_ROOT}/config")
0
+environment_path = path("#{config_path}/environment.rb")
0
+initializers_path = path("#{config_path}/initializers")
0
+initializer_template_path = path(this_path + "/install/initializer.rb")
0
+initializer_destination = path("#{initializers_path}/railz_scout.rb")
0
+
0
+unless File.exists? initializers_path
0
+ FileUtils.mkdir_p initializers_path
0
+ required = initializer_destination.sub(/\.rb$/, '')
0
+ open(environment_path, 'a') do |f|
0
+ f.write "\n\n# == Added by RailzScout:\n"
0
+ f.write "require '#{required}'\n"
0
+ end if IO.read(environment_path).grep(/#{required}/).empty?
0
+end
0
+
0
 FileUtils.cp initializer_template_path, initializer_destination

Comments

    No one has commented yet.