Browse Source

Switch to require_relative

Helps with debugging code without reloading the entire gem

Fixes #130
dev
Andy Meneely 10 years ago
parent
commit
cbe013323d
  1. 5
      CHANGELOG.md
  2. 8
      lib/squib.rb
  3. 3
      lib/squib/api/background.rb
  4. 4
      lib/squib/api/data.rb
  5. 12
      lib/squib/api/image.rb
  6. 10
      lib/squib/api/save.rb
  7. 10
      lib/squib/api/shapes.rb
  8. 12
      lib/squib/api/text.rb
  9. 14
      lib/squib/api/text_embed.rb
  10. 2
      lib/squib/api/units.rb
  11. 4
      lib/squib/args/arg_loader.rb
  12. 4
      lib/squib/args/box.rb
  13. 4
      lib/squib/args/coords.rb
  14. 4
      lib/squib/args/draw.rb
  15. 2
      lib/squib/args/embed_adjust.rb
  16. 2
      lib/squib/args/embed_key.rb
  17. 4
      lib/squib/args/import.rb
  18. 2
      lib/squib/args/input_file.rb
  19. 6
      lib/squib/args/paint.rb
  20. 4
      lib/squib/args/paragraph.rb
  21. 4
      lib/squib/args/save_batch.rb
  22. 2
      lib/squib/args/scale_box.rb
  23. 6
      lib/squib/args/sheet.rb
  24. 4
      lib/squib/args/showcase_special.rb
  25. 2
      lib/squib/args/svg_special.rb
  26. 4
      lib/squib/args/transform.rb
  27. 5
      lib/squib/args/typographer.rb
  28. 4
      lib/squib/args/unit_conversion.rb
  29. 16
      lib/squib/card.rb
  30. 3
      lib/squib/conf.rb
  31. 34
      lib/squib/deck.rb
  32. 2
      lib/squib/graphics/cairo_context_wrapper.rb
  33. 2
      lib/squib/graphics/hand.rb
  34. 2
      lib/squib/graphics/showcase.rb
  35. 2
      lib/squib/graphics/text.rb

5
CHANGELOG.md

