aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-12-14 17:29:48 +0100
committerGitHub <noreply@github.com>2016-12-14 17:29:48 +0100
commitddc4f589a12d3452af284dfe293fe7039873baa6 (patch)
tree9b57f134065b41a432b58e5a09b228d94f636618 /server/sonar-web/src/main
parent84585eb459563996e4bee7b4b3d3b8a95387814a (diff)
downloadsonarqube-ddc4f589a12d3452af284dfe293fe7039873baa6.tar.gz
sonarqube-ddc4f589a12d3452af284dfe293fe7039873baa6.zip
Drop some Ruby code
* Drop color-tools ruby gem * Drop unused jrails.rb * Sanitize database_version.rb
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/models/measure_color.rb84
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/models/metric.rb4
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/models/project_measure.rb7
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/config/environment.rb1
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/config/initializers/jrails.rb426
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/.specification101
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/README82
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/Rakefile125
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color.rb87
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/cmyk.rb182
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/css.rb27
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/grayscale.rb135
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/hsl.rb130
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette.rb15
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette/gimp.rb107
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette/monocontrast.rb180
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb-colors.rb189
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb.rb311
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb/metallic.rb28
-rwxr-xr-xserver/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/yiq.rb78
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/gems/specifications/color-tools-1.3.0.gemspec32
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/lib/database_version.rb58
22 files changed, 0 insertions, 2389 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/measure_color.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/measure_color.rb
deleted file mode 100644
index 5ae56f53ada..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/measure_color.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# SonarQube, open source software quality management tool.
-# Copyright (C) 2008-2016 SonarSource
-# mailto:contact AT sonarsource DOT com
-#
-# SonarQube is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# SonarQube is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-class MeasureColor
-
- MIN_COLOR=Color::RGB.from_html("EE0000") # red
- MEAN_COLOR=Color::RGB.from_html("FFEE00") # orange
- MAX_COLOR=Color::RGB.from_html("00AA00") # green
- NONE_COLOR=Color::RGB.from_html("DDDDDD") # gray
-
- #
- # Options :
- # * min : min value, else the metric worst_value
- # * max : max value, else the metric best_value
- # * period_index: integer between 1 and 5 if set, else nil
- # * check_alert_status: true|false. Default is true.
- #
- def self.color(measure, options={})
- return NONE_COLOR if measure.nil?
-
- options = {:check_alert_status => true}.merge(options)
- max_value = options[:max] || measure.metric.best_value
- min_value = options[:min] || measure.metric.worst_value
- percent=-1.0
-
- if options[:period_index]
- if min_value && max_value
- value=measure.variation(options[:period_index])
- percent = value_to_percent(value, min_value, max_value)
- end
- else
- if options[:check_alert_status] && !measure.alert_status.blank?
- case(measure.alert_status)
- when Metric::TYPE_LEVEL_OK then percent=100.0
- when Metric::TYPE_LEVEL_ERROR then percent=0.0
- when Metric::TYPE_LEVEL_WARN then percent=50.0
- end
- elsif measure.metric.value_type==Metric::VALUE_TYPE_LEVEL
- case(measure.text_value)
- when Metric::TYPE_LEVEL_OK then percent=100.0
- when Metric::TYPE_LEVEL_WARN then percent=50.0
- when Metric::TYPE_LEVEL_ERROR then percent=0.0
- end
- elsif measure.value && max_value && min_value
- percent = value_to_percent(measure.value, min_value, max_value)
- end
- end
-
- max_color=options[:max_color]||MAX_COLOR
- min_color=options[:min_color]||MIN_COLOR
- mean_color=options[:mean_color]||MEAN_COLOR
- if percent<0.0
- NONE_COLOR
- elsif (percent > 50.0)
- max_color.mix_with(mean_color, (percent - 50.0) * 2.0)
- else
- min_color.mix_with(mean_color, (50.0 - percent) * 2.0)
- end
- end
-
-
- def self.value_to_percent(value, min, max)
- percent = 100.0 * (value.to_f - min.to_f) / (max.to_f - min.to_f)
- percent=100.0 if percent>100.0
- percent=0.0 if percent<0.0
- percent
- end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/metric.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/metric.rb
index 3678dde7a5c..aa0f039d760 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/metric.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/metric.rb
@@ -250,10 +250,6 @@ class Metric < ActiveRecord::Base
'direction' => direction.to_i, 'val_type' => val_type.to_s, 'hidden' => hidden}
end
- def treemap_color?
- enabled && !hidden && ((numeric? && worst_value && best_value) || val_type==Metric::VALUE_TYPE_LEVEL)
- end
-
def treemap_size?
enabled && !hidden && numeric? && !domain.blank?
end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/project_measure.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/project_measure.rb
index 4e6e1a5168e..f8d38a7fa36 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/project_measure.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/project_measure.rb
@@ -166,13 +166,6 @@ class ProjectMeasure < ActiveRecord::Base
Internal.i18n.formatLongDuration(value.to_i, 'SHORT')
end
- def color
- @color ||=
- begin
- MeasureColor.color(self)
- end
- end
-
def leading_zero( value )
if ( value < 10 )
return "0" + value.to_s
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/config/environment.rb b/server/sonar-web/src/main/webapp/WEB-INF/config/environment.rb
index b355a78aa1d..ddc82b6d7c2 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/config/environment.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/config/environment.rb
@@ -6,7 +6,6 @@ ENV['GEM_HOME'] = $servlet_context.getRealPath('/WEB-INF/gems')
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
-require 'color'
# Disable all the warnings :
# Gem::SourceIndex#initialize called from /.../web/WEB-INF/gems/gems/rails-2.3.15/lib/rails/vendor_gem_source_index.rb:100.
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/config/initializers/jrails.rb b/server/sonar-web/src/main/webapp/WEB-INF/config/initializers/jrails.rb
deleted file mode 100644
index 2bd2767ef63..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/config/initializers/jrails.rb
+++ /dev/null
@@ -1,426 +0,0 @@
-# SONAR-5052 Replace prototypejs by jquery in Ruby on Rails helpers (form_remote_tag, link_to_function, ...)
-# See https://github.com/aaronchi/jrails
-
-module ActionView
- module Helpers
-
- module JavaScriptHelper
-
- # This function can be used to render rjs inline
- #
- # <%= javascript_function do |page|
- # page.replace_html :list, :partial => 'list', :object => @list
- # end %>
- #
- def javascript_function(*args, &block)
- html_options = args.extract_options!
- function = args[0] || ''
-
- html_options.symbolize_keys!
- function = update_page(&block) if block_given?
- javascript_tag(function)
- end
-
- def jquery_id(id)
- id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id
- end
-
- def jquery_ids(ids)
- Array(ids).map{|id| jquery_id(id)}.join(',')
- end
-
- end
-
- module PrototypeHelper
-
- USE_PROTECTION = const_defined?(:DISABLE_JQUERY_FORGERY_PROTECTION) ? !DISABLE_JQUERY_FORGERY_PROTECTION : true
-
- unless const_defined? :JQUERY_VAR
- JQUERY_VAR = 'jQuery'
- end
-
- unless const_defined? :JQCALLBACKS
- JQCALLBACKS = Set.new([ :beforeSend, :complete, :error, :success ] + (100..599).to_a)
- #instance_eval { remove_const :AJAX_OPTIONS }
- remove_const(:AJAX_OPTIONS) if const_defined?(:AJAX_OPTIONS)
- AJAX_OPTIONS = Set.new([ :before, :after, :condition, :url,
- :asynchronous, :method, :insertion, :position,
- :form, :with, :update, :script ]).merge(JQCALLBACKS)
- end
-
- def periodically_call_remote(options = {})
- frequency = options[:frequency] || 10 # every ten seconds by default
- code = "setInterval(function() {#{remote_function(options)}}, #{frequency} * 1000)"
- javascript_tag(code)
- end
-
- def remote_function(options)
- javascript_options = options_for_ajax(options)
-
- update = ''
- if options[:update] && options[:update].is_a?(Hash)
- update = []
- update << "success:'#{options[:update][:success]}'" if options[:update][:success]
- update << "failure:'#{options[:update][:failure]}'" if options[:update][:failure]
- update = '{' + update.join(',') + '}'
- elsif options[:update]
- update << "'#{options[:update]}'"
- end
-
- function = "#{JQUERY_VAR}.ajax(#{javascript_options})"
-
- function = "#{options[:before]}; #{function}" if options[:before]
- function = "#{function}; #{options[:after]}" if options[:after]
- function = "if (#{options[:condition]}) { #{function}; }" if options[:condition]
- function = "if (confirm('#{escape_javascript(options[:confirm])}')) { #{function}; }" if options[:confirm]
- return function
- end
-
- class JavaScriptGenerator
- module GeneratorMethods
-
- def insert_html(position, id, *options_for_render)
- insertion = position.to_s.downcase
- insertion = 'append' if insertion == 'bottom'
- insertion = 'prepend' if insertion == 'top'
- call "#{JQUERY_VAR}(\"#{jquery_id(id)}\").#{insertion}", render(*options_for_render)
- end
-
- def replace_html(id, *options_for_render)
- insert_html(:html, id, *options_for_render)
- end
-
- def replace(id, *options_for_render)
- call "#{JQUERY_VAR}(\"#{jquery_id(id)}\").replaceWith", render(*options_for_render)
- end
-
- def remove(*ids)
- call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").remove"
- end
-
- def show(*ids)
- call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").show"
- end
-
- def hide(*ids)
- call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").hide"
- end
-
- def toggle(*ids)
- call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").toggle"
- end
-
- def jquery_id(id)
- id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id
- end
-
- def jquery_ids(ids)
- Array(ids).map{|id| jquery_id(id)}.join(',')
- end
-
- end
- end
-
- protected
- def options_for_ajax(options)
- js_options = build_callbacks(options)
-
- url_options = options[:url]
- url_options = url_options.merge(:escape => false) if url_options.is_a?(Hash)
- js_options['url'] = "'#{url_for(url_options)}'"
- js_options['async'] = false if options[:type] == :synchronous
- js_options['type'] = options[:method] ? method_option_to_s(options[:method]) : ( options[:form] ? "'post'" : nil )
- js_options['dataType'] = options[:datatype] ? "'#{options[:datatype]}'" : (options[:update] ? nil : "'script'")
-
- if options[:form]
- js_options['data'] = "#{JQUERY_VAR}.param(#{JQUERY_VAR}(this).serializeArray())"
- elsif options[:submit]
- js_options['data'] = "#{JQUERY_VAR}(\"##{options[:submit]} :input\").serialize()"
- elsif options[:with]
- js_options['data'] = options[:with].gsub("Form.serialize(this.form)","#{JQUERY_VAR}.param(#{JQUERY_VAR}(this.form).serializeArray())")
- end
-
- js_options['type'] ||= "'post'"
- if options[:method]
- if method_option_to_s(options[:method]) == "'put'" || method_option_to_s(options[:method]) == "'delete'"
- js_options['type'] = "'post'"
- if js_options['data']
- js_options['data'] << " + '&"
- else
- js_options['data'] = "'"
- end
- js_options['data'] << "_method=#{options[:method]}'"
- end
- end
-
- if USE_PROTECTION && respond_to?('protect_against_forgery?') && protect_against_forgery?
- if js_options['data']
- js_options['data'] << " + '&"
- else
- js_options['data'] = "'"
- end
- js_options['data'] << "#{request_forgery_protection_token}=' + encodeURIComponent('#{escape_javascript form_authenticity_token}')"
- end
- js_options['data'] = "''" if js_options['type'] == "'post'" && js_options['data'].nil?
- options_for_javascript(js_options.reject {|key, value| value.nil?})
- end
-
- def build_update_for_success(html_id, insertion=nil)
- insertion = build_insertion(insertion)
- "#{JQUERY_VAR}('#{jquery_id(html_id)}').#{insertion}(request);"
- end
-
- def build_update_for_error(html_id, insertion=nil)
- insertion = build_insertion(insertion)
- "#{JQUERY_VAR}('#{jquery_id(html_id)}').#{insertion}(request.responseText);"
- end
-
- def build_insertion(insertion)
- insertion = insertion ? insertion.to_s.downcase : 'html'
- insertion = 'append' if insertion == 'bottom'
- insertion = 'prepend' if insertion == 'top'
- insertion
- end
-
- def build_observer(klass, name, options = {})
- if options[:with] && (options[:with] !~ /[\{=(.]/)
- options[:with] = "'#{options[:with]}=' + value"
- else
- options[:with] ||= 'value' unless options[:function]
- end
-
- callback = options[:function] || remote_function(options)
- javascript = "#{JQUERY_VAR}('#{jquery_id(name)}').delayedObserver("
- javascript << "#{options[:frequency] || 0}, "
- javascript << "function(element, value) {"
- javascript << "#{callback}}"
- #javascript << ", '#{options[:on]}'" if options[:on]
- javascript << ")"
- javascript_tag(javascript)
- end
-
- def build_callbacks(options)
- callbacks = {}
- options[:beforeSend] = '';
- [:uninitialized,:loading].each do |key|
- options[:beforeSend] << (options[key].last == ';' ? options.delete(key) : options.delete(key) << ';') if options[key]
- end
- options.delete(:beforeSend) if options[:beforeSend].blank?
- options[:complete] = options.delete(:loaded) if options[:loaded]
- options[:error] = options.delete(:failure) if options[:failure]
- if options[:update]
- if options[:update].is_a?(Hash)
- options[:update][:error] = options[:update].delete(:failure) if options[:update][:failure]
- if options[:update][:success]
- options[:success] = build_update_for_success(options[:update][:success], options[:position]) << (options[:success] ? options[:success] : '')
- end
- if options[:update][:error]
- options[:error] = build_update_for_error(options[:update][:error], options[:position]) << (options[:error] ? options[:error] : '')
- end
- else
- options[:success] = build_update_for_success(options[:update], options[:position]) << (options[:success] ? options[:success] : '')
- end
- end
- options.each do |callback, code|
- if JQCALLBACKS.include?(callback)
- callbacks[callback] = "function(request){#{code}}"
- end
- end
- callbacks
- end
-
- end
-
- class JavaScriptElementProxy < JavaScriptProxy #:nodoc:
-
- unless const_defined? :JQUERY_VAR
- JQUERY_VAR = PrototypeHelper::JQUERY_VAR
- end
-
- def initialize(generator, id)
- id = id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id
- @id = id
- super(generator, "#{JQUERY_VAR}(\"#{id}\")")
- end
-
- def replace_html(*options_for_render)
- call 'html', @generator.send(:render, *options_for_render)
- end
-
- def replace(*options_for_render)
- call 'replaceWith', @generator.send(:render, *options_for_render)
- end
-
- def reload(options_for_replace={})
- replace(options_for_replace.merge({ :partial => @id.to_s.sub(/^#/,'') }))
- end
-
- def value()
- call 'val()'
- end
-
- def value=(value)
- call 'val', value
- end
-
- end
-
- class JavaScriptElementCollectionProxy < JavaScriptCollectionProxy #:nodoc:\
-
- unless const_defined? :JQUERY_VAR
- JQUERY_VAR = PrototypeHelper::JQUERY_VAR
- end
-
- def initialize(generator, pattern)
- super(generator, "#{JQUERY_VAR}(#{pattern.to_json})")
- end
- end
-
- module ScriptaculousHelper
-
- unless const_defined? :JQUERY_VAR
- JQUERY_VAR = PrototypeHelper::JQUERY_VAR
- end
-
- unless const_defined? :SCRIPTACULOUS_EFFECTS
- SCRIPTACULOUS_EFFECTS = {
- :appear => {:method => 'fadeIn'},
- :blind_down => {:method => 'blind', :mode => 'show', :options => {:direction => 'vertical'}},
- :blind_up => {:method => 'blind', :mode => 'hide', :options => {:direction => 'vertical'}},
- :blind_right => {:method => 'blind', :mode => 'show', :options => {:direction => 'horizontal'}},
- :blind_left => {:method => 'blind', :mode => 'hide', :options => {:direction => 'horizontal'}},
- :bounce_in => {:method => 'bounce', :mode => 'show', :options => {:direction => 'up'}},
- :bounce_out => {:method => 'bounce', :mode => 'hide', :options => {:direction => 'up'}},
- :drop_in => {:method => 'drop', :mode => 'show', :options => {:direction => 'up'}},
- :drop_out => {:method => 'drop', :mode => 'hide', :options => {:direction => 'down'}},
- :fade => {:method => 'fadeOut'},
- :fold_in => {:method => 'fold', :mode => 'hide'},
- :fold_out => {:method => 'fold', :mode => 'show'},
- :grow => {:method => 'scale', :mode => 'show'},
- :shrink => {:method => 'scale', :mode => 'hide'},
- :slide_down => {:method => 'slide', :mode => 'show', :options => {:direction => 'up'}},
- :slide_up => {:method => 'slide', :mode => 'hide', :options => {:direction => 'up'}},
- :slide_right => {:method => 'slide', :mode => 'show', :options => {:direction => 'left'}},
- :slide_left => {:method => 'slide', :mode => 'hide', :options => {:direction => 'left'}},
- :squish => {:method => 'scale', :mode => 'hide', :options => {:origin => "['top','left']"}},
- :switch_on => {:method => 'clip', :mode => 'show', :options => {:direction => 'vertical'}},
- :switch_off => {:method => 'clip', :mode => 'hide', :options => {:direction => 'vertical'}},
- :toggle_appear => {:method => 'fadeToggle'},
- :toggle_slide => {:method => 'slide', :mode => 'toggle', :options => {:direction => 'up'}},
- :toggle_blind => {:method => 'blind', :mode => 'toggle', :options => {:direction => 'vertical'}},
- }
- end
-
- def visual_effect(name, element_id = false, js_options = {})
- element = element_id ? element_id : "this"
-
- if SCRIPTACULOUS_EFFECTS.has_key? name.to_sym
- effect = SCRIPTACULOUS_EFFECTS[name.to_sym]
- name = effect[:method]
- mode = effect[:mode]
- js_options = js_options.merge(effect[:options]) if effect[:options]
- end
-
- [:color, :direction, :startcolor, :endcolor].each do |option|
- js_options[option] = "'#{js_options[option]}'" if js_options[option]
- end
-
- if js_options.has_key? :duration
- speed = js_options.delete :duration
- speed = (speed * 1000).to_i unless speed.nil?
- else
- speed = js_options.delete :speed
- end
-
- if ['fadeIn','fadeOut','fadeToggle'].include?(name)
- # 090905 - Jake - changed ' to \" so it passes assert_select_rjs with an id
- javascript = "#{JQUERY_VAR}(\"#{jquery_id(element_id)}\").#{name}("
- javascript << "#{speed}" unless speed.nil?
- javascript << ");"
- else
- # 090905 - Jake - changed ' to \" so it passes "assert_select_rjs :effect, ID"
- javascript = "#{JQUERY_VAR}(\"#{jquery_id(element_id)}\").#{mode || 'effect'}('#{name}'"
- javascript << ",#{options_for_javascript(js_options)}" unless speed.nil? && js_options.empty?
- javascript << ",#{speed}" unless speed.nil?
- javascript << ");"
- end
-
- end
-
- def sortable_element_js(element_id, options = {}) #:nodoc:
- #convert similar attributes
- options[:handle] = ".#{options[:handle]}" if options[:handle]
- if options[:tag] || options[:only]
- options[:items] = "> "
- options[:items] << options.delete(:tag) if options[:tag]
- options[:items] << ".#{options.delete(:only)}" if options[:only]
- end
- options[:connectWith] = options.delete(:containment).map {|x| "##{x}"} if options[:containment]
- options[:containment] = options.delete(:container) if options[:container]
- options[:dropOnEmpty] = false unless options[:dropOnEmpty]
- options[:helper] = "'clone'" if options[:ghosting] == true
- options[:axis] = case options.delete(:constraint)
- when "vertical", :vertical
- "y"
- when "horizontal", :horizontal
- "x"
- when false
- nil
- when nil
- "y"
- end
- options.delete(:axis) if options[:axis].nil?
- options.delete(:overlap)
- options.delete(:ghosting)
-
- if options[:onUpdate] || options[:url]
- if options[:format]
- options[:with] ||= "#{JQUERY_VAR}(this).sortable('serialize',{key:'#{element_id}[]', expression:#{options[:format]}})"
- options.delete(:format)
- else
- options[:with] ||= "#{JQUERY_VAR}(this).sortable('serialize',{key:'#{element_id}[]'})"
- end
-
- options[:onUpdate] ||= "function(){" + remote_function(options) + "}"
- end
-
- options.delete_if { |key, value| PrototypeHelper::AJAX_OPTIONS.include?(key) }
- options[:update] = options.delete(:onUpdate) if options[:onUpdate]
-
- [:axis, :cancel, :containment, :cursor, :handle, :tolerance, :items, :placeholder].each do |option|
- options[option] = "'#{options[option]}'" if options[option]
- end
-
- options[:connectWith] = array_or_string_for_javascript(options[:connectWith]) if options[:connectWith]
-
- %(#{JQUERY_VAR}('#{jquery_id(element_id)}').sortable(#{options_for_javascript(options)});)
- end
-
- def draggable_element_js(element_id, options = {})
- %(#{JQUERY_VAR}("#{jquery_id(element_id)}").draggable(#{options_for_javascript(options)});)
- end
-
- def drop_receiving_element_js(element_id, options = {})
- #convert similar options
- options[:hoverClass] = options.delete(:hoverclass) if options[:hoverclass]
- options[:drop] = options.delete(:onDrop) if options[:onDrop]
-
- if options[:drop] || options[:url]
- options[:with] ||= "'id=' + encodeURIComponent(#{JQUERY_VAR}(ui.draggable).attr('id'))"
- options[:drop] ||= "function(ev, ui){" + remote_function(options) + "}"
- end
-
- options.delete_if { |key, value| PrototypeHelper::AJAX_OPTIONS.include?(key) }
-
- options[:accept] = array_or_string_for_javascript(options[:accept]) if options[:accept]
- [:activeClass, :hoverClass, :tolerance].each do |option|
- options[option] = "'#{options[option]}'" if options[option]
- end
-
- %(#{JQUERY_VAR}('#{jquery_id(element_id)}').droppable(#{options_for_javascript(options)});)
- end
-
- end
-
- end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/.specification b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/.specification
deleted file mode 100755
index 20db297481a..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/.specification
+++ /dev/null
@@ -1,101 +0,0 @@
---- !ruby/object:Gem::Specification
-name: color-tools
-version: !ruby/object:Gem::Version
- prerelease: false
- segments:
- - 1
- - 3
- - 0
- version: 1.3.0
-platform: ruby
-authors:
- - Austin Ziegler
-autorequire: color
-bindir: bin
-cert_chain:
-date: 2005-08-07 00:00:00 +02:00
-default_executable:
-dependencies: []
-
-description: color-tools is a Ruby library to provide RGB, CMYK, and other colourspace support to applications that require it. It also provides 152 named RGB colours. It offers 152 named RGB colours (184 with spelling variations) that are commonly supported and used in HTML, SVG, and X11 applications. A technique for generating a monochromatic contrasting palette is also included.
-email: austin@rubyforge.org
-executables: []
-
-extensions: []
-
-extra_rdoc_files:
- - README
- - Install
- - Changelog
-files:
- - Changelog
- - Install
- - lib
- - metaconfig
- - pre-setup.rb
- - Rakefile
- - README
- - setup.rb
- - tests
- - lib/color
- - lib/color.rb
- - lib/color/cmyk.rb
- - lib/color/css.rb
- - lib/color/grayscale.rb
- - lib/color/hsl.rb
- - lib/color/palette
- - lib/color/palette.rb
- - lib/color/rgb
- - lib/color/rgb-colors.rb
- - lib/color/rgb.rb
- - lib/color/yiq.rb
- - lib/color/palette/gimp.rb
- - lib/color/palette/monocontrast.rb
- - lib/color/rgb/metallic.rb
- - tests/testall.rb
- - tests/test_cmyk.rb
- - tests/test_css.rb
- - tests/test_gimp.rb
- - tests/test_grayscale.rb
- - tests/test_hsl.rb
- - tests/test_monocontrast.rb
- - tests/test_rgb.rb
- - tests/test_yiq.rb
-has_rdoc: true
-homepage: http://rubyforge.org/projects/ruby-pdf
-licenses: []
-
-post_install_message:
-rdoc_options:
- - --title
- - color-tools
- - --main
- - README
- - --line-numbers
-require_paths:
- - lib
-required_ruby_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">"
- - !ruby/object:Gem::Version
- segments:
- - 0
- - 0
- - 0
- version: 0.0.0
-required_rubygems_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- segments:
- - 0
- version: "0"
-requirements: []
-
-rubyforge_project: ruby-pdf
-rubygems_version: 1.3.6
-signing_key:
-specification_version: 1
-summary: color-tools provides colour space definition and manpiulation as well as commonly named RGB colours.
-test_files: []
-
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/README b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/README
deleted file mode 100755
index 7f22cf98d1b..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/README
+++ /dev/null
@@ -1,82 +0,0 @@
-= color-tools README
-color-tools is a Ruby library to provide RGB, CMYK, and other colourspace
-support to applications that require it. It also provides 152 named RGB
-colours. It offers 152 named RGB colours (184 with spelling variations)
-that are commonly supported and used in HTML, SVG, and X11 applications. A
-technique for generating a monochromatic contrasting palette is also
-included.
-
-Version 1.3 offers significant enhancements over color-tools 1.2, and a
-plan for an incompatible change to the library.
-
-* Colours that were defined in the Color namespace (e.g., Color::Red,
- Color::AliceBlue) are now defined in Color::RGB (e.g., Color::RGB::Red,
- Color::RGB::AliceBlue). They are added back to the Color namespace on
- the first use of the old colours and a warning is printed. In version
- 1.4, this warning will be printed on every use of the old colours. In
- version 1.5, the backwards compatible support for colours like
- Color::Red will be removed completely.
-
-* A CSS colour name module has been added. It is based on the Color::RGB
- predefined colours. It is called with "Color::CSS[color]". The provided
- colour name will be looked up ignoring case so that "DarkSalmon" and
- "darksalmon" (and :darksalmon) are the same value. This makes it easier
- on web or SVG developers who wish to be able to manipulate a colour
- based on a CSS colour name.
-
-* A new predefined colour namespace has been added for RGB metallic
- colours (Color::Metallic, in color/rgb/metallic), suggested by Jim
- Freeze <jfn@freeze.org>.
-
-* A new colour space, Color::HSL (hue, saturation, and luminosity) has
- been added with some helper methods to Color::RGB for colour
- manipulation.
-
-* Added unit tests and fixed various little bugs.
-
-== Copyright
-Copyright 2005 by Austin Ziegler
-
-Color::Palette was developed based on techniques described by Andy
-"Malarkey" Clarke[1], implemented in JavaScript by Steve G. Chipman at
-SlayerOffice[2] and by Patrick Fitzgerald of BarelyFitz[3] in PHP.
-
-== Licence
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Soft-
-ware"), to deal in the Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute,
-sublicense, and/or sell copies of the Software, and to permit persons to
-whom the Software is furnished to do so, subject to the following
-conditions:
-
-* The names of its contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-
-[1] http://www.stuffandnonsense.co.uk/archives/creating_colour_palettes.html
-[2] http://slayeroffice.com/tools/color_palette/
-[3] http://www.barelyfitz.com/projects/csscolor/
-
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: README,v 1.9 2005/08/08 02:44:17 austin Exp $
-#++
-# vim: sts=2 sw=2 ts=4 et ai tw=74
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/Rakefile b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/Rakefile
deleted file mode 100755
index 56f98e868cd..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/Rakefile
+++ /dev/null
@@ -1,125 +0,0 @@
-#! /usr/bin/env rake
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: Rakefile,v 1.7 2005/08/08 02:53:16 austin Exp $
-#++
-# vim: sts=2 sw=2 ts=4 et ai tw=77
-
-$LOAD_PATH.unshift('lib')
-
-require 'rubygems'
-require 'rake/gempackagetask'
-require 'color'
-require 'archive/tar/minitar'
-require 'zlib'
-
-DISTDIR = "color-tools-#{Color::COLOR_TOOLS_VERSION}"
-TARDIST = "../#{DISTDIR}.tar.gz"
-
-DATE_RE = %r<(\d{4})[./-]?(\d{2})[./-]?(\d{2})(?:[\sT]?(\d{2})[:.]?(\d{2})[:.]?(\d{2})?)?>
-
-if ENV['RELEASE_DATE']
- year, month, day, hour, minute, second = DATE_RE.match(ENV['RELEASE_DATE']).captures
- year ||= 0
- month ||= 0
- day ||= 0
- hour ||= 0
- minute ||= 0
- second ||= 0
- ReleaseDate = Time.mktime(year, month, day, hour, minute, second)
-else
- ReleaseDate = nil
-end
-
-task :test do |t|
- require 'test/unit/testsuite'
- require 'test/unit/ui/console/testrunner'
-
- runner = Test::Unit::UI::Console::TestRunner
-
- $LOAD_PATH.unshift('tests')
- $stderr.puts "Checking for test cases:" if t.verbose
- Dir['tests/test_*.rb'].each do |testcase|
- $stderr.puts "\t#{testcase}" if t.verbose
- load testcase
- end
-
- suite = Test::Unit::TestSuite.new("color-tools")
-
- ObjectSpace.each_object(Class) do |testcase|
- suite << testcase.suite if testcase < Test::Unit::TestCase
- end
-
- runner.run(suite)
-end
-
-spec = eval(File.read("color-tools.gemspec"))
-spec.version = Color::COLOR_TOOLS_VERSION
-desc "Build the RubyGem for color-tools"
-task :gem => [ :test ]
-Rake::GemPackageTask.new(spec) do |g|
- g.need_tar = false
- g.need_zip = false
- g.package_dir = ".."
-end
-
-desc "Build a color-tools .tar.gz distribution."
-task :tar => [ TARDIST ]
-file TARDIST => [ :test ] do |t|
- current = File.basename(Dir.pwd)
- Dir.chdir("..") do
- begin
- files = Dir["#{current}/**/*"].select { |dd| dd !~ %r{(?:/CVS/?|~$)} }
- files.map! do |dd|
- ddnew = dd.gsub(/^#{current}/, DISTDIR)
- mtime = ReleaseDate || File.stat(dd).mtime
- if File.directory?(dd)
- { :name => ddnew, :mode => 0755, :dir => true, :mtime => mtime }
- else
- if dd =~ %r{bin/}
- mode = 0755
- else
- mode = 0644
- end
- data = File.open(dd, "rb") { |ff| ff.read }
- { :name => ddnew, :mode => mode, :data => data, :size => data.size,
- :mtime => mtime }
- end
- end
-
- ff = File.open(t.name.gsub(%r{^\.\./}o, ''), "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- if entry[:dir]
- tw.mkdir(entry[:name], entry)
- else
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
- end
- ensure
- tw.close if tw
- gz.close if gz
- end
- end
-end
-task TARDIST => [ :test ]
-
-desc "Build the rdoc documentation for color-tools"
-task :docs do
- require 'rdoc/rdoc'
- rdoc_options = %w(--title color-tools --main README --line-numbers)
- files = FileList[*%w(README Changelog bin/**/*.rb lib/**/*.rb)]
- rdoc_options += files.to_a
- RDoc::RDoc.new.document(rdoc_options)
-end
-
-desc "Build everything."
-task :default => [ :tar, :gem ]
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color.rb
deleted file mode 100755
index 82c2b344715..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: color.rb,v 1.8 2005/08/08 02:44:17 austin Exp $
-#++
-
-# = Colour Management with Ruby
-#
-# == Copyright
-# Copyright 2005 by Austin Ziegler
-#
-# Color::RGB and Color::CMYK were originally developed for the Ruby PDF
-# project and PDF::Writer and represent wholly unique code.
-#
-# Color::Palette was developed based on techniques described by Andy
-# "Malarkey"[http://www.stuffandnonsense.co.uk/archives/creating_colour_palettes.html]
-# Clarke, implemented in JavaScript by Steve G. Chipman at
-# SlayerOffice[http://slayeroffice.com/tools/color_palette/] and by Patrick
-# Fitzgerald of BarelyFitz[http://www.barelyfitz.com/projects/csscolor/] in
-# PHP.
-#
-# == LICENCE
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# * The names of its contributors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-module Color
- COLOR_TOOLS_VERSION = '1.3.0'
-
- class RGB; end
- class CMYK; end
- class GrayScale; end
- class YIQ; end
-end
-
-require 'color/rgb'
-require 'color/cmyk'
-require 'color/grayscale'
-require 'color/hsl'
-require 'color/yiq'
-require 'color/rgb/metallic'
-
- # We load EVERYTHING if we're being run under ZenTest.
-if defined? $ZENTEST and $ZENTEST
- require 'color/css'
- require 'color/palette/gimp'
- require 'color/palette/monocontrast'
-end
-
-module Color
- def self.const_missing(name) #:nodoc:
- if Color::RGB.const_defined?(name)
- warn "These colour constants have been deprecated. Use Color::RGB::#{name} instead."
- Color::RGB::constants.each do |const|
- next if const == "PDF_FORMAT_STR"
- next if const == "Metallic"
- const_set(const, Color::RGB.const_get(const))
- end
- class << Color; remove_method :const_missing; end
- Color.const_get(name)
- else
- super
- end
- end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/cmyk.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/cmyk.rb
deleted file mode 100755
index 83ea8cae43b..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/cmyk.rb
+++ /dev/null
@@ -1,182 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: cmyk.rb,v 1.5 2005/08/08 02:44:17 austin Exp $
-#++
-
- # An CMYK colour object. CMYK (cyan, magenta, yellow, and black) colours
- # are based on additive percentages of ink. A CMYK colour of (0.3, 0, 0.8,
- # 0.3) would be mixed from 30% cyan, 0% magenta, 80% yellow, and 30%
- # black.
-class Color::CMYK
- # The format of a DeviceCMYK colour for PDF. In color-tools 2.0 this
- # will be removed from this package and added back as a modification by
- # the PDF::Writer package.
- PDF_FORMAT_STR = "%.3f %.3f %.3f %.3f %s"
-
- # Compares the other colour to this one. The other colour will be
- # converted to CMYK before comparison, so the comparison between a CMYK
- # colour and a non-CMYK colour will be approximate and based on the
- # other colour's #to_cmyk conversion. If there is no #to_cmyk
- # conversion, this will raise an exception. This will report that two
- # CMYK colours are equivalent if all component values are within 1e-4
- # (0.0001) of each other.
- def ==(other)
- other = other.to_cmyk
- other.kind_of?(Color::CMYK) and
- ((@c - other.c).abs <= 1e-4) and
- ((@m - other.m).abs <= 1e-4) and
- ((@y - other.y).abs <= 1e-4) and
- ((@k - other.k).abs <= 1e-4)
- end
-
- # Creates a CMYK colour object from fractional values 0..1.
- #
- # Color::CMYK.from_fraction(0.3, 0, 0.8, 0.3)
- def self.from_fraction(c = 0, m = 0, y = 0, k = 0)
- colour = Color::CMYK.new
- colour.c = c
- colour.m = m
- colour.y = y
- colour.k = k
- colour
- end
-
- # Creates a CMYK colour object from percentages. Internally, the colour
- # is managed as fractional values 0..1.
- #
- # Color::CMYK.from_fraction(30, 0, 80, 30)
- def initialize(c = 0, m = 0, y = 0, k = 0)
- @c = c / 100.0
- @m = m / 100.0
- @y = y / 100.0
- @k = k / 100.0
- end
-
- # Present the colour as a DeviceCMYK fill colour string for PDF. This
- # will be removed from the default package in color-tools 2.0.
- def pdf_fill
- PDF_FORMAT_STR % [ @c, @m, @y, @k, "k" ]
- end
-
- # Present the colour as a DeviceCMYK stroke colour string for PDF. This
- # will be removed from the default package in color-tools 2.0.
- def pdf_stroke
- PDF_FORMAT_STR % [ @c, @m, @y, @k, "K" ]
- end
-
- # Present the colour as an RGB HTML/CSS colour string. Note that this
- # will perform a #to_rgb operation using the default conversion formula.
- def html
- to_rgb.html
- end
-
- # Converts the CMYK colour to RGB. Most colour experts strongly suggest
- # that this is not a good idea (some even suggesting that it's a very
- # bad idea). CMYK represents additive percentages of inks on white
- # paper, whereas RGB represents mixed colour intensities on a black
- # screen.
- #
- # However, the colour conversion can be done, and there are two
- # different methods for the conversion that provide slightly different
- # results. Adobe PDF conversions are done with the first form.
- #
- # # Adobe PDF Display Formula
- # r = 1.0 - min(1.0, c + k)
- # g = 1.0 - min(1.0, m + k)
- # b = 1.0 - min(1.0, y + k)
- #
- # # Other
- # r = 1.0 - (c * (1.0 - k) + k)
- # g = 1.0 - (m * (1.0 - k) + k)
- # b = 1.0 - (y * (1.0 - k) + k)
- #
- # If we have a CMYK colour of [33% 66% 83% 25%], the first method will
- # give an approximate RGB colour of (107, 23, 0) or #6b1700. The second
- # method will give an approximate RGB colour of (128, 65, 33) or
- # #804121. Which is correct? Although the colours may seem to be
- # drastically different in the RGB colour space, they are very similar
- # colours, differing mostly in intensity. The first is a darker,
- # slightly redder brown; the second is a lighter brown.
- #
- # Because of this subtlety, both methods are now offered for conversion
- # in color-tools 1.2 or later. The Adobe method is not used by default;
- # to enable it, pass +true+ to #to_rgb.
- #
- # Future versions of color-tools may offer other conversion mechanisms
- # that offer greater colour fidelity.
- def to_rgb(use_adobe_method = false)
- if use_adobe_method
- r = 1.0 - [1.0, @c + @k].min
- g = 1.0 - [1.0, @m + @k].min
- b = 1.0 - [1.0, @y + @k].min
- else
- r = 1.0 - (@c.to_f * (1.0 - @k.to_f) + @k.to_f)
- g = 1.0 - (@m.to_f * (1.0 - @k.to_f) + @k.to_f)
- b = 1.0 - (@y.to_f * (1.0 - @k.to_f) + @k.to_f)
- end
- Color::RGB.from_fraction(r, g, b)
- end
-
- # Converts the CMYK colour to a single greyscale value. There are
- # undoubtedly multiple methods for this conversion, but only a minor
- # variant of the Adobe conversion method will be used:
- #
- # g = 1.0 - min(1.0, 0.299 * c + 0.587 * m + 0.114 * y + k)
- #
- # This treats the CMY values similarly to YIQ (NTSC) values and then
- # adds the level of black. This is a variant of the Adobe version
- # because it uses the more precise YIQ (NTSC) conversion values for Y
- # (intensity) rather than the approximates provided by Adobe (0.3, 0.59,
- # and 0.11).
- def to_grayscale
- c = 0.299 * @c.to_f
- m = 0.587 * @m.to_f
- y = 0.114 * @y.to_f
- g = 1.0 - [1.0, c + m + y + @k].min
- Color::GrayScale.from_fraction(g)
- end
- alias to_greyscale to_grayscale
-
- def to_cmyk
- self
- end
-
- # Converts to RGB then YIQ.
- def to_yiq
- to_rgb.to_yiq
- end
-
- # Converts to RGB then HSL.
- def to_hsl
- to_rgb.to_hsl
- end
-
- attr_accessor :c, :m, :y, :k
- remove_method :c=, :m=, :y=, :k= ;
- def c=(cc) #:nodoc:
- cc = 1.0 if cc > 1
- cc = 0.0 if cc < 0
- @c = cc
- end
- def m=(mm) #:nodoc:
- mm = 1.0 if mm > 1
- mm = 0.0 if mm < 0
- @m = mm
- end
- def y=(yy) #:nodoc:
- yy = 1.0 if yy > 1
- yy = 0.0 if yy < 0
- @y = yy
- end
- def k=(kk) #:nodoc:
- kk = 1.0 if kk > 1
- kk = 0.0 if kk < 0
- @k = kk
- end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/css.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/css.rb
deleted file mode 100755
index 5e333325b14..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/css.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: css.rb,v 1.1 2005/08/05 23:07:20 austin Exp $
-#++
-
-require 'color'
-
- # This namespace contains some CSS colour names.
-module Color::CSS
- # Returns the RGB colour for name or +nil+ if the name is not valid.
- def self.[](name)
- @colors[name.to_s.downcase.to_sym]
- end
-
- @colors = {}
- Color::RGB.constants.each do |const|
- next if const == "PDF_FORMAT_STR"
- next if const == "Metallic"
- @colors[const.downcase.to_sym] ||= Color::RGB.const_get(const)
- end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/grayscale.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/grayscale.rb
deleted file mode 100755
index 4d9d4892486..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/grayscale.rb
+++ /dev/null
@@ -1,135 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: grayscale.rb,v 1.3 2005/08/08 02:44:17 austin Exp $
-#++
-
- # A colour object representing shades of grey. Used primarily in PDF
- # document creation.
-class Color::GrayScale
- # The format of a DeviceGrey colour for PDF. In color-tools 2.0 this
- # will be removed from this package and added back as a modification by
- # the PDF::Writer package.
- PDF_FORMAT_STR = "%.3f %s"
-
- # Creates a greyscale colour object from fractional values 0..1.
- #
- # Color::GreyScale.from_fraction(0.5)
- def self.from_fraction(g = 0)
- color = Color::GrayScale.new
- color.g = g
- color
- end
-
- # Creates a greyscale colour object from percentages 0..100.
- #
- # Color::GrayScale.new(50)
- def initialize(g = 0)
- @g = g / 100.0
- end
-
- # Compares the other colour to this one. The other colour will be
- # converted to GreyScale before comparison, so the comparison between a
- # GreyScale colour and a non-GreyScale colour will be approximate and
- # based on the other colour's #to_greyscale conversion. If there is no
- # #to_greyscale conversion, this will raise an exception. This will
- # report that two GreyScale values are equivalent if they are within
- # 1e-4 (0.0001) of each other.
- def ==(other)
- other = other.to_grayscale
- other.kind_of?(Color::GrayScale) and
- ((@g - other.g).abs <= 1e-4)
- end
-
- # Present the colour as a DeviceGrey fill colour string for PDF. This
- # will be removed from the default package in color-tools 2.0.
- def pdf_fill
- PDF_FORMAT_STR % [ @g, "g" ]
- end
-
- # Present the colour as a DeviceGrey stroke colour string for PDF. This
- # will be removed from the default package in color-tools 2.0.
- def pdf_stroke
- PDF_FORMAT_STR % [ @g, "G" ]
- end
-
- def to_255
- [(@g * 255).round, 255].min
- end
- private :to_255
-
- # Present the colour as an HTML/CSS colour string.
- def html
- gs = "%02x" % to_255
- "##{gs * 3}"
- end
-
- # Convert the greyscale colour to CMYK.
- def to_cmyk
- k = 1.0 - @g.to_f
- Color::CMYK.from_fraction(0, 0, 0, k)
- end
-
- # Convert the greyscale colour to RGB.
- def to_rgb(ignored = true)
- g = to_255
- Color::RGB.new(g, g, g)
- end
-
- def to_grayscale
- self
- end
- alias to_greyscale to_grayscale
-
- # Lightens the greyscale colour by the stated percent.
- def lighten_by(percent)
- g = [@g + (@g * (percent / 100.0)), 1.0].min
- Color::GrayScale.from_fraction(g)
- end
-
- # Darken the RGB hue by the stated percent.
- def darken_by(percent)
- g = [@g - (@g * (percent / 100.0)), 0.0].max
- Color::GrayScale.from_fraction(g)
- end
-
- # Returns the YIQ (NTSC) colour encoding of the greyscale value. This
- # is an approximation, as the values for I and Q are calculated by
- # treating the greyscale value as an RGB value. The Y (intensity or
- # brightness) value is the same as the greyscale value.
- def to_yiq
- y = @g
- i = (@g * 0.596) + (@g * -0.275) + (@g * -0.321)
- q = (@g * 0.212) + (@g * -0.523) + (@g * 0.311)
- Color::YIQ.from_fraction(y, i, q)
- end
-
- # Returns the HSL colour encoding of the greyscale value.
- def to_hsl
- Color::HSL.from_fraction(0, 0, @g)
- end
-
- # Returns the brightness value for this greyscale value; this is the
- # greyscale value.
- def brightness
- @g
- end
-
- attr_accessor :g
- remove_method :g= ;
- def g=(gg) #:nodoc:
- gg = 1.0 if gg > 1
- gg = 0.0 if gg < 0
- @g = gg
- end
-end
-
-module Color
- # A synonym for Color::GrayScale.
- GreyScale = GrayScale
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/hsl.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/hsl.rb
deleted file mode 100755
index 05886a8d7e3..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/hsl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: hsl.rb,v 1.2 2005/08/08 02:44:17 austin Exp $
-#++
-
- # An HSL colour object. Internally, the hue (#h), saturation (#s), and
- # luminosity (#l) values are dealt with as fractional values in the range
- # 0..1.
-class Color::HSL
- class << self
- # Creates an HSL colour object from fractional values 0..1.
- def from_fraction(h = 0.0, s = 0.0, l = 0.0)
- colour = Color::HSL.new
- colour.h = h
- colour.s = s
- colour.l = l
- colour
- end
- end
-
- # Compares the other colour to this one. The other colour will be
- # converted to HSL before comparison, so the comparison between a HSL
- # colour and a non-HSL colour will be approximate and based on the other
- # colour's #to_hsl conversion. If there is no #to_hsl conversion, this
- # will raise an exception. This will report that two HSL values are
- # equivalent if all component values are within 1e-4 (0.0001) of each
- # other.
- def ==(other)
- other = other.to_hsl
- other.kind_of?(Color::HSL) and
- ((@h - other.h).abs <= 1e-4) and
- ((@s - other.s).abs <= 1e-4) and
- ((@l - other.l).abs <= 1e-4)
- end
-
- # Creates an HSL colour object from the standard values of degrees and
- # percentages (e.g., 145º, 30%, 50%).
- def initialize(h = 0, s = 0, l = 0)
- @h = h / 360.0
- @s = s / 100.0
- @l = l / 100.0
- end
-
- # Present the colour as an HTML/CSS colour string.
- def html
- to_rgb.html
- end
-
- # Converting to HSL as adapted from Foley and Van-Dam from
- # http://www.bobpowell.net/RGBHSB.htm.
- def to_rgb(ignored = nil)
- # If luminosity is zero, the colour is always black.
- return Color::RGB.new if @l == 0
- # If luminosity is one, the colour is always white.
- return Color::RGB.new(0xff, 0xff, 0xff) if @l == 1
- # If saturation is zero, the colour is always a greyscale colour.
- return Color::RGB.new(@l, @l, @l) if @s <= 1e-5
-
- if (@l - 0.5) < 1e-5
- tmp2 = @l * (1.0 + @s.to_f)
- else
- tmp2 = @l + @s - (@l * @s.to_f)
- end
- tmp1 = 2.0 * @l - tmp2
-
- t3 = [ @h + 1.0 / 3.0, @h, @h - 1.0 / 3.0 ]
- t3 = t3.map { |tmp3|
- tmp3 += 1.0 if tmp3 < 1e-5
- tmp3 -= 1.0 if (tmp3 - 1.0) > 1e-5
- tmp3
- }
-
- rgb = t3.map do |tmp3|
- if ((6.0 * tmp3) - 1.0) < 1e-5
- tmp1 + ((tmp2 - tmp1) * tmp3 * 6.0)
- elsif ((2.0 * tmp3) - 1.0) < 1e-5
- tmp2
- elsif ((3.0 * tmp3) - 2.0) < 1e-5
- tmp1 + (tmp2 - tmp1) * ((2 / 3.0) - tmp3) * 6.0
- else
- tmp1
- end
- end
-
- Color::RGB.from_fraction(*rgb)
- end
-
- # Converts to RGB then YIQ.
- def to_yiq
- to_rgb.to_yiq
- end
-
- # Converts to RGB then CMYK.
- def to_cmyk
- to_rgb.to_cmyk
- end
-
- # Returns the luminosity (#l) of the colour.
- def brightness
- @l
- end
- def to_greyscale
- Color::GrayScale.from_fraction(@l)
- end
- alias to_grayscale to_greyscale
-
- attr_accessor :h, :s, :l
- remove_method :h=, :s=, :l= ;
- def h=(hh) #:nodoc:
- hh = 1.0 if hh > 1
- hh = 0.0 if hh < 0
- @h = hh
- end
- def s=(ss) #:nodoc:
- ss = 1.0 if ss > 1
- ss = 0.0 if ss < 0
- @s = ss
- end
- def l=(ll) #:nodoc:
- ll = 1.0 if ll > 1
- ll = 0.0 if ll < 0
- @l = ll
- end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette.rb
deleted file mode 100755
index abe0b261edf..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: palette.rb,v 1.2 2005/08/05 23:07:20 austin Exp $
-#++
-
-require 'color'
-
-module Color::Palette
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette/gimp.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette/gimp.rb
deleted file mode 100755
index 1d594c0608b..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette/gimp.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: gimp.rb,v 1.3 2005/08/08 02:44:17 austin Exp $
-#++
-
-require 'color/palette'
-
- # A class that can read a GIMP (GNU Image Manipulation Program) palette
- # file and provide a Hash-like interface to the contents. GIMP colour
- # palettes are RGB values only.
- #
- # Because two or more entries in a GIMP palette may have the same name,
- # all named entries are returned as an array.
- #
- # pal = Color::Palette::Gimp.from_file(my_gimp_palette)
- # pal[0] => Color::RGB<...>
- # pal["white"] => [ Color::RGB<...> ]
- # pal["unknown"] => [ Color::RGB<...>, Color::RGB<...>, ... ]
- #
- # GIMP Palettes are always indexable by insertion order (an integer key).
-class Color::Palette::Gimp
- include Enumerable
-
- class << self
- # Create a GIMP palette object from the named file.
- def from_file(filename)
- File.open(filename, "rb") { |io| Color::Palette::Gimp.from_io(io) }
- end
-
- # Create a GIMP palette object from the provided IO.
- def from_io(io)
- Color::Palette::Gimp.new(io.read)
- end
- end
-
- # Create a new GIMP palette.
- def initialize(palette)
- @colors = []
- @names = {}
- @valid = false
- @name = "(unnamed)"
-
- index = 0
-
- palette.split($/).each do |line|
- line.chomp!
- line.gsub!(/\s*#.*\Z/, '')
-
- next if line.empty?
-
- if line =~ /\AGIMP Palette\Z/
- @valid = true
- next
- end
-
- info = /(\w+):\s(.*$)/.match(line)
- if info
- @name = info.captures[1] if info.captures[0] =~ /name/i
- next
- end
-
- line.gsub!(/^\s+/, '')
- data = line.split(/\s+/, 4)
- name = data.pop.strip
- data.map! { |el| el.to_i }
-
- color = Color::RGB.new(*data)
-
- @colors[index] = color
- @names[name] ||= []
- @names[name] << color
-
- index += 1
- end
- end
-
- def [](key)
- if key.kind_of?(Numeric)
- @colors[key]
- else
- @names[key]
- end
- end
-
- # Loops through each colour.
- def each
- @colors.each { |el| yield el }
- end
-
- # Loops through each named colour set.
- def each_name #:yields color_name, color_set:#
- @names.each { |color_name, color_set| yield color_name, color_set }
- end
-
- # Returns true if this is believed to be a valid GIMP palette.
- def valid?
- @valid
- end
-
- attr_reader :name
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette/monocontrast.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette/monocontrast.rb
deleted file mode 100755
index b2f9c616149..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/palette/monocontrast.rb
+++ /dev/null
@@ -1,180 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: monocontrast.rb,v 1.3 2005/08/08 02:44:17 austin Exp $
-#++
-
-require 'color/palette'
-
- # Generates a monochromatic constrasting colour palette for background and
- # foreground. What does this mean?
- #
- # Monochromatic: A single colour is used to generate the base palette, and
- # this colour is lightened five times and darkened five times to provide
- # eleven distinct colours.
- #
- # Contrasting: The foreground is also generated as a monochromatic colour
- # palettte; however, all generated colours are tested to see that they are
- # appropriately contrasting to ensure maximum readability of the
- # foreground against the background.
-class Color::Palette::MonoContrast
- # Hash of CSS background colour values.
- #
- # This is always 11 values:
- #
- # 0:: The starting colour.
- # +1..+5:: Lighter colours.
- # -1..-5:: Darker colours.
- attr_reader :background
- # Hash of CSS foreground colour values.
- #
- # This is always 11 values:
- #
- # 0:: The starting colour.
- # +1..+5:: Lighter colours.
- # -1..-5:: Darker colours.
- attr_reader :foreground
-
- DEFAULT_MINIMUM_BRIGHTNESS_DIFF = (125.0 / 255.0)
-
- # The minimum brightness difference between the background and the
- # foreground, and must be between 0..1. Setting this value will
- # regenerate the palette based on the base colours. The default value
- # for this is 125 / 255.0. If this value is set to +nil+, it will be
- # restored to the default.
- attr_accessor :minimum_brightness_diff
- remove_method :minimum_brightness_diff= ;
- def minimum_brightness_diff=(bd) #:nodoc:
- if bd.nil?
- @minimum_brightness_diff = DEFAULT_MINIMUM_BRIGHTNESS_DIFF
- elsif bd > 1.0
- @minimum_brightness_diff = 1.0
- elsif bd < 0.0
- @minimum_brightness_diff = 0.0
- else
- @minimum_brightness_diff = bd
- end
-
- regenerate(@background[0], @foreground[0])
- end
-
- DEFAULT_MINIMUM_COLOR_DIFF = (500.0 / 255.0)
-
- # The minimum colour difference between the background and the
- # foreground, and must be between 0..3. Setting this value will
- # regenerate the palette based on the base colours. The default value
- # for this is 500 / 255.0.
- attr_accessor :minimum_color_diff
- remove_method :minimum_color_diff= ;
- def minimum_color_diff=(cd) #:noco:
- if cd.nil?
- @minimum_color_diff = DEFAULT_MINIMUM_COLOR_DIFF
- elsif cd > 3.0
- @minimum_color_diff = 3.0
- elsif cd < 0.0
- @minimum_color_diff = 0.0
- else
- @minimum_color_diff = cd
- end
- regenerate(@background[0], @foreground[0])
- end
-
- # Generate the initial palette.
- def initialize(background, foreground = nil)
- @minimum_brightness_diff = DEFAULT_MINIMUM_BRIGHTNESS_DIFF
- @minimum_color_diff = DEFAULT_MINIMUM_COLOR_DIFF
-
- regenerate(background, foreground)
- end
-
- # Generate the colour palettes.
- def regenerate(background, foreground = nil)
- foreground ||= background
- background = background.to_rgb
- foreground = foreground.to_rgb
-
- @background = {}
- @foreground = {}
-
- @background[-5] = background.darken_by(10)
- @background[-4] = background.darken_by(25)
- @background[-3] = background.darken_by(50)
- @background[-2] = background.darken_by(75)
- @background[-1] = background.darken_by(85)
- @background[ 0] = background
- @background[+1] = background.lighten_by(85)
- @background[+2] = background.lighten_by(75)
- @background[+3] = background.lighten_by(50)
- @background[+4] = background.lighten_by(25)
- @background[+5] = background.lighten_by(10)
-
- @foreground[-5] = calculate_foreground(@background[-5], foreground)
- @foreground[-4] = calculate_foreground(@background[-4], foreground)
- @foreground[-3] = calculate_foreground(@background[-3], foreground)
- @foreground[-2] = calculate_foreground(@background[-2], foreground)
- @foreground[-1] = calculate_foreground(@background[-1], foreground)
- @foreground[ 0] = calculate_foreground(@background[ 0], foreground)
- @foreground[+1] = calculate_foreground(@background[+1], foreground)
- @foreground[+2] = calculate_foreground(@background[+2], foreground)
- @foreground[+3] = calculate_foreground(@background[+3], foreground)
- @foreground[+4] = calculate_foreground(@background[+4], foreground)
- @foreground[+5] = calculate_foreground(@background[+5], foreground)
- end
-
- # Given a background colour and a foreground colour, modifies the
- # foreground colour so that it will have enough contrast to be seen
- # against the background colour.
- #
- # Uses #mininum_brightness_diff and #minimum_color_diff.
- def calculate_foreground(background, foreground)
- nfg = nil
- # Loop through brighter and darker versions of the foreground color.
- # The numbers here represent the amount of foreground color to mix
- # with black and white.
- [100, 75, 50, 25, 0].each do |percent|
- dfg = foreground.darken_by(percent)
- lfg = foreground.lighten_by(percent)
-
- dbd = brightness_diff(background, dfg)
- lbd = brightness_diff(background, lfg)
-
- if lbd > dbd
- nfg = lfg
- nbd = lbd
- else
- nfg = dfg
- nbd = dbd
- end
-
- ncd = color_diff(background, nfg)
-
- break if nbd >= @minimum_brightness_diff and ncd >= @minimum_color_diff
- end
- nfg
- end
-
- # Returns the absolute difference between the brightness levels of two
- # colours. This will be a decimal value between 0 and 1. W3C
- # accessibility guidelines for colour
- # contrast[http://www.w3.org/TR/AERT#color-contrast] suggest that this
- # value be at least approximately 0.49 (125 / 255.0) for proper contrast.
- def brightness_diff(c1, c2)
- (c1.brightness - c2.brightness).abs
- end
-
- # Returns the contrast between to colours, a decimal value between 0 and
- # 3. W3C accessibility guidelines for colour
- # contrast[http://www.w3.org/TR/AERT#color-contrast] suggest that this
- # value be at least approximately 1.96 (500 / 255.0) for proper contrast.
- def color_diff(c1, c2)
- r = (c1.r - c2.r).abs
- g = (c1.g - c2.g).abs
- b = (c1.b - c2.b).abs
- r + g + b
- end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb-colors.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb-colors.rb
deleted file mode 100755
index 6dd281cbc5e..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb-colors.rb
+++ /dev/null
@@ -1,189 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: rgb-colors.rb,v 1.1 2005/08/05 23:07:20 austin Exp $
-#++
-
-class Color::RGB
- AliceBlue = Color::RGB.new(0xf0, 0xf8, 0xff).freeze
- AntiqueWhite = Color::RGB.new(0xfa, 0xeb, 0xd7).freeze
- Aqua = Color::RGB.new(0x00, 0xff, 0xff).freeze
- Aquamarine = Color::RGB.new(0x7f, 0xff, 0xd4).freeze
- Azure = Color::RGB.new(0xf0, 0xff, 0xff).freeze
- Beige = Color::RGB.new(0xf5, 0xf5, 0xdc).freeze
- Bisque = Color::RGB.new(0xff, 0xe4, 0xc4).freeze
- Black = Color::RGB.new(0, 0, 0).freeze
- BlanchedAlmond = Color::RGB.new(0xff, 0xeb, 0xcd).freeze
- Blue = Color::RGB.new(0x00, 0x00, 0xff).freeze
- BlueViolet = Color::RGB.new(0x8a, 0x2b, 0xe2).freeze
- Brown = Color::RGB.new(0xa5, 0x2a, 0x2a).freeze
- Burlywood = Color::RGB.new(0xde, 0xb8, 0x87).freeze
- BurlyWood = Burlywood
- CadetBlue = Color::RGB.new(0x5f, 0x9e, 0xa0).freeze
- Chartreuse = Color::RGB.new(0x7f, 0xff, 0x00).freeze
- Chocolate = Color::RGB.new(0xd2, 0x69, 0x1e).freeze
- Coral = Color::RGB.new(0xff, 0x7f, 0x50).freeze
- CornflowerBlue = Color::RGB.new(0x64, 0x95, 0xed).freeze
- Cornsilk = Color::RGB.new(0xff, 0xf8, 0xdc).freeze
- Crimson = Color::RGB.new(0xdc, 0x14, 0x3c).freeze
- Cyan = Color::RGB.new(0x00, 0xff, 0xff).freeze
- DarkBlue = Color::RGB.new(0x00, 0x00, 0x8b).freeze
- DarkCyan = Color::RGB.new(0x00, 0x8b, 0x8b).freeze
- DarkGoldenrod = Color::RGB.new(0xb8, 0x86, 0x0b).freeze
- DarkGoldenRod = DarkGoldenrod
- DarkGray = Color::RGB.new(0xa9, 0xa9, 0xa9).freeze
- DarkGreen = Color::RGB.new(0x00, 0x64, 0x00).freeze
- DarkGrey = DarkGray
- DarkKhaki = Color::RGB.new(0xbd, 0xb7, 0x6b).freeze
- DarkMagenta = Color::RGB.new(0x8b, 0x00, 0x8b).freeze
- DarkoliveGreen = Color::RGB.new(0x55, 0x6b, 0x2f).freeze
- DarkOliveGreen = DarkoliveGreen
- Darkorange = Color::RGB.new(0xff, 0x8c, 0x00).freeze
- DarkOrange = Darkorange
- DarkOrchid = Color::RGB.new(0x99, 0x32, 0xcc).freeze
- DarkRed = Color::RGB.new(0x8b, 0x00, 0x00).freeze
- Darksalmon = Color::RGB.new(0xe9, 0x96, 0x7a).freeze
- DarkSalmon = Darksalmon
- DarkSeaGreen = Color::RGB.new(0x8f, 0xbc, 0x8f).freeze
- DarkSlateBlue = Color::RGB.new(0x48, 0x3d, 0x8b).freeze
- DarkSlateGray = Color::RGB.new(0x2f, 0x4f, 0x4f).freeze
- DarkSlateGrey = DarkSlateGray
- DarkTurquoise = Color::RGB.new(0x00, 0xce, 0xd1).freeze
- DarkViolet = Color::RGB.new(0x94, 0x00, 0xd3).freeze
- DeepPink = Color::RGB.new(0xff, 0x14, 0x93).freeze
- DeepSkyBlue = Color::RGB.new(0x00, 0xbf, 0xbf).freeze
- DimGray = Color::RGB.new(0x69, 0x69, 0x69).freeze
- DimGrey = DimGray
- DodgerBlue = Color::RGB.new(0x1e, 0x90, 0xff).freeze
- Feldspar = Color::RGB.new(0xd1, 0x92, 0x75).freeze
- Firebrick = Color::RGB.new(0xb2, 0x22, 0x22).freeze
- FireBrick = Firebrick
- FloralWhite = Color::RGB.new(0xff, 0xfa, 0xf0).freeze
- ForestGreen = Color::RGB.new(0x22, 0x8b, 0x22).freeze
- Fuchsia = Color::RGB.new(0xff, 0x00, 0xff).freeze
- Gainsboro = Color::RGB.new(0xdc, 0xdc, 0xdc).freeze
- GhostWhite = Color::RGB.new(0xf8, 0xf8, 0xff).freeze
- Gold = Color::RGB.new(0xff, 0xd7, 0x00).freeze
- Goldenrod = Color::RGB.new(0xda, 0xa5, 0x20).freeze
- GoldenRod = Goldenrod
- Gray = Color::RGB.new(0x80, 0x80, 0x80).freeze
- Green = Color::RGB.new(0x00, 0x80, 0x00).freeze
- GreenYellow = Color::RGB.new(0xad, 0xff, 0x2f).freeze
- Grey = Gray
- Honeydew = Color::RGB.new(0xf0, 0xff, 0xf0).freeze
- HoneyDew = Honeydew
- HotPink = Color::RGB.new(0xff, 0x69, 0xb4).freeze
- IndianRed = Color::RGB.new(0xcd, 0x5c, 0x5c).freeze
- Indigo = Color::RGB.new(0x4b, 0x00, 0x82).freeze
- Ivory = Color::RGB.new(0xff, 0xff, 0xf0).freeze
- Khaki = Color::RGB.new(0xf0, 0xe6, 0x8c).freeze
- Lavender = Color::RGB.new(0xe6, 0xe6, 0xfa).freeze
- LavenderBlush = Color::RGB.new(0xff, 0xf0, 0xf5).freeze
- LawnGreen = Color::RGB.new(0x7c, 0xfc, 0x00).freeze
- LemonChiffon = Color::RGB.new(0xff, 0xfa, 0xcd).freeze
- LightBlue = Color::RGB.new(0xad, 0xd8, 0xe6).freeze
- LightCoral = Color::RGB.new(0xf0, 0x80, 0x80).freeze
- LightCyan = Color::RGB.new(0xe0, 0xff, 0xff).freeze
- LightGoldenrodYellow = Color::RGB.new(0xfa, 0xfa, 0xd2).freeze
- LightGoldenRodYellow = LightGoldenrodYellow
- LightGray = Color::RGB.new(0xd3, 0xd3, 0xd3).freeze
- LightGreen = Color::RGB.new(0x90, 0xee, 0x90).freeze
- LightGrey = LightGray
- LightPink = Color::RGB.new(0xff, 0xb6, 0xc1).freeze
- Lightsalmon = Color::RGB.new(0xff, 0xa0, 0x7a).freeze
- LightSalmon = Lightsalmon
- LightSeaGreen = Color::RGB.new(0x20, 0xb2, 0xaa).freeze
- LightSkyBlue = Color::RGB.new(0x87, 0xce, 0xfa).freeze
- LightSlateBlue = Color::RGB.new(0x84, 0x70, 0xff).freeze
- LightSlateGray = Color::RGB.new(0x77, 0x88, 0x99).freeze
- LightSlateGrey = LightSlateGray
- LightsteelBlue = Color::RGB.new(0xb0, 0xc4, 0xde).freeze
- LightSteelBlue = LightsteelBlue
- LightYellow = Color::RGB.new(0xff, 0xff, 0xe0).freeze
- Lime = Color::RGB.new(0x00, 0xff, 0x00).freeze
- LimeGreen = Color::RGB.new(0x32, 0xcd, 0x32).freeze
- Linen = Color::RGB.new(0xfa, 0xf0, 0xe6).freeze
- Magenta = Color::RGB.new(0xff, 0x00, 0xff).freeze
- Maroon = Color::RGB.new(0x80, 0x00, 0x00).freeze
- MediumAquamarine = Color::RGB.new(0x66, 0xcd, 0xaa).freeze
- MediumAquaMarine = MediumAquamarine
- MediumBlue = Color::RGB.new(0x00, 0x00, 0xcd).freeze
- MediumOrchid = Color::RGB.new(0xba, 0x55, 0xd3).freeze
- MediumPurple = Color::RGB.new(0x93, 0x70, 0xdb).freeze
- MediumSeaGreen = Color::RGB.new(0x3c, 0xb3, 0x71).freeze
- MediumSlateBlue = Color::RGB.new(0x7b, 0x68, 0xee).freeze
- MediumSpringGreen = Color::RGB.new(0x00, 0xfa, 0x9a).freeze
- MediumTurquoise = Color::RGB.new(0x48, 0xd1, 0xcc).freeze
- MediumVioletRed = Color::RGB.new(0xc7, 0x15, 0x85).freeze
- MidnightBlue = Color::RGB.new(0x19, 0x19, 0x70).freeze
- MintCream = Color::RGB.new(0xf5, 0xff, 0xfa).freeze
- MistyRose = Color::RGB.new(0xff, 0xe4, 0xe1).freeze
- Moccasin = Color::RGB.new(0xff, 0xe4, 0xb5).freeze
- NavajoWhite = Color::RGB.new(0xff, 0xde, 0xad).freeze
- Navy = Color::RGB.new(0x00, 0x00, 0x80).freeze
- OldLace = Color::RGB.new(0xfd, 0xf5, 0xe6).freeze
- Olive = Color::RGB.new(0x80, 0x80, 0x00).freeze
- Olivedrab = Color::RGB.new(0x6b, 0x8e, 0x23).freeze
- OliveDrab = Olivedrab
- Orange = Color::RGB.new(0xff, 0xa5, 0x00).freeze
- OrangeRed = Color::RGB.new(0xff, 0x45, 0x00).freeze
- Orchid = Color::RGB.new(0xda, 0x70, 0xd6).freeze
- PaleGoldenrod = Color::RGB.new(0xee, 0xe8, 0xaa).freeze
- PaleGoldenRod = PaleGoldenrod
- PaleGreen = Color::RGB.new(0x98, 0xfb, 0x98).freeze
- PaleTurquoise = Color::RGB.new(0xaf, 0xee, 0xee).freeze
- PaleVioletRed = Color::RGB.new(0xdb, 0x70, 0x93).freeze
- PapayaWhip = Color::RGB.new(0xff, 0xef, 0xd5).freeze
- Peachpuff = Color::RGB.new(0xff, 0xda, 0xb9).freeze
- PeachPuff = Peachpuff
- Peru = Color::RGB.new(0xcd, 0x85, 0x3f).freeze
- Pink = Color::RGB.new(0xff, 0xc0, 0xcb).freeze
- Plum = Color::RGB.new(0xdd, 0xa0, 0xdd).freeze
- PowderBlue = Color::RGB.new(0xb0, 0xe0, 0xe6).freeze
- Purple = Color::RGB.new(0x80, 0x00, 0x80).freeze
- Red = Color::RGB.new(0xff, 0x00, 0x00).freeze
- RosyBrown = Color::RGB.new(0xbc, 0x8f, 0x8f).freeze
- RoyalBlue = Color::RGB.new(0x41, 0x69, 0xe1).freeze
- SaddleBrown = Color::RGB.new(0x8b, 0x45, 0x13).freeze
- Salmon = Color::RGB.new(0xfa, 0x80, 0x72).freeze
- SandyBrown = Color::RGB.new(0xf4, 0xa4, 0x60).freeze
- SeaGreen = Color::RGB.new(0x2e, 0x8b, 0x57).freeze
- Seashell = Color::RGB.new(0xff, 0xf5, 0xee).freeze
- SeaShell = Seashell
- Sienna = Color::RGB.new(0xa0, 0x52, 0x2d).freeze
- Silver = Color::RGB.new(0xc0, 0xc0, 0xc0).freeze
- SkyBlue = Color::RGB.new(0x87, 0xce, 0xeb).freeze
- SlateBlue = Color::RGB.new(0x6a, 0x5a, 0xcd).freeze
- SlateGray = Color::RGB.new(0x70, 0x80, 0x90).freeze
- SlateGrey = SlateGray
- Snow = Color::RGB.new(0xff, 0xfa, 0xfa).freeze
- SpringGreen = Color::RGB.new(0x00, 0xff, 0x7f).freeze
- SteelBlue = Color::RGB.new(0x46, 0x82, 0xb4).freeze
- Tan = Color::RGB.new(0xd2, 0xb4, 0x8c).freeze
- Teal = Color::RGB.new(0x00, 0x80, 0x80).freeze
- Thistle = Color::RGB.new(0xd8, 0xbf, 0xd8).freeze
- Tomato = Color::RGB.new(0xff, 0x63, 0x47).freeze
- Turquoise = Color::RGB.new(0x40, 0xe0, 0xd0).freeze
- Violet = Color::RGB.new(0xee, 0x82, 0xee).freeze
- VioletRed = Color::RGB.new(0xd0, 0x20, 0x90).freeze
- Wheat = Color::RGB.new(0xf5, 0xde, 0xb3).freeze
- White = Color::RGB.new(0xff, 0xff, 0xff).freeze
- WhiteSmoke = Color::RGB.new(0xf5, 0xf5, 0xf5).freeze
- Yellow = Color::RGB.new(0xff, 0xff, 0x00).freeze
- YellowGreen = Color::RGB.new(0x9a, 0xcd, 0x32).freeze
-
- Gray10 = Grey10 = Color::RGB.from_percentage(10, 10, 10).freeze
- Gray20 = Grey20 = Color::RGB.from_percentage(20, 20, 20).freeze
- Gray30 = Grey30 = Color::RGB.from_percentage(30, 30, 30).freeze
- Gray40 = Grey40 = Color::RGB.from_percentage(40, 40, 40).freeze
- Gray50 = Grey50 = Color::RGB.from_percentage(50, 50, 50).freeze
- Gray60 = Grey60 = Color::RGB.from_percentage(60, 60, 60).freeze
- Gray70 = Grey70 = Color::RGB.from_percentage(70, 70, 70).freeze
- Gray80 = Grey80 = Color::RGB.from_percentage(80, 80, 80).freeze
- Gray90 = Grey90 = Color::RGB.from_percentage(90, 90, 90).freeze
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb.rb
deleted file mode 100755
index 98de0d768e0..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb.rb
+++ /dev/null
@@ -1,311 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: rgb.rb,v 1.6 2005/08/08 02:44:17 austin Exp $
-#++
-
- # An RGB colour object.
-class Color::RGB
- # The format of a DeviceRGB colour for PDF. In color-tools 2.0 this will
- # be removed from this package and added back as a modification by the
- # PDF::Writer package.
- PDF_FORMAT_STR = "%.3f %.3f %.3f %s"
-
- class << self
- # Creates an RGB colour object from percentages 0..100.
- #
- # Color::RGB.from_percentage(10, 20 30)
- def from_percentage(r = 0, g = 0, b = 0)
- from_fraction(r / 100.0, g / 100.0, b / 100.0)
- end
-
- # Creates an RGB colour object from fractional values 0..1.
- #
- # Color::RGB.from_fraction(.3, .2, .1)
- def from_fraction(r = 0.0, g = 0.0, b = 0.0)
- colour = Color::RGB.new
- colour.r = r
- colour.g = g
- colour.b = b
- colour
- end
-
- # Creates an RGB colour object from an HTML colour descriptor (e.g.,
- # <tt>"fed"</tt> or <tt>"#cabbed;"</tt>.
- #
- # Color::RGB.from_html("fed")
- # Color::RGB.from_html("#fed")
- # Color::RGB.from_html("#cabbed")
- # Color::RGB.from_html("cabbed")
- def from_html(html_colour)
- html_colour = html_colour.gsub(%r{[#;]}, '')
- case html_colour.size
- when 3
- colours = html_colour.scan(%r{[0-9A-Fa-f]}).map { |el| (el * 2).to_i(16) }
- when 6
- colours = html_colour.scan(%r<[0-9A-Fa-f]{2}>).map { |el| el.to_i(16) }
- else
- raise ArgumentError
- end
-
- Color::RGB.new(*colours)
- end
- end
-
- # Compares the other colour to this one. The other colour will be
- # converted to RGB before comparison, so the comparison between a RGB
- # colour and a non-RGB colour will be approximate and based on the other
- # colour's default #to_rgb conversion. If there is no #to_rgb
- # conversion, this will raise an exception. This will report that two
- # RGB colours are equivalent if all component values are within 1e-4
- # (0.0001) of each other.
- def ==(other)
- other = other.to_rgb
- other.kind_of?(Color::RGB) and
- ((@r - other.r).abs <= 1e-4) and
- ((@g - other.g).abs <= 1e-4) and
- ((@b - other.b).abs <= 1e-4)
- end
-
- # Creates an RGB colour object from the standard range 0..255.
- #
- # Color::RGB.new(32, 64, 128)
- # Color::RGB.new(0x20, 0x40, 0x80)
- def initialize(r = 0, g = 0, b = 0)
- @r = r / 255.0
- @g = g / 255.0
- @b = b / 255.0
- end
-
- # Present the colour as a DeviceRGB fill colour string for PDF. This
- # will be removed from the default package in color-tools 2.0.
- def pdf_fill
- PDF_FORMAT_STR % [ @r, @g, @b, "rg" ]
- end
-
- # Present the colour as a DeviceRGB stroke colour string for PDF. This
- # will be removed from the default package in color-tools 2.0.
- def pdf_stroke
- PDF_FORMAT_STR % [ @r, @g, @b, "RG" ]
- end
-
- # Present the colour as an HTML/CSS colour string.
- def html
- r = (@r * 255).round
- r = 255 if r > 255
-
- g = (@g * 255).round
- g = 255 if g > 255
-
- b = (@b * 255).round
- b = 255 if b > 255
-
- "#%02x%02x%02x" % [ r, g, b ]
- end
-
- # Converts the RGB colour to CMYK. Most colour experts strongly suggest
- # that this is not a good idea (some even suggesting that it's a very
- # bad idea). CMYK represents additive percentages of inks on white
- # paper, whereas RGB represents mixed colour intensities on a black
- # screen.
- #
- # However, the colour conversion can be done. The basic method is
- # multi-step:
- #
- # 1. Convert the R, G, and B components to C, M, and Y components.
- # c = 1.0 – r
- # m = 1.0 – g
- # y = 1.0 – b
- # 2. Compute the minimum amount of black (K) required to smooth the
- # colour in inks.
- # k = min(c, m, y)
- # 3. Perform undercolour removal on the C, M, and Y components of the
- # colours because less of each colour is needed for each bit of
- # black. Also, regenerate the black (K) based on the undercolour
- # removal so that the colour is more accurately represented in ink.
- # c = min(1.0, max(0.0, c – UCR(k)))
- # m = min(1.0, max(0.0, m – UCR(k)))
- # y = min(1.0, max(0.0, y – UCR(k)))
- # k = min(1.0, max(0.0, BG(k)))
- #
- # The undercolour removal function and the black generation functions
- # return a value based on the brightness of the RGB colour.
- def to_cmyk
- c = 1.0 - @r.to_f
- m = 1.0 - @g.to_f
- y = 1.0 - @b.to_f
-
- k = [c, m, y].min
- k = k - (k * brightness)
-
- c = [1.0, [0.0, c - k].max].min
- m = [1.0, [0.0, m - k].max].min
- y = [1.0, [0.0, y - k].max].min
- k = [1.0, [0.0, k].max].min
-
- Color::CMYK.from_fraction(c, m, y, k)
- end
-
- def to_rgb(ignored = nil)
- self
- end
-
- # Returns the YIQ (NTSC) colour encoding of the RGB value.
- def to_yiq
- y = (@r * 0.299) + (@g * 0.587) + (@b * 0.114)
- i = (@r * 0.596) + (@g * -0.275) + (@b * -0.321)
- q = (@r * 0.212) + (@g * -0.523) + (@b * 0.311)
- Color::YIQ.from_fraction(y, i, q)
- end
-
- # Returns the HSL colour encoding of the RGB value.
- def to_hsl
- min = [ @r, @g, @b ].min
- max = [ @r, @g, @b ].max
- delta = (max - min).to_f
-
- lum = (max + min) / 2.0
-
- if delta <= 1e-5 # close to 0.0, so it's a grey
- hue = 0
- sat = 0
- else
- if (lum - 0.5) <= 1e-5
- sat = delta / (max + min).to_f
- else
- sat = delta / (2 - max - min).to_f
- end
-
- if @r == max
- hue = (@g - @b) / delta.to_f
- elsif @g == max
- hue = (2.0 + @b - @r) / delta.to_f
- elsif (@b - max) <= 1e-5
- hue = (4.0 + @r - @g) / delta.to_f
- end
- hue /= 6.0
-
- hue += 1 if hue < 0
- hue -= 1 if hue > 1
- end
- Color::HSL.from_fraction(hue, sat, lum)
- end
-
- # Mix the RGB hue with White so that the RGB hue is the specified
- # percentage of the resulting colour. Strictly speaking, this isn't a
- # darken_by operation.
- def lighten_by(percent)
- mix_with(White, percent)
- end
-
- # Mix the RGB hue with Black so that the RGB hue is the specified
- # percentage of the resulting colour. Strictly speaking, this isn't a
- # darken_by operation.
- def darken_by(percent)
- mix_with(Black, percent)
- end
-
- # Mix the mask colour (which must be an RGB object) with the current
- # colour at the stated opacity percentage (0..100).
- def mix_with(mask, opacity)
- opacity /= 100.0
- rgb = self.dup
-
- rgb.r = (@r * opacity) + (mask.r * (1 - opacity))
- rgb.g = (@g * opacity) + (mask.g * (1 - opacity))
- rgb.b = (@b * opacity) + (mask.b * (1 - opacity))
-
- rgb
- end
-
- # Returns the brightness value for a colour, a number between 0..1.
- # Based on the Y value of YIQ encoding, representing luminosity, or
- # perceived brightness.
- #
- # This may be modified in a future version of color-tools to use the
- # luminosity value of HSL.
- def brightness
- to_yiq.y
- end
- def to_grayscale
- Color::GrayScale.from_fraction(to_hsl.l)
- end
-
- alias to_greyscale to_grayscale
-
- # Returns a new colour with the brightness adjusted by the specified
- # percentage. Negative percentages will darken the colour; positive
- # percentages will brighten the colour.
- #
- # Color::RGB::DarkBlue.adjust_brightness(10)
- # Color::RGB::DarkBlue.adjust_brightness(-10)
- def adjust_brightness(percent)
- percent /= 100.0
- percent += 1.0
- percent = [ percent, 2.0 ].min
- percent = [ 0.0, percent ].max
-
- hsl = to_hsl
- hsl.l *= percent
- hsl.to_rgb
- end
-
- # Returns a new colour with the saturation adjusted by the specified
- # percentage. Negative percentages will reduce the saturation; positive
- # percentages will increase the saturation.
- #
- # Color::RGB::DarkBlue.adjust_saturation(10)
- # Color::RGB::DarkBlue.adjust_saturation(-10)
- def adjust_saturation(percent)
- percent /= 100.0
- percent += 1.0
- percent = [ percent, 2.0 ].min
- percent = [ 0.0, percent ].max
-
- hsl = to_hsl
- hsl.s *= percent
- hsl.to_rgb
- end
-
- # Returns a new colour with the hue adjusted by the specified
- # percentage. Negative percentages will reduce the hue; positive
- # percentages will increase the hue.
- #
- # Color::RGB::DarkBlue.adjust_hue(10)
- # Color::RGB::DarkBlue.adjust_hue(-10)
- def adjust_hue(percent)
- percent /= 100.0
- percent += 1.0
- percent = [ percent, 2.0 ].min
- percent = [ 0.0, percent ].max
-
- hsl = to_hsl
- hsl.h *= percent
- hsl.to_rgb
- end
-
- attr_accessor :r, :g, :b
- remove_method :r=, :g=, :b= ;
- def r=(rr) #:nodoc:
- rr = 1.0 if rr > 1
- rr = 0.0 if rr < 0
- @r = rr
- end
- def g=(gg) #:nodoc:
- gg = 1.0 if gg > 1
- gg = 0.0 if gg < 0
- @g = gg
- end
- def b=(bb) #:nodoc:
- bb = 1.0 if bb > 1
- bb = 0.0 if bb < 0
- @b = bb
- end
-end
-
-require 'color/rgb-colors'
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb/metallic.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb/metallic.rb
deleted file mode 100755
index caf1d01dd4f..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/rgb/metallic.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: metallic.rb,v 1.1 2005/08/05 23:07:20 austin Exp $
-#++
-
- # This namespace contains some RGB metallic colours suggested by Jim Freeze.
-module Color::RGB::Metallic
- Aluminum = Color::RGB.new(0x99, 0x99, 0x99)
- CoolCopper = Color::RGB.new(0xd9, 0x87, 0x19)
- Copper = Color::RGB.new(0xb8, 0x73, 0x33)
- Iron = Color::RGB.new(0x4c, 0x4c, 0x4c)
- Lead = Color::RGB.new(0x19, 0x19, 0x19)
- Magnesium = Color::RGB.new(0xb3, 0xb3, 0xb3)
- Mercury = Color::RGB.new(0xe6, 0xe6, 0xe6)
- Nickel = Color::RGB.new(0x80, 0x80, 0x80)
- PolySilicon = Color::RGB.new(0x60, 0x00, 0x00)
- Poly = PolySilicon
- Silver = Color::RGB.new(0xcc, 0xcc, 0xcc)
- Steel = Color::RGB.new(0x66, 0x66, 0x66)
- Tin = Color::RGB.new(0x7f, 0x7f, 0x7f)
- Tungsten = Color::RGB.new(0x33, 0x33, 0x33)
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/yiq.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/yiq.rb
deleted file mode 100755
index deab573185c..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/color-tools-1.3.0/lib/color/yiq.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-#--
-# Colour management with Ruby.
-#
-# Copyright 2005 Austin Ziegler
-# http://rubyforge.org/ruby-pdf/
-#
-# Licensed under a MIT-style licence.
-#
-# $Id: yiq.rb,v 1.3 2005/08/08 02:44:17 austin Exp $
-#++
-
- # A colour object representing YIQ (NTSC) colour encoding.
-class Color::YIQ
- # Creates a YIQ colour object from fractional values 0 .. 1.
- #
- # Color::YIQ.new(0.3, 0.2, 0.1)
- def self.from_fraction(y = 0, i = 0, q = 0)
- color = Color::YIQ.new
- color.y = y
- color.i = i
- color.q = q
- color
- end
-
- # Creates a YIQ colour object from percentages 0 .. 100.
- #
- # Color::YIQ.new(10, 20, 30)
- def initialize(y = 0, i = 0, q = 0)
- @y = y / 100.0
- @i = i / 100.0
- @q = q / 100.0
- end
-
- # Compares the other colour to this one. The other colour will be
- # converted to YIQ before comparison, so the comparison between a YIQ
- # colour and a non-YIQ colour will be approximate and based on the other
- # colour's #to_yiq conversion. If there is no #to_yiq conversion, this
- # will raise an exception. This will report that two YIQ values are
- # equivalent if all component colours are within 1e-4 (0.0001) of each
- # other.
- def ==(other)
- other = other.to_yiq
- other.kind_of?(Color::YIQ) and
- ((@y - other.y).abs <= 1e-4) and
- ((@i - other.i).abs <= 1e-4) and
- ((@q - other.q).abs <= 1e-4)
- end
-
- def to_yiq
- self
- end
-
- def brightness
- @y
- end
- def to_grayscale
- Color::GrayScale.new(@y)
- end
- alias to_greyscale to_grayscale
-
- attr_accessor :y, :i, :q
- remove_method :y=, :i=, :q=
- def y=(yy) #:nodoc:
- yy = 1.0 if yy > 1
- yy = 0.0 if yy < 0
- @y = yy
- end
- def i=(ii) #:nodoc:
- ii = 1.0 if ii > 1
- ii = 0.0 if ii < 0
- @i = ii
- end
- def q=(qq) #:nodoc:
- qq = 1.0 if qq > 1
- qq = 0.0 if qq < 0
- @q = qq
- end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/specifications/color-tools-1.3.0.gemspec b/server/sonar-web/src/main/webapp/WEB-INF/gems/specifications/color-tools-1.3.0.gemspec
deleted file mode 100644
index c99bc8f9b49..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/gems/specifications/color-tools-1.3.0.gemspec
+++ /dev/null
@@ -1,32 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = "color-tools"
- s.version = "1.3.0"
-
- s.required_rubygems_version = nil if s.respond_to? :required_rubygems_version=
- s.authors = ["Austin Ziegler"]
- s.autorequire = "color"
- s.cert_chain = nil
- s.date = "2005-08-07"
- s.description = "color-tools is a Ruby library to provide RGB, CMYK, and other colourspace support to applications that require it. It also provides 152 named RGB colours. It offers 152 named RGB colours (184 with spelling variations) that are commonly supported and used in HTML, SVG, and X11 applications. A technique for generating a monochromatic contrasting palette is also included."
- s.email = "austin@rubyforge.org"
- s.extra_rdoc_files = ["README", "Install", "Changelog"]
- s.files = ["README", "Install", "Changelog"]
- s.homepage = "http://rubyforge.org/projects/ruby-pdf"
- s.rdoc_options = ["--title", "color-tools", "--main", "README", "--line-numbers"]
- s.require_paths = ["lib"]
- s.required_ruby_version = Gem::Requirement.new("> 0.0.0")
- s.rubyforge_project = "ruby-pdf"
- s.rubygems_version = "1.8.23"
- s.summary = "color-tools provides colour space definition and manpiulation as well as commonly named RGB colours."
-
- if s.respond_to? :specification_version then
- s.specification_version = 1
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- else
- end
- else
- end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/lib/database_version.rb b/server/sonar-web/src/main/webapp/WEB-INF/lib/database_version.rb
index bb9e17f3fb1..1267b9d093a 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/lib/database_version.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/lib/database_version.rb
@@ -17,38 +17,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-
class DatabaseVersion
- class DeprecatedSchemaInfo < ActiveRecord::Base
- set_table_name 'schema_info'
- end
-
- def self.current_version
- begin
- result=ActiveRecord::Migrator.current_version
- rescue
- result=0
- end
-
- if result==0
- begin
- result=DeprecatedSchemaInfo.find(:first).version
- rescue
- end
- end
- result
- end
-
- def self.target_version
- files = Dir["#{migrations_path}/[0-9]*_*.rb"].sort
- files.last.scan(/([0-9]+)_[_a-z0-9]*.rb/).first[0].to_i
- end
-
- def self.migrations_path
- File.dirname(__FILE__).to_s + "/../db/migrate/"
- end
-
$uptodate = false
def self.uptodate?
@@ -58,32 +28,4 @@ class DatabaseVersion
$uptodate
end
- def self.upgrade
- ActiveRecord::Migrator.migrate(migrations_path)
- end
-
- def self.upgrade_and_start
- Java::OrgSonarServerPlatform::Platform.getInstance().upgradeDb()
- Java::OrgSonarServerPlatform::Platform.getInstance().doStart()
- load_java_web_services
- end
-
- def self.load_java_web_services
- ActionController::Routing::Routes.add_java_ws_routes
- end
-
- def self.connected?
- ActiveRecord::Base.connected?
- end
-
- def self.dialect
- ::Java::OrgSonarServerUi::JRubyFacade.getInstance().getDatabase().getDialect().getActiveRecordDialectCode()
- end
-
- def self.production?
- @@production ||=
- begin
- dialect()!='.h2.'
- end
- end
end