This commit is contained in:
Captain Future
2011-04-17 16:26:36 +02:00
commit e6134722d4
39 changed files with 1199 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
require 'spree_core'
require 'spree_digital_hooks'
module SpreeDigital
class Engine < Rails::Engine
config.autoload_paths += %W(#{config.root}/lib)
def self.activate
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
Rails.env.production? ? require(c) : load(c)
end
end
config.to_prepare &method(:activate).to_proc
end
end
+11
View File
@@ -0,0 +1,11 @@
class SpreeDigitalHooks < Spree::ThemeSupport::HookListener
insert_after :admin_product_tabs do
<<-END
<li<%== ' class="active"' if current == "Digital Versions" %>>
<%= link_to t("digital_versions"), admin_product_digitals_path(@product) %>
</li>
END
end
end
+18
View File
@@ -0,0 +1,18 @@
namespace :spree_digital do
desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
task :install do
Rake::Task['spree_digital:install:migrations'].invoke
end
namespace :install do
desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
task :migrations do
source = File.join(File.dirname(__FILE__), '..', '..', 'db')
destination = File.join(Rails.root, 'db')
Spree::FileUtilz.mirror_files(source, destination)
end
end
end
+1
View File
@@ -0,0 +1 @@
# add custom rake tasks here