README.md in app_drone-0.2.1 vs README.md in app_drone-0.3.1

- old
+ new

@@ -41,12 +41,12 @@ t.add AppDrone::Bootstrap, vendor: true To list parameters for a specific drone: AppDrone::Bootstrap.params - # => #<struct Struct::Param name=:vendor, type=:boolean, options=[{:info=>"download a local copy into the repo"}]> - # => #<struct Struct::Param name=:responsive, type=:boolean, options=[{:info=>"include responsive grid"}]> + # => #<struct Struct::Param name=:vendor, type=:boolean, options={:info=>"download a local copy into the repo"}> + # => #<struct Struct::Param name=:responsive, type=:boolean, options={:info=>"include responsive grid"}> For readability, you can use the symbol shorthand instead of full class name: t.add :factory_girl # adds AppDrone::FactoryGirl @@ -101,10 +101,37 @@ end AppDrone::MyDrone.dependencies # => [AppDrone::DeathRay, AppDrone::YourMom] + +### Drone pairings + +Pairing is weaker than a dependency. A template will not render without its dependencies, but pairs are optional inclusions to add extra params and behavior in the presence of another drone. + + class AppDrone::BarbraStreisand < AppDrone::Drone + depends_on :bobby_davis_jr + pairs_with :celine_dion + + param :wear_human_suit_over_mechaskin, :boolean, info: 'Wear the human disguise' + param_with :celine_dion, :celine_in_rehab, :boolean, info: 'Is she currently in rehab?' + + def align + bobby_davis_jr.say 'Hi' + bobby_davis_jr.introduce 'This is Celine Dion' if pair?(:celine_dion) + self.get_changed if param(:wear_human_suit_over_mechaskin) + end + + def execute + do! :duet_with_bobby + if pair?(:celine_dion) + do! :coke_with_celine unless param(:celine_in_rehab) + end + end + + end + ### Drone behavior parameters class AppDrone::MyDrone < AppDrone::Drone param :lazer_color, :string, rainbow: ['all','teh','colors!'] end @@ -114,10 +141,33 @@ t = AppDrone::Template.new t.add :my_drone, lazer_color: 'teh' +A drone may also declare a parameter that is only to be used in presence of a dependency. + +You can also use `param_with` to specify a parameter that is expected in presence of a pair: + + class AppDrone::EddieIzzard + desc 'Professional transvestite' + + pairs_with :heels + param_with :heels, :wearing_heels, :boolean, default: true + + def align + # defaults to true in the presence of :heels dependency + if pair?(:heels) && param(:wearing_heels) + puts "I am a professional transvestite, so I can run about in heels and not fall over." + puts "Cause if a woman falls over wearing heels, that’s embarrassing." + puts "But if a bloke falls over wearing heels, you have to kill yourself." + puts "It’s the end of your life. + end + end + + end + + ### Drone communication Drones can talk to eachother via a proxy on the template they are included in, using the class name as a reference: class AppDrone::MyDrone < AppDrone::Drone @@ -136,11 +186,10 @@ bundle.add 'my_gem' stylesheet.add_import 'shiny_sheet' end end - **Take a look at existing drones for more info!** ### An important reminder @@ -151,48 +200,48 @@ ## Drones ### Active drones (put 'em to work!) - Bundle -- Stylesheet -- Javascript +- Stylesheet (Sass & Compass) +- Javascript (Coffescript & jQuery) - SlimView - HighVoltage -- Showcase (drones use this to demonstrate their working functionality) - Chosen, by harvestHQ +- Bootstrap, by Twitter +- SimpleForm (with optional Country Select and automatic Twitter Bootstrap integration) +- Flair (drones use this to demonstrate their working functionality) - Cleanup - + ### Frozen drones (currently in development) -- Bootstrap -- FactoryGirl -- Git -- Guard - RankedModel +- Git - RSpec -- SimpleForm +- FactoryGirl +- Guard - ### Future drones (TODO - I'll get there some day!) - Stylesheet utils - SlimViews: Add browser-specific classes to <html> via useragent + helpers.. - UserAgent blocking script - Responders - HasScope - Pagination -- CarrierWave (and optional cloud resizing thingy) +- jQuery shims +- jQuery UI (vendor + theme etc.) +- pie.htc for IE +- HTML5 shim for IE - Airbrake + API Key +- CarrierWave (and optional cloud resizing thingy) - rails-best-practices (and the other output gem for debugging) - NewRelic - EngineYard for deployment -- jQuery shims - Backbone integration + Skim - Ember.js integration - Pivotal tracker -- pie.htc for IE -- HTML5 shim for IE ## Contributing I'd love it if you could get involved! Feel free to suggest improvements, drones you'd like developed, or help me get test coverage up to scratch :)