Merge pull request #1 from finnlabs/feature/rails3_reportingengine_to_engine

Feature/rails3 reportingengine to engine
pull/6827/head
Christian Rijke 12 years ago
commit f43208c00d
  1. 1
      Gemfile
  2. 0
      lib/assets/images/reporting_engine/close.gif
  3. 0
      lib/assets/images/reporting_engine/delete.gif
  4. 0
      lib/assets/images/reporting_engine/delete.png
  5. 0
      lib/assets/images/reporting_engine/disk.gif
  6. 0
      lib/assets/images/reporting_engine/disks.gif
  7. 0
      lib/assets/images/reporting_engine/icon_info_red.gif
  8. 0
      lib/assets/images/reporting_engine/loading.gif
  9. 0
      lib/assets/images/reporting_engine/remove.gif
  10. 0
      lib/assets/images/reporting_engine/remove.png
  11. 0
      lib/assets/javascripts/reporting_engine/cordinc_tooltip.js
  12. 0
      lib/assets/javascripts/reporting_engine/reporting.js
  13. 0
      lib/assets/javascripts/reporting_engine/reporting/controls.js
  14. 0
      lib/assets/javascripts/reporting_engine/reporting/filters.js
  15. 0
      lib/assets/javascripts/reporting_engine/reporting/group_bys.js
  16. 0
      lib/assets/javascripts/reporting_engine/reporting/lang/reporting-de.js
  17. 0
      lib/assets/javascripts/reporting_engine/reporting/lang/reporting-en.js
  18. 0
      lib/assets/javascripts/reporting_engine/reporting/progressbar.js
  19. 0
      lib/assets/javascripts/reporting_engine/reporting/prototype_progress_bar.js
  20. 0
      lib/assets/javascripts/reporting_engine/reporting/restore_query.js
  21. 0
      lib/assets/javascripts/reporting_engine/sortable.js
  22. 0
      lib/assets/stylesheets/reporting_engine/help.css
  23. 0
      lib/assets/stylesheets/reporting_engine/reporting.css
  24. 8
      lib/reporting_engine.rb
  25. 46
      lib/reporting_engine/engine.rb
  26. 17
      lib/reporting_engine/engine_module.rb
  27. 20
      lib/reporting_engine/helpers/reporting_helper.rb
  28. 2
      lib/reporting_engine/patches.rb
  29. 4
      lib/reporting_engine/patches/big_decimal_patch.rb
  30. 4
      lib/reporting_engine/patches/to_date_patch.rb
  31. 2
      lib/reporting_engine/report.rb
  32. 2
      lib/reporting_engine/report/inherited_attribute.rb
  33. 2
      lib/reporting_engine/version.rb
  34. 4
      lib/reporting_engine/widget.rb
  35. 2
      lib/reporting_engine/widget/table.rb
  36. 10
      reporting_engine.gemspec

@ -1 +0,0 @@
gem 'json'

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

@ -7,13 +7,13 @@
# or Controllers will go to this module, first. The default behavior
# is to pass translation work on to I18n.t() or I18n.l(), depending on
# the type of arguments.
module ReportingHelper
def l(*values)
return values.first if values.size == 1 and values.first.respond_to? :to_str
if [Date, DateTime, Time].include? values.first.class
::I18n.l(values.first)
else
::I18n.t(*values)
end
end
end
# module ReportingHelper
# def l(*values)
# return values.first if values.size == 1 and values.first.respond_to? :to_str
# if [Date, DateTime, Time].include? values.first.class
# ::I18n.l(values.first)
# else
# ::I18n.t(*values)
# end
# end
# end

@ -0,0 +1,2 @@
module ReportingEngine::Patches
end

@ -1,4 +1,4 @@
module BigDecimalPatch
module ReportingEngine::Patches::BigDecimalPatch
module BigDecimal
::BigDecimal.send :include, self
def to_d; self end
@ -13,7 +13,7 @@ module BigDecimalPatch
::String.send :include, self
def to_d; ::BigDecimal.new(self) end
end
module NilClass
::NilClass.send :include, self
def to_d; 0 end

@ -1,6 +1,6 @@
require 'date'
module ToDatePatch
module ReportingEngine::Patches::ToDatePatch
module StringAndNil
::String.send(:include, self)
::NilClass.send(:include, self)
@ -14,7 +14,7 @@ module ToDatePatch
module DateAndTime
::Date.send(:include, self)
::Time.send(:include, self)
def to_dateish
self
end

@ -1,4 +1,4 @@
require 'reporting_engine/engine'
require_dependency 'reporting_engine/engine_module'
class Report < ActiveRecord::Base
extend ProactiveAutoloader

@ -1,5 +1,5 @@
require 'set'
require 'reporting_engine/report'
require_dependency 'reporting_engine/report'
module Report::InheritedAttribute
include Report::QueryUtils

@ -1,3 +1,3 @@
module ReportingEngine
VERSION = '0.0.1'
end
end

@ -1,5 +1,5 @@
require 'reporting_engine/reporting_helper'
require 'reporting_engine/proactive_autoloader'
require_dependency 'reporting_engine/helpers/reporting_helper'
require_dependency 'reporting_engine/proactive_autoloader'
class Widget < ActionView::Base

@ -1,4 +1,4 @@
require 'reporting_engine/report/inherited_attribute'
require_dependency 'reporting_engine/report/inherited_attribute'
class Widget::Table < Widget::Base
extend Report::InheritedAttribute

@ -5,17 +5,17 @@ require "reporting_engine/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "reporting_engine"
s.name = "reportingengine"
s.version = ReportingEngine::VERSION
s.authors = "Finn GmbH"
s.email = "info@finn.de"
s.homepage = "http://www.finn.de"
s.summary = "Creates table reports with custom fields and grouping"
# s.description = "This plugin adds features enabling agile teams to work with OpenProject in Scrum projects."
# FIXME
#s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.rdoc"]
# FIXME
# s.test_files = Dir["spec/**/*"]
# s.description = ""
s.files = Dir["{app,config,db,lib}/**/*"] + %w(CHANGELOG.rdoc Gemfile COPYRIGHT.txt LICENSE.txt Rakefile)
s.test_files = Dir["test/**/*_test.rb"]
s.add_dependency "rails", "~> 3.2.9"
s.add_dependency "json"

Loading…
Cancel
Save