refactor: renamed class Page to PageLayout

pull/6827/head
Jens Ulferts 14 years ago
parent cfc74802cc
commit ca0e0e06df
  1. 2
      app/helpers/rb_master_backlogs_helper.rb
  2. 2
      features/step_definitions/_given_steps.rb
  3. 2
      lib/taskboard_card/document.rb
  4. 20
      lib/taskboard_card/page_layout.rb
  5. 6
      lib/tasks/install.rake

@ -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',

@ -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

@ -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!

@ -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}'"

@ -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"

Loading…
Cancel
Save