Rubocop: Using single-quotes properly

This commit is contained in:
Andy Meneely
2014-10-29 12:04:33 -04:00
parent 37fd4e7733
commit e115135d51
23 changed files with 2466 additions and 110 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ module Squib
(s.first_row+1).upto(s.last_row) do |row|
cell = s.cell(row,col)
# Roo hack for avoiding unnecessary .0's on whole integers
cell = s.excelx_value(row,col) if s.excelx_type(row,col) == [:numeric_or_formula, "General"]
cell = s.excelx_value(row,col) if s.excelx_type(row,col) == [:numeric_or_formula, 'General']
data[header] << cell
end#row
end#col
+2 -2
View File
@@ -20,7 +20,7 @@ module Squib
def png(opts = {})
opts = needs(opts, [:range, :files, :x, :y, :alpha, :layout, :blend])
Dir.chdir(@img_dir) do
@progress_bar.start("Loading PNG(s)", opts[:range].size) do |bar|
@progress_bar.start('Loading PNG(s)', opts[:range].size) do |bar|
opts[:range].each do |i|
@cards[i].png(opts[:file][i], opts[:x][i], opts[:y][i], opts[:alpha][i], opts[:blend][i])
bar.increment
@@ -51,7 +51,7 @@ module Squib
def svg(opts = {})
p = needs(opts,[:range, :files, :svgid, :force_svgid, :x, :y, :width, :height, :layout, :alpha, :blend])
Dir.chdir(@img_dir) do
@progress_bar.start("Loading SVG(s)", p[:range].size) do |bar|
@progress_bar.start('Loading SVG(s)', p[:range].size) do |bar|
p[:range].each do |i|
unless p[:force_id][i] && p[:id][i].to_s.empty?
@cards[i].svg(p[:file][i], p[:id][i], p[:x][i], p[:y][i],
+1 -1
View File
@@ -6,7 +6,7 @@ module Squib
# @example
# inches(2.5) # 750 (for default Deck::dpi of 300)
#
# @param [Decimal] n, the number of inches
# @param n [Decimal], the number of inches
# @return [Decimal] the number of pixels, according to the deck's DPI
# @api public
def inches(n)
+1 -1
View File
@@ -26,7 +26,7 @@ module Squib
def process(args)
raise ArgumentError.new('Please specify a path.') if args.empty?
new_project_path = File.expand_path(args.join(" "), Dir.pwd)
new_project_path = File.expand_path(args.join(' '), Dir.pwd)
template_path = File.expand_path('../project_template', File.dirname(__FILE__))
FileUtils.mkdir_p new_project_path
+2 -2
View File
@@ -9,7 +9,7 @@ module Squib
:blend => :none,
:color => :black,
:default_font => 'Arial 36',
:dir => "_output",
:dir => '_output',
:ellipsize => :end,
:fill_color => '#0000',
:force_id => false,
@@ -23,7 +23,7 @@ module Squib
:justify => false,
:margin => 75,
:markup => false,
:prefix => "card_",
:prefix => 'card_',
:progress_bar => false,
:range => :all,
:rotate => false,
+3 -3
View File
@@ -42,7 +42,7 @@ module Squib
# @example
# require 'squib'
# Squib::Deck.new do
# text str: 'Hello, World!'
# text str: 'Hello, World!"
# end
#
# @param width [Integer] the width of each card in pixels
@@ -126,9 +126,9 @@ module Squib
parent_keys.each do |parent_key|
from_extends = yml[key].merge(recurse_extends(yml, parent_key, visited)) do |key, child_val, parent_val|
if child_val.to_s.strip.start_with?('+=')
parent_val + child_val.sub("+=",'').strip.to_f
parent_val + child_val.sub('+=','').strip.to_f
elsif child_val.to_s.strip.start_with?('-=')
parent_val - child_val.sub("-=",'').strip.to_f
parent_val - child_val.sub('-=','').strip.to_f
else
child_val #child overrides parent when merging, no +=
end
+1 -1
View File
@@ -23,7 +23,7 @@ module Squib
@enabled = enabled
end
def start(title="", total=100, &block)
def start(title='', total=100, &block)
if @enabled
@bar = ProgressBar.create(title: title, total: total, format: '%t <%B> %p%% %a')
yield(@bar)
+1 -1
View File
@@ -1,6 +1,6 @@
require 'squib'
Squib::Deck.new(cards: 3, layout: 'layout.yml') do
text str: "Hello, World!"
text str: 'Hello, World!'
save format: :png
end
+1 -1
View File
@@ -6,5 +6,5 @@ module Squib
# Most of the time this is in the alpha of the next release.
# e.g. v0.0.5a is on its way to becoming v0.0.5
#
VERSION = "0.0.5a"
VERSION = '0.0.5a'
end