caboose-cms 0.0.4 → 0.0.5
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/lib/caboose/version.rb +1 -1
- data/lib/tasks/caboose_tasks.rake +26 -0
- metadata +1 -1
data/lib/caboose/version.rb
CHANGED
@@ -2,3 +2,29 @@
|
|
2
2
|
# task :caboose do
|
3
3
|
# # Task goes here
|
4
4
|
# end
|
5
|
+
|
6
|
+
def init_file(filename, str = nil)
|
7
|
+
if !File.exists(filename)
|
8
|
+
File.open(filename, 'w') do |file|
|
9
|
+
file.write str unless str.nil?
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "Initialize a caboose installation"
|
15
|
+
task :init do
|
16
|
+
|
17
|
+
# Add the js and css files
|
18
|
+
init_file(Rails.root.join('app','assets','javascripts','caboose_before.js'))
|
19
|
+
init_file(Rails.root.join('app','assets','javascripts','caboose_after.js'))
|
20
|
+
init_file(Rails.root.join('app','assets','stylesheets','caboose_before.css'))
|
21
|
+
init_file(Rails.root.join('app','assets','stylesheets','caboose_after.css'))
|
22
|
+
|
23
|
+
# Add the caboose initializer file
|
24
|
+
str = ""
|
25
|
+
str << "Caboose::salt = 'CHANGE THIS TO A UNIQUE STRING!!!'\n\n"
|
26
|
+
str << "Caboose::assets_path = Rails.root.join('app', 'assets', 'caboose')\n\n"
|
27
|
+
str << "Caboose::plugins = []\n"
|
28
|
+
init_file(Rails.root.join('config','initializers','caboose.rb'), str)
|
29
|
+
|
30
|
+
end
|