From cb7ff5f4d710c51d391f040d91f0b60e5ccb4e6d Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Thu, 19 Mar 2015 13:45:47 -0400 Subject: [PATCH] Yard: Add in lots of @api private directives --- lib/squib/api/text_embed.rb | 5 +++++ lib/squib/args/unit_conversion.rb | 4 ++++ lib/squib/card.rb | 2 ++ lib/squib/graphics/cairo_context_wrapper.rb | 8 ++++++++ lib/squib/graphics/showcase.rb | 2 ++ lib/squib/graphics/text.rb | 2 ++ 6 files changed, 23 insertions(+) diff --git a/lib/squib/api/text_embed.rb b/lib/squib/api/text_embed.rb index b90148e..86d1452 100644 --- a/lib/squib/api/text_embed.rb +++ b/lib/squib/api/text_embed.rb @@ -1,7 +1,11 @@ module Squib class TextEmbed + # :nodoc: + # @api private attr_reader :rules + # :nodoc: + # @api private def initialize @rules = {} # store an array of options for later usage end @@ -17,6 +21,7 @@ module Squib # @option opts alpha [Decimal] (1.0) the alpha-transparency percentage used to blend this image. Supports Arrays, see {file:README.md#Arrays_and_Singleton_Expansion Arrays and Singleon Expansion} # @option opts blend [:none, :multiply, :screen, :overlay, :darken, :lighten, :color_dodge, :color_burn, :hard_light, :soft_light, :difference, :exclusion, :hsl_hue, :hsl_saturation, :hsl_color, :hsl_luminosity] (:none) the composite blend operator used when applying this image. See Blend Modes at http://cairographics.org/operators. Supports Arrays, see {file:README.md#Arrays_and_Singleton_Expansion Arrays and Singleon Expansion} # @option opts angle [FixNum] (0) Rotation of the in radians. Note that this rotates around the upper-left corner, making the placement of x-y coordinates slightly tricky. Supports Arrays, see {file:README.md#Arrays_and_Singleton_Expansion Arrays and Singleon Expansion} + # @api public def svg(opts) opts = Squib::SYSTEM_DEFAULTS.merge(opts) # TODO: add input validation here. We need the key for example. diff --git a/lib/squib/args/unit_conversion.rb b/lib/squib/args/unit_conversion.rb index 4ef3eb0..db4c3d7 100644 --- a/lib/squib/args/unit_conversion.rb +++ b/lib/squib/args/unit_conversion.rb @@ -2,8 +2,12 @@ require 'squib/constants' module Squib module Args + # :nodoc: + # @api private module UnitConversion + # :nodoc: + # @api private module_function def parse(arg, dpi=300) case arg.to_s.rstrip diff --git a/lib/squib/card.rb b/lib/squib/card.rb index 7e4a29a..25f83d0 100644 --- a/lib/squib/card.rb +++ b/lib/squib/card.rb @@ -27,6 +27,8 @@ module Squib @cairo_context.antialias = ANTIALIAS_OPTS[(@deck.antialias.downcase)] || 'subpixel' end + # :nodoc: + # @api private def make_surface(svgfile, backend) case backend when :memory diff --git a/lib/squib/graphics/cairo_context_wrapper.rb b/lib/squib/graphics/cairo_context_wrapper.rb index b745f57..a67c6a9 100644 --- a/lib/squib/graphics/cairo_context_wrapper.rb +++ b/lib/squib/graphics/cairo_context_wrapper.rb @@ -3,10 +3,16 @@ require 'squib/graphics/gradient_regex' module Squib module Graphics + # Wrapper class for the Cairo context. Private. class CairoContextWrapper extend Forwardable + + # :nodoc: + # @api private attr_accessor :cairo_cxt + # :nodoc: + # @api private def initialize(cairo_cxt) @cairo_cxt = cairo_cxt end @@ -18,6 +24,8 @@ module Squib :operator=, :show_page, :clip, :transform, :mask, :create_pango_layout, :antialias= + # :nodoc: + # @api private def set_source_squibcolor(arg) if match = arg.match(LINEAR_GRADIENT) x1, y1, x2, y2 = match.captures diff --git a/lib/squib/graphics/showcase.rb b/lib/squib/graphics/showcase.rb index 1c66920..5da79de 100644 --- a/lib/squib/graphics/showcase.rb +++ b/lib/squib/graphics/showcase.rb @@ -60,6 +60,8 @@ module Squib return tmp_cc.target end + # :nodoc: + # @api private def perspective(src, scale, face_right) dest_cxt = Cairo::Context.new(Cairo::ImageSurface.new(src.width * scale, src.height)) in_thickness = 1 # Take strip 1 pixel-width at a time diff --git a/lib/squib/graphics/text.rb b/lib/squib/graphics/text.rb index 54e9b9e..71a5a7e 100644 --- a/lib/squib/graphics/text.rb +++ b/lib/squib/graphics/text.rb @@ -82,6 +82,8 @@ module Squib layout end + # :nodoc: + # @api private def next_embed(keys, str) ret = nil ret_key = nil