@ -1,6 +1,11 @@
# Squib CHANGELOG # Squib CHANGELOG
Squib follows [semantic versioning](http://semver.org). Squib follows [semantic versioning](http://semver.org).
## v0.10.0 / Unreleased
Chores:
* Switched to `require_relative` internally throughout the codebase to be more pry-friendly (#130)
## v0.9.0 / 2016-01-10 ## v0.9.0 / 2016-01-10
Features: Features:

8
lib/squib.rb

@ -2,10 +2,10 @@ require 'logger'
require 'cairo' require 'cairo'
require 'pango' require 'pango'
require 'rsvg2' require 'rsvg2'
require 'squib/version' require_relative 'squib/version'
require 'squib/commands/new' require_relative 'squib/commands/new'
require 'squib/deck' require_relative 'squib/deck'
require 'squib/card' require_relative 'squib/card'
module Squib module Squib

3
lib/squib/api/background.rb

@ -1,3 +1,6 @@
require_relative '../args/card_range'
require_relative '../args/draw'
module Squib module Squib
class Deck class Deck
# Fills the background with the given color # Fills the background with the given color

4
lib/squib/api/data.rb

@ -1,7 +1,7 @@
require 'roo' require 'roo'
require 'csv' require 'csv'
require 'squib/args/input_file' require_relative '../args/input_file'
require 'squib/args/import' require_relative '../args/import'
module Squib module Squib

12
lib/squib/api/image.rb

@ -1,9 +1,9 @@
require 'squib/args/card_range' require_relative '../args/card_range'
require 'squib/args/paint' require_relative '../args/paint'
require 'squib/args/scale_box' require_relative '../args/scale_box'
require 'squib/args/transform' require_relative '../args/transform'
require 'squib/args/input_file' require_relative '../args/input_file'
require 'squib/args/svg_special' require_relative '../args/svg_special'
module Squib module Squib
class Deck class Deck

10
lib/squib/api/save.rb

@ -1,8 +1,8 @@
require 'squib/args/card_range' require_relative '../args/card_range'
require 'squib/args/hand_special' require_relative '../args/hand_special'
require 'squib/args/save_batch' require_relative '../args/save_batch'
require 'squib/args/sheet' require_relative '../args/sheet'
require 'squib/args/showcase_special' require_relative '../args/showcase_special'
module Squib module Squib
class Deck class Deck

10
lib/squib/api/shapes.rb

@ -1,8 +1,8 @@
require 'squib/args/box' require_relative '../args/box'
require 'squib/args/draw' require_relative '../args/draw'
require 'squib/args/card_range' require_relative '../args/card_range'
require 'squib/args/transform' require_relative '../args/transform'
require 'squib/args/coords' require_relative '../args/coords'
module Squib module Squib
class Deck class Deck

12
lib/squib/api/text.rb

@ -1,8 +1,8 @@
require 'squib/api/text_embed' require_relative 'text_embed'
require 'squib/args/box' require_relative '../args/box'
require 'squib/args/card_range' require_relative '../args/card_range'
require 'squib/args/draw' require_relative '../args/draw'
require 'squib/args/paragraph' require_relative '../args/paragraph'
module Squib module Squib
class Deck class Deck
@ -43,7 +43,7 @@ module Squib
# @option opts angle [FixNum] (0) Rotation of the text in radians. Note that this rotates around the upper-left corner of the text box, making the placement of x-y coordinates slightly tricky. # @option opts angle [FixNum] (0) Rotation of the text in radians. Note that this rotates around the upper-left corner of the text box, making the placement of x-y coordinates slightly tricky.
# @option opts stroke_width [Decimal] (0.0) the width of the outside stroke. Supports Unit Conversion, see {file:README.md#Units Units}. # @option opts stroke_width [Decimal] (0.0) the width of the outside stroke. Supports Unit Conversion, see {file:README.md#Units Units}.
# @option opts stroke_color [String] (:black) the color with which to stroke the outside of the rectangle. {file:README.md#Specifying_Colors___Gradients Specifying Colors & Gradients} # @option opts stroke_color [String] (:black) the color with which to stroke the outside of the rectangle. {file:README.md#Specifying_Colors___Gradients Specifying Colors & Gradients}
# @option opts stroke_strategy [:fill_first, :stroke_first] (:fill_first) specify whether the stroke is done before (thinner) or after (thicker) filling the shape. # @option opts stroke_strategy [:fill_first, :stroke_first] (:fill_first) specify whether the stroke is done before (thinner) or after (thicker) filling the shape.
# @option opts dash [String] ('') define a dash pattern for the stroke. Provide a string with space-separated numbers that define the pattern of on-and-off alternating strokes, measured in pixels by defautl. Supports Unit Conversion, see {file:README.md#Units Units} (e.g. `'0.02in 0.02in'`). # @option opts dash [String] ('') define a dash pattern for the stroke. Provide a string with space-separated numbers that define the pattern of on-and-off alternating strokes, measured in pixels by defautl. Supports Unit Conversion, see {file:README.md#Units Units} (e.g. `'0.02in 0.02in'`).
# @option opts hint [String] (:nil) draw a rectangle around the text with the given color. Overrides global hints (see {Deck#hint}). # @option opts hint [String] (:nil) draw a rectangle around the text with the given color. Overrides global hints (see {Deck#hint}).
# @return [Array] Returns an Array of hashes keyed by :width and :height that mark the ink extents of the text rendered. # @return [Array] Returns an Array of hashes keyed by :width and :height that mark the ink extents of the text rendered.

14
lib/squib/api/text_embed.rb

@ -1,10 +1,10 @@
require 'squib/args/box' require_relative '../args/box'
require 'squib/args/card_range' require_relative '../args/card_range'
require 'squib/args/embed_adjust' require_relative '../args/embed_adjust'
require 'squib/args/embed_key' require_relative '../args/embed_key'
require 'squib/args/input_file' require_relative '../args/input_file'
require 'squib/args/paint' require_relative '../args/paint'
require 'squib/args/transform' require_relative '../args/transform'
module Squib module Squib
class TextEmbed class TextEmbed

2
lib/squib/api/units.rb

@ -1,4 +1,4 @@
require 'squib/constants' require_relative '../constants'
module Squib module Squib
class Deck class Deck

4
lib/squib/args/arg_loader.rb

@ -1,5 +1,5 @@
require 'squib/constants' require_relative '../constants'
require 'squib/conf' require_relative '../conf'
require 'ostruct' require 'ostruct'
module Squib module Squib

4
lib/squib/args/box.rb

@ -1,4 +1,4 @@
require 'squib/args/arg_loader' require_relative 'arg_loader'
module Squib module Squib
# @api private # @api private
@ -52,4 +52,4 @@ module Squib
end end
end end
end end

4
lib/squib/args/coords.rb

@ -1,4 +1,4 @@
require 'squib/args/arg_loader' require_relative 'arg_loader'
module Squib module Squib
# @api private # @api private
@ -30,4 +30,4 @@ module Squib
end end
end end
end end

4
lib/squib/args/draw.rb

@ -1,6 +1,6 @@
require 'cairo' require 'cairo'
require 'squib/args/arg_loader' require_relative 'arg_loader'
require 'squib/args/color_validator' require_relative 'color_validator'
module Squib module Squib
# @api private # @api private

2
lib/squib/args/embed_adjust.rb

@ -1,4 +1,4 @@
require 'squib/args/arg_loader' require_relative 'arg_loader'
module Squib module Squib
# @api private # @api private

2
lib/squib/args/embed_key.rb

@ -1,4 +1,4 @@
require 'squib/args/arg_loader' require_relative 'arg_loader'
module Squib module Squib
# @api private # @api private

4
lib/squib/args/import.rb

@ -1,4 +1,4 @@
require 'squib/args/arg_loader' require_relative 'arg_loader'
module Squib module Squib
# @api private # @api private
@ -37,4 +37,4 @@ module Squib
end end
end end
end end

2
lib/squib/args/input_file.rb

@ -1,4 +1,4 @@
require 'squib/args/arg_loader' require_relative 'arg_loader'
module Squib module Squib
# @api private # @api private

6
lib/squib/args/paint.rb

@ -1,6 +1,6 @@
require 'cairo' require 'cairo'
require 'squib/args/arg_loader' require_relative 'arg_loader'
require 'squib/args/color_validator' require_relative 'color_validator'
module Squib module Squib
# @api private # @api private
@ -41,4 +41,4 @@ module Squib
end end
end end
end end

4
lib/squib/args/paragraph.rb

@ -1,5 +1,5 @@
require 'squib/args/arg_loader' require_relative '../constants'
require 'squib/constants' require_relative 'arg_loader'
module Squib module Squib
# @api private # @api private

4
lib/squib/args/save_batch.rb

@ -1,5 +1,5 @@
require 'squib/args/arg_loader' require_relative 'arg_loader'
require 'squib/args/dir_validator' require_relative 'dir_validator'
module Squib module Squib
# @api private # @api private

2
lib/squib/args/scale_box.rb

@ -1,4 +1,4 @@
require 'squib/args/arg_loader' require_relative 'arg_loader'
module Squib module Squib
# @api private # @api private

6
lib/squib/args/sheet.rb

@ -1,7 +1,7 @@
require 'cairo' require 'cairo'
require 'squib/args/arg_loader' require_relative 'arg_loader'
require 'squib/args/color_validator' require_relative 'color_validator'
require 'squib/args/dir_validator' require_relative 'dir_validator'
module Squib module Squib
# @api private # @api private

4
lib/squib/args/showcase_special.rb

@ -1,6 +1,6 @@
require 'cairo' require 'cairo'
require 'squib/args/arg_loader' require_relative 'arg_loader'
require 'squib/args/dir_validator' require_relative 'dir_validator'
module Squib module Squib
# @api private # @api private

2
lib/squib/args/svg_special.rb

@ -1,4 +1,4 @@
require 'squib/args/arg_loader' require_relative 'arg_loader'
module Squib module Squib
# @api private # @api private

4
lib/squib/args/transform.rb

@ -1,4 +1,4 @@
require 'squib/args/arg_loader' require_relative 'arg_loader'
module Squib module Squib
# @api private # @api private
@ -58,4 +58,4 @@ module Squib
end end
end end
end end

5
lib/squib/args/typographer.rb

@ -1,4 +1,5 @@
require 'squib/constants' require_relative '../constants'
module Squib module Squib
#@api private #@api private
module Args module Args
@ -115,4 +116,4 @@ module Squib
end end
end end
end end

4
lib/squib/args/unit_conversion.rb

@ -1,4 +1,4 @@
require 'squib/constants' require_relative '../constants'
module Squib module Squib
module Args module Args
@ -22,4 +22,4 @@ module Squib
end end
end end
end end

16
lib/squib/card.rb

@ -1,5 +1,5 @@
require 'cairo' require 'cairo'
require 'squib/graphics/cairo_context_wrapper' require_relative 'graphics/cairo_context_wrapper'
module Squib module Squib
# Back end graphics. Private. # Back end graphics. Private.
@ -54,13 +54,13 @@ module Squib
######################## ########################
### BACKEND GRAPHICS ### ### BACKEND GRAPHICS ###
######################## ########################
require 'squib/graphics/background' require_relative 'graphics/background'
require 'squib/graphics/image' require_relative 'graphics/image'
require 'squib/graphics/save_doc' require_relative 'graphics/save_doc'
require 'squib/graphics/save_images' require_relative 'graphics/save_images'
require 'squib/graphics/shapes' require_relative 'graphics/shapes'
require 'squib/graphics/showcase' require_relative 'graphics/showcase'
require 'squib/graphics/text' require_relative 'graphics/text'
end end
end end

3
lib/squib/conf.rb

@ -1,7 +1,6 @@
require 'forwardable' require 'forwardable'
require 'squib'
require 'squib/args/typographer'
require 'yaml' require 'yaml'
require_relative 'args/typographer'
module Squib module Squib
# @api private # @api private

34
lib/squib/deck.rb

@ -1,14 +1,14 @@
require 'forwardable' require 'forwardable'
require 'pp' require 'pp'
require 'squib' require_relative '../squib'
require 'squib/args/unit_conversion' require_relative 'args/unit_conversion'
require 'squib/card' require_relative 'card'
require 'squib/conf' require_relative 'conf'
require 'squib/constants' require_relative 'constants'
require 'squib/graphics/hand' require_relative 'graphics/hand'
require 'squib/graphics/showcase' require_relative 'graphics/showcase'
require 'squib/layout_parser' require_relative 'layout_parser'
require 'squib/progress' require_relative 'progress'
# The project module # The project module
@ -100,14 +100,14 @@ module Squib
################## ##################
### PUBLIC API ### ### PUBLIC API ###
################## ##################
require 'squib/api/background' require_relative 'api/background'
require 'squib/api/data' require_relative 'api/data'
require 'squib/api/image' require_relative 'api/image'
require 'squib/api/save' require_relative 'api/save'
require 'squib/api/settings' require_relative 'api/settings'
require 'squib/api/shapes' require_relative 'api/shapes'
require 'squib/api/text' require_relative 'api/text'
require 'squib/api/units' require_relative 'api/units'
end end
end end

2
lib/squib/graphics/cairo_context_wrapper.rb

@ -1,5 +1,5 @@
require 'forwardable' require 'forwardable'
require 'squib/graphics/gradient_regex' require_relative 'gradient_regex'
module Squib module Squib
module Graphics module Graphics

2
lib/squib/graphics/hand.rb

@ -1,4 +1,4 @@
require 'squib/graphics/cairo_context_wrapper' require_relative 'cairo_context_wrapper'
module Squib module Squib
class Deck class Deck

2
lib/squib/graphics/showcase.rb

@ -1,4 +1,4 @@
require 'squib/graphics/cairo_context_wrapper' require_relative 'cairo_context_wrapper'
module Squib module Squib
class Deck class Deck

2
lib/squib/graphics/text.rb

@ -1,5 +1,5 @@
require 'pango' require 'pango'
require 'squib/args/typographer' require_relative '../args/typographer'
module Squib module Squib
class Card class Card

Loading…
Cancel
Save