diff --git a/app/helpers/rb_master_backlogs_helper.rb b/app/helpers/rb_master_backlogs_helper.rb index 8576aeb3a3..39f4431ed9 100644 --- a/app/helpers/rb_master_backlogs_helper.rb +++ b/app/helpers/rb_master_backlogs_helper.rb @@ -47,7 +47,7 @@ module RbMasterBacklogsHelper :project_id => @project, :sprint_id => backlog.sprint) - if TaskboardCard::Page.selected_label.present? + if TaskboardCard::PageLayout.selected_label.present? items[:cards] = link_to(l(:label_sprint_cards), :controller => 'rb_stories', :action => 'index', diff --git a/features/step_definitions/_given_steps.rb b/features/step_definitions/_given_steps.rb index 268e7628bd..34c59178c0 100644 --- a/features/step_definitions/_given_steps.rb +++ b/features/step_definitions/_given_steps.rb @@ -259,7 +259,7 @@ Given /^I have selected card label stock (.+)$/ do |stock| # to get the ones, shipped with the plugin or # rake redmine:backlogs:current_labels # to get current one, downloaded from the internetz. - Cards::TaskboardCards.should be_available + TaskboardCard::PageLayout.should be_available end Given /^I have set my API access key$/ do diff --git a/lib/taskboard_card/document.rb b/lib/taskboard_card/document.rb index 714b08fef5..e895e2e0f3 100644 --- a/lib/taskboard_card/document.rb +++ b/lib/taskboard_card/document.rb @@ -25,7 +25,7 @@ module TaskboardCard set_language_if_valid lang raise "No label stock selected" unless Setting.plugin_redmine_backlogs[:card_spec] - label = Page.selected_label + label = PageLayout.selected_label raise "Label stock \"#{Setting.plugin_redmine_backlogs[:card_spec]}\" not found" unless label label['papersize'].upcase! diff --git a/lib/taskboard_card/page.rb b/lib/taskboard_card/page_layout.rb similarity index 87% rename from lib/taskboard_card/page.rb rename to lib/taskboard_card/page_layout.rb index df8e42f35e..0849042a57 100644 --- a/lib/taskboard_card/page.rb +++ b/lib/taskboard_card/page_layout.rb @@ -7,7 +7,7 @@ require 'uri/common' require 'prawn' module TaskboardCard - class Page + class PageLayout unloadable include TaskboardCard::Measurement @@ -94,15 +94,15 @@ module TaskboardCard geom.elements.each('Layout') do |layout| label = { - 'inner_margin' => Page.measurement(margin), + 'inner_margin' => PageLayout.measurement(margin), 'across' => Integer(layout.attributes['nx']), 'down' => Integer(layout.attributes['ny']), - 'top_margin' => Page.measurement(layout.attributes['y0']), - 'height' => Page.measurement(geom.attributes['height']), - 'horizontal_pitch' => Page.measurement(layout.attributes['dx']), - 'left_margin' => Page.measurement(layout.attributes['x0']), - 'width' => Page.measurement(geom.attributes['width']), - 'vertical_pitch' => Page.measurement(layout.attributes['dy']), + 'top_margin' => PageLayout.measurement(layout.attributes['y0']), + 'height' => PageLayout.measurement(geom.attributes['height']), + 'horizontal_pitch' => PageLayout.measurement(layout.attributes['dx']), + 'left_margin' => PageLayout.measurement(layout.attributes['x0']), + 'width' => PageLayout.measurement(geom.attributes['width']), + 'vertical_pitch' => PageLayout.measurement(layout.attributes['dy']), 'papersize' => papersize, 'source' => 'glabel' } @@ -113,7 +113,7 @@ module TaskboardCard key = "#{specs.attributes['brand']} #{specs.attributes['part']}" - if Page.malformed?(label) + if PageLayout.malformed?(label) puts "Skipping malformed label '#{key}' from #{filename}" malformed_labels[key] = label else @@ -134,7 +134,7 @@ module TaskboardCard YAML.dump(malformed_labels, dump) end - if Setting.plugin_redmine_backlogs[:card_spec] && ! Page.selected_label && LABELS.size != 0 + if Setting.plugin_redmine_backlogs[:card_spec] && ! PageLayout.selected_label && LABELS.size != 0 # current label non-existant label = LABELS.keys[0] puts "Non-existant label stock '#{Setting.plugin_redmine_backlogs[:card_spec]}' selected, replacing with random '#{label}'" diff --git a/lib/tasks/install.rake b/lib/tasks/install.rake index 289d90aa0c..ac2e647f16 100644 --- a/lib/tasks/install.rake +++ b/lib/tasks/install.rake @@ -5,13 +5,13 @@ namespace :redmine do desc "Install default label definitions" task :default_labels => :environment do - FileUtils.cp(TaskboardCard::Page::LABELS_FILE_NAME + '.default', - TaskboardCard::Page::LABELS_FILE_NAME) + FileUtils.cp(TaskboardCard::PageLayout::LABELS_FILE_NAME + '.default', + TaskboardCard::PageLayout::LABELS_FILE_NAME) end desc "Install current label definitions git.gnome.org" task :current_labels => :environment do - TaskboardCard::Page.fetch_labels + TaskboardCard::PageLayout.fetch_labels end desc "Install and configure Redmine Backlogs"