Merge pull request #1 from finnlabs/feature/rails3_reportingengine_to_engine
Feature/rails3 reportingengine to enginepull/6827/head
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 139 B |
Before Width: | Height: | Size: 67 B After Width: | Height: | Size: 67 B |
Before Width: | Height: | Size: 1022 B After Width: | Height: | Size: 1022 B |
Before Width: | Height: | Size: 64 B After Width: | Height: | Size: 64 B |
Before Width: | Height: | Size: 67 B After Width: | Height: | Size: 67 B |
Before Width: | Height: | Size: 67 B After Width: | Height: | Size: 67 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 54 B After Width: | Height: | Size: 54 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
@ -1,5 +1,3 @@ |
||||
fail "upgrade ruby version, ruby < 1.8.7 suffers from Hash#hash bug" if {:a => 10}.hash != {:a => 10}.hash |
||||
#require "hwia_rails" |
||||
|
||||
require 'reporting_engine/big_decimal_patch' |
||||
require 'reporting_engine/to_date_patch' |
||||
module ReportingEngine |
||||
require "reporting_engine/engine" |
||||
end |
||||
|
@ -1,17 +1,33 @@ |
||||
module Engine |
||||
## |
||||
# Subclass of Report to be used for constant lookup and such. |
||||
# It is considered public API to override this method i.e. in Tests. |
||||
# |
||||
# @return [Class] subclass |
||||
def engine |
||||
return @engine if @engine |
||||
if is_a? Module |
||||
@engine = Object.const_get(name[/^[^:]+/] || :Report) |
||||
elsif respond_to? :parent and parent.respond_to? :engine |
||||
parent.engine |
||||
else |
||||
self.class.engine |
||||
require 'rails/engine' |
||||
|
||||
module ReportingEngine |
||||
class Engine < ::Rails::Engine |
||||
engine_name :reportingengine |
||||
|
||||
config.autoload_paths += Dir["#{config.root}/lib/"] |
||||
|
||||
initializer 'reportingengine.precompile_assets' do |
||||
Rails.application.config.assets.precompile += %w(reportingengine.css reportingengine.js) |
||||
end |
||||
|
||||
|
||||
config.to_prepare do |
||||
require_dependency 'reporting_engine/patches' |
||||
require_dependency 'reporting_engine/patches/big_decimal_patch' |
||||
require_dependency 'reporting_engine/patches/to_date_patch' |
||||
end |
||||
|
||||
config.after_initialize do |
||||
Redmine::Plugin.register :reportingengine do |
||||
name 'ReportingEngine' |
||||
author 'Finn GmbH' |
||||
description 'A plugin for reports' |
||||
|
||||
url 'https://github.com/finnlabs/reportingengine' |
||||
author_url 'http://www.finn.de/' |
||||
|
||||
version ReportingEngine::VERSION |
||||
end |
||||
end |
||||
end |
||||
end |
||||
end |
||||
|
@ -0,0 +1,17 @@ |
||||
module Engine |
||||
## |
||||
# Subclass of Report to be used for constant lookup and such. |
||||
# It is considered public API to override this method i.e. in Tests. |
||||
# |
||||
# @return [Class] subclass |
||||
def engine |
||||
return @engine if @engine |
||||
if is_a? Module |
||||
@engine = Object.const_get(name[/^[^:]+/] || :Report) |
||||
elsif respond_to? :parent and parent.respond_to? :engine |
||||
parent.engine |
||||
else |
||||
self.class.engine |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,2 @@ |
||||
module ReportingEngine::Patches |
||||
end |
@ -1,3 +1,3 @@ |
||||
module ReportingEngine |
||||
VERSION = '0.0.1' |
||||
end |
||||
end |
||||
|