Giter VIP home page Giter VIP logo

confetti's Introduction

Confetti

Write mobile app configuration files based on a W3C Widget compliant config.xml file

Installation

gem install confetti

Usage

$ confetti generate android_manifest

or, from Ruby

require "confetti"
c_whatever = Confetti::Config.new "/some/dir/config.xml"
c_whatever.write_android_manifest "/some/dir/AndroidManifest.xml"

Supported outputs right now: android_manifest, android_strings, webos_appinfo, ios_info, symbian_wrt_info, blackberry_widgets_config

Roadmap

  • extra platforms: Windows Phone 7, who knows what else
  • conversion from platform to platform (iOS to Android, or whatever)
  • support for platform-specific preferences, and features as PhoneGap APIs
  • maybe some documentation (let's not go crazy)

How to Add a New Platform

Let's say you want write a nintendo_ds_config generator:

  • create a feature file, like features/nintendo.feature
    • specify all the files to generate for your platform
    • specify the name each file will go under
      • nintendo_ds_config
    • and the default filename
      • NintendoDSConfig.xml
    • run rake features to verify that it fails
  • add a sample configuration file to spec/fixtures
    • the filename is based on the descriptive name
      • nintendo_ds_config_expected.xml
  • add some failing specs
    • copy one of the existing specs from spec/templates
      • cp android_manifest_spec.rb nintendo_ds_config_spec.rb
    • modify the new file to match your new template
      • this isn't as well automated as we'd like
    • run rake spec to verify that they fail
  • create your view class
    • as lib/confetti/templates/nintendo_ds_config.rb
    • should define Confetti::Template::NintendoDsConfig < Base
  • create your template file
    • copy your expected config into lib/confetti/templates
      • as nintendo_ds_config.mustache
    • replace the variable sections with mustache tags
  • in your view class
    • write methods that correspond to the variable sections in your template
  • run rake spec to ensure everything was set up correctly
  • add specs for generate and write methods
    • open spec/config_spec.rb
    • add the following line to the describe config generation block
      • it_should_have_generate_and_write_methods_for :nintendo_ds_config
  • run rake spec, see them fail
  • add generate and write methods
    • open lib/confetti/config.rb
    • add your platform to the generate_and_write call
      • generate_and_write ... :nintendo_ds_config
  • run rake spec again
  • build and install the gem, or whatever, so the cucumber tests work
  • run feature/nintendo.feature
    • it's all green!
    • you're the man now dog

confetti's People

Contributors

alunny avatar hardeep avatar goya avatar bobeast avatar

Watchers

Srinivas Annam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.