README.md in dbt-1.1.2 vs README.md in dbt-1.1.3

- old
+ new

@@ -1,19 +1,20 @@ DBT ----------- +--- DBT (Dependencies and deBugging Tool) is a tool that looks for `break`, `require`, and `provides` commands (and does a *teensy* bit of code analyzing - it will detect VERY basic class and module declarations) to make your RubyMotion -`Rakefile` and `debugger_cmds` files short and consistent. +`debugger_cmds` file easy to create, and declaring your file dependencies stupid +simple. **CAUTION**: It overwrites the `debugger_cmds` file! To use, include this gem (`gem 'dbt'`), and add `DBT.analyze(app)` to your -`Rakefile`, after you have added your libraries and whatnot. It looks at +`Rakefile`, after you have added your own files to `app.files`. It looks at `app.files` and scans those files, so I mean it when I say "after you have added -your libraries and whatnot". In your source code you add DBT commands: +your own files". In your source code you add DBT commands: ```ruby # @provides Foo # @requires module:Bar class Foo @@ -28,11 +29,11 @@ end ``` When you run `rake`, these commands will be found and translated into directives -for `app.files_dependencies` and `debugger_cmds`. Run `rake` or `rake debug=1`, +for `app.files_dependencies` and `debugger_cmds`. Run `rake` or `rake debug=1`, and off you go! Your files will be grep'd for `^\w*(class|module)`, and these will be registered automatically as: @@ -41,14 +42,24 @@ # @provides class:ClassName class ClassName end # @provides module:ModuleName -class ModuleName +module ModuleName end +# @provides module:Foo +module Foo + # Sorry, no support for Foo::Bar... I do intend to add it, though! + # + # @provides class:Bar + class Bar + end +end + + # ...in another file... # @requires class:ClassName # @requires module:ModuleName class AnotherClass < ClassName include ModuleName @@ -56,9 +67,43 @@ ``` So right out of the box, you can add `# @requires class:Foo` if you're having trouble with dependencies and want a quick fix without having to add `# @provides` declarations all over the place. + +Which begs the question, *when* would you need to declare an explicit +`# @provides`? Examples: + +##### Splitting up a class across multiple files: +###### controller.rb +```ruby +# @provides Controller +class Controller < UIViewController +end +``` + +###### controller_table_view.rb +```ruby +# provides table view methods +# +# @requires Controller +class Controller + + def numberOfSectionsInTableView(table_view) + 1 + end + +end +``` + +##### Not-easily-greppable syntax +```ruby +# @provides module:Foo::Bar +module Foo ; module Bar +end end +``` + +# Breakpoints Breakpoints are created using the syntax `#--> break`, with two or more dashes before the `>`. There must not be any whitespace before or after the `#`. ```ruby