README.md in dyna-0.1.8 vs README.md in dyna-0.1.9

- old
+ new

@@ -1,10 +1,10 @@ # Dyna -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dyna`. To experiment with that code, run `bin/console` for an interactive prompt. +Dyna is a tool to manage DynamoDB Table. -TODO: Delete this and the text above, and describe your gem +It defines the state of DynamoDB Table using DSL, and updates DynamoDB Table according to DSL. ## Installation Add this line to your application's Gemfile: @@ -20,22 +20,91 @@ $ gem install dyna ## Usage -TODO: Write usage instructions here +```sh +export AWS_ACCESS_KEY_ID='...' +export AWS_SECRET_ACCESS_KEY='...' +export AWS_REGION='ap-northeast-1' +dyna -e -o Dynafile # export DynamoDB Table +vi Dynafile +dyna -a --dry-run +dyna -a # apply `Dyanfile` to DynamoDB +``` -## Development +## Help -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. +``` +Usage: dyna [options] + -p, --profile PROFILE_NAME + --credentials-path PATH + -k, --access-key ACCESS_KEY + -s, --secret-key SECRET_KEY + -r, --region REGION + -a, --apply + -f, --file FILE + -n, --table_names TABLE_LIST + -x, --exclude_table_names TABLE_LIST + --dry-run + -e, --export + -o, --output FILE + --split + --no-color + --debug +``` -To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). +## Dynafile example -## Contributing +```ruby +require 'other/dynafile' -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dyna. +dynamo_db "ap-northeast-1" do + table "test_table" do + key_schema( + hash: "ForumName", + range: "Subject" + ) + attribute_definition( + attribute_name: "ForumName", + attribute_type: "S", + ) + attribute_definition( + attribute_name: "Subject", + attribute_type: "S", + ) + provisioned_throughput( + read_capacity_units: 1, + write_capacity_units: 2, + ) + + local_secondary_index "LocalIndexName" do + key_schema hash: "ForumName", range: "Subject" + projection projection_type: "ALL" + end + + global_secondary_index "GlobalIndexName" do + key_schema hash: "ForumName", range: "Subject" + projection projection_type: "ALL" + provisioned_throughput read_capacity_units: 1, write_capacity_units: 2 + end + + stream_specification( + stream_enabled: true, + stream_view_type: "NEW_AND_OLD_IMAGES", + ) + end +``` + +## Similar tools + +* [Codenize.tools](http://codenize.tools/) + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/wata-gh/dyna. + ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). -