├── TODO ├── History.txt ├── dm-observer ├── TODO ├── History.txt ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── lib │ └── dm-observer │ │ └── version.rb ├── Manifest.txt ├── README.txt └── LICENSE ├── dm-sweatshop ├── TODO ├── History.txt ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── README.txt ├── lib │ ├── dm-sweatshop │ │ ├── version.rb │ │ └── model.rb │ └── dm-sweatshop.rb ├── Manifest.txt └── LICENSE ├── dm-cli ├── History.txt ├── spec │ └── spec.opts ├── lib │ ├── dm-cli.rb │ └── dm-cli │ │ └── version.rb ├── TODO ├── bin │ ├── .irbrc │ └── dm ├── Manifest.txt ├── README.txt └── LICENSE ├── dm-is-versioned ├── TODO ├── History.txt ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── README.txt ├── lib │ ├── dm-is-versioned │ │ └── is │ │ │ └── version.rb │ └── dm-is-versioned.rb ├── Manifest.txt └── LICENSE ├── dm-tags ├── .gitignore ├── spec │ ├── spec.opts │ ├── dm-setup.rb │ ├── spec_helper.rb │ ├── classes.rb │ └── dm-tags │ │ └── tag_spec.rb ├── Rakefile ├── tasks │ ├── environment.rake │ ├── rspec.rake │ └── website.rake ├── History.txt ├── lib │ ├── dm-tags │ │ ├── version.rb │ │ ├── tag.rb │ │ └── tagging.rb │ └── dm-tags.rb ├── config │ └── requirements.rb ├── Manifest.txt └── License.txt ├── dm-adjust ├── History.txt ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── lib │ ├── dm-adjust │ │ ├── version.rb │ │ ├── repository.rb │ │ └── model.rb │ └── dm-adjust.rb ├── TODO ├── Manifest.txt ├── README.txt └── LICENSE ├── dm-is-list ├── History.txt ├── TODO ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── lib │ ├── dm-is-list │ │ └── is │ │ │ └── version.rb │ └── dm-is-list.rb └── Manifest.txt ├── dm-is-tree ├── History.txt ├── spec │ └── spec.opts ├── README.txt ├── lib │ ├── dm-is-tree │ │ └── is │ │ │ └── version.rb │ └── dm-is-tree.rb ├── TODO ├── Manifest.txt └── LICENSE ├── dm-querizer ├── History.txt ├── TODO ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── lib │ ├── dm-querizer │ │ ├── version.rb │ │ ├── collection.rb │ │ └── model.rb │ └── dm-querizer.rb ├── Manifest.txt └── README.txt ├── dm-types ├── History.txt ├── spec │ ├── spec.opts │ ├── integration │ │ ├── json_spec.rb │ │ ├── ip_address_spec.rb │ │ ├── file_path_spec.rb │ │ ├── permalink_spec.rb │ │ ├── uri_spec.rb │ │ ├── yaml_spec.rb │ │ ├── flag_spec.rb │ │ └── uuid_spec.rb │ ├── unit │ │ ├── regexp_spec.rb │ │ └── epoch_time_spec.rb │ └── spec_helper.rb ├── README.txt ├── lib │ ├── dm-types │ │ ├── version.rb │ │ ├── serial.rb │ │ ├── regexp.rb │ │ ├── epoch_time.rb │ │ ├── file_path.rb │ │ ├── csv.rb │ │ ├── uri.rb │ │ ├── permalink.rb │ │ ├── ip_address.rb │ │ ├── bcrypt_hash.rb │ │ ├── yaml.rb │ │ └── json.rb │ └── dm-types.rb ├── TODO └── LICENSE ├── dm-aggregates ├── History.txt ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── lib │ ├── dm-aggregates │ │ ├── version.rb │ │ ├── repository.rb │ │ ├── collection.rb │ │ ├── model.rb │ │ └── support │ │ │ └── symbol.rb │ └── dm-aggregates.rb ├── TODO ├── Manifest.txt └── LICENSE ├── dm-ar-finders ├── History.txt ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── README.txt ├── lib │ └── dm-ar-finders │ │ └── version.rb ├── TODO ├── Manifest.txt └── LICENSE ├── dm-constraints ├── History.txt ├── TODO ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── lib │ ├── dm-constraints │ │ ├── version.rb │ │ ├── postgres_adapter.rb │ │ └── mysql_adapter.rb │ └── dm-constraints.rb ├── README.txt ├── Manifest.txt ├── tasks │ ├── doc.rb │ ├── install.rb │ └── gemspec.rb ├── Rakefile └── LICENSE ├── dm-is-example ├── History.txt ├── TODO ├── spec │ ├── spec.opts │ ├── integration │ │ └── example_spec.rb │ └── spec_helper.rb ├── README.txt ├── lib │ ├── dm-is-example │ │ └── is │ │ │ ├── version.rb │ │ │ └── example.rb │ └── dm-is-example.rb ├── Manifest.txt └── LICENSE ├── dm-is-nested_set ├── History.txt ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── lib │ ├── dm-is-nested_set │ │ └── is │ │ │ └── version.rb │ └── dm-is-nested_set.rb ├── Manifest.txt └── TODO ├── dm-is-searchable ├── History.txt ├── README.txt ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── lib │ ├── dm-is-searchable │ │ └── is │ │ │ └── version.rb │ └── dm-is-searchable.rb └── Manifest.txt ├── dm-migrations ├── History.txt ├── spec │ ├── spec.opts │ ├── unit │ │ ├── sql_spec.rb │ │ └── sql │ │ │ ├── column_spec.rb │ │ │ └── table_spec.rb │ └── spec_helper.rb ├── lib │ ├── dm-migrations.rb │ ├── dm-migrations │ │ └── version.rb │ ├── sql │ │ ├── column.rb │ │ └── table.rb │ └── sql.rb ├── README.txt ├── TODO ├── db │ └── migrations │ │ ├── config.rb │ │ ├── 2_add_dob_to_people.rb │ │ └── 1_create_people_table.rb ├── Manifest.txt └── LICENSE ├── dm-serializer ├── History.txt ├── spec │ ├── spec.opts │ ├── fixtures │ │ ├── quatum_cat.rb │ │ ├── cow.rb │ │ └── planet.rb │ └── unit │ │ └── serializer_spec.rb ├── autotest │ └── discover.rb ├── README.txt ├── lib │ └── dm-serializer │ │ └── version.rb ├── TODO └── Manifest.txt ├── dm-shorthand ├── History.txt ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── lib │ └── dm-shorthand │ │ └── version.rb ├── TODO ├── Manifest.txt ├── README.txt └── LICENSE ├── dm-timestamps ├── History.txt ├── spec │ ├── spec.opts │ └── spec_helper.rb ├── README.txt ├── lib │ ├── dm-timestamps │ │ └── version.rb │ └── dm-timestamps.rb ├── TODO ├── Manifest.txt └── LICENSE ├── dm-validations ├── History.txt ├── spec │ ├── spec.opts │ ├── integration │ │ ├── custom_validator_spec.rb │ │ ├── validation_errors_spec.rb │ │ ├── generic_validator_spec.rb │ │ ├── contextual_validators_spec.rb │ │ └── primitive_validator_spec.rb │ └── spec_helper.rb ├── lib │ └── dm-validations │ │ ├── support │ │ └── object.rb │ │ ├── version.rb │ │ └── formats │ │ └── url.rb └── TODO ├── merb_datamapper ├── History.txt ├── spec │ ├── spec.opts │ ├── spec_helper.rb │ └── generators │ │ └── data_mapper_resource_controller_spec.rb ├── lib │ ├── merb_datamapper │ │ └── version.rb │ ├── generators │ │ ├── templates │ │ │ ├── migration.rb │ │ │ ├── model.rb │ │ │ ├── model_migration.rb │ │ │ └── views │ │ │ │ ├── show.html.erb │ │ │ │ ├── new.html.erb │ │ │ │ ├── edit.html.erb │ │ │ │ └── index.html.erb │ │ ├── data_mapper_migration.rb │ │ ├── data_mapper_model.rb │ │ └── data_mapper_resource_controller.rb │ └── merb │ │ └── orms │ │ └── data_mapper │ │ └── database.yml.sample ├── TODO ├── README.txt └── LICENSE ├── adapters ├── dm-rest-adapter │ ├── TODO │ ├── History.txt │ ├── spec │ │ ├── spec.opts │ │ ├── ruby_forker.rb │ │ ├── spec_helper.rb │ │ ├── create_spec.rb │ │ └── delete_spec.rb │ ├── fixtures │ │ └── book_service │ │ │ ├── public │ │ │ ├── favicon.ico │ │ │ ├── images │ │ │ │ └── rails.png │ │ │ ├── javascripts │ │ │ │ └── application.js │ │ │ ├── robots.txt │ │ │ ├── dispatch.rb │ │ │ ├── dispatch.cgi │ │ │ ├── dispatch.fcgi │ │ │ ├── 422.html │ │ │ ├── 404.html │ │ │ └── 500.html │ │ │ ├── app │ │ │ ├── helpers │ │ │ │ ├── books_helper.rb │ │ │ │ ├── shelf_helper.rb │ │ │ │ └── application_helper.rb │ │ │ ├── models │ │ │ │ ├── shelf.rb │ │ │ │ └── book.rb │ │ │ ├── views │ │ │ │ ├── shelves │ │ │ │ │ ├── show.html.erb │ │ │ │ │ ├── new.html.erb │ │ │ │ │ ├── edit.html.erb │ │ │ │ │ └── index.html.erb │ │ │ │ ├── books │ │ │ │ │ ├── show.html.erb │ │ │ │ │ ├── new.html.erb │ │ │ │ │ ├── edit.html.erb │ │ │ │ │ └── index.html.erb │ │ │ │ └── layouts │ │ │ │ │ └── books.html.erb │ │ │ └── controllers │ │ │ │ └── application.rb │ │ │ ├── script │ │ │ ├── about │ │ │ ├── console │ │ │ ├── destroy │ │ │ ├── generate │ │ │ ├── plugin │ │ │ ├── runner │ │ │ ├── server │ │ │ ├── dbconsole │ │ │ ├── process │ │ │ │ ├── reaper │ │ │ │ ├── spawner │ │ │ │ └── inspector │ │ │ └── performance │ │ │ │ ├── request │ │ │ │ ├── profiler │ │ │ │ └── benchmarker │ │ │ ├── db │ │ │ ├── development.sqlite3 │ │ │ └── migrate │ │ │ │ ├── 20080621171551_create_shelves.rb │ │ │ │ ├── 20080608165526_create_books.rb │ │ │ │ └── 20080629143033_create_fake_books_and_shelves.rb │ │ │ ├── test │ │ │ ├── fixtures │ │ │ │ ├── shelves.yml │ │ │ │ └── books.yml │ │ │ ├── unit │ │ │ │ ├── book_test.rb │ │ │ │ └── shelf_test.rb │ │ │ └── functional │ │ │ │ └── shelf_controller_test.rb │ │ │ ├── config │ │ │ ├── initializers │ │ │ │ ├── mime_types.rb │ │ │ │ ├── inflections.rb │ │ │ │ └── new_rails_defaults.rb │ │ │ ├── database.yml │ │ │ └── environments │ │ │ │ ├── development.rb │ │ │ │ ├── production.rb │ │ │ │ └── test.rb │ │ │ └── Rakefile │ ├── README.txt │ ├── stories │ │ ├── resources │ │ │ ├── helpers │ │ │ │ ├── story_helper.rb │ │ │ │ └── book.rb │ │ │ └── steps │ │ │ │ └── read.rb │ │ ├── all.rb │ │ ├── crud │ │ │ ├── delete │ │ │ └── stories.rb │ │ └── helper.rb │ ├── lib │ │ └── rest_adapter │ │ │ └── version.rb │ └── Manifest.txt ├── dm-ferret-adapter │ ├── History.txt │ ├── .gitignore │ ├── spec │ │ └── spec.opts │ ├── lib │ │ └── ferret_adapter │ │ │ ├── version.rb │ │ │ └── repository_ext.rb │ ├── TODO │ └── Manifest.txt └── dm-couchdb-adapter │ ├── History.txt │ ├── spec │ ├── testfile.txt │ ├── spec.opts │ └── couchdb_view_spec.rb │ ├── .gitignore │ ├── lib │ └── couchdb_adapter │ │ ├── version.rb │ │ └── json_object.rb │ ├── TODO │ └── Manifest.txt ├── dm-is-state_machine ├── History.txt ├── spec │ ├── spec.opts │ ├── integration │ │ ├── invalid_events_spec.rb │ │ ├── invalid_states_spec.rb │ │ └── invalid_transitions_spec.rb │ ├── examples │ │ ├── invalid_events.rb │ │ ├── invalid_states.rb │ │ ├── invalid_transitions_2.rb │ │ └── invalid_transitions_1.rb │ ├── unit │ │ ├── data │ │ │ ├── state_spec.rb │ │ │ └── event_spec.rb │ │ ├── dsl │ │ │ └── state_dsl_spec.rb │ │ └── state_machine_spec.rb │ └── spec_helper.rb ├── lib │ └── dm-is-state_machine │ │ └── is │ │ ├── version.rb │ │ └── data │ │ ├── state.rb │ │ └── event.rb ├── README.txt ├── TODO ├── Manifest.txt └── LICENSE ├── dm-is-remixable ├── spec │ ├── spec.opts │ ├── data │ │ ├── tag.rb │ │ ├── image.rb │ │ ├── viewable.rb │ │ ├── commentable.rb │ │ ├── billable.rb │ │ ├── topic.rb │ │ ├── taggable.rb │ │ ├── addressable.rb │ │ ├── bot.rb │ │ ├── rating.rb │ │ └── user.rb │ └── spec_helper.rb ├── History.txt ├── lib │ ├── dm-is-remixable │ │ └── is │ │ │ └── version.rb │ └── dm-is-remixable.rb ├── Manifest.txt └── LICENSE ├── lib └── dm-more │ └── version.rb ├── rails_datamapper ├── init.rb └── generators │ ├── dm_model │ ├── templates │ │ ├── model.rb │ │ ├── unit_test.rb │ │ └── migration.rb │ └── dm_model_generator.rb │ └── rspec_dm_model │ ├── templates │ ├── model.rb │ └── model_spec.rb │ └── rspec_dm_model_generator.rb ├── Manifest.txt ├── .gitignore ├── README.txt ├── README.textile ├── tasks └── hoe.rb └── MIT-LICENSE /TODO: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-observer/TODO: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dm-sweatshop/TODO: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dm-cli/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-is-versioned/TODO: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dm-tags/.gitignore: -------------------------------------------------------------------------------- 1 | pkg/* -------------------------------------------------------------------------------- /dm-adjust/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-is-list/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-is-tree/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-observer/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-querizer/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-sweatshop/History.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dm-types/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-aggregates/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-ar-finders/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-constraints/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-is-example/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-is-nested_set/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-is-searchable/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-is-versioned/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-migrations/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-serializer/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-shorthand/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-tags/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --colour -------------------------------------------------------------------------------- /dm-timestamps/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-validations/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /merb_datamapper/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | -------------------------------------------------------------------------------- /dm-is-example/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | -------------------------------------------------------------------------------- /dm-is-state_machine/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dm-querizer/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | -------------------------------------------------------------------------------- /adapters/dm-ferret-adapter/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /adapters/dm-couchdb-adapter/History.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /adapters/dm-ferret-adapter/.gitignore: -------------------------------------------------------------------------------- 1 | index 2 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --colour 2 | -------------------------------------------------------------------------------- /dm-is-searchable/README.txt: -------------------------------------------------------------------------------- 1 | = dm-is-searchable 2 | -------------------------------------------------------------------------------- /adapters/dm-couchdb-adapter/spec/testfile.txt: -------------------------------------------------------------------------------- 1 | test string -------------------------------------------------------------------------------- /dm-adjust/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-cli/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-constraints/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | Everything :) 4 | -------------------------------------------------------------------------------- /dm-types/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-aggregates/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-ar-finders/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-constraints/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-is-example/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-is-list/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | * Add support for scopes 4 | -------------------------------------------------------------------------------- /dm-is-list/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-is-tree/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-migrations/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --colour 2 | --format progress 3 | -------------------------------------------------------------------------------- /dm-observer/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-querizer/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-serializer/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-shorthand/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-sweatshop/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-timestamps/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-validations/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dm-is-nested_set/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-is-remixable/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-is-searchable/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-is-state_machine/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-is-versioned/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /merb_datamapper/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /adapters/dm-couchdb-adapter/.gitignore: -------------------------------------------------------------------------------- 1 | couchdb.stderr 2 | couchdb.stdout 3 | -------------------------------------------------------------------------------- /adapters/dm-couchdb-adapter/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /adapters/dm-ferret-adapter/spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format specdoc 2 | --colour 3 | -------------------------------------------------------------------------------- /dm-cli/lib/dm-cli.rb: -------------------------------------------------------------------------------- 1 | require File.join(File.dirname(__FILE__), "dm-cli", "cli") 2 | -------------------------------------------------------------------------------- /dm-migrations/lib/dm-migrations.rb: -------------------------------------------------------------------------------- 1 | require File.dirname(__FILE__) + '/migration' 2 | -------------------------------------------------------------------------------- /dm-serializer/autotest/discover.rb: -------------------------------------------------------------------------------- 1 | Autotest.add_discovery do 2 | "dmserializer" 3 | end 4 | -------------------------------------------------------------------------------- /dm-is-example/README.txt: -------------------------------------------------------------------------------- 1 | = dm-is-example 2 | 3 | Description of plugin. What it does, and how. 4 | -------------------------------------------------------------------------------- /dm-sweatshop/README.txt: -------------------------------------------------------------------------------- 1 | = dm-sweatshop 2 | 3 | DataMapper plugin for building pseudo random models 4 | -------------------------------------------------------------------------------- /dm-tags/spec/dm-setup.rb: -------------------------------------------------------------------------------- 1 | DataMapper.setup(:default, 'sqlite3::memory:') 2 | DataMapper.auto_migrate! -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/helpers/books_helper.rb: -------------------------------------------------------------------------------- 1 | module BooksHelper 2 | end 3 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/helpers/shelf_helper.rb: -------------------------------------------------------------------------------- 1 | module ShelfHelper 2 | end 3 | -------------------------------------------------------------------------------- /dm-migrations/README.txt: -------------------------------------------------------------------------------- 1 | = dm-migrations 2 | 3 | DataMapper plugin for writing and specing migrations. 4 | -------------------------------------------------------------------------------- /dm-serializer/README.txt: -------------------------------------------------------------------------------- 1 | = dm-serializer 2 | 3 | DataMapper plugin for serializing DataMapper objects. 4 | -------------------------------------------------------------------------------- /lib/dm-more/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module More 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/README.txt: -------------------------------------------------------------------------------- 1 | = dm-rest-adapter 2 | 3 | A DataMapper adapter for REST Web Services 4 | -------------------------------------------------------------------------------- /dm-cli/lib/dm-cli/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | class CLI 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-is-versioned/README.txt: -------------------------------------------------------------------------------- 1 | = dm-is-versioned 2 | 3 | DataMapper plugin enabling simple versioning of models. 4 | -------------------------------------------------------------------------------- /dm-types/README.txt: -------------------------------------------------------------------------------- 1 | = dm-types 2 | 3 | DataMapper plugin providing many extra types for use in data models. 4 | -------------------------------------------------------------------------------- /dm-types/lib/dm-types/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Types 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-ar-finders/README.txt: -------------------------------------------------------------------------------- 1 | = dm-ar-finders 2 | 3 | DataMapper plugin providing support for ActiveRecord-style finders. 4 | -------------------------------------------------------------------------------- /dm-is-remixable/History.txt: -------------------------------------------------------------------------------- 1 | === 0.9.3 / 2008-07-31 2 | 3 | * 1 major enhancement 4 | 5 | * Pre-Release, super beta. 6 | -------------------------------------------------------------------------------- /dm-validations/lib/dm-validations/support/object.rb: -------------------------------------------------------------------------------- 1 | class Object 2 | def validatable? 3 | false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-is-tree/README.txt: -------------------------------------------------------------------------------- 1 | = dm-is-tree 2 | 3 | DataMapper plugin allowing the creation of tree structures from data models. 4 | -------------------------------------------------------------------------------- /dm-observer/lib/dm-observer/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Observer 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-querizer/lib/dm-querizer/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Querizer 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-sweatshop/lib/dm-sweatshop/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | class Sweatshop 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-timestamps/README.txt: -------------------------------------------------------------------------------- 1 | = dm-timestamps 2 | 3 | DataMapper plugin which adds "magic" to created_at, created_on, et cetera. 4 | -------------------------------------------------------------------------------- /dm-ar-finders/lib/dm-ar-finders/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module ARFinders 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-migrations/lib/dm-migrations/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | class Migration 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-serializer/lib/dm-serializer/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Serializer 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-shorthand/lib/dm-shorthand/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Shorthand 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-timestamps/lib/dm-timestamps/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Timestamps 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-constraints/lib/dm-constraints/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Constraints 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /dm-validations/lib/dm-validations/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Validations 3 | VERSION = "0.9.6" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /merb_datamapper/lib/merb_datamapper/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module MerbDataMapper 3 | VERSION = "0.9.8" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/stories/resources/helpers/story_helper.rb: -------------------------------------------------------------------------------- 1 | require 'spec/story' 2 | require File.dirname(__FILE__) + '/../../../spec/ruby_forker' 3 | -------------------------------------------------------------------------------- /dm-adjust/lib/dm-adjust/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module More 3 | module Adjust 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-is-list/lib/dm-is-list/is/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Is 3 | module List 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-is-tree/lib/dm-is-tree/is/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Is 3 | module Tree 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-constraints/README.txt: -------------------------------------------------------------------------------- 1 | = dm-constraints 2 | 3 | Plugin that adds foreign key constraints to associations. 4 | Currently supports only PostgreSQL and MySQL 5 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/about: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/about' 4 | -------------------------------------------------------------------------------- /dm-aggregates/lib/dm-aggregates/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module More 3 | module Aggregates 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-is-example/lib/dm-is-example/is/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Is 3 | module Example 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-tags/Rakefile: -------------------------------------------------------------------------------- 1 | require 'config/requirements' 2 | require 'config/hoe' # setup Hoe + all gem configuration 3 | 4 | Dir['tasks/**/*.rake'].each { |rake| load rake } -------------------------------------------------------------------------------- /rails_datamapper/init.rb: -------------------------------------------------------------------------------- 1 | gem 'dm-core' 2 | require 'dm-core' 3 | require File.expand_path(File.dirname(__FILE__) + '/lib/rails_datamapper') 4 | create_connection() 5 | -------------------------------------------------------------------------------- /Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | MIT-LICENSE 3 | Manifest.txt 4 | README.textile 5 | README.txt 6 | Rakefile 7 | TODO 8 | lib/dm-more.rb 9 | lib/dm-more/version.rb 10 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/models/shelf.rb: -------------------------------------------------------------------------------- 1 | class Shelf < ActiveRecord::Base 2 | validates_presence_of :name 3 | 4 | has_many :books 5 | end 6 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/console' 4 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/destroy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/destroy' 4 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/generate: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/generate' 4 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/plugin: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/plugin' 4 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/runner: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/runner' 4 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/server' 4 | -------------------------------------------------------------------------------- /dm-is-nested_set/lib/dm-is-nested_set/is/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Is 3 | module NestedSet 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-is-remixable/lib/dm-is-remixable/is/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Is 3 | module Remixable 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-is-searchable/lib/dm-is-searchable/is/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Is 3 | module Searchable 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-is-versioned/lib/dm-is-versioned/is/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Is 3 | module Versioned 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /rails_datamapper/generators/dm_model/templates/model.rb: -------------------------------------------------------------------------------- 1 | class <%= class_name %> 2 | include DataMapper::Resource 3 | property :id, Integer, :serial => true 4 | end 5 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/dbconsole: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../config/boot' 3 | require 'commands/dbconsole' 4 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/lib/rest_adapter/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module More 3 | class RestAdapter 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /rails_datamapper/generators/rspec_dm_model/templates/model.rb: -------------------------------------------------------------------------------- 1 | class <%= class_name %> 2 | include DataMapper::Resource 3 | property :id, Integer, :serial => true 4 | end 5 | -------------------------------------------------------------------------------- /adapters/dm-ferret-adapter/lib/ferret_adapter/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module More 3 | class FerretAdapter 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-adjust/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | --- 5 | TODO tickets may also be found in the DataMapper Issue Tracker: 6 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 7 | -------------------------------------------------------------------------------- /dm-aggregates/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | --- 5 | TODO tickets may also be found in the DataMapper Issue Tracker: 6 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 7 | -------------------------------------------------------------------------------- /dm-is-state_machine/lib/dm-is-state_machine/is/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Is 3 | module StateMachine 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-tags/tasks/environment.rake: -------------------------------------------------------------------------------- 1 | task :ruby_env do 2 | RUBY_APP = if RUBY_PLATFORM =~ /java/ 3 | "jruby" 4 | else 5 | "ruby" 6 | end unless defined? RUBY_APP 7 | end 8 | -------------------------------------------------------------------------------- /adapters/dm-couchdb-adapter/lib/couchdb_adapter/version.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module More 3 | class CouchDBAdapter 4 | VERSION = "0.9.6" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/process/reaper: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/process/reaper' 4 | -------------------------------------------------------------------------------- /dm-aggregates/lib/dm-aggregates/repository.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | class Repository 3 | def aggregate(query) 4 | adapter.aggregate(query) 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-cli/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | 5 | 6 | --- 7 | TODO tickets may also be found in the DataMapper Issue Tracker: 8 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 9 | -------------------------------------------------------------------------------- /dm-types/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | 5 | 6 | --- 7 | TODO tickets may also be found in the DataMapper Issue Tracker: 8 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 9 | -------------------------------------------------------------------------------- /merb_datamapper/lib/generators/templates/migration.rb: -------------------------------------------------------------------------------- 1 | migration <%= current_migration_nr + 1 %>, :<%= migration_name %> do 2 | up do 3 | end 4 | 5 | down do 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/db/development.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchris/dm-more/master/adapters/dm-rest-adapter/fixtures/book_service/db/development.sqlite3 -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/public/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchris/dm-more/master/adapters/dm-rest-adapter/fixtures/book_service/public/images/rails.png -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/process/spawner: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/process/spawner' 4 | -------------------------------------------------------------------------------- /dm-ar-finders/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | 5 | 6 | --- 7 | TODO tickets may also be found in the DataMapper Issue Tracker: 8 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 9 | -------------------------------------------------------------------------------- /dm-migrations/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | 5 | 6 | --- 7 | TODO tickets may also be found in the DataMapper Issue Tracker: 8 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 9 | -------------------------------------------------------------------------------- /dm-serializer/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | 5 | 6 | --- 7 | TODO tickets may also be found in the DataMapper Issue Tracker: 8 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 9 | -------------------------------------------------------------------------------- /dm-shorthand/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | 5 | 6 | --- 7 | TODO tickets may also be found in the DataMapper Issue Tracker: 8 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 9 | -------------------------------------------------------------------------------- /dm-timestamps/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | 5 | 6 | --- 7 | TODO tickets may also be found in the DataMapper Issue Tracker: 8 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 9 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/performance/request: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/performance/request' 4 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/process/inspector: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/process/inspector' 4 | -------------------------------------------------------------------------------- /dm-adjust/lib/dm-adjust/repository.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | class Repository 3 | def adjust(attributes, query) 4 | adapter.adjust(attributes, query) 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /dm-migrations/lib/sql/column.rb: -------------------------------------------------------------------------------- 1 | module SQL 2 | 3 | class Column 4 | 5 | attr_accessor :name, :type, :not_null, :default_value, :primary_key, :unique 6 | 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/performance/profiler: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/performance/profiler' 4 | -------------------------------------------------------------------------------- /dm-shorthand/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | gem 'rspec', '>=1.1.3' 3 | require 'spec' 4 | require 'pathname' 5 | require Pathname(__FILE__).dirname.parent.expand_path + 'lib/dm-shorthand' 6 | -------------------------------------------------------------------------------- /adapters/dm-couchdb-adapter/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | 5 | 6 | --- 7 | TODO tickets may also be found in the DataMapper Issue Tracker: 8 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 9 | -------------------------------------------------------------------------------- /adapters/dm-ferret-adapter/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | 5 | 6 | --- 7 | TODO tickets may also be found in the DataMapper Issue Tracker: 8 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 9 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | # Methods added to this helper will be available to all templates in the application. 2 | module ApplicationHelper 3 | end 4 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/script/performance/benchmarker: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require File.dirname(__FILE__) + '/../../config/boot' 3 | require 'commands/performance/benchmarker' 4 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/stories/all.rb: -------------------------------------------------------------------------------- 1 | require File.join(File.dirname(__FILE__), *%w[helper]) 2 | 3 | %w[crud].each do |dir| 4 | require File.join(File.dirname(__FILE__), "#{dir}/stories") 5 | end 6 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/models/book.rb: -------------------------------------------------------------------------------- 1 | class Book < ActiveRecord::Base 2 | validates_presence_of :title 3 | validates_presence_of :author 4 | 5 | belongs_to :shelf 6 | end 7 | -------------------------------------------------------------------------------- /dm-cli/bin/.irbrc: -------------------------------------------------------------------------------- 1 | IRB.conf[:PROMPT] = {:DM => { :PROMPT_I=>"%03n:%i dm> ", :PROMPT_N=>"%03n:%i dm> ", :PROMPT_S=>"%03n:%i%l dm", :PROMPT_C=>"%03n:%i dm*", :RETURN=>"%s\n" }} 2 | IRB.conf[:PROMPT_MODE] = :DM 3 | -------------------------------------------------------------------------------- /dm-tags/History.txt: -------------------------------------------------------------------------------- 1 | == 0.0.1 2008-07-29 2 | 3 | * 1 major enhancement: 4 | * Initial release 5 | 6 | == 0.0.2 2008-07-30 7 | 8 | * 1 major enhancement: 9 | * Added contextual finding to Model.tagged_with -------------------------------------------------------------------------------- /dm-is-remixable/spec/data/tag.rb: -------------------------------------------------------------------------------- 1 | class Tag 2 | include DataMapper::Resource 3 | 4 | property :id, Integer, :key => true, :serial => true 5 | property :name, String, :unique => true, :nullable => false 6 | end -------------------------------------------------------------------------------- /dm-is-tree/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | * dm-is-tree requires specs 5 | 6 | --- 7 | TODO tickets may also be found in the DataMapper Issue Tracker: 8 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 9 | -------------------------------------------------------------------------------- /dm-migrations/db/migrations/config.rb: -------------------------------------------------------------------------------- 1 | DataMapper::Logger.new(STDOUT, :debug) 2 | DataMapper.logger.debug( "Starting Migration" ) 3 | 4 | DataMapper.setup(:default, 'postgres://postgres@localhost/dm_core_test') 5 | -------------------------------------------------------------------------------- /dm-is-tree/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-is-tree.rb 8 | lib/dm-is-tree/is/tree.rb 9 | lib/dm-is-tree/is/version.rb 10 | spec/spec.opts 11 | -------------------------------------------------------------------------------- /dm-is-tree/lib/dm-is-tree.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'pathname' 3 | 4 | gem 'dm-core', '=0.9.6' 5 | require 'dm-core' 6 | 7 | require Pathname(__FILE__).dirname.expand_path / 'dm-is-tree' / 'is' / 'tree.rb' 8 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/test/fixtures/shelves.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | # one: 4 | # column: value 5 | # 6 | # two: 7 | # column: value 8 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/views/shelves/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 | Name: 3 | <%=h @shelf.name %> 4 |
5 | 6 | <%= link_to 'Edit', edit_shelf_path(@shelf) %> | 7 | <%= link_to 'Back', shelves_path %> 8 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/public/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // Place your application-specific JavaScript functions and classes here 2 | // This file is automatically included by javascript_include_tag :defaults 3 | -------------------------------------------------------------------------------- /merb_datamapper/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | $TESTING=true 2 | $:.push File.join(File.dirname(__FILE__), '..', 'lib') 3 | 4 | require 'rubygems' 5 | 6 | gem 'dm-core', '=0.9.6' 7 | require 'dm-core' 8 | require 'merb-core' 9 | 10 | -------------------------------------------------------------------------------- /dm-types/lib/dm-types/serial.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Types 3 | class Serial < DataMapper::Type 4 | primitive Integer 5 | serial true 6 | end # class Serial 7 | end # module Types 8 | end # module DataMapper 9 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/test/unit/book_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BookTest < ActiveSupport::TestCase 4 | # Replace this with your real tests. 5 | def test_truth 6 | assert true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /dm-shorthand/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-shorthand.rb 8 | lib/dm-shorthand/version.rb 9 | spec/spec.opts 10 | spec/spec_helper.rb 11 | spec/unit/dm-shorthand.rb 12 | -------------------------------------------------------------------------------- /dm-sweatshop/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | $TESTING=true 2 | $:.push File.join(File.dirname(__FILE__), '..', 'lib') 3 | 4 | require 'dm-sweatshop' 5 | 6 | DataMapper.setup(:default, 'sqlite3::memory:') 7 | 8 | Spec::Runner.configure do |config| 9 | end -------------------------------------------------------------------------------- /dm-tags/lib/dm-tags/version.rb: -------------------------------------------------------------------------------- 1 | require 'dm-core' 2 | module DataMapper::Tags 3 | module VERSION #:nodoc: 4 | MAJOR = 0 5 | MINOR = 0 6 | TINY = 2 7 | 8 | STRING = [MAJOR, MINOR, TINY].join('.') 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/test/unit/shelf_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ShelfTest < ActiveSupport::TestCase 4 | # Replace this with your real tests. 5 | def test_truth 6 | assert true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /dm-cli/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | bin/.irbrc 8 | bin/dm 9 | lib/dm-cli.rb 10 | lib/dm-cli/cli.rb 11 | lib/dm-cli/version.rb 12 | spec/spec.opts 13 | spec/unit/cli_spec.rb 14 | -------------------------------------------------------------------------------- /dm-tags/lib/dm-tags.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) unless 2 | $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) 3 | 4 | require 'dm-tags/tagging' 5 | require 'dm-tags/tag' 6 | require 'dm-tags/dm_tags' -------------------------------------------------------------------------------- /rails_datamapper/generators/dm_model/templates/unit_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class <%= class_name %>Test < ActiveSupport::TestCase 4 | # Replace this with your real tests. 5 | def test_truth 6 | assert true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /dm-cli/bin/dm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "rubygems" 3 | 4 | gem "dm-core", ">=0.9.5" 5 | require "dm-core" 6 | require "dm-cli" 7 | require "optparse" 8 | 9 | DataMapper::CLI::BinDir = File.dirname(__FILE__) 10 | DataMapper::CLI.start 11 | -------------------------------------------------------------------------------- /dm-observer/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-observer.rb 8 | lib/dm-observer/version.rb 9 | spec/integration/dm-observer_spec.rb 10 | spec/spec.opts 11 | spec/spec_helper.rb 12 | -------------------------------------------------------------------------------- /dm-ar-finders/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-ar-finders.rb 8 | lib/dm-ar-finders/version.rb 9 | spec/integration/ar-finders_spec.rb 10 | spec/spec.opts 11 | spec/spec_helper.rb 12 | -------------------------------------------------------------------------------- /dm-is-example/spec/integration/example_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper' 3 | 4 | if HAS_SQLITE3 || HAS_MYSQL || HAS_POSTGRES 5 | describe 'DataMapper::Is::Example' do 6 | 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /dm-timestamps/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-timestamps.rb 8 | lib/dm-timestamps/version.rb 9 | spec/integration/timestamps_spec.rb 10 | spec/spec.opts 11 | spec/spec_helper.rb 12 | -------------------------------------------------------------------------------- /dm-is-searchable/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | lib/dm-is-searchable.rb 7 | lib/dm-is-searchable/is/searchable.rb 8 | lib/dm-is-searchable/is/version.rb 9 | spec/spec.opts 10 | spec/spec_helper.rb 11 | -------------------------------------------------------------------------------- /dm-aggregates/lib/dm-aggregates/collection.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | class Collection 3 | include AggregateFunctions 4 | 5 | private 6 | 7 | def property_by_name(property_name) 8 | properties[property_name] 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /dm-cli/README.txt: -------------------------------------------------------------------------------- 1 | = dm-cli 2 | 3 | DataMapper plugin allowing interaction with models through a Command-Line 4 | Interface (CLI). 5 | 6 | For any issues or questions, in addition to tickets please contact wayneeseguin@gmail.com / wayneeseguin on irc.freenode.net. 7 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/test/fixtures/books.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | one: 4 | title: MyString 5 | author: MyString 6 | 7 | two: 8 | title: MyString 9 | author: MyString 10 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/stories/resources/helpers/book.rb: -------------------------------------------------------------------------------- 1 | class Book 2 | include DataMapper::Resource 3 | property :author, String 4 | property :created_at, DateTime 5 | property :id, Integer, :serial => true 6 | property :title, String 7 | end 8 | -------------------------------------------------------------------------------- /dm-is-remixable/spec/data/image.rb: -------------------------------------------------------------------------------- 1 | module Image 2 | include DataMapper::Resource 3 | 4 | is :remixable 5 | 6 | property :id, Integer, :key => true, :serial => true 7 | property :description, String 8 | property :path, String 9 | end 10 | -------------------------------------------------------------------------------- /dm-migrations/spec/unit/sql_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname + '../spec_helper' 3 | 4 | require Pathname(__FILE__).dirname + '../../lib/sql' 5 | 6 | describe 'SQL module' do 7 | 8 | it 'doesnt really do anything' 9 | 10 | end 11 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/test/functional/shelf_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ShelfControllerTest < ActionController::TestCase 4 | # Replace this with your real tests. 5 | def test_truth 6 | assert true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /dm-aggregates/lib/dm-aggregates/model.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Model 3 | include AggregateFunctions 4 | 5 | private 6 | 7 | def property_by_name(property_name) 8 | properties(repository.name)[property_name] 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /dm-is-list/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-is-list.rb 8 | lib/dm-is-list/is/list.rb 9 | lib/dm-is-list/is/version.rb 10 | spec/integration/list_spec.rb 11 | spec/spec.opts 12 | spec/spec_helper.rb 13 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-Agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /dm-serializer/spec/fixtures/quatum_cat.rb: -------------------------------------------------------------------------------- 1 | class QuantumCat 2 | include DataMapper::Resource 3 | 4 | property :id, Serial 5 | property :name, String 6 | property :location, String 7 | 8 | repository(:alternate) do 9 | property :is_dead, Boolean 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /dm-tags/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'spec' 3 | # require 'merb-core' 4 | require 'dm-core' 5 | require 'dm-validations' 6 | require File.dirname(__FILE__) + '/../lib/dm-tags' 7 | require File.dirname(__FILE__) + '/classes' 8 | require File.dirname(__FILE__) + '/dm-setup' -------------------------------------------------------------------------------- /dm-is-example/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-is-example.rb 8 | lib/dm-is-example/is/example.rb 9 | lib/dm-is-example/is/version.rb 10 | spec/integration/example_spec.rb 11 | spec/spec.opts 12 | spec/spec_helper.rb 13 | -------------------------------------------------------------------------------- /dm-is-remixable/spec/data/viewable.rb: -------------------------------------------------------------------------------- 1 | module Viewable 2 | include DataMapper::Resource 3 | 4 | is :remixable, 5 | :suffix => "view" 6 | 7 | property :id, Integer, :key => true, :serial => true 8 | 9 | property :created_at, DateTime 10 | property :ip, String 11 | end 12 | -------------------------------------------------------------------------------- /dm-is-versioned/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-is-versioned.rb 8 | lib/dm-is-versioned/is/version.rb 9 | lib/dm-is-versioned/is/versioned.rb 10 | spec/spec.opts 11 | spec/spec_helper.rb 12 | spec/versioned_spec.rb 13 | -------------------------------------------------------------------------------- /dm-sweatshop/lib/dm-sweatshop.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | 3 | gem 'dm-core', '=0.9.6' 4 | require 'dm-core' 5 | require 'randexp' 6 | 7 | dir = Pathname(__FILE__).dirname.expand_path / 'dm-sweatshop' 8 | 9 | require dir / "version" 10 | require dir / "sweatshop" 11 | require dir / "model" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | test_log 2 | pkg 3 | pkg/* 4 | */pkg/* 5 | bundle 6 | bundle/* 7 | doc 8 | *.log 9 | log 10 | !log*.rb 11 | */log 12 | log/* 13 | */log/* 14 | coverage 15 | */coverage 16 | lib/dm-more.rb 17 | *.db 18 | nbproject 19 | .DS_Store 20 | rspec_report.html 21 | *.swp 22 | _Yardoc 23 | -------------------------------------------------------------------------------- /merb_datamapper/lib/generators/templates/model.rb: -------------------------------------------------------------------------------- 1 | <% with_modules(modules) do -%> 2 | class <%= class_name %> 3 | include DataMapper::Resource 4 | <% attributes.each do |name, type| %> 5 | property :<%= name -%>, <%= datamapper_type(type) -%> 6 | <% end %> 7 | 8 | end 9 | <% end -%> 10 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /merb_datamapper/lib/generators/data_mapper_migration.rb: -------------------------------------------------------------------------------- 1 | Merb::Generators::MigrationGenerator.template :migration_datamapper, :orm => :datamapper do |t| 2 | t.source = File.join(File.dirname(__FILE__), 'templates/migration.rb') 3 | t.destination = "#{destination_directory}/#{file_name}.rb" 4 | end 5 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | 2 | == dm-more == 3 | 4 | Extra non-essential parts for DataMapper. 5 | 6 | Including: 7 | 8 | * Migrations 9 | * Validations 10 | * Aggregates 11 | * Observers 12 | 13 | == Aggregates 14 | 15 | Currently includes count, min, max, avg, sum (more info in dm-aggregates/README) 16 | -------------------------------------------------------------------------------- /dm-is-nested_set/lib/dm-is-nested_set.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'pathname' 3 | 4 | gem 'dm-core', '=0.9.6' 5 | require 'dm-core' 6 | 7 | gem 'dm-adjust', '=0.9.6' 8 | require 'dm-adjust' 9 | 10 | require Pathname(__FILE__).dirname.expand_path / 'dm-is-nested_set' / 'is' / 'nested_set.rb' 11 | -------------------------------------------------------------------------------- /dm-is-remixable/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-is-remixable.rb 8 | lib/dm-is-remixable/is/remixable.rb 9 | lib/dm-is-remixable/is/version.rb 10 | spec/integration/remixable_spec.rb 11 | spec/spec.opts 12 | spec/spec_helper.rb 13 | -------------------------------------------------------------------------------- /dm-serializer/spec/unit/serializer_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper' 3 | 4 | describe DataMapper::Serialize do 5 | it "is included into DataMapper::Resource" do 6 | Cow.new.should be_kind_of(DataMapper::Serialize) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /dm-is-nested_set/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-is-nested_set.rb 8 | lib/dm-is-nested_set/is/nested_set.rb 9 | lib/dm-is-nested_set/is/version.rb 10 | spec/integration/nested_set_spec.rb 11 | spec/spec.opts 12 | spec/spec_helper.rb 13 | -------------------------------------------------------------------------------- /dm-is-remixable/spec/data/commentable.rb: -------------------------------------------------------------------------------- 1 | module Commentable 2 | include DataMapper::Resource 3 | 4 | is :remixable, 5 | :suffix => "comment" 6 | 7 | property :id, Integer, :key => true, :serial => true 8 | property :comment, String 9 | property :created_at, DateTime 10 | end 11 | -------------------------------------------------------------------------------- /dm-tags/lib/dm-tags/tag.rb: -------------------------------------------------------------------------------- 1 | class Tag 2 | include DataMapper::Resource 3 | property :id, Integer, :serial => true 4 | property :name, String, :nullable => false, :unique => true 5 | 6 | has n, :taggings 7 | 8 | def taggables 9 | taggings.map{|tagging| tagging.taggable} 10 | end 11 | end -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/views/books/show.html.erb: -------------------------------------------------------------------------------- 1 |2 | Title: 3 | <%=h @book.title %> 4 |
5 | 6 |7 | Author: 8 | <%=h @book.author %> 9 |
10 | 11 | 12 | <%= link_to 'Edit', edit_book_path(@book) %> | 13 | <%= link_to 'Back', books_path %> 14 | -------------------------------------------------------------------------------- /dm-validations/spec/integration/custom_validator_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper' 3 | 4 | describe DataMapper::Validate::CustomValidator do 5 | it "should have specs" do 6 | pending 7 | # FIXME do something, add specs 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /dm-migrations/db/migrations/2_add_dob_to_people.rb: -------------------------------------------------------------------------------- 1 | migration 2, :add_dob_to_people do 2 | up do 3 | modify_table :people do 4 | add_column :dob, DateTime, :nullable? => true 5 | end 6 | end 7 | 8 | down do 9 | modify_table :people do 10 | drop_column :dob 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /dm-querizer/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-querizer.rb 8 | lib/dm-querizer/collection.rb 9 | lib/dm-querizer/model.rb 10 | lib/dm-querizer/querizer.rb 11 | lib/dm-querizer/version.rb 12 | spec/querizer_spec.rb 13 | spec/spec.opts 14 | spec/spec_helper.rb 15 | -------------------------------------------------------------------------------- /adapters/dm-ferret-adapter/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | bin/ferret 8 | lib/ferret_adapter.rb 9 | lib/ferret_adapter/local_index.rb 10 | lib/ferret_adapter/remote_index.rb 11 | lib/ferret_adapter/repository_ext.rb 12 | lib/ferret_adapter/version.rb 13 | spec/spec.opts 14 | -------------------------------------------------------------------------------- /dm-migrations/lib/sql.rb: -------------------------------------------------------------------------------- 1 | require File.dirname(__FILE__) + '/sql/table_creator' 2 | require File.dirname(__FILE__) + '/sql/table_modifier' 3 | 4 | require File.dirname(__FILE__) + '/sql/sqlite3' 5 | require File.dirname(__FILE__) + '/sql/mysql' 6 | require File.dirname(__FILE__) + '/sql/postgresql' 7 | 8 | module SQL 9 | 10 | end 11 | -------------------------------------------------------------------------------- /merb_datamapper/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | * Fix session support 5 | * Add in model migration generation 6 | * Tidy up Resource Controller generator 7 | * Add property interpolation for views 8 | --- 9 | TODO tickets may also be found in the DataMapper Issue Tracker: 10 | http://wm.lighthouseapp.com/projects/4819-datamapper/overview 11 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/db/migrate/20080621171551_create_shelves.rb: -------------------------------------------------------------------------------- 1 | class CreateShelves < ActiveRecord::Migration 2 | def self.up 3 | create_table :shelves do |t| 4 | t.string :name 5 | 6 | t.timestamps 7 | end 8 | end 9 | 10 | def self.down 11 | drop_table :shelves 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /dm-is-list/lib/dm-is-list.rb: -------------------------------------------------------------------------------- 1 | 2 | require 'rubygems' 3 | require 'pathname' 4 | 5 | gem 'dm-core', '=0.9.6' 6 | require 'dm-core' 7 | 8 | gem 'dm-adjust', '=0.9.6' 9 | require 'dm-adjust' 10 | 11 | require Pathname(__FILE__).dirname.expand_path / 'dm-is-list' / 'is' / 'list.rb' 12 | 13 | DataMapper::Model.append_extensions DataMapper::Is::List 14 | -------------------------------------------------------------------------------- /dm-migrations/db/migrations/1_create_people_table.rb: -------------------------------------------------------------------------------- 1 | migration 1, :create_people_table do 2 | up do 3 | create_table :people do 4 | column :id, Integer, :serial => true 5 | column :name, String, :size => 50 6 | column :age, Integer 7 | end 8 | end 9 | down do 10 | drop_table :people 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /rails_datamapper/generators/rspec_dm_model/templates/model_spec.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper') 2 | 3 | describe <%= class_name %> do 4 | before(:each) do 5 | @<%= file_name %> = <%= class_name %>.new 6 | end 7 | 8 | it "should be valid" do 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /dm-serializer/spec/fixtures/cow.rb: -------------------------------------------------------------------------------- 1 | class Cow 2 | include DataMapper::Resource 3 | 4 | property :id, Integer, :key => true 5 | property :composite, Integer, :key => true 6 | property :name, String 7 | property :breed, String 8 | 9 | def serialize_properties 10 | {:extra => "Extra", :another => 42} 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /dm-sweatshop/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.textile 5 | Rakefile 6 | TODO 7 | lib/dm-sweatshop.rb 8 | lib/dm-sweatshop/sweatshop.rb 9 | lib/dm-sweatshop/model.rb 10 | lib/dm-sweatshop/version.rb 11 | spec/dm-sweatshop/model_spec.rb 12 | spec/dm-sweatshop/sweatshop_spec.rb 13 | spec/spec.opts 14 | spec/spec_helper.rb 15 | -------------------------------------------------------------------------------- /dm-is-state_machine/README.txt: -------------------------------------------------------------------------------- 1 | = dm-state-machine 2 | 3 | DataMapper plugin that adds state machine functionality. 4 | 5 | == Installation 6 | 7 | Download dm-more and install dm-is-state_machine. Require it in your app. 8 | 9 | == Getting started 10 | 11 | Please refer to the integration specs in spec/integration, which refer to 12 | spec/examples. 13 | -------------------------------------------------------------------------------- /dm-migrations/lib/sql/table.rb: -------------------------------------------------------------------------------- 1 | require File.dirname(__FILE__) + '/column' 2 | 3 | module SQL 4 | 5 | class Table 6 | 7 | attr_accessor :name, :columns 8 | 9 | def to_s 10 | name 11 | end 12 | 13 | def column(column_name) 14 | @columns.select { |c| c.name == column_name.to_s }.first 15 | end 16 | 17 | end 18 | 19 | end 20 | -------------------------------------------------------------------------------- /merb_datamapper/README.txt: -------------------------------------------------------------------------------- 1 | = merb_datamapper 2 | 3 | A plugin for the Merb framework that provides DataMapper access 4 | 5 | To use sessions: 6 | 7 | 1. set the session store to datamapper in init.rb: 8 | Merb::Config.use { |c| 9 | c[:session_store] = 'datamapper' 10 | } 11 | 12 | 2. add the dependency in init.rb: 13 | use_orm :datamapper 14 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/views/shelves/new.html.erb: -------------------------------------------------------------------------------- 1 |
7 | <%= f.label :name %>
8 | <%= f.text_field :name %>
9 |
11 | <%= f.submit "Create" %> 12 |
13 | <% end %> 14 | 15 | <%= link_to 'Back', shelves_path %> 16 | -------------------------------------------------------------------------------- /dm-adjust/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-adjust.rb 8 | lib/dm-adjust/adapters/data_objects_adapter.rb 9 | lib/dm-adjust/collection.rb 10 | lib/dm-adjust/model.rb 11 | lib/dm-adjust/repository.rb 12 | lib/dm-adjust/version.rb 13 | spec/integration/adjust_spec.rb 14 | spec/spec.opts 15 | spec/spec_helper.rb 16 | -------------------------------------------------------------------------------- /dm-querizer/lib/dm-querizer/collection.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | class Collection 3 | def all(query = {},&block) 4 | query = DataMapper::Querizer.translate(&block) if block 5 | return self if query.kind_of?(Hash) ? query.empty? : query == self.query 6 | query = scoped_query(query) 7 | query.repository.read_many(query) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /dm-is-remixable/spec/data/billable.rb: -------------------------------------------------------------------------------- 1 | module Billable 2 | include DataMapper::Resource 3 | 4 | is :remixable, 5 | :suffix => "billing_account" 6 | 7 | property :id, Integer, :key => true, :serial => true 8 | 9 | property :cc_type, Enum.new("mastercard","amex","visa") 10 | property :cc_num, String, :length => 12..20 11 | property :expiration, Date 12 | end 13 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require(File.join(File.dirname(__FILE__), 'config', 'boot')) 5 | 6 | require 'rake' 7 | require 'rake/testtask' 8 | require 'rake/rdoctask' 9 | 10 | require 'tasks/rails' 11 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/db/migrate/20080608165526_create_books.rb: -------------------------------------------------------------------------------- 1 | class CreateBooks < ActiveRecord::Migration 2 | def self.up 3 | create_table :books do |t| 4 | t.string :title 5 | t.string :author 6 | t.integer :shelf_id 7 | 8 | t.timestamps 9 | end 10 | end 11 | 12 | def self.down 13 | drop_table :books 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /dm-querizer/lib/dm-querizer.rb: -------------------------------------------------------------------------------- 1 | # Needed to import datamapper and other gems 2 | require 'rubygems' 3 | require 'pathname' 4 | 5 | # Add all external dependencies for the plugin here 6 | gem 'dm-core', '=0.9.6' 7 | require 'dm-core' 8 | 9 | dir = Pathname(__FILE__).dirname.expand_path / 'dm-querizer' 10 | 11 | require dir / 'querizer' 12 | require dir / 'model' 13 | require dir / 'collection' 14 | -------------------------------------------------------------------------------- /dm-is-nested_set/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | * Add support for more than one root, and scope/namespacing 4 | * Write docs throughout the plugin 5 | * Add support for transactions and tablelocking when reorganizing items 6 | * Add function for (re)building nested set from ordinary tree 7 | * Caching the finder-methods 8 | * Allow options to pass through finders 9 | * Handle children of destroyed objects 10 | -------------------------------------------------------------------------------- /dm-is-remixable/spec/data/topic.rb: -------------------------------------------------------------------------------- 1 | require Pathname(__FILE__).dirname / "rating" 2 | 3 | class Topic 4 | include DataMapper::Resource 5 | 6 | property :id, Integer, :key => true, :serial => true 7 | 8 | property :name, String 9 | property :description, String 10 | 11 | remix n, My::Nested::Remixable::Rating, 12 | :as => :ratings_for_topic, 13 | :class_name => "Rating" 14 | 15 | end 16 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/stories/crud/delete: -------------------------------------------------------------------------------- 1 | Story: remote app wants to delete a Resource 2 | As a remote app 3 | I want to delete a Resource 4 | So that the information will no longer be available 5 | 6 | Scenario: remote app attempts to delete a Resource by ID 7 | Given a local representation of a remote Resource 8 | When I destroy the Resource 9 | Then the Resource will no longer be available 10 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/views/shelves/edit.html.erb: -------------------------------------------------------------------------------- 1 |
7 | <%= f.label :name %>
8 | <%= f.text_field :name %>
9 |
11 | <%= f.submit "Update" %> 12 |
13 | <% end %> 14 | 15 | <%= link_to 'Show', @shelf %> | 16 | <%= link_to 'Back', shelves_path %> 17 | -------------------------------------------------------------------------------- /README.textile: -------------------------------------------------------------------------------- 1 | h1. dm-more 2 | 3 | h2. Extra, non-essential parts for DataMapper 4 | 5 | Including 6 | 7 | * Migrations 8 | * Validations 9 | * Serializers 10 | * A Command-Line Interface 11 | * Timestamps 12 | * Types 13 | * ActiveRecord-style finders 14 | * Adapters for your favorite repository or database type 15 | * Integration with your favorite web frameworks 16 | * Observers for watching resources. 17 | -------------------------------------------------------------------------------- /dm-adjust/lib/dm-adjust.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'pathname' 3 | 4 | require Pathname(__FILE__).dirname + 'dm-adjust/version' 5 | 6 | gem 'dm-core', DataMapper::More::Adjust::VERSION 7 | require 'dm-core' 8 | 9 | dir = Pathname(__FILE__).dirname.expand_path / 'dm-adjust' 10 | 11 | require dir / 'collection' 12 | require dir / 'model' 13 | require dir / 'repository' 14 | require dir / 'adapters' / 'data_objects_adapter' 15 | -------------------------------------------------------------------------------- /dm-is-state_machine/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | * Should skipping to a new state automatically trigger :enter Proc? 5 | * Add loopback checking (i.e. when transitioning from a state back to itself) 6 | * Add support for callbacks 7 | * Consider using DataMapper's Enum type. 8 | * Consider trying out a nested state machine. 9 | * Not real happy with spec/unit/dsl: 10 | - specs are brittle 11 | - specs don't actually test much 12 | -------------------------------------------------------------------------------- /adapters/dm-couchdb-adapter/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/couchdb_adapter.rb 8 | lib/couchdb_adapter/attachments.rb 9 | lib/couchdb_adapter/json_object.rb 10 | lib/couchdb_adapter/version.rb 11 | lib/couchdb_adapter/view.rb 12 | spec/couchdb_adapter_spec.rb 13 | spec/couchdb_attachments_spec.rb 14 | spec/couchdb_view_spec.rb 15 | spec/spec.opts 16 | spec/testfile.txt 17 | -------------------------------------------------------------------------------- /merb_datamapper/lib/generators/templates/model_migration.rb: -------------------------------------------------------------------------------- 1 | migration <%= current_migration_nr + 1 %>, :<%= migration_name %> do 2 | up do 3 | <% unless properties.empty? -%> 4 | create_table :<%= table_name %> do 5 | <% properties.each do |p| -%> 6 | column :<%= p.name -%>, <%= p.type %> 7 | <% end -%> 8 | end 9 | <% end -%> 10 | end 11 | 12 | down do 13 | drop_table :<%= table_name %> 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /dm-tags/config/requirements.rb: -------------------------------------------------------------------------------- 1 | require 'fileutils' 2 | include FileUtils 3 | 4 | require 'rubygems' 5 | %w[rake hoe newgem rubigen spec dm-core].each do |req_gem| 6 | begin 7 | require req_gem 8 | rescue LoadError 9 | puts "This Rakefile requires the '#{req_gem}' RubyGem." 10 | puts "Installation: gem install #{req_gem} -y" 11 | exit 12 | end 13 | end 14 | 15 | $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib])) 16 | -------------------------------------------------------------------------------- /dm-is-state_machine/spec/integration/invalid_events_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper' 3 | 4 | describe "InvalidEvents" do 5 | 6 | it "should get InvalidContext when requiring" do 7 | lambda { 8 | require File.join( File.dirname(__FILE__), "..", "examples", "invalid_events" ) 9 | }.should raise_error(DataMapper::Is::StateMachine::InvalidContext) 10 | end 11 | 12 | end 13 | -------------------------------------------------------------------------------- /dm-is-state_machine/spec/integration/invalid_states_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper' 3 | 4 | describe "InvalidStates" do 5 | 6 | it "should get InvalidContext when requiring" do 7 | lambda { 8 | require File.join( File.dirname(__FILE__), "..", "examples", "invalid_states" ) 9 | }.should raise_error(DataMapper::Is::StateMachine::InvalidContext) 10 | end 11 | 12 | end 13 | -------------------------------------------------------------------------------- /dm-is-remixable/spec/data/taggable.rb: -------------------------------------------------------------------------------- 1 | module Taggable 2 | def self.included(base) 3 | base.extend Taggable::ClassMethods 4 | end 5 | 6 | include DataMapper::Resource 7 | 8 | is :remixable 9 | 10 | property :id, Integer, :key => true, :serial => true 11 | property :tag_id, Integer 12 | 13 | 14 | 15 | 16 | module ClassMethods 17 | 18 | def related_tags 19 | puts "should work" 20 | end 21 | 22 | end 23 | 24 | end -------------------------------------------------------------------------------- /dm-tags/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | License.txt 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | lib/dm-tags.rb 7 | lib/dm-tags/dm_tags.rb 8 | lib/dm-tags/tag.rb 9 | lib/dm-tags/tagging.rb 10 | lib/dm-tags/version.rb 11 | setup.rb 12 | spec/classes.rb 13 | spec/dm-setup.rb 14 | spec/dm-tags/dm_tags_spec.rb 15 | spec/dm-tags/tag_spec.rb 16 | spec/dm-tags/taggable_spec.rb 17 | spec/dm-tags/tagging_spec.rb 18 | spec/spec.opts 19 | spec/spec_helper.rb 20 | tasks/rspec.rake -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/views/books/new.html.erb: -------------------------------------------------------------------------------- 1 |
7 | <%= f.label :title %>
8 | <%= f.text_field :title %>
9 |
11 | <%= f.label :author %>
12 | <%= f.text_field :author %>
13 |
15 | <%= f.submit "Create" %> 16 |
17 | <% end %> 18 | 19 | <%= link_to 'Back', books_path %> 20 | -------------------------------------------------------------------------------- /dm-aggregates/lib/dm-aggregates.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | 3 | dir = Pathname(__FILE__).dirname.expand_path + 'dm-aggregates' 4 | 5 | require dir + 'version' 6 | gem 'dm-core', DataMapper::More::Aggregates::VERSION 7 | require 'dm-core' 8 | 9 | 10 | require dir + 'aggregate_functions' 11 | require dir + 'model' 12 | require dir + 'repository' 13 | require dir + 'collection' 14 | require dir + 'adapters' + 'data_objects_adapter' 15 | require dir + 'support' + 'symbol' 16 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format 4 | # (all these examples are active by default): 5 | # Inflector.inflections do |inflect| 6 | # inflect.plural /^(ox)$/i, '\1en' 7 | # inflect.singular /^(ox)en/i, '\1' 8 | # inflect.irregular 'person', 'people' 9 | # inflect.uncountable %w( fish sheep ) 10 | # end 11 | -------------------------------------------------------------------------------- /dm-is-state_machine/spec/examples/invalid_events.rb: -------------------------------------------------------------------------------- 1 | # An invalid example. 2 | class InvalidEvents 3 | include DataMapper::Resource 4 | 5 | property :id, Serial 6 | 7 | is :state_machine do 8 | state :day 9 | state :night 10 | end 11 | 12 | # The next lines are intentionally incorrect. 13 | # 14 | # 'event' only makes sense in a block under 'is :state_machine' 15 | event :sunrise 16 | event :sunset 17 | 18 | end 19 | 20 | InvalidEvents.auto_migrate! 21 | -------------------------------------------------------------------------------- /dm-is-state_machine/spec/examples/invalid_states.rb: -------------------------------------------------------------------------------- 1 | # An invalid example. 2 | class InvalidStates 3 | include DataMapper::Resource 4 | 5 | property :id, Serial 6 | 7 | is :state_machine do 8 | event :sunrise 9 | event :sunset 10 | end 11 | 12 | # The next lines are intentionally incorrect. 13 | # 14 | # 'state' only makes sense in a block under 'is :state_machine' 15 | state :light 16 | state :dark 17 | 18 | end 19 | 20 | InvalidStates.auto_migrate! 21 | -------------------------------------------------------------------------------- /rails_datamapper/generators/dm_model/templates/migration.rb: -------------------------------------------------------------------------------- 1 | class <%= migration_name %> < ActiveRecord::Migration 2 | def self.up 3 | create_table :<%= table_name %> do |t| 4 | <% for attribute in attributes -%> 5 | t.<%= attribute.type %> :<%= attribute.name %> 6 | <% end -%> 7 | <% unless options[:skip_timestamps] %> 8 | t.timestamps 9 | <% end -%> 10 | end 11 | end 12 | 13 | def self.down 14 | drop_table :<%= table_name %> 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /dm-adjust/README.txt: -------------------------------------------------------------------------------- 1 | dm-adjust 2 | ============= 3 | 4 | DataMapper plugin providing methods to increment and decrement properties 5 | 6 | It provides the following function (for collections and resources): 7 | 8 | == adjust 9 | 10 | Person.adjust(:salary => 1000) # increases the salary of all people with 1000. 11 | Person.all(:age.gte => 40).adjust(:salary => 2000) # increase salary of them oldies. 12 | Children.adjust(:allowance => -100) # less money for candy and concerts 13 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/stories/helper.rb: -------------------------------------------------------------------------------- 1 | $LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/../lib/rest_adapter") 2 | require 'rubygems' 3 | require 'spec' 4 | require 'tempfile' 5 | require 'dm-core' 6 | #require 'pathname' 7 | #require Pathname(__FILE__).dirname.parent.expand_path + '../../lib/rest_adapter' 8 | require File.join(File.dirname(__FILE__), *%w[resources helpers story_helper]) 9 | require File.join(File.dirname(__FILE__), *%w[resources steps using_rest_adapter]) 10 | -------------------------------------------------------------------------------- /dm-is-versioned/lib/dm-is-versioned.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'pathname' 3 | 4 | gem 'dm-core', '=0.9.6' 5 | require 'dm-core' 6 | 7 | require Pathname(__FILE__).dirname.expand_path / 'dm-is-versioned' / 'is' / 'versioned.rb' 8 | 9 | # Include the plugin in Resource 10 | module DataMapper 11 | module Resource 12 | module ClassMethods 13 | include DataMapper::Is::Versioned 14 | end # module ClassMethods 15 | end # module Resource 16 | end # module DataMapper 17 | -------------------------------------------------------------------------------- /dm-aggregates/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-aggregates.rb 8 | lib/dm-aggregates/adapters/data_objects_adapter.rb 9 | lib/dm-aggregates/aggregate_functions.rb 10 | lib/dm-aggregates/collection.rb 11 | lib/dm-aggregates/model.rb 12 | lib/dm-aggregates/repository.rb 13 | lib/dm-aggregates/support/symbol.rb 14 | lib/dm-aggregates/version.rb 15 | spec/integration/aggregates_spec.rb 16 | spec/spec.opts 17 | spec/spec_helper.rb 18 | -------------------------------------------------------------------------------- /dm-constraints/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | lib/dm-constraints.rb 8 | lib/dm-constraints/data_objects_adapter.rb 9 | lib/dm-constraints/mysql_adapter.rb 10 | lib/dm-constraints/postgres_adapter.rb 11 | lib/dm-constraints/version.rb 12 | spec/integration/constraints_spec.rb 13 | spec/spec.opts 14 | spec/spec_helper.rb 15 | tasks/ci.rb 16 | tasks/dm.rb 17 | tasks/doc.rb 18 | tasks/gemspec.rb 19 | tasks/hoe.rb 20 | tasks/install.rb 21 | -------------------------------------------------------------------------------- /dm-aggregates/lib/dm-aggregates/support/symbol.rb: -------------------------------------------------------------------------------- 1 | class Symbol 2 | def count 3 | DataMapper::Query::Operator.new(self, :count) 4 | end 5 | 6 | def min 7 | DataMapper::Query::Operator.new(self, :min) 8 | end 9 | 10 | def max 11 | DataMapper::Query::Operator.new(self, :max) 12 | end 13 | 14 | def avg 15 | DataMapper::Query::Operator.new(self, :avg) 16 | end 17 | 18 | def sum 19 | DataMapper::Query::Operator.new(self, :sum) 20 | end 21 | end # class Symbol 22 | -------------------------------------------------------------------------------- /dm-is-remixable/spec/data/addressable.rb: -------------------------------------------------------------------------------- 1 | module Addressable 2 | include DataMapper::Resource 3 | 4 | is :remixable, 5 | :suffix => "address" 6 | 7 | property :id, Integer, :key => true, :serial => true 8 | 9 | property :address1, String, :length => 255 10 | property :address2, String, :length => 255 11 | 12 | property :city, String, :length => 128 13 | property :state, String, :length => 2 14 | property :zip, String, :length => 5..10 15 | end 16 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/spec/ruby_forker.rb: -------------------------------------------------------------------------------- 1 | require 'rbconfig' 2 | 3 | module RubyForker 4 | # Forks a ruby interpreter with same type as ourself. 5 | # juby will fork jruby, ruby will fork ruby etc. 6 | def ruby(args, stderr=nil) 7 | config = ::Config::CONFIG 8 | interpreter = File::join(config['bindir'], config['ruby_install_name']) + config['EXEEXT'] 9 | cmd = "#{interpreter} #{args}" 10 | cmd << " 2> #{stderr}" unless stderr.nil? 11 | `#{cmd}` 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /dm-tags/lib/dm-tags/tagging.rb: -------------------------------------------------------------------------------- 1 | class Tagging 2 | include DataMapper::Resource 3 | property :id, Integer, :serial => true 4 | property :tag_id, Integer, :nullable => false 5 | property :taggable_id, Integer, :nullable => false 6 | property :taggable_type, String, :nullable => false 7 | property :tag_context, String, :nullable => false 8 | 9 | belongs_to :tag 10 | 11 | def taggable 12 | eval("#{taggable_type}.get!(#{taggable_id})") if taggable_type and taggable_id 13 | end 14 | end -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/views/books/edit.html.erb: -------------------------------------------------------------------------------- 1 |
7 | <%= f.label :title %>
8 | <%= f.text_field :title %>
9 |
11 | <%= f.label :author %>
12 | <%= f.text_field :author %>
13 |
15 | <%= f.submit "Update" %> 16 |
17 | <% end %> 18 | 19 | <%= link_to 'Show', @book %> | 20 | <%= link_to 'Back', books_path %> 21 | -------------------------------------------------------------------------------- /dm-migrations/spec/unit/sql/column_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname + '../../spec_helper' 3 | 4 | require Pathname(__FILE__).dirname + '../../../lib/sql/column' 5 | 6 | describe SQL::Column do 7 | before do 8 | @column = SQL::Column.new 9 | end 10 | 11 | %w{name type not_null default_value primary_key unique}.each do |meth| 12 | it "should have a ##{meth} attribute" do 13 | @column.should respond_to(meth.intern) 14 | end 15 | end 16 | 17 | end 18 | -------------------------------------------------------------------------------- /dm-serializer/Manifest.txt: -------------------------------------------------------------------------------- 1 | History.txt 2 | LICENSE 3 | Manifest.txt 4 | README.txt 5 | Rakefile 6 | TODO 7 | autotest/discover.rb 8 | autotest/dmserializer_rspec.rb 9 | lib/dm-serializer.rb 10 | lib/dm-serializer/version.rb 11 | spec/fixtures/cow.rb 12 | spec/fixtures/planet.rb 13 | spec/fixtures/quatum_cat.rb 14 | spec/spec.opts 15 | spec/spec_helper.rb 16 | spec/unit/serializer_spec.rb 17 | spec/unit/to_csv_spec.rb 18 | spec/unit/to_json_spec.rb 19 | spec/unit/to_xml_spec.rb 20 | spec/unit/to_yaml_spec.rb 21 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname.parent.expand_path + 'lib/rest_adapter' 3 | 4 | DataMapper.setup(:default, { 5 | :adapter => 'rest', 6 | :format => 'xml', 7 | :host => 'localhost', 8 | :port => '3001' 9 | }) 10 | 11 | class Book 12 | include DataMapper::Resource 13 | property :author, String 14 | property :created_at, DateTime 15 | property :id, Integer, :serial => true 16 | property :title, String 17 | end 18 | -------------------------------------------------------------------------------- /dm-serializer/spec/fixtures/planet.rb: -------------------------------------------------------------------------------- 1 | class Planet 2 | include DataMapper::Resource 3 | 4 | property :name, String, :key => true 5 | property :aphelion, Float 6 | 7 | def category 8 | case self.name.downcase 9 | when "mercury", "venus", "earth", "mars" then "terrestrial" 10 | when "jupiter", "saturn", "uranus", "neptune" then "gas giants" 11 | when "pluto" then "dwarf planets" 12 | end 13 | end 14 | 15 | def has_known_form_of_life? 16 | self.name.downcase == "earth" 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /dm-adjust/lib/dm-adjust/model.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Model 3 | 4 | ## 5 | # increment or decrement attributes on all objects in a resource 6 | # 7 | # @example [Usage] 8 | # * People.adjust(:salary => +1000) 9 | # * Children.adjust(:allowance => -100) 10 | # 11 | # @param attributesEdit this file in app/views/<%= file_name %>/show.html.erb
4 | 5 | <% for property in properties -%> 6 |7 | <%= Extlib::Inflection.humanize(property.field) %>: 8 | <%%=h @<%= singular_model %>.<%= property.getter %> %> 9 |
10 | 11 | <% end -%> 12 | 13 | <%%= link_to 'Edit', url(:edit_<%= singular_model %>, @<%= singular_model %>) %> | 14 | <%%= link_to 'Back', url(:<%= plural_model %>) %> 15 | -------------------------------------------------------------------------------- /dm-types/lib/dm-types/regexp.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Types 3 | class Regexp < DataMapper::Type 4 | primitive String 5 | 6 | def self.load(value, property) 7 | ::Regexp.new(value) unless value.nil? 8 | end 9 | 10 | def self.dump(value, property) 11 | return nil if value.nil? 12 | value.source 13 | end 14 | 15 | def self.typecast(value, property) 16 | value.kind_of?(::Regexp) ? value : load(value, property) 17 | end 18 | end 19 | end 20 | end 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /adapters/dm-ferret-adapter/lib/ferret_adapter/repository_ext.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | class Repository 3 | # This accepts a ferret query string and an optional limit argument 4 | # which defaults to all. This is the proper way to perform searches more 5 | # complicated than DM's query syntax can handle (such as OR searches). 6 | # 7 | # See DataMapper::Adapters::FerretAdapter#search for information on 8 | # the return value. 9 | def search(query, limit = :all) 10 | adapter.search(query, limit) 11 | end 12 | end 13 | end -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/views/shelves/index.html.erb: -------------------------------------------------------------------------------- 1 || Name | 6 ||||
|---|---|---|---|
| <%=h shelf.name %> | 11 |<%= link_to 'Show', shelf %> | 12 |<%= link_to 'Edit', edit_shelf_path(shelf) %> | 13 |<%= link_to 'Destroy', shelf, :confirm => 'Are you sure?', :method => :delete %> | 14 |
<%= flash[:notice] %>
13 | 14 | <%= yield %> 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /dm-is-example/lib/dm-is-example.rb: -------------------------------------------------------------------------------- 1 | # Needed to import datamapper and other gems 2 | require 'rubygems' 3 | require 'pathname' 4 | 5 | # Add all external dependencies for the plugin here 6 | gem 'dm-core', '=0.9.6' 7 | require 'dm-core' 8 | 9 | # Require plugin-files 10 | require Pathname(__FILE__).dirname.expand_path / 'dm-is-example' / 'is' / 'example.rb' 11 | 12 | 13 | # Include the plugin in Resource 14 | module DataMapper 15 | module Resource 16 | module ClassMethods 17 | include DataMapper::Is::Example 18 | end # module ClassMethods 19 | end # module Resource 20 | end # module DataMapper 21 | -------------------------------------------------------------------------------- /merb_datamapper/lib/generators/templates/views/new.html.erb: -------------------------------------------------------------------------------- 1 |Edit this file in app/views/<%= file_name %>/new.html.erb
4 | 5 | <%%= form_for(@<%= singular_model %>, :action => url(:<%= plural_model %>) ) do %> 6 | <% for property in properties.select{|p| !p.key?} -%> 7 |8 | <%%= text_field :<%= property %>, :label => "<%= Extlib::Inflection.humanize(property) %>" %> 9 |
10 | 11 | <% end -%> 12 |13 | <%%= submit "Create" %> 14 |
15 | <%% end =%> 16 | 17 | <%%= link_to 'Back', url(:<%= plural_model %>) %> 18 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/views/books/index.html.erb: -------------------------------------------------------------------------------- 1 || Title | 6 |Author | 7 ||||
|---|---|---|---|---|
| <%=h book.title %> | 12 |<%=h book.author %> | 13 |<%= link_to 'Show', book %> | 14 |<%= link_to 'Edit', edit_book_path(book) %> | 15 |<%= link_to 'Destroy', book, :confirm => 'Are you sure?', :method => :delete %> | 16 |
Edit this file in app/views/<%= file_name %>/edit.html.erb
4 | 5 | <%%= form_for(@<%= singular_model %>, :action => url(:<%= singular_model %>, @<%= singular_model %>)) do %> 6 | <% for property in properties.select{|p| !p.key?} -%> 7 |8 | <%%= text_field :<%= property %>, :label => "<%= Extlib::Inflection.humanize(property) %>" %> 9 |
10 | 11 | <% end -%> 12 |13 | <%%= submit "Update" %> 14 |
15 | <%% end =%> 16 | 17 | <%%= link_to 'Show', url(:<%= singular_model %>, @<%= singular_model %>) %> | 18 | <%%= link_to 'Back', url(:<%= plural_model %>) %> 19 | -------------------------------------------------------------------------------- /dm-validations/lib/dm-validations/formats/url.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Validate 3 | module Format 4 | module Url 5 | 6 | def self.included(base) 7 | DataMapper::Validate::FormatValidator::FORMATS.merge!( 8 | :url => [ Url, lambda { |field, value| '%s is not a valid URL'.t(value) }] 9 | ) 10 | end 11 | 12 | Url = begin 13 | # Regex from http://www.igvita.com/2006/09/07/validating-url-in-ruby-on-rails/ 14 | /(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix 15 | end 16 | 17 | end # module Url 18 | end # module Format 19 | end # module Validate 20 | end # module DataMapper 21 | -------------------------------------------------------------------------------- /dm-types/lib/dm-types/file_path.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | 3 | module DataMapper 4 | module Types 5 | class FilePath < DataMapper::Type 6 | primitive String 7 | 8 | def self.load(value, property) 9 | if value.nil? 10 | nil 11 | else 12 | Pathname.new(value) 13 | end 14 | end 15 | 16 | def self.dump(value, property) 17 | return nil if value.nil? 18 | value.to_s 19 | end 20 | 21 | def self.typecast(value, property) 22 | # Leave alone if a Pathname is given. 23 | value.kind_of?(Pathname) ? value : load(value, property) 24 | end 25 | end # class FilePath 26 | end # module Types 27 | end # module DataMapper 28 | -------------------------------------------------------------------------------- /dm-types/lib/dm-types/csv.rb: -------------------------------------------------------------------------------- 1 | module DataMapper 2 | module Types 3 | class Csv < DataMapper::Type 4 | primitive String 5 | size 65535 6 | lazy true 7 | 8 | def self.load(value, property) 9 | case value 10 | when String then FasterCSV.parse(value) 11 | when Array then value 12 | else nil 13 | end 14 | end 15 | 16 | def self.dump(value, property) 17 | case value 18 | when Array then 19 | FasterCSV.generate do |csv| 20 | value.each { |row| csv << row } 21 | end 22 | when String then value 23 | else nil 24 | end 25 | end 26 | end # class Csv 27 | end # module Types 28 | end # module DataMapper 29 | -------------------------------------------------------------------------------- /dm-types/lib/dm-types/uri.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'addressable/uri' 3 | 4 | module DataMapper 5 | module Types 6 | class URI < DataMapper::Type 7 | primitive String 8 | 9 | def self.load(value, property) 10 | Addressable::URI.parse(value) 11 | end 12 | 13 | def self.dump(value, property) 14 | return nil if value.nil? 15 | value.to_s 16 | end 17 | 18 | def self.typecast(value, property) 19 | if value.kind_of?(Addressable::URI) 20 | value 21 | elsif value.nil? 22 | load(nil, property) 23 | else 24 | load(value.to_s, property) 25 | end 26 | end 27 | end # class URI 28 | end # module Types 29 | end # module DataMapper 30 | -------------------------------------------------------------------------------- /dm-constraints/tasks/install.rb: -------------------------------------------------------------------------------- 1 | WIN32 = (RUBY_PLATFORM =~ /win32|mingw|bccwin|cygwin/) rescue nil 2 | SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS']) 3 | 4 | desc "Install #{GEM_NAME}" 5 | if WIN32 6 | task :install => :gem do 7 | system %{gem install --no-rdoc --no-ri -l pkg/#{GEM_NAME}-#{GEM_VERSION}.gem} 8 | end 9 | namespace :dev do 10 | desc 'Install for development (for windows)' 11 | task :winstall => :gem do 12 | warn "You can now call 'rake install' instead of 'rake dev:winstall'." 13 | system %{gem install --no-rdoc --no-ri -l pkg/#{GEM_NAME}-#{GEM_VERSION}.gem} 14 | end 15 | end 16 | else 17 | task :install => :package do 18 | sh %{#{SUDO} gem install --local pkg/#{GEM_NAME}-#{GEM_VERSION}.gem} 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /dm-types/spec/integration/ip_address_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname.parent.expand_path + 'spec_helper' 3 | 4 | describe DataMapper::Types::IPAddress do 5 | before(:all) do 6 | class IPAddressTest 7 | include DataMapper::Resource 8 | 9 | property :id, Serial 10 | property :ip, IPAddress 11 | end 12 | IPAddressTest.auto_migrate! 13 | end 14 | 15 | it "should work" do 16 | repository(:default) do 17 | IPAddressTest.create(:ip => '127.0.0.1') 18 | end 19 | 20 | IPAddressTest.first.ip.should == IPAddr.new('127.0.0.1') 21 | end 22 | 23 | it 'should immediately typecast supplied values' do 24 | IPAddressTest.new(:ip => '10.0.0.1').ip.should == IPAddr.new('10.0.0.1') 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /dm-types/spec/integration/file_path_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname.parent.expand_path + 'spec_helper' 3 | 4 | describe DataMapper::Types::FilePath do 5 | before(:all) do 6 | class FilePathTest 7 | include DataMapper::Resource 8 | 9 | property :id, Integer, :serial => true 10 | property :path, FilePath 11 | end 12 | FilePathTest.auto_migrate! 13 | end 14 | 15 | it "should work" do 16 | repository(:default) do 17 | FilePathTest.create!(:path => '/usr') 18 | end 19 | 20 | FilePathTest.first.path.should == Pathname.new('/usr') 21 | end 22 | 23 | it 'should immediately typecast supplied values' do 24 | FilePathTest.new(:path => '/usr').path.should == Pathname.new('/usr') 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /dm-is-state_machine/spec/integration/invalid_transitions_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper' 3 | 4 | describe "InvalidTransitions1" do 5 | 6 | it "should get InvalidContext when requiring" do 7 | lambda { 8 | require File.join( File.dirname(__FILE__), "..", "examples", "invalid_transitions_1" ) 9 | }.should raise_error(DataMapper::Is::StateMachine::InvalidContext) 10 | end 11 | 12 | end 13 | 14 | describe "InvalidTransitions2" do 15 | 16 | it "should get InvalidContext when requiring" do 17 | lambda { 18 | require File.join( File.dirname(__FILE__), "..", "examples", "invalid_transitions_2" ) 19 | }.should raise_error(DataMapper::Is::StateMachine::InvalidContext) 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /dm-constraints/tasks/gemspec.rb: -------------------------------------------------------------------------------- 1 | desc "Generate gemspec" 2 | task :gemspec do |x| 3 | # Clean up extraneous files before checking manifest 4 | %x[rake clean] 5 | 6 | # Check the manifest before generating the gemspec 7 | manifest = %x[rake check_manifest] 8 | manifest.gsub!("(in /usr/local/projects/dm/dm-core)\n", "") 9 | 10 | unless manifest.empty? 11 | print "\n", "#"*68, "\n" 12 | print <<-EOS 13 | Manifest.txt is not up-to-date. Please review the changes below. 14 | If the changes are correct, run 'rake check_manifest | patch' 15 | and then run this command again. 16 | EOS 17 | print "#"*68, "\n\n" 18 | puts manifest 19 | else 20 | %x[rake debug_gem > #{GEM_NAME}.gemspec] 21 | puts "Successfully created gemspec for #{GEM_NAME}!" 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /dm-types/lib/dm-types/permalink.rb: -------------------------------------------------------------------------------- 1 | require 'iconv' 2 | 3 | module DataMapper 4 | module Types 5 | class Permalink < DataMapper::Type 6 | primitive String 7 | size 65535 8 | 9 | def self.load(value, property) 10 | if value.nil? 11 | nil 12 | elsif value.is_a?(String) 13 | Iconv.new('UTF-8//TRANSLIT//IGNORE', 'UTF-8').iconv(value.gsub(/[^\w\s\-\—]/,'').gsub(/[^\w]|[\_]/,' ').split.join('-').downcase) 14 | else 15 | raise ArgumentError.new("+value+ must be nil or a String") 16 | end 17 | end 18 | 19 | def self.dump(value, property) 20 | return nil if value.nil? 21 | value.to_s 22 | end 23 | 24 | end # class Permalink 25 | end # module Types 26 | end # module DataMapper -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/config/initializers/new_rails_defaults.rb: -------------------------------------------------------------------------------- 1 | # These settings change the behavior of Rails 2 apps and will be defaults 2 | # for Rails 3. You can remove this initializer when Rails 3 is released. 3 | 4 | # Include Active Record class name as root for JSON serialized output. 5 | ActiveRecord::Base.include_root_in_json = true 6 | 7 | # Store the full class name (including module namespace) in STI type column. 8 | ActiveRecord::Base.store_full_sti_class = true 9 | 10 | # Use ISO 8601 format for JSON serialized times and dates. 11 | ActiveSupport.use_standard_json_time_format = true 12 | 13 | # Don't escape HTML entities in JSON, leave that for the #json_escape helper. 14 | # if you're including raw json in an HTML page. 15 | ActiveSupport.escape_html_entities_in_json = false 16 | -------------------------------------------------------------------------------- /dm-querizer/README.txt: -------------------------------------------------------------------------------- 1 | = dm-querizer 2 | 3 | DataMapper plugin that provides a short rubyish query-syntax. 4 | 5 | When this plugin is loaded you can supply blocks to #all and #first. Ordinary hashes 6 | still work, so you do not lose any functionality. 7 | 8 | Old: User.all( :name => 'john', :age.gt => 20 ) 9 | New: User.all{ name == 'john' && age > 20 } 10 | 11 | Old: User.all( :age.gte => 35, :name.like => 'mark%' ) 12 | New: User.all{ age >= 35 && name =~ 'mark%' } 13 | 14 | You can also use ';' instead of '&&' for even shorter queries. 15 | 16 | User.all{ name == 'john' && age > 20 } 17 | User.all{ name == 'john'; age > 20 } 18 | 19 | The plugin is still very much experimental. != is not working (and might never work). 20 | Instead you can use '~'; 21 | 22 | Old: User.all( :name.not => 'mark' ) 23 | New: User.all{ name ~ 'mark' } 24 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/app/controllers/application.rb: -------------------------------------------------------------------------------- 1 | # Filters added to this controller apply to all controllers in the application. 2 | # Likewise, all the methods added will be available for all controllers. 3 | 4 | class ApplicationController < ActionController::Base 5 | helper :all # include all helpers, all the time 6 | 7 | # See ActionController::RequestForgeryProtection for details 8 | # Uncomment the :secret if you're not using the cookie session store 9 | protect_from_forgery # :secret => 'fb23937b455a775732b021a8db838ba7' 10 | 11 | # See ActionController::Base for details 12 | # Uncomment this to filter the contents of submitted sensitive data parameters 13 | # from your application log (in this case, all fields with names like "password"). 14 | # filter_parameter_logging :password 15 | end 16 | -------------------------------------------------------------------------------- /dm-types/spec/unit/regexp_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname.parent.expand_path + 'spec_helper' 3 | 4 | describe DataMapper::Types::Regexp, ".load" do 5 | it 'should make a Regexp from the value if a string is provided' do 6 | Regexp.should_receive(:new).with('regexp_string').once 7 | DataMapper::Types::Regexp.load('regexp_string', :property) 8 | end 9 | 10 | it 'should return nil otherwise' do 11 | DataMapper::Types::Regexp.load(nil, :property).should == nil 12 | end 13 | end 14 | 15 | describe DataMapper::Types::Regexp, ".dump" do 16 | it 'should dump to a string' do 17 | DataMapper::Types::Regexp.dump(/\d+/, :property).should == "\\d+" 18 | end 19 | 20 | it 'should return nil if the value is nil' do 21 | DataMapper::Types::Regexp.dump(nil, :property).should == nil 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /dm-migrations/spec/unit/sql/table_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname + '../../spec_helper' 3 | 4 | require Pathname(__FILE__).dirname + '../../../lib/sql/table' 5 | 6 | describe SQL::Table do 7 | before do 8 | @table = SQL::Table.new 9 | end 10 | 11 | %w{name columns}.each do |meth| 12 | it "should have a ##{meth} attribute" do 13 | @table.should respond_to(meth.intern) 14 | end 15 | end 16 | 17 | it 'should #to_s as the name' do 18 | @table.name = "table_name" 19 | @table.to_s.should == "table_name" 20 | end 21 | 22 | it 'should find a column by name' do 23 | column_a = mock('column', :name => 'id') 24 | column_b = mock('column', :name => 'login') 25 | @table.columns = [column_a, column_b] 26 | 27 | @table.column('id').should == column_a 28 | end 29 | 30 | 31 | end 32 | -------------------------------------------------------------------------------- /dm-constraints/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | gem 'rspec', '>=1.1.3' 3 | require 'spec' 4 | require 'pathname' 5 | 6 | gem 'dm-core', '>=0.9.5' 7 | require 'dm-core' 8 | 9 | def load_driver(name, default_uri) 10 | 11 | lib = "do_#{name}" 12 | begin 13 | gem lib, '>=0.9.5' 14 | require lib 15 | DataMapper.setup(name, ENV["#{name.to_s.upcase}_SPEC_URI"] || default_uri) 16 | DataMapper::Repository.adapters[:default] = DataMapper::Repository.adapters[name] 17 | name 18 | rescue Gem::LoadError => e 19 | warn "Could not load #{lib}: #{e}" 20 | false 21 | end 22 | end 23 | 24 | HAS_POSTGRES = load_driver(:postgres, 'postgres://postgres@localhost/dm_core_test') 25 | HAS_MYSQL = load_driver(:mysql, 'mysql://localhost/dm_core_test') 26 | 27 | require Pathname(__FILE__).dirname.expand_path.parent + 'lib/dm-constraints' 28 | -------------------------------------------------------------------------------- /dm-is-state_machine/spec/unit/data/event_spec.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper' 3 | 4 | module EventHelper 5 | def new_event(*args) 6 | DataMapper::Is::StateMachine::Data::Event.new(*args) 7 | end 8 | end 9 | 10 | describe DataMapper::Is::StateMachine::Data::Event do 11 | include EventHelper 12 | 13 | before(:each) do 14 | @machine = mock("machine") 15 | @event = new_event(:ping, @machine) 16 | end 17 | 18 | it "#initialize should work" do 19 | @event.name.should == :ping 20 | @event.machine.should == @machine 21 | @event.transitions.should == [] 22 | end 23 | 24 | it "#add_transition should work" do 25 | @event.add_transition(:nothing, :pinged) 26 | @event.transitions.should == [{:from => :nothing, :to => :pinged }] 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/db/migrate/20080629143033_create_fake_books_and_shelves.rb: -------------------------------------------------------------------------------- 1 | class CreateFakeBooksAndShelves < ActiveRecord::Migration 2 | def self.up 3 | books = [] 4 | books << Book.new(:title => "The Pragmatic Programmer", :author => "Dave Thomas") 5 | books << Book.new(:title => "Agile Web Development With Rails", :author => "Dave Thomas") 6 | shelf = Shelf.new(:name => "Ruby Geekery") 7 | books.each { |book| shelf.books << book } 8 | shelf.save! 9 | 10 | books.clear 11 | books << Book.new(:title => "Kama Sutra", :author => "Who fucking knows") 12 | books << Book.new(:title => "Sex for Dummies", :author => "Some guy") 13 | shelf = Shelf.new(:name => "What geeks SHOULD be reading") 14 | books.each { |book| shelf.books << book } 15 | shelf.save! 16 | end 17 | 18 | def self.down 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /adapters/dm-rest-adapter/fixtures/book_service/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | # Settings specified here will take precedence over those in config/environment.rb 2 | 3 | # In the development environment your application's code is reloaded on 4 | # every request. This slows down response time but is perfect for development 5 | # since you don't have to restart the webserver when you make code changes. 6 | config.cache_classes = false 7 | 8 | # Log error messages when you accidentally call methods on nil. 9 | config.whiny_nils = true 10 | 11 | # Show full error reports and disable caching 12 | config.action_controller.consider_all_requests_local = true 13 | config.action_view.debug_rjs = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send 17 | config.action_mailer.raise_delivery_errors = false 18 | -------------------------------------------------------------------------------- /merb_datamapper/lib/generators/templates/views/index.html.erb: -------------------------------------------------------------------------------- 1 |Edit this file in app/views/<%= file_name %>/index.html.erb
4 | 5 || <%= Extlib::Inflection.humanize(property.field) %> | 9 | <% end -%> 10 |||
|---|---|---|
| <%%=h <%= singular_model %>.<%= property.getter %> %> | 16 | <% end -%> 17 |<%%= link_to 'Show', url(:<%= singular_model %>, <%= singular_model %>) %> | 18 |<%%= link_to 'Edit', url(:edit_<%= singular_model %>, <%= singular_model %>) %> | 19 |
Maybe you tried to change something you didn't have access to.
28 |You may have mistyped the address or the page may have moved.
28 |We've been notified about this issue and we'll take a look at it shortly.
28 |