Skip to content
Browse files

Updated some rdocs

  • Loading branch information...
1 parent 9a455d5 commit c3b869b8e1f7111b95f9ce0880761698a35a4e6c @lukebayes committed
Showing with 58 additions and 9 deletions.
  1. +15 −8 lib/sprout/executable/param.rb
  2. +43 −1 lib/sprout/library.rb
View
23 lib/sprout/executable/param.rb
@@ -121,9 +121,8 @@ class Param
attr_accessor :prefix
##
- # A Symbol that refers to a custom attribute reader
- # that is available to instance methods on the
- # Sprout::Executable that uses it.
+ # A Symbol that refers to a method that will return
+ # the expected value when called. This method can be private.
#
# add_param :visible, Boolean, :reader => :get_visible
#
@@ -164,14 +163,22 @@ class Param
attr_accessor :value
##
- # A Symbol that refers to a custom attribute writer
- # that is available to instance methods on the
- # Sprout::Executable that uses it.
+ # A Symbol that refers to a method (not accessor) that
+ # will be called when the value is set. This method is
+ # not responsible for actually storing the value, but
+ # should instead be thought of as a badly named callback
+ # that will be triggered with the new value whenever the
+ # value changes.
+ #
+ # This method can be private.
#
# add_param :visible, Boolean, :writer => :set_visible
#
- # def set_visible=(vis)
- # @visible = vis
+ # private
+ #
+ # def set_visible value
+ # do_something_with value
+ # value
# end
#
attr_accessor :writer
View
44 lib/sprout/library.rb
@@ -15,6 +15,7 @@ module Sprout
# * Source Code: Raw or pre-compiled (swc, jar, abc)
#
# = Specification
+ #
# Libraries can be added to local or remote file targets in a
# Sprout::Specification. When calling add_library, one must provide the
# library name (symbol that will be used from Rake) and a relative path (or
@@ -60,7 +61,48 @@ module Sprout
# When the library task is executed, the library should be resolved and
# expanded into the project. When the mxmlc task is executed, the installed
# library should be associated with the compilation command.
- #
+ #
+ # Some library Specifications include multiple targets within the same Specification.
+ #
+ # One good example of such a Spec, is the FlashSDK :flex4 Specification.
+ #
+ # Following is a truncated version of that Spec:
+ #
+ # Sprout::Specification.new do |s|
+ # s.name = 'flex4'
+ # s.version = '4.1.0.16076'
+ # s.add_remote_file_target do |t|
+ # t.platform = :universal
+ # t.archive_type = :zip
+ # t.url = "http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4/flex_sdk_4.1.0.16076.zip"
+ # t.md5 = "4c5f3d3fa4e1f5be244679210cd852c0"
+ # t.add_library :flex, "frameworks/libs/flex.swc"
+ # t.add_library :flex4, "frameworks/libs/flex4.swc"
+ # t.add_library :f_textlayout, "frameworks/libs/framework_textLayout.swc"
+ # t.add_library :framework, "frameworks/libs/framework.swc"
+ # t.add_library :rpc, "frameworks/libs/rpc.swc"
+ # t.add_library :sparkskins, "frameworks/libs/sparkskins.swc"
+ # t.add_library :textlayout, "frameworks/libs/textLayout.swc"
+ # t.add_library :utilities, "frameworks/libs/utilities.swc"
+ # end
+ # end
+ #
+ # Because this library Specification is included in the flashsdk Rubygem, you
+ # would register the spec by loading the flashsdk gem from your Gemfile like:
+ #
+ # gem 'flashsdk', '>= 1.0.0.pre'
+ #
+ # Once the Rubygem is installed, you can load and register this library with
+ # the following library task in your rakefile:
+ #
+ # library :flex4
+ #
+ # Once the library is registered, you can refer to particular SWC files within the library like:
+ #
+ # mxmlc "bin/Foo.swf" => [:utilities, :textlayout] do |t|
+ # ...
+ # end
+ #
# ---
#
# Previous Topic: {Sprout::Generator}

0 comments on commit c3b869b

Please sign in to comment.
Something went wrong with that request. Please try again.