public
Description: A Rails Plugin to allow for drop-in ticket creation from a Rails application to the Lighthouse issue tracking system
Homepage: http://www.iterativedesigns.com/QuickTicket
Clone URL: git://github.com/voodootikigod/quickticket.git
Click here to lend your support to: quickticket and make a donation at www.pledgie.com !
quickticket / install.rb
100644 51 lines (36 sloc) 1.962 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
45
46
47
48
49
50
51
require 'fileutils'
 
# Install JS file
js_path = '/public/javascripts/quickticket.js'
js_target = File.dirname(__FILE__) + "/../../..#{js_path}"
FileUtils.cp File.dirname(__FILE__) + js_path, js_target unless File.exist?(js_target)
 
# Install CSS file
css_path = '/public/stylesheets/quickticket.css'
css_target = File.dirname(__FILE__) + "/../../..#{css_path}"
FileUtils.cp File.dirname(__FILE__) + css_path, css_target unless File.exist?(css_target)
 
# Install image file
image_path = '/public/images/feedback.png'
image_target = File.dirname(__FILE__) + "/../../..#{image_path}"
FileUtils.cp File.dirname(__FILE__) + image_path, image_target unless File.exist?(image_target)
 
#dump sample values into environment.rb
 
default_values = <<-VALUES
 
###################################################
#
# QuickTicket Configuration
#
 
#replace with your account name (first part of the domain name for Lighthouse)
IterativeDesigns::QuickTicket.account = "iterativedesigns"
 
#replace with your valid Lighthouse Token (from the "My Profile" section in Lighthouse)
IterativeDesigns::QuickTicket.token = "12j3hl4jkh4jk13h2jk4h2jk1"
 
# You can find this through your URL when you click on the project
IterativeDesigns::QuickTicket.project = 1234
 
# The name of your application to make it feel localized, leave blank if you do not care.
IterativeDesigns::QuickTicket.site_name = "QuickTicket"
 
# If set to false, the quickticket.css file (located in RAILS_ROOT/public/stylesheets) will not be dynamically included.
IterativeDesigns::QuickTicket.with_style=true
 
# The environments you want your QuickTicket to show up in, list as many or as few as you want.
IterativeDesigns::QuickTicket.environments = ['production']
 
VALUES
 
File.open(File.dirname(__FILE__) + "/../../../config/environment.rb", File::WRONLY | File::APPEND) do |environment_rb|
  environment_rb << default_values
end
 
puts IO.read(File.join(File.dirname(__FILE__), 'README.markdown'))