Permalink
Browse files

Merge pull request #20 from postmodern/dependency_bump

Dependency bump
  • Loading branch information...
2 parents 0a42e3f + 4f6cfcc commit 4efcf10cdde1ea8f1a936d6f5a0d2ed48539f678 @snusnu committed Feb 1, 2013
Showing with 168 additions and 1,310 deletions.
  1. +5 −0 .document
  2. +1 −0 .yardopts
  3. +0 −970 CHANGELOG
  4. +26 −20 Gemfile
  5. 0 LICENSE → LICENSE.txt
  6. +90 −0 README.md
  7. +0 −94 README.textile
  8. +1 −23 Rakefile
  9. +0 −6 TODO
  10. +0 −1 VERSION
  11. +19 −148 dm-accepts_nested_attributes.gemspec
  12. +0 −20 tasks/changelog.rake
  13. +0 −18 tasks/local_gemfile.rake
  14. +26 −10 tasks/spec.rake
View
5 .document
@@ -0,0 +1,5 @@
+lib/**/*.rb
+bin/*
+-
+README.md
+LICENSE.txt
View
1 .yardopts
@@ -0,0 +1 @@
+--markup rdoc --title 'dm-accepts_nested_attributes Documentation' --protected
View
970 CHANGELOG
@@ -1,970 +0,0 @@
-[47b2757 | Thu Dec 03 13:42:02 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Use jeweler, add standard dm-more tasks and bump to 0.12.0
-
-[2a08a89 | Mon Nov 23 16:46:40 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Simplified require statements
-
-[e24cefe | Mon Nov 23 16:53:50 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Use :required => true instead of :nullable => false
-
- This means that dm-accepts_nested_attributes now
- depends on dm-core >= 0.10.2
-
-[4c30792 | Mon Sep 21 17:06:53 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Fixed error message in case no appropriate relationship was found
-
-[41f43e8 | Thu Sep 17 12:19:11 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Simplified code doesn't depend on class_inheritable_reader
-
- This means that dana is now usable inside modules,
- which is necessary for proper dm-is-remixable suppport
- and my dm-is-localizable plugin in particular.
-
-[95041df | Sat Sep 12 20:02:37 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Removed current limitations section from README
-
- This no longer applies.
-
-[780f8a0 | Sat Sep 12 14:15:05 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Refactored to support ruby 1.9
-
- This should fix the following error that was
- previously thrown on ruby 1.9.1
-
- implicit argument passing of super from method
- defined by define_method is not supported
-
- Also, it really should have been this way from
- the beginning. Using define_method was completely
- unnecessary.
-
-[95ab6bf | Thu Sep 03 15:42:08 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Finally, all specs pass!
-
- * I'm not really pleased with the way it works now
- though. If anyone has better suggestions, I'd be
- glad to hear them.
-
-[503e6d9 | Wed Sep 02 13:00:56 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Removed now unnecessary workaround
-
-[f47516a | Fri Aug 28 15:22:56 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Destroying m:n now works, 1:1 and 1:n don't :)
-
- * Getting weird can't modify frozen object errors
- in has_1_spec and has_n_spec when running specs
- for destroy.
-
-[07122e4 | Fri Aug 28 15:20:24 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Allow dm-constraints to migrate the constraints
-
-[e0d017a | Wed Aug 05 17:21:45 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Strip whitespace
-
-[19d1871 | Wed Aug 05 17:13:16 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Support STI scenarios
-
- * Previously, calling accepts_nested_attributes_for
- on an STI subclass resulted in errors because
- options_for_nested_attributes wasn't inherited.
-
- * Hopefully this commit fixes that. No specs to prove
- that though, so far.
-
-[d36e7ee | Wed Aug 05 17:11:15 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Enable 'rake spec' without errors saying dm-core can't be found
-
- * However, rake spec still yields weird transaction errors like
-
- Lock wait timeout exceeded; try restarting transaction
-
-[1d51f5b | Tue Aug 04 13:08:41 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Bumped version
-
-[2fa2de4 | Mon Aug 03 07:53:51 UTC 2009] Angel N. Sciortino <contact@angeliccomputing.com>
-
- * update operations now perform validations too
-
- * This is achieved by calling resource.attributes = ...
- followed by resource.save under the hood.
-
- * Once Resource#update calls Resource#save inside dm-core
- this shouldn't be necessary anymore (but wouldn't hurt
- either)
-
-[286ac11 | Mon Aug 03 18:19:02 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Commented currently unspecced relationship declarations
-
- * These introduce lots of spec failures because dm-core
- seems to establish not nullable FK properties on the
- target end of the relationship.
-
- * For reference, the specs started failing with
- http://is.gd/20SH8
-
-[571ba2e | Fri Jul 31 16:20:25 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Removed obsolete section from README
-
-[9a9bbe1 | Fri Jul 03 14:26:21 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * spec fixtures for has_1_through and has_n_through with n intermediaries
-
-[ae1acfa | Fri Jul 03 13:55:32 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added additional spec expectations for nested attribute writers
-
- * Added explicit expectations to prove that calling
- nested attribute writers never alters the state
- of the storage engine directly. Persistence will
- only happen when #save is called.
-
-[7b0194f | Wed Jul 01 19:41:38 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * support composite keys when creating new nested resources
-
- * refactored the previous constant into it's own method
- to support composite keys and also allow overwriting
-
-[a9efa26 | Wed Jul 01 18:45:49 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * no assumptions on the length of the m:m target collection
-
- * Maybe this will never be necessary, but I'm still thinking
- about how this whole #assign_or_mark_for_destruction method
- could be refactored. I don't like the fact the name itself
- already implies that this method has 2 different purposes.
-
-[d2e0a9d | Wed Jul 01 18:20:36 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * fixed renaming regression in #normalize_attributes_collection
-
-[34efa0f | Wed Jul 01 18:19:57 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * don't sort attributes in #normalize_attributes_collection
-
- * I can see no real advantage in doing so, let's keep it simple
-
-[5a17003 | Wed Jul 01 18:18:11 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * idiomatic datamapper usage
-
- * this changes the spec error to a simple unmet expectation
- compared to an fk violation error before
-
- * this is kind of weird, since existing_record is the same
- in both cases
-
-[fa4edde | Wed Jul 01 16:46:47 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * no need to do anything if the m:m target collection is empty
-
-[599da7f | Wed Jul 01 16:45:20 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * don't expect the target_collection to always be of length 1
-
- * actually this is the case in the current implementation,
- but that may change, and the code is simpler that way
-
-[2ce2b3f | Wed Jul 01 16:40:22 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * respect composite keys at the target end of m:m relationships
-
-[0331a9f | Wed Jul 01 16:05:04 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * mark the correct resources for destruction in m:m scenario
-
- * However, it doesn't work, because the target resource always
- gets destroyed before the intermediaries
-
-[a1e8da4 | Mon Jun 29 15:39:19 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed meaningless documentation
-
-[a07dcef | Thu Jun 25 03:26:08 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added spec that proves that m2m deletion wipes out all intermediaries
-
- * this is bad bad behavior and needs to be fixed
-
-[c8d21a0 | Thu Jun 25 03:04:20 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * all specs pass with or without dm-constraints
-
- * deleted an invalid spec that expected dm-constraints
- to be present
-
-[6913c23 | Thu Jun 25 02:42:13 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * allow github to build a datamapper 0.10 compatible gem
-
-[d6abeb1 | Thu Jun 25 02:39:03 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed rspec tmbundle logger support
-
-[bc119f9 | Thu Jun 25 02:34:45 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * support running specs with or without dm-constraints
-
-[84609fb | Thu Jun 25 01:57:03 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * updated datamapper 0.10.0 compatibility information
-
-[bda6fbc | Thu Jun 25 01:53:38 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * cleaner code for many_to_many deletion
-
- * also added TODO note about handling this with
- mark_for_destruction like all the other
- relationship kinds.
-
-[bce5322 | Thu Jun 25 00:58:11 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * support deleting of many_to_many associations (all specs pass)
-
- * Deletion is currently triggered when calling the nested
- attribute writer. This is most probably not desired and
- is likely to change.
-
- * Example:
-
- Person.has(n, :projects, :through => :project_memberships)
- @person.projects_attributes = {
- :id => project.id, :_delete => true
- }
-
- This will delete the associated project_membership
- and then the project
-
-[a8f2a9a | Wed Jun 24 15:52:48 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * mark_for_destruction? now really returns true or false (not nil)
-
-[8127032 | Wed Jun 24 15:44:27 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * corrected specs for atomic commits
-
- * those specs aren't really shared, but only valid
- for situations with no :reject_if guard that returns
- true.
-
- * only 1 spec failing now and that's deleting
- has(n, :through)
-
-[226a5a6 | Wed Jun 24 04:00:41 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added hopefully last missing documentation
-
-[51b5fdb | Wed Jun 24 03:54:41 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * finished documenting all modules and methods
-
- * also fixed a bug where attributes weren't sent
- to the :reject_if guard in case the guard was
- specified as Symbol or String.
-
-[faeaf5b | Wed Jun 24 02:05:08 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * #save_self no overwritten on every resource
-
- * this makes more deletion specs pass and is actually
- really obvious. wonder why it took me so long.
-
- * still a few atomic commits related specs failing
- but slowly getting there.
-
- * also, this needs my current dm-validations work
- available at
- http://github.com/snusnu/dm-more/commits/validation_context_work
-
-[2582c12 | Wed Jun 24 02:02:36 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * docfixes and a minor internal implementation change
-
-[097bf9d | Wed Jun 24 02:01:13 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * minor internal method renaming.
-
- * actually, i'm considering refactoring this method
- * i don't like the name, it already indicates that
- this methods serves 2 purposes which isn't good.
-
-[5cd44f9 | Wed Jun 24 01:58:52 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * no need to name useless rest arguments
-
- * in fact, it may very well be safe to remove them
- altogether. think more about this.
-
-[666ee63 | Wed Jun 24 01:57:56 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * use mysql in specs since dm-constraints are broken for sqlite3
-
-[92d25ff | Wed Jun 24 01:57:37 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * use dm-constraints in specs for more safety
-
-[9c5f2af | Wed Jun 17 16:16:00 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * updated Manifext.txt and gemspec to reflect the current structure
-
-[717d870 | Tue Jun 16 13:17:34 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * adapted to latest dm-core
-
- * still the same specs failing
-
-[0ae2f1a | Mon Jun 15 15:02:02 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * less invasive dm-core overwrite in Resource#save_parents
-
- * i don't know if that's the best way, but it works for now
-
-[dc188ee | Mon Jun 15 15:01:06 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * minor spec refactoring to run the shared examples all the time
-
-[178c99b | Sat Jun 13 20:20:44 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added comments about what goes wrong
-
-[9f2279e | Sat Jun 13 18:52:47 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * styles matter, i like this better
-
-[123c70f | Sat Jun 13 18:26:21 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * refactored shared specs for has(n, :through) associations
-
- * factored out real shared behavior and run it from
- all examples
-
- * causes 1 failure in "should perform atomic commits"
-
-[2393d0d | Sat Jun 13 18:25:57 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * refactored shared specs for has(n) associations
-
- * factored out real shared behavior and run it from
- all examples
-
- * causes 1 failure in "should perform atomic commits"
-
-[f786acd | Sat Jun 13 18:25:11 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * refactored shared specs for has(1) associations
-
- * factored out real shared behavior and run it from
- all examples
-
- * causes 1 failure in "should perform atomic commits"
-
-[ad7d968 | Sat Jun 13 17:45:58 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * refactored shared specs for belongs_to associations
-
- * factored out real shared behavior and run it from
- all examples
-
-[a14e6fd | Sat Jun 13 16:07:36 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * made all but 3 specs pass
-
- * this means that all specs except those that test
- destroying of an associated resource via the
- nested attribute accessors, works.
-
- * TODO this spec change needs more thinking. I'm
- not yet sure if not creating a Person in this case
- is the right behavior.
-
-[8de57d1 | Sat Jun 13 16:05:44 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * adapt overwritten save behavior to latest dm-core changes
-
-[e3837fe | Sat Jun 13 16:05:18 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * don't use chainable in client code
-
- * it should be sufficient that dm-core declared
- the method as chainable
-
-[4121c57 | Sat Jun 13 16:04:26 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed debug statements
-
-[80b9774 | Fri Jun 12 20:59:12 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added debug statements
-
-[3d316f8 | Fri Jun 12 20:58:56 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * specs now explicitly assign related resources to the association
-
-[04a87ad | Thu Jun 04 15:44:20 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed unneeded assertions
-
- * deleting a related resource still not working
- * transactions still not working
-
- * other than that, it seems quite fine
-
-[6a2e07f | Tue Jun 02 20:17:56 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * include save behavior only if a resource accepts nested attributes
-
-[d2c27c6 | Tue Jun 02 19:59:41 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * spec formatting and useless assertion removal
-
-[5f8d0e1 | Tue Jun 02 19:39:28 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added a few TODO and FIXME comments
-
-[a317852 | Tue Jun 02 19:05:20 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * moved shared specs to spec/shared directory.
-
- * this reduces clutter from the main specs
- * also it will hopefully help with refactoring
- the specs to provide better shared specs that
- can be used for all integrations specs
-
-[3ab51dc | Tue Jun 02 18:24:23 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * moved rspec_tmbundle_support to spec/lib
-
-[3579f97 | Tue Jun 02 18:19:03 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * formatting and some assertion changes for belongs_to specs
-
-[7752b87 | Tue Jun 02 18:06:08 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * nice formatting for spec fixtures.
-
-[4c18a35 | Tue Jun 02 17:55:25 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * use parent saving behavior for *all* resources.
-
- * breaks lots of specs that were already passing
- * i don't know why this is, but nevertheless i think
- that this is probably the way to go.
-
-[653f615 | Tue Jun 02 17:33:15 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * disabled mark_for_destruction for now
-
-[15a5174 | Thu May 28 18:06:23 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * docs for the resource extensions
-
-[22dea73 | Thu May 28 17:40:55 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * more docs for the model extensions
-
-[a109f10 | Thu May 28 16:19:29 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * allow deletion of many_to_one target via generated writer
-
- * this makes all belongs_to_specs pass, however it doesn't
- work for has_1_specs.
-
- * before this changeset, both belongs_to and has_1 failed
- at the same spec (deleting the related resource). i wonder
- why that is ...
-
-[81eda71 | Thu May 28 16:16:50 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * docs for one method to have yard style in place
-
-[b50b192 | Thu May 28 16:01:00 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added a few TODO notes
-
-[8652a89 | Thu May 28 16:00:49 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * readability ftw
-
-[89d02cf | Thu May 28 14:52:14 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * better names for internal methods
-
- * accepts_nested_attributes_for_relationship_to_#{type}
- is now
- accepts_nested_attributes_for_related_#{type}
-
-[04e39ed | Thu May 28 14:41:03 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * fixed reject_new_record guards (gone bad while refactoring)
-
- * belongs_to and has_1 specs only have 1 failure
- related to deleting the record
-
- * TODO: find out why mark_as_destruction doesn't
- do the right thing when called from #save
-
-[7052c72 | Thu May 28 14:39:23 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed comment in shared spec that doesn't apply to every usage
-
-[8479ee6 | Thu May 28 13:32:39 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * fixed nested_attributes reader (gone bad in the refactoring)
-
-[b72f510 | Thu May 28 13:16:24 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * better formatting for save methods
-
-[d8535cc | Thu May 28 13:05:05 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * changed internal method name convention
-
- * accepts_nested_attributes_for_#{type}_relationship
- is now
- accepts_nested_attributes_for_relationship_to_#{type}
-
-[1fdf6b5 | Thu May 28 12:37:35 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * rspec_tmbundle_support now uses Extlib::Logger
-
- * DataMapper::Logger is now Extlib::Logger
-
-[a2d4f4e | Thu May 28 04:29:58 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed resource_spec from Manifest and gemspec
-
-[2e89d38 | Thu May 28 04:29:29 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * no need to expect explicitly ordered spec files
-
-[76c06a3 | Thu May 28 04:28:53 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * i guess whitespace isn't necessary there
-
-[0e309e1 | Thu May 28 04:16:56 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * bypass needless calls to association_name all the time
-
- * key options_for_nested_attributes by relationship
- instead of association_name. this eliminates the
- need to repeatedly fetch the relationship by its
- name and provides more concise codes in general.
-
- * removed the relationship method since it's not
- needed anymore
-
- * removed the reject_new_nested_attributes_guard_for
- method since it's not needed anymore
-
- * number of passing specs is still the same
-
-[dd859c3 | Thu May 28 04:12:44 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * include save_or_destroy in save, no need to separate it
-
-[fdd29b0 | Thu May 28 02:36:01 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed dead meaningless parameters
-
- * also, let the code speak for itself if it can.
- in this case, the comments didn't offer any
- additional value
-
-[da8747c | Thu May 28 02:23:00 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * typo
-
-[8c6a061 | Thu May 28 02:22:16 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * methods should have a single task
-
- * don't validate the association_name inside
- assert_valid_options_for_nested_attributes
-
-[da2d474 | Thu May 28 02:21:15 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * explicitly include plugin functionality
-
- * don't alter existing datamapper api by simply
- requiring files. instead, do it explicitly as
- this also serves a documentation puropose since
- it's more obvious what's going on.
-
-[ae50006 | Wed May 27 23:31:47 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * every case statement wants an else branch
-
- * although the plugin will guarantee not to enter
- this code path, who knows what people try to do.
- it's a (private) method, so someone could use
- it in a possibly wrong way so why not inform
- him/her if that happens.
-
- * also, i think that the use of 'next' instead of
- deeply nested if/unless/case reads nicer
-
-[38ece56 | Wed May 27 23:17:36 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * avoid mutating parameters when it's not necessary
-
-[38225d6 | Wed May 27 23:15:32 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * made normalize_attributes_collection self contained
-
-[b42cf92 | Wed May 27 21:50:16 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed specs for ':reject_if => :foo' for now
-
- * added a TODO note to remind me to add them back again,
- once i have decided where to best put them.
-
-[57ccf94 | Wed May 27 21:41:59 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * check proper exception class in specs
-
-[6fa76ee | Wed May 27 21:11:54 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * replaced meaningless specs with one that makes sense
-
-[361a5d1 | Wed May 27 21:01:04 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * don't use bang! methods when not appropriate.
-
- * see http://is.gd/HqLo for a detailed explanation
-
-[4e8014b | Wed May 27 20:52:07 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * extracted method mainly for documentation purposes
-
-[5e22497 | Wed May 27 20:51:04 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * replaced explicitly defined helper with dm-core api access
-
-[e981ce6 | Wed May 27 19:10:46 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * cleaned up weird condition syntax
-
-[9a6318c | Wed May 27 19:10:20 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * better usage of RelationshipAccess
-
- * it's not necessary to call relationship! from
- inside accepts_nested_attributes_for.
- The association_name is *definitely* valid at
- this time.
-
-[6e8c49f | Wed May 27 18:20:47 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * model extension now less invasive and easier to extend
-
- * Added relationship/relationship! methods to
- provide a cleaner interface to the relationships
- defined on a model. This hides the implementation
- detail that relationships are stored in a hash
- which is bound to change anyway. Also, it allows
- to *fail fast* when trying to access a relationship
- that is not defined in a model (via relationship!)
-
- * restructured the files to better encapsulate and
- communicate what's in them.
-
- * better use of dm-core methods allowed previously
- explicitly declared methods to be removed.
-
-[5084804 | Tue May 26 18:55:12 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * imported dkubb's version of Resource#save for dana
-
- * unit specs all pass
- * belongs_to specs pass except for deletion (not yet integrated)
- * all has_x specs still have failures
-
-[44fd13d | Fri May 22 20:52:53 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * having serious troubles trying to get 0.10.0 to work :-(
-
-[aed8d1e | Wed May 20 02:53:32 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * NOT compatible with datamapper 0.10.0
-
- * a list of errors when running unmodified specs:
-
- uninitialized constant
- DataMapper::Associations::RelationshipChain
-
- undefined method `transaction'
- for #<Person @id=nil @name="snusnu"
-
- undefined local variable or method `create'
- for #<Person @id=nil @name="Martin">
- (probably extlib related?)
-
- The property 'name' is not accessible in Profile
- (probably transaction related)
-
-[eecfa47 | Wed May 20 02:45:48 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * updated version to 0.10.0
-
-[55d6029 | Wed May 20 02:40:51 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed usage of rubygems
-
-[9ae06e1 | Wed May 20 02:40:39 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * upgraded datamapper dependencies to 0.10.0
-
-[b704849 | Wed May 13 04:30:18 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * updated CHANGELOG
-
-[b621475 | Wed May 13 04:29:30 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * bumped version to 0.0.6.
-
-[91923dd | Wed May 13 04:18:49 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * respect dm-is-remixable (thx Asher Van Brunt for pointing this out)
-
- Since class_inheritable_accessor is not available on Module, dana
- bailed out for dm-is-remixable. This should hopefully fix this issue.
-
-[ef8e1ca | Mon May 11 00:17:43 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added CHANGELOG rake task and file (taken from manveru/ramaze)
-
-[52c55bc | Wed Apr 29 04:50:32 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * bump tiny version for extlib/hook compatible gem.
-
-[c34edae | Wed Apr 29 04:46:43 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * now compatible with extlib/hook. (last commit was missing files)
-
-[8e42229 | Wed Apr 29 04:34:20 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * workaround extlib/hook not respecting hooked but redefined methods.
-
-[578e658 | Wed Apr 29 02:46:56 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * only alter common DataMapper namespace if really necessary.
-
-[7da8378 | Wed Apr 29 01:41:07 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * less brittle specs with no more auto_migrations before(:each)
-
-[f2a2fcb | Wed Apr 29 01:38:00 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * updated Manifest and gemspec to reflect spec cleanings
-
-[dd0a4a8 | Fri Apr 24 17:29:41 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed fixtures and specs for customized has(n, :through) associations.
-
- It makes no sense to spec all different options for the association
- macros in integration specs. Rather, it should be specced once and
- for all (in unit specs) that dm-accepts_nested_attributes infers the
- right kind of associations. Think about it, then do it!
-
-[ac7c008 | Fri Apr 24 17:27:12 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * be explicit about before(:each)
-
-[7a56d17 | Fri Apr 24 17:26:35 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed commented code
-
-[03bc5c2 | Fri Apr 24 17:25:25 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * don't auto_migrate! before(:each) spec run (takes half the time)
-
-[b6f5bf5 | Tue Apr 21 14:52:22 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * removed debugging outputs
-
-[001c791 | Sat Apr 18 14:31:35 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added red specs for transactions. make them green.
-
-[9852f03 | Sat Apr 18 03:07:04 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * formatting
-
-[3fceda3 | Sat Apr 18 02:34:54 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * no need to require gem dependencies in spec_helper.rb
-
-[2118726 | Wed Apr 15 18:57:22 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * initial support for wrapping every save inside a transaction.
-
- * this probably needs more thinking, also funny is that specs if
- called from textmate rspec bundle all pass, whereas when called
- from the shell, some of them (only has(1)) break.
- investigate this
- * dbussink also suggested it might be a good idea to add an option
- that allows to turn transaction usage off.
- * also, look for some api to infer wether a backend supports
- (nested) transactions or not. we could default to true if it does,
- but still leave the option to turn it off nevertheless.
-
-[abdc211 | Wed Apr 15 14:18:07 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added sanitize_nested_attributes to provide a hook for doing this.
-
- * see http://is.gd/sz2d for the motivation behind this new method
-
-[158b6ea | Wed Apr 15 02:50:38 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * fixed broken generated gemspec. find out why this happens.
-
-[5603c57 | Wed Apr 15 02:49:54 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * updated manifest to include new specs from integration branch
-
-[4c5e656 | Tue Apr 14 18:25:02 UTC 2009] Rupert Voelcker <rupert@rupespad.com>
-
- * added #{association_name}_attributes reader
-
- Signed-off-by: Martin Gamsjaeger <gamsnjaga@gmail.com>
-
-[6d26213 | Tue Apr 14 03:09:34 UTC 2009] Rupert Voelcker <rupert@rupespad.com>
-
- * added associated attributes reader (doesn't do anything yet)
-
- Signed-off-by: Martin Gamsjaeger <gamsnjaga@gmail.com>
-
-[32dcfe8 | Wed Apr 15 02:20:00 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * initial support for dm-validations
-
- * this desperately needs specs! currently only basic not null
- constraint specs pass (well, there are no other).
- * saving a resource along with its associations should always
- be done inside a transaction! figure out how to do that!
- * validation errors from associated resources should be copied
- to the parent resource. this currently happens, but it's not
- specced at all so consider the behavior undefined.
-
-[fef1578 | Wed Apr 15 01:37:14 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * initialize dm logger before setting up dm adapter
-
-[8d7ede8 | Wed Apr 15 01:35:50 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * allow to call puth helper like puts without parameter
-
-[4e204a1 | Tue Apr 14 01:19:30 UTC 2009] Rupert Voelcker <rupert@rupespad.com>
-
- * now works with 'renamed' has many relationships
-
- Signed-off-by: Martin Gamsjaeger <gamsnjaga@gmail.com>
-
-[8f20aad | Mon Apr 13 00:33:40 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * build that gem\!
-
-[cc02415 | Sun Apr 12 22:57:26 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * updated manifest
-
-[d0f0dce | Sun Apr 12 22:57:08 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * use constants from Rakefile in tasks/install
-
-[b45ea52 | Fri Apr 10 16:12:11 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added get_#{association_name} helper for (many/one)_to_one associations.
-
- This is mainly to support common usecases in fields_for. This method
- will return a new record if the associated object is nil at the time
- it is accessed, and the associated object otherwise. This should help
- fields_for to render the right id and name attributes for the input
- fields. This method is not generated for (one/many)_to_many associations
- since these return an Collection anyway and this allow to call build
- or get on it. A possible use case would look something like this:
-
- <% fields_for @location.get_geo_point do %>
- ...
- <% end =%>
-
- The whole purpose of this commit is to provide something to fields_for
- that is guaranteed to not be nil.
-
-[8acb396 | Fri Apr 10 02:28:48 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * no .rb extension in require statements
-
-[bd6dfe6 | Fri Apr 10 01:52:45 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added passing specs for reject_if procs
-
-[2a1d309 | Thu Apr 09 19:55:52 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * updated README
-
-[b0fcf44 | Thu Apr 09 19:52:14 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * update now works for has(n, :through) -> all works now
-
-[a8ba5f6 | Thu Apr 09 19:44:48 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * destroy now works for has(n, :through)
-
-[2b5d583 | Thu Apr 09 19:11:35 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * explain what's going on when creating a new has(n, :through) child entry
-
-[b8a4be4 | Thu Apr 09 18:59:44 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * updated README to reflect latest changes
-
-[1efbb4c | Thu Apr 09 18:56:27 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * create now works for has(n, :through)
-
-[71d3d73 | Thu Apr 09 16:07:41 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * added a few spec helpers
-
-[2783be5 | Thu Apr 09 03:06:59 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * more robust (backwards compatible) monkeypatch.
-
-[c49516e | Thu Apr 09 01:42:23 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * README cosmetics
-
-[974d7b5 | Thu Apr 09 01:38:01 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Updated README to reflect the latest status.
-
-[69eb9ff | Thu Apr 09 01:28:10 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * reworked association saving. all except has(n,:through) work now
-
-[1200617 | Wed Apr 08 18:57:58 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * really minor README cosmetics
-
-[bda2607 | Wed Apr 08 17:44:34 UTC 2009] snusnu <gamsnjaga@gmail.com>
-
- * Push it
-
View
46 Gemfile
@@ -1,29 +1,29 @@
-source 'http://rubygems.org'
+require 'pathname'
+
+source :rubygems
+
+gemspec
SOURCE = ENV.fetch('SOURCE', :git).to_sym
REPO_POSTFIX = SOURCE == :path ? '' : '.git'
DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
-DM_VERSION = '~> 1.1.0'
-DM_UVERSION = '< 1.2'
-DO_VERSION = '~> 0.10.3'
+DM_VERSION = '~> 1.3.0.beta'
+DO_VERSION = '~> 0.10.6'
DM_DO_ADAPTERS = %w[ sqlite postgres mysql oracle sqlserver ]
+CURRENT_BRANCH = ENV.fetch('GIT_BRANCH', 'master')
-gem 'dm-core', DM_VERSION, DM_UVERSION, SOURCE => "#{DATAMAPPER}/dm-core#{REPO_POSTFIX}"
-
-group :development do
+gem 'dm-core', DM_VERSION,
+ SOURCE => "#{DATAMAPPER}/dm-core#{REPO_POSTFIX}",
+ :branch => CURRENT_BRANCH
- gem 'dm-validations', DM_VERSION, DM_UVERSION, SOURCE => "#{DATAMAPPER}/dm-validations#{REPO_POSTFIX}"
- gem 'dm-constraints', DM_VERSION, DM_UVERSION, SOURCE => "#{DATAMAPPER}/dm-constraints#{REPO_POSTFIX}"
+platforms :mri_18 do
+ group :quality do
- gem 'rake', '~> 0.8.7'
- gem 'rspec', '~> 1.3'
- gem 'yard', '~> 0.5'
- gem 'jeweler', '~> 1.5.2'
+ gem 'rcov', '~> 0.9.10'
+ gem 'yard', '~> 0.7.2'
+ gem 'yardstick', '~> 0.4'
-end
-
-group :quality do
- gem 'yardstick', '~> 0.1', :platforms => :mri_18
+ end
end
group :datamapper do
@@ -42,18 +42,24 @@ group :datamapper do
gem "do_#{adapter}", DO_VERSION, do_options.dup
end
- gem 'dm-do-adapter', DM_VERSION, DM_UVERSION, SOURCE => "#{DATAMAPPER}/dm-do-adapter#{REPO_POSTFIX}"
+ gem 'dm-do-adapter', DM_VERSION,
+ SOURCE => "#{DATAMAPPER}/dm-do-adapter#{REPO_POSTFIX}",
+ :branch => CURRENT_BRANCH
end
adapters.each do |adapter|
- gem "dm-#{adapter}-adapter", DM_VERSION, DM_UVERSION, SOURCE => "#{DATAMAPPER}/dm-#{adapter}-adapter#{REPO_POSTFIX}"
+ gem "dm-#{adapter}-adapter", DM_VERSION,
+ SOURCE => "#{DATAMAPPER}/dm-#{adapter}-adapter#{REPO_POSTFIX}",
+ :branch => CURRENT_BRANCH
end
plugins = ENV['PLUGINS'] || ENV['PLUGIN']
plugins = plugins.to_s.tr(',', ' ').split.push('dm-migrations').uniq
plugins.each do |plugin|
- gem plugin, DM_VERSION, DM_UVERSION, SOURCE => "#{DATAMAPPER}/#{plugin}#{REPO_POSTFIX}"
+ gem plugin, DM_VERSION,
+ SOURCE => "#{DATAMAPPER}/#{plugin}#{REPO_POSTFIX}",
+ :branch => CURRENT_BRANCH
end
end
View
0 LICENSE → LICENSE.txt
File renamed without changes.
View
90 README.md
@@ -0,0 +1,90 @@
+# dm-accepts_nested_attributes
+
+A DataMapper plugin that allows nested model attribute assignment like activerecord does.
+
+Current documentation can always be found at [rdoc.info](http://rdoc.info/projects/snusnu/dm-accepts_nested_attributes)
+
+## Examples
+
+The following example illustrates the use of this plugin.
+
+ require "rubygems"
+
+ require "dm-core"
+ require "dm-validations"
+ require "dm-accepts_nested_attributes"
+
+ DataMapper::Logger.new(STDOUT, :debug)
+ DataMapper.setup(:default, 'sqlite3::memory:')
+
+ class Person
+ include DataMapper::Resource
+ property :id, Serial
+ property :name, String
+ has 1, :profile
+ has n, :project_memberships
+ has n, :projects, :through => :project_memberships
+
+ accepts_nested_attributes_for :profile
+ accepts_nested_attributes_for :projects
+
+ # adds the following instance methods
+ # #profile_attributes=
+ # #profile_attributes
+ # #projects_attributes=
+ # #projects_attributes
+ end
+
+ class Profile
+ include DataMapper::Resource
+ property :id, Serial
+ property :person_id, Integer
+ belongs_to :person
+
+ accepts_nested_attributes_for :person
+
+ # adds the following instance methods
+ # #person_attributes=
+ # #person_attributes
+ end
+
+ class Project
+ include DataMapper::Resource
+ property :id, Serial
+ has n, :tasks
+ has n, :project_memberships
+ has n, :people, :through => :project_memberships
+
+ accepts_nested_attributes_for :tasks
+ accepts_nested_attributes_for :people
+
+ # adds the following instance methods
+ # #tasks_attributes=
+ # #tasks_attributes
+ # #people_attributes=
+ # #people_attributes
+ end
+
+ class ProjectMembership
+ include DataMapper::Resource
+ property :id, Serial
+ property :person_id, Integer
+ property :project_id, Integer
+ belongs_to :person
+ belongs_to :project
+ end
+
+ class Task
+ include DataMapper::Resource
+ property :id, Serial
+ property :project_id, Integer
+ belongs_to :project
+ end
+
+ DataMapper.auto_migrate!
+
+## TODO
+
+* collect validation errors from related resources
+* update README to include more complete usecases
+* think about replacing :reject_if with :if and :unless
View
94 README.textile
@@ -1,94 +0,0 @@
-h2. dm-accepts_nested_attributes
-
-A DataMapper plugin that allows nested model attribute assignment like activerecord does.
-
-Current documentation can always be found at "rdoc.info":http://rdoc.info/projects/snusnu/dm-accepts_nested_attributes
-
-h3. Examples
-
-The following example illustrates the use of this plugin.
-
-<pre>
-<code>
-require "rubygems"
-
-require "dm-core"
-require "dm-validations"
-require "dm-accepts_nested_attributes"
-
-DataMapper::Logger.new(STDOUT, :debug)
-DataMapper.setup(:default, 'sqlite3::memory:')
-
-class Person
- include DataMapper::Resource
- property :id, Serial
- property :name, String
- has 1, :profile
- has n, :project_memberships
- has n, :projects, :through => :project_memberships
-
- accepts_nested_attributes_for :profile
- accepts_nested_attributes_for :projects
-
- # adds the following instance methods
- # #profile_attributes=
- # #profile_attributes
- # #projects_attributes=
- # #projects_attributes
-end
-
-class Profile
- include DataMapper::Resource
- property :id, Serial
- property :person_id, Integer
- belongs_to :person
-
- accepts_nested_attributes_for :person
-
- # adds the following instance methods
- # #person_attributes=
- # #person_attributes
-end
-
-class Project
- include DataMapper::Resource
- property :id, Serial
- has n, :tasks
- has n, :project_memberships
- has n, :people, :through => :project_memberships
-
- accepts_nested_attributes_for :tasks
- accepts_nested_attributes_for :people
-
- # adds the following instance methods
- # #tasks_attributes=
- # #tasks_attributes
- # #people_attributes=
- # #people_attributes
-end
-
-class ProjectMembership
- include DataMapper::Resource
- property :id, Serial
- property :person_id, Integer
- property :project_id, Integer
- belongs_to :person
- belongs_to :project
-end
-
-class Task
- include DataMapper::Resource
- property :id, Serial
- property :project_id, Integer
- belongs_to :project
-end
-
-DataMapper.auto_migrate!
-</code>
-</pre>
-
-h2. TODO
-
-* collect validation errors from related resources
-* update README to include more complete usecases
-* think about replacing :reject_if with :if and :unless
View
24 Rakefile
@@ -1,26 +1,4 @@
require 'rubygems'
require 'rake'
-begin
- gem 'jeweler', '~> 1.5.2'
- require 'jeweler'
-
- Jeweler::Tasks.new do |gem|
- gem.name = 'dm-accepts_nested_attributes'
- gem.summary = 'Nested model assignment for datamapper'
- gem.description = 'A datamapper plugin that allows nested model assignment like activerecord.'
- gem.email = 'gamsnjaga [a] gmail [d] com'
- gem.homepage = 'http://github.com/snusnu/dm-accepts_nested_attributes'
- gem.authors = [ 'Martin Gamsjaeger (snusnu)' ]
- gem.has_rdoc = 'yard'
- end
-
- Jeweler::GemcutterTasks.new
-
- FileList['tasks/**/*.rake'].each { |task| import task }
-
-rescue LoadError => e
- puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
- puts '-----------------------------------------------------------------------------'
- puts e.backtrace # Let's help by actually showing *which* dependency is missing
-end
+FileList['tasks/**/*.rake'].each { |task| import task }
View
6 TODO
@@ -1,6 +0,0 @@
-TODO
-====
-
-* collect validation errors from related resources
-* update README to include more complete usecases
-* think about replacing :reject_if with :if and :unless
View
1 VERSION
@@ -1 +0,0 @@
-1.1.0
View
167 dm-accepts_nested_attributes.gemspec
@@ -1,155 +1,26 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{dm-accepts_nested_attributes}
- s.version = "1.1.0"
+ s.name = 'dm-accepts_nested_attributes'
+ s.version = '1.1.0'
+ s.license = 'MIT'
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Martin Gamsjaeger (snusnu)"]
- s.date = %q{2011-03-19}
- s.description = %q{A datamapper plugin that allows nested model assignment like activerecord.}
- s.email = %q{gamsnjaga [a] gmail [d] com}
- s.extra_rdoc_files = [
- "LICENSE",
- "README.textile",
- "TODO"
- ]
- s.files = [
- "CHANGELOG",
- "Gemfile",
- "LICENSE",
- "README.textile",
- "Rakefile",
- "TODO",
- "VERSION",
- "dm-accepts_nested_attributes.gemspec",
- "lib/dm-accepts_nested_attributes.rb",
- "lib/dm-accepts_nested_attributes/model.rb",
- "lib/dm-accepts_nested_attributes/relationship.rb",
- "lib/dm-accepts_nested_attributes/resource.rb",
- "lib/dm-accepts_nested_attributes/version.rb",
- "spec/accepts_nested_attributes_for_spec.rb",
- "spec/assign_nested_attributes_for_spec.rb",
- "spec/comb/1-1_disjoint_spec.rb",
- "spec/comb/1-1_overlapping_spec.rb",
- "spec/comb/1-1_subset_spec.rb",
- "spec/comb/1-1_superset_spec.rb",
- "spec/comb/1-m_disjoint_spec.rb",
- "spec/comb/1-m_overlapping_spec.rb",
- "spec/comb/1-m_subset_spec.rb",
- "spec/comb/1-m_superset_spec.rb",
- "spec/comb/m-1_disjoint_spec.rb",
- "spec/comb/m-1_overlapping_spec.rb",
- "spec/comb/m-1_subset_spec.rb",
- "spec/comb/m-1_superset_spec.rb",
- "spec/comb/n-m_composite_spec.rb",
- "spec/comb/n-m_surrogate_spec.rb",
- "spec/many_to_many_composite_spec.rb",
- "spec/many_to_many_spec.rb",
- "spec/many_to_one_composite_spec.rb",
- "spec/many_to_one_spec.rb",
- "spec/one_to_many_composite_spec.rb",
- "spec/one_to_many_spec.rb",
- "spec/one_to_one_composite_spec.rb",
- "spec/one_to_one_spec.rb",
- "spec/rcov.opts",
- "spec/resource_spec.rb",
- "spec/shared/many_to_many_composite_spec.rb",
- "spec/shared/many_to_many_spec.rb",
- "spec/shared/many_to_one_composite_spec.rb",
- "spec/shared/many_to_one_spec.rb",
- "spec/shared/one_to_many_composite_spec.rb",
- "spec/shared/one_to_many_spec.rb",
- "spec/shared/one_to_one_composite_spec.rb",
- "spec/shared/one_to_one_spec.rb",
- "spec/spec.opts",
- "spec/spec_helper.rb",
- "spec/update_dirty_spec.rb",
- "spec/update_multiple_spec.rb",
- "tasks/changelog.rake",
- "tasks/ci.rake",
- "tasks/local_gemfile.rake",
- "tasks/spec.rake",
- "tasks/yard.rake",
- "tasks/yardstick.rake"
- ]
- s.homepage = %q{http://github.com/snusnu/dm-accepts_nested_attributes}
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.5.2}
- s.summary = %q{Nested model assignment for datamapper}
- s.test_files = [
- "spec/accepts_nested_attributes_for_spec.rb",
- "spec/assign_nested_attributes_for_spec.rb",
- "spec/comb/1-1_disjoint_spec.rb",
- "spec/comb/1-1_overlapping_spec.rb",
- "spec/comb/1-1_subset_spec.rb",
- "spec/comb/1-1_superset_spec.rb",
- "spec/comb/1-m_disjoint_spec.rb",
- "spec/comb/1-m_overlapping_spec.rb",
- "spec/comb/1-m_subset_spec.rb",
- "spec/comb/1-m_superset_spec.rb",
- "spec/comb/m-1_disjoint_spec.rb",
- "spec/comb/m-1_overlapping_spec.rb",
- "spec/comb/m-1_subset_spec.rb",
- "spec/comb/m-1_superset_spec.rb",
- "spec/comb/n-m_composite_spec.rb",
- "spec/comb/n-m_surrogate_spec.rb",
- "spec/many_to_many_composite_spec.rb",
- "spec/many_to_many_spec.rb",
- "spec/many_to_one_composite_spec.rb",
- "spec/many_to_one_spec.rb",
- "spec/one_to_many_composite_spec.rb",
- "spec/one_to_many_spec.rb",
- "spec/one_to_one_composite_spec.rb",
- "spec/one_to_one_spec.rb",
- "spec/resource_spec.rb",
- "spec/shared/many_to_many_composite_spec.rb",
- "spec/shared/many_to_many_spec.rb",
- "spec/shared/many_to_one_composite_spec.rb",
- "spec/shared/many_to_one_spec.rb",
- "spec/shared/one_to_many_composite_spec.rb",
- "spec/shared/one_to_many_spec.rb",
- "spec/shared/one_to_one_composite_spec.rb",
- "spec/shared/one_to_one_spec.rb",
- "spec/spec_helper.rb",
- "spec/update_dirty_spec.rb",
- "spec/update_multiple_spec.rb"
- ]
+ s.authors = ['Martin Gamsjaeger (snusnu)']
+ s.email = 'gamsnjaga [a] gmail [d] com'
+ s.summary = %{Nested model assignment for datamapper}
+ s.description = %{A datamapper plugin that allows nested model assignment like activerecord.}
+ s.homepage = 'http://github.com/snusnu/dm-accepts_nested_attributes'
- if s.respond_to? :specification_version then
- s.specification_version = 3
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {spec}/*`.split("\n")
+ s.extra_rdoc_files = %w[LICENSE.txt README.md]
+ s.require_paths = ['lib']
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<dm-core>, [">= 1.1.0.rc0", "< 1.2"])
- s.add_development_dependency(%q<dm-validations>, [">= 1.1.0.rc0", "< 1.2"])
- s.add_development_dependency(%q<dm-constraints>, [">= 1.1.0.rc0", "< 1.2"])
- s.add_development_dependency(%q<rake>, ["~> 0.8.7"])
- s.add_development_dependency(%q<rspec>, ["~> 1.3"])
- s.add_development_dependency(%q<yard>, ["~> 0.5"])
- s.add_development_dependency(%q<rcov>, ["~> 0.9.7"])
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
- else
- s.add_dependency(%q<dm-core>, [">= 1.1.0.rc0", "< 1.2"])
- s.add_dependency(%q<dm-validations>, [">= 1.1.0.rc0", "< 1.2"])
- s.add_dependency(%q<dm-constraints>, [">= 1.1.0.rc0", "< 1.2"])
- s.add_dependency(%q<rake>, ["~> 0.8.7"])
- s.add_dependency(%q<rspec>, ["~> 1.3"])
- s.add_dependency(%q<yard>, ["~> 0.5"])
- s.add_dependency(%q<rcov>, ["~> 0.9.7"])
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
- end
- else
- s.add_dependency(%q<dm-core>, [">= 1.1.0.rc0", "< 1.2"])
- s.add_dependency(%q<dm-validations>, [">= 1.1.0.rc0", "< 1.2"])
- s.add_dependency(%q<dm-constraints>, [">= 1.1.0.rc0", "< 1.2"])
- s.add_dependency(%q<rake>, ["~> 0.8.7"])
- s.add_dependency(%q<rspec>, ["~> 1.3"])
- s.add_dependency(%q<yard>, ["~> 0.5"])
- s.add_dependency(%q<rcov>, ["~> 0.9.7"])
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
- end
+ s.add_dependency 'dm-core', '~> 1.1'
+ s.add_development_dependency 'dm-validations', '~> 1.1'
+ s.add_development_dependency 'dm-constraints', '~> 1.1'
+ s.add_development_dependency 'rake', '~> 0.9'
+ s.add_development_dependency 'rspec', '~> 1.3'
+ s.add_development_dependency 'yard', '~> 0.8'
+ s.add_development_dependency 'rcov', '~> 0.9'
end
-
View
20 tasks/changelog.rake
@@ -1,20 +0,0 @@
-require 'time'
-
-desc 'update changelog'
-task :changelog do
- File.open('CHANGELOG', 'w+') do |changelog|
- `git log -z --abbrev-commit`.split("\0").each do |commit|
- next if commit =~ /^Merge: \d*/
- ref, author, time, _, title, _, message = commit.split("\n", 7)
- ref = ref[/commit ([0-9a-f]+)/, 1]
- author = author[/Author: (.*)/, 1].strip
- time = Time.parse(time[/Date: (.*)/, 1]).utc
- title.strip!
-
- changelog.puts "[#{ref} | #{time}] #{author}"
- changelog.puts '', " * #{title}"
- changelog.puts '', message.rstrip if message
- changelog.puts
- end
- end
-end
View
18 tasks/local_gemfile.rake
@@ -1,18 +0,0 @@
-desc "Support bundling from local source code (allows BUNDLE_GEMFILE=Gemfile.local bundle foo)"
-task :local_gemfile do |t|
-
- root = Pathname(__FILE__).dirname.parent
- datamapper = root.parent
-
- source_regex = /DATAMAPPER = 'git:\/\/github.com\/datamapper'/
- gem_source_regex = /:git => \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/
-
- root.join('Gemfile.local').open('w') do |f|
- root.join('Gemfile').open.each do |line|
- line.sub!(source_regex, "DATAMAPPER = '#{datamapper}'")
- line.sub!(gem_source_regex, ':path => "#{DATAMAPPER}/\1"')
- f.puts line
- end
- end
-
-end
View
36 tasks/spec.rake
@@ -1,22 +1,38 @@
-require 'spec/rake/spectask'
-require 'spec/rake/verify_rcov'
-
spec_defaults = lambda do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.libs << 'lib' << 'spec'
spec.spec_opts << '--options' << 'spec/spec.opts'
end
-Spec::Rake::SpecTask.new(:spec, &spec_defaults)
+begin
+ require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:rcov) do |rcov|
- spec_defaults.call(rcov)
- rcov.rcov = true
- rcov.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
+ Spec::Rake::SpecTask.new(:spec, &spec_defaults)
+rescue LoadError
+ task :spec do
+ abort 'rspec is not available. In order to run spec, you must: gem install rspec'
+ end
end
-RCov::VerifyTask.new(:verify_rcov => :rcov) do |rcov|
- rcov.threshold = 100
+begin
+ require 'rcov'
+ require 'spec/rake/verify_rcov'
+
+ Spec::Rake::SpecTask.new(:rcov) do |rcov|
+ spec_defaults.call(rcov)
+ rcov.rcov = true
+ rcov.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
+ end
+
+ RCov::VerifyTask.new(:verify_rcov => :rcov) do |rcov|
+ rcov.threshold = 100
+ end
+rescue LoadError
+ %w[ rcov verify_rcov ].each do |name|
+ task name do
+ abort "rcov is not available. In order to run #{name}, you must: gem install rcov"
+ end
+ end
end
task :default => :spec

0 comments on commit 4efcf10

Please sign in to comment.