aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-05-18 22:16:31 +0200
committerHarald Eilertsen <haraldei@anduin.net>2015-05-18 22:35:38 +0200
commit19108680b52989b8f1e0d0d0f3fd1b68d4ecb289 (patch)
tree6551244a65c8e866e2fdc06103d5cfe487555e5f
parent2190534b7dc3c882319c60318843a88817f8c9dd (diff)
downloadcapistrano-refinerycms-19108680b52989b8f1e0d0d0f3fd1b68d4ecb289.tar.gz
capistrano-refinerycms-19108680b52989b8f1e0d0d0f3fd1b68d4ecb289.tar.bz2
capistrano-refinerycms-19108680b52989b8f1e0d0d0f3fd1b68d4ecb289.zip
Add generator for config file template, and include template in gem.
-rw-r--r--capistrano-refinerycms.gemspec4
-rw-r--r--lib/generators/capistrano/refinerycms/template_generator.rb18
2 files changed, 21 insertions, 1 deletions
diff --git a/capistrano-refinerycms.gemspec b/capistrano-refinerycms.gemspec
index 3b21495..708550d 100644
--- a/capistrano-refinerycms.gemspec
+++ b/capistrano-refinerycms.gemspec
@@ -25,7 +25,9 @@ Gem::Specification.new do |s|
s.files = ["lib/capistrano-refinerycms.rb",
"lib/capistrano/refinerycms.rb",
"lib/capistrano/refinerycms/helpers.rb",
- "lib/capistrano/tasks/refinerycms.rake"]
+ "lib/capistrano/tasks/refinerycms.rake",
+ "lib/generators/capistrano/refinerycms/templates/config_initializers_refinery_core.rb.erb",
+ "lib/generators/capistrano/refinerycms/template_generator.rb"]
s.homepage = 'https://github.com/snake66/capistrano-refinerycms.git'
s.license = 'GPLv3'
end
diff --git a/lib/generators/capistrano/refinerycms/template_generator.rb b/lib/generators/capistrano/refinerycms/template_generator.rb
new file mode 100644
index 0000000..6198461
--- /dev/null
+++ b/lib/generators/capistrano/refinerycms/template_generator.rb
@@ -0,0 +1,18 @@
+module Capistrano
+ module RefineryCMS
+ module Generators
+ class TemplateGenerator < Rails::Generators::Base
+ desc "Create local template for RefineryCMS core config file."
+ source_root File.expand_path('../templates', __FILE__)
+ argument :templates_path, :type => :string,
+ :default => "config/deploy/templates",
+ :banner => "Path to templates"
+
+ def copy_template
+ filename = "config_initializers_refinery_core.rb.erb"
+ copy_file File.join('templates', filename), File.join(templates_path, filename)
+ end
+ end
+ end
+ end
+end \ No newline at end of file