wyngle-ripple 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/.gitignore +35 -0
  2. data/Gemfile +17 -0
  3. data/Gemfile.lock +133 -0
  4. data/Gemfile.rails30 +3 -0
  5. data/Gemfile.rails31 +3 -0
  6. data/Gemfile.rails32 +3 -0
  7. data/Guardfile +17 -0
  8. data/LICENSE +16 -0
  9. data/README.markdown +166 -0
  10. data/RELEASE_NOTES.textile +286 -0
  11. data/Rakefile +63 -0
  12. data/lib/rails/generators/ripple/configuration/configuration_generator.rb +13 -0
  13. data/lib/rails/generators/ripple/configuration/templates/ripple.yml +25 -0
  14. data/lib/rails/generators/ripple/js/js_generator.rb +13 -0
  15. data/lib/rails/generators/ripple/js/templates/js/contrib.js +63 -0
  16. data/lib/rails/generators/ripple/js/templates/js/iso8601.js +76 -0
  17. data/lib/rails/generators/ripple/js/templates/js/ripple.js +132 -0
  18. data/lib/rails/generators/ripple/model/model_generator.rb +20 -0
  19. data/lib/rails/generators/ripple/model/templates/model.rb.erb +10 -0
  20. data/lib/rails/generators/ripple/observer/observer_generator.rb +16 -0
  21. data/lib/rails/generators/ripple/observer/templates/observer.rb.erb +2 -0
  22. data/lib/rails/generators/ripple/test/templates/cucumber.rb.erb +7 -0
  23. data/lib/rails/generators/ripple/test/test_generator.rb +45 -0
  24. data/lib/rails/generators/ripple_generator.rb +79 -0
  25. data/lib/ripple.rb +86 -0
  26. data/lib/ripple/associations.rb +380 -0
  27. data/lib/ripple/associations/embedded.rb +35 -0
  28. data/lib/ripple/associations/instantiators.rb +26 -0
  29. data/lib/ripple/associations/linked.rb +65 -0
  30. data/lib/ripple/associations/many.rb +38 -0
  31. data/lib/ripple/associations/many_embedded_proxy.rb +39 -0
  32. data/lib/ripple/associations/many_linked_proxy.rb +66 -0
  33. data/lib/ripple/associations/many_reference_proxy.rb +95 -0
  34. data/lib/ripple/associations/many_stored_key_proxy.rb +76 -0
  35. data/lib/ripple/associations/one.rb +20 -0
  36. data/lib/ripple/associations/one_embedded_proxy.rb +35 -0
  37. data/lib/ripple/associations/one_key_proxy.rb +58 -0
  38. data/lib/ripple/associations/one_linked_proxy.rb +26 -0
  39. data/lib/ripple/associations/one_stored_key_proxy.rb +43 -0
  40. data/lib/ripple/associations/proxy.rb +118 -0
  41. data/lib/ripple/attribute_methods.rb +132 -0
  42. data/lib/ripple/attribute_methods/dirty.rb +59 -0
  43. data/lib/ripple/attribute_methods/query.rb +34 -0
  44. data/lib/ripple/attribute_methods/read.rb +28 -0
  45. data/lib/ripple/attribute_methods/write.rb +25 -0
  46. data/lib/ripple/callbacks.rb +71 -0
  47. data/lib/ripple/conflict/basic_resolver.rb +86 -0
  48. data/lib/ripple/conflict/document_hooks.rb +46 -0
  49. data/lib/ripple/conflict/resolver.rb +96 -0
  50. data/lib/ripple/conflict/test_helper.rb +34 -0
  51. data/lib/ripple/conversion.rb +29 -0
  52. data/lib/ripple/core_ext.rb +3 -0
  53. data/lib/ripple/core_ext/casting.rb +151 -0
  54. data/lib/ripple/core_ext/indexes.rb +89 -0
  55. data/lib/ripple/core_ext/object.rb +8 -0
  56. data/lib/ripple/document.rb +105 -0
  57. data/lib/ripple/document/bucket_access.rb +25 -0
  58. data/lib/ripple/document/finders.rb +131 -0
  59. data/lib/ripple/document/key.rb +35 -0
  60. data/lib/ripple/document/link.rb +30 -0
  61. data/lib/ripple/document/persistence.rb +130 -0
  62. data/lib/ripple/embedded_document.rb +63 -0
  63. data/lib/ripple/embedded_document/around_callbacks.rb +18 -0
  64. data/lib/ripple/embedded_document/finders.rb +26 -0
  65. data/lib/ripple/embedded_document/persistence.rb +75 -0
  66. data/lib/ripple/i18n.rb +5 -0
  67. data/lib/ripple/indexes.rb +151 -0
  68. data/lib/ripple/inspection.rb +32 -0
  69. data/lib/ripple/locale/en.yml +26 -0
  70. data/lib/ripple/locale/fr.yml +24 -0
  71. data/lib/ripple/nested_attributes.rb +275 -0
  72. data/lib/ripple/observable.rb +28 -0
  73. data/lib/ripple/properties.rb +74 -0
  74. data/lib/ripple/property_type_mismatch.rb +12 -0
  75. data/lib/ripple/railtie.rb +26 -0
  76. data/lib/ripple/railties/ripple.rake +68 -0
  77. data/lib/ripple/serialization.rb +82 -0
  78. data/lib/ripple/test_server.rb +35 -0
  79. data/lib/ripple/timestamps.rb +25 -0
  80. data/lib/ripple/translation.rb +18 -0
  81. data/lib/ripple/validations.rb +65 -0
  82. data/lib/ripple/validations/associated_validator.rb +43 -0
  83. data/lib/ripple/version.rb +3 -0
  84. data/ripple.gemspec +29 -0
  85. data/spec/fixtures/config.yml +8 -0
  86. data/spec/generators/ripple/configuration_generator_spec.rb +9 -0
  87. data/spec/generators/ripple/js_generator_spec.rb +14 -0
  88. data/spec/generators/ripple/model_generator_spec.rb +64 -0
  89. data/spec/generators/ripple/observer_generator_spec.rb +20 -0
  90. data/spec/generators/ripple/test_generator_spec.rb +118 -0
  91. data/spec/generators/ripple_generator_spec.rb +11 -0
  92. data/spec/integration/ripple/associations_spec.rb +164 -0
  93. data/spec/integration/ripple/conflict_resolution_spec.rb +329 -0
  94. data/spec/integration/ripple/indexes_spec.rb +47 -0
  95. data/spec/integration/ripple/nested_attributes_spec.rb +261 -0
  96. data/spec/integration/ripple/persistence_spec.rb +36 -0
  97. data/spec/integration/ripple/search_associations_spec.rb +31 -0
  98. data/spec/ripple/associations/many_embedded_proxy_spec.rb +119 -0
  99. data/spec/ripple/associations/many_linked_proxy_spec.rb +191 -0
  100. data/spec/ripple/associations/many_reference_proxy_spec.rb +170 -0
  101. data/spec/ripple/associations/many_stored_key_proxy_spec.rb +158 -0
  102. data/spec/ripple/associations/one_embedded_proxy_spec.rb +125 -0
  103. data/spec/ripple/associations/one_key_proxy_spec.rb +82 -0
  104. data/spec/ripple/associations/one_linked_proxy_spec.rb +91 -0
  105. data/spec/ripple/associations/one_stored_key_proxy_spec.rb +72 -0
  106. data/spec/ripple/associations/proxy_spec.rb +84 -0
  107. data/spec/ripple/associations_spec.rb +153 -0
  108. data/spec/ripple/attribute_methods/dirty_spec.rb +80 -0
  109. data/spec/ripple/attribute_methods_spec.rb +286 -0
  110. data/spec/ripple/bucket_access_spec.rb +25 -0
  111. data/spec/ripple/callbacks_spec.rb +195 -0
  112. data/spec/ripple/conflict/resolver_spec.rb +42 -0
  113. data/spec/ripple/conversion_spec.rb +14 -0
  114. data/spec/ripple/core_ext_spec.rb +181 -0
  115. data/spec/ripple/document/link_spec.rb +67 -0
  116. data/spec/ripple/document_spec.rb +96 -0
  117. data/spec/ripple/embedded_document/finders_spec.rb +29 -0
  118. data/spec/ripple/embedded_document/persistence_spec.rb +80 -0
  119. data/spec/ripple/embedded_document_spec.rb +84 -0
  120. data/spec/ripple/finders_spec.rb +220 -0
  121. data/spec/ripple/indexes_spec.rb +111 -0
  122. data/spec/ripple/inspection_spec.rb +51 -0
  123. data/spec/ripple/key_spec.rb +31 -0
  124. data/spec/ripple/observable_spec.rb +120 -0
  125. data/spec/ripple/persistence_spec.rb +351 -0
  126. data/spec/ripple/properties_spec.rb +262 -0
  127. data/spec/ripple/ripple_spec.rb +71 -0
  128. data/spec/ripple/serialization_spec.rb +51 -0
  129. data/spec/ripple/timestamps_spec.rb +83 -0
  130. data/spec/ripple/validations/associated_validator_spec.rb +77 -0
  131. data/spec/ripple/validations_spec.rb +102 -0
  132. data/spec/spec_helper.rb +39 -0
  133. data/spec/support/associations.rb +1 -0
  134. data/spec/support/associations/proxies.rb +17 -0
  135. data/spec/support/generator_setup.rb +26 -0
  136. data/spec/support/integration_setup.rb +11 -0
  137. data/spec/support/models.rb +35 -0
  138. data/spec/support/models/address.rb +10 -0
  139. data/spec/support/models/box.rb +13 -0
  140. data/spec/support/models/car.rb +41 -0
  141. data/spec/support/models/cardboard_box.rb +2 -0
  142. data/spec/support/models/clock.rb +10 -0
  143. data/spec/support/models/clock_observer.rb +2 -0
  144. data/spec/support/models/company.rb +23 -0
  145. data/spec/support/models/credit_card.rb +5 -0
  146. data/spec/support/models/customer.rb +3 -0
  147. data/spec/support/models/email.rb +3 -0
  148. data/spec/support/models/family.rb +16 -0
  149. data/spec/support/models/favorite.rb +3 -0
  150. data/spec/support/models/indexer.rb +26 -0
  151. data/spec/support/models/invoice.rb +6 -0
  152. data/spec/support/models/late_invoice.rb +2 -0
  153. data/spec/support/models/nested.rb +12 -0
  154. data/spec/support/models/ninja.rb +7 -0
  155. data/spec/support/models/note.rb +4 -0
  156. data/spec/support/models/page.rb +3 -0
  157. data/spec/support/models/paid_invoice.rb +3 -0
  158. data/spec/support/models/post.rb +13 -0
  159. data/spec/support/models/profile.rb +7 -0
  160. data/spec/support/models/subscription.rb +26 -0
  161. data/spec/support/models/tasks.rb +9 -0
  162. data/spec/support/models/team.rb +11 -0
  163. data/spec/support/models/transactions.rb +17 -0
  164. data/spec/support/models/tree.rb +3 -0
  165. data/spec/support/models/user.rb +19 -0
  166. data/spec/support/models/widget.rb +23 -0
  167. data/spec/support/search.rb +14 -0
  168. data/spec/support/test_server.rb +39 -0
  169. data/spec/support/test_server.yml.example +14 -0
  170. metadata +434 -0
data/.gitignore ADDED
@@ -0,0 +1,35 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
22
+ _notes
23
+ doc
24
+ .yardoc
25
+ .bundle
26
+ spec/support/test_server.yml
27
+ **/bin
28
+ *.rbc
29
+ .rvmrc
30
+
31
+ .riaktest
32
+ **/.riaktest
33
+ vendor/erlang
34
+ vendor/riak
35
+ tmp/*
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :guard do
6
+ gem 'guard-rspec'
7
+ gem 'rb-fsevent'
8
+ gem 'growl'
9
+ end
10
+
11
+ if File.directory?(File.expand_path("../../riak-client", __FILE__))
12
+ gem 'riak-client', :path => "../riak-client"
13
+ end
14
+
15
+ platforms :jruby do
16
+ gem 'jruby-openssl'
17
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,133 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ wyngle-ripple (0.1.0)
5
+ activemodel (>= 3.0.0, < 3.3.0)
6
+ activesupport (>= 3.0.0, < 3.3.0)
7
+ riak-client (~> 1.0)
8
+ tzinfo
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ actionpack (3.2.16)
14
+ activemodel (= 3.2.16)
15
+ activesupport (= 3.2.16)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ journey (~> 1.0.4)
19
+ rack (~> 1.4.5)
20
+ rack-cache (~> 1.2)
21
+ rack-test (~> 0.6.1)
22
+ sprockets (~> 2.2.1)
23
+ activemodel (3.2.16)
24
+ activesupport (= 3.2.16)
25
+ builder (~> 3.0.0)
26
+ activesupport (3.2.16)
27
+ i18n (~> 0.6, >= 0.6.4)
28
+ multi_json (~> 1.0)
29
+ ammeter (0.2.9)
30
+ activesupport (>= 3.0)
31
+ railties (>= 3.0)
32
+ rspec (>= 2.2)
33
+ rspec-rails (>= 2.2)
34
+ atomic (1.1.14)
35
+ beefcake (0.3.7)
36
+ builder (3.0.4)
37
+ celluloid (0.15.2)
38
+ timers (~> 1.1.0)
39
+ coderay (1.1.0)
40
+ diff-lcs (1.1.3)
41
+ erubis (2.7.0)
42
+ ffi (1.9.3)
43
+ formatador (0.2.4)
44
+ growl (1.0.3)
45
+ guard (2.3.0)
46
+ formatador (>= 0.2.4)
47
+ listen (~> 2.1)
48
+ lumberjack (~> 1.0)
49
+ pry (>= 0.9.12)
50
+ thor (>= 0.18.1)
51
+ guard-rspec (1.2.1)
52
+ guard (>= 1.1)
53
+ hike (1.2.3)
54
+ i18n (0.6.9)
55
+ innertube (1.0.2)
56
+ journey (1.0.4)
57
+ json (1.8.1)
58
+ listen (2.4.0)
59
+ celluloid (>= 0.15.2)
60
+ rb-fsevent (>= 0.9.3)
61
+ rb-inotify (>= 0.9)
62
+ lumberjack (1.0.4)
63
+ method_source (0.8.2)
64
+ multi_json (1.8.4)
65
+ pry (0.9.12.4)
66
+ coderay (~> 1.0)
67
+ method_source (~> 0.8)
68
+ slop (~> 3.4)
69
+ rack (1.4.5)
70
+ rack-cache (1.2)
71
+ rack (>= 0.4)
72
+ rack-ssl (1.3.3)
73
+ rack
74
+ rack-test (0.6.2)
75
+ rack (>= 1.0)
76
+ railties (3.2.16)
77
+ actionpack (= 3.2.16)
78
+ activesupport (= 3.2.16)
79
+ rack-ssl (~> 1.3.2)
80
+ rake (>= 0.8.7)
81
+ rdoc (~> 3.4)
82
+ thor (>= 0.14.6, < 2.0)
83
+ rake (10.1.1)
84
+ rb-fsevent (0.9.4)
85
+ rb-inotify (0.9.3)
86
+ ffi (>= 0.5.0)
87
+ rdoc (3.12.2)
88
+ json (~> 1.4)
89
+ riak-client (1.4.3)
90
+ beefcake (~> 0.3.7)
91
+ builder (>= 2.1.2)
92
+ i18n (>= 0.4.0)
93
+ innertube (~> 1.0.2)
94
+ multi_json (~> 1.0)
95
+ rspec (2.8.0)
96
+ rspec-core (~> 2.8.0)
97
+ rspec-expectations (~> 2.8.0)
98
+ rspec-mocks (~> 2.8.0)
99
+ rspec-core (2.8.0)
100
+ rspec-expectations (2.8.0)
101
+ diff-lcs (~> 1.1.2)
102
+ rspec-mocks (2.8.0)
103
+ rspec-rails (2.8.1)
104
+ actionpack (>= 3.0)
105
+ activesupport (>= 3.0)
106
+ railties (>= 3.0)
107
+ rspec (~> 2.8.0)
108
+ slop (3.4.7)
109
+ sprockets (2.2.2)
110
+ hike (~> 1.2)
111
+ multi_json (~> 1.0)
112
+ rack (~> 1.0)
113
+ tilt (~> 1.1, != 1.3.0)
114
+ thor (0.18.1)
115
+ thread_safe (0.1.3)
116
+ atomic
117
+ tilt (1.4.1)
118
+ timers (1.1.0)
119
+ tzinfo (1.1.0)
120
+ thread_safe (~> 0.1)
121
+
122
+ PLATFORMS
123
+ ruby
124
+
125
+ DEPENDENCIES
126
+ ammeter (~> 0.2.2)
127
+ growl
128
+ guard-rspec
129
+ jruby-openssl
130
+ rake
131
+ rb-fsevent
132
+ rspec (~> 2.8.0)
133
+ wyngle-ripple!
data/Gemfile.rails30 ADDED
@@ -0,0 +1,3 @@
1
+ gem 'activemodel', '~> 3.0.11'
2
+
3
+ instance_eval File.read(File.expand_path('../Gemfile', __FILE__))
data/Gemfile.rails31 ADDED
@@ -0,0 +1,3 @@
1
+ gem 'activemodel', '~> 3.1.0'
2
+
3
+ instance_eval File.read(File.expand_path('../Gemfile', __FILE__))
data/Gemfile.rails32 ADDED
@@ -0,0 +1,3 @@
1
+ gem 'activemodel', '~> 3.2.1'
2
+
3
+ instance_eval File.read(File.expand_path('../Gemfile', __FILE__))
data/Guardfile ADDED
@@ -0,0 +1,17 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+ gemset = ENV['RVM_GEMSET'] || 'ripple'
4
+ gemset = "@#{gemset}" unless gemset.to_s == ''
5
+
6
+ rvms = %w[ 1.8.7 1.9.2 1.9.3 jruby ].map do |version|
7
+ "#{version}@#{gemset}"
8
+ end
9
+
10
+ guard 'rspec', :cli => '--profile', :rvm => rvms do
11
+ watch(%r{^spec/.+_spec\.rb$})
12
+ watch(%r{lib/rails/generators(.*)(\w+)/\2_generator\.rb}) {|m| "spec/generators#{m[1]}#{m[2]}_generator_spec.rb" }
13
+ watch(%r{lib/rails/generators(.*)(\w+)/templates}) {|m| "spec/generators#{m[1]}#{m[2]}_generator_spec.rb" }
14
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
15
+ watch('spec/spec_helper.rb') { "spec/ripple" }
16
+ end
17
+
data/LICENSE ADDED
@@ -0,0 +1,16 @@
1
+ Copyright 2010-2011 Sean Cribbs and Basho Technologies, Inc.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+
15
+ All of the files in this project are under the project-wide license
16
+ unless they are otherwise marked.
data/README.markdown ADDED
@@ -0,0 +1,166 @@
1
+ # `ripple`: Riak Document Models [![Build Status](https://secure.travis-ci.org/basho-labs/ripple.png)](http://travis-ci.org/basho-labs/ripple)
2
+
3
+ `ripple` is a rich Ruby modeling layer for Riak, Basho's distributed
4
+ database that contains an ActiveModel-based document abstraction which
5
+ is inspired by ActiveRecord, DataMapper, and MongoMapper.
6
+
7
+ ## Dependencies
8
+
9
+ `ripple` requires Ruby 1.8.7 or later and versions 3 or above of
10
+ ActiveModel and ActiveSupport (and their dependencies, including
11
+ i18n). Naturally, it also depends on the `riak-client` gem to connect
12
+ to Riak.
13
+
14
+ Development dependencies are handled with bundler. Install bundler
15
+ (`gem install bundler`) and run this command in each sub-project to
16
+ get started:
17
+
18
+ ``` bash
19
+ $ bundle install
20
+ ```
21
+
22
+ Run the RSpec suite using `bundle exec`:
23
+
24
+ ``` bash
25
+ $ bundle exec rake spec
26
+ ```
27
+
28
+ ## Document Model Examples
29
+
30
+ ``` ruby
31
+ require 'ripple'
32
+
33
+ # Documents are stored as JSON objects in Riak but have rich
34
+ # semantics, including validations and associations.
35
+ class Email
36
+ include Ripple::Document
37
+ property :from, String, :presence => true
38
+ property :to, String, :presence => true
39
+ property :sent, Time, :default => proc { Time.now }
40
+ property :body, String
41
+ end
42
+
43
+ email = Email.find("37458abc752f8413e") # GET /riak/emails/37458abc752f8413e
44
+ email.from = "someone@nowhere.net"
45
+ email.save # PUT /riak/emails/37458abc752f8413e
46
+
47
+ reply = Email.new
48
+ reply.from = "justin@bashoooo.com"
49
+ reply.to = "sean@geeemail.com"
50
+ reply.body = "Riak is a good fit for scalable Ruby apps."
51
+ reply.save # POST /riak/emails (Riak-assigned key)
52
+
53
+ # Documents can contain embedded documents, and link to other standalone documents
54
+ # via associations using the many and one class methods.
55
+ class Person
56
+ include Ripple::Document
57
+ property :name, String
58
+ many :addresses
59
+ many :friends, :class_name => "Person"
60
+ one :account
61
+ end
62
+
63
+ # Account and Address are embeddable documents
64
+ class Account
65
+ include Ripple::EmbeddedDocument
66
+ property :paid_until, Time
67
+ embedded_in :person # Adds "person" method to get parent document
68
+ end
69
+
70
+ class Address
71
+ include Ripple::EmbeddedDocument
72
+ property :street, String
73
+ property :city, String
74
+ property :state, String
75
+ property :zip, String
76
+ end
77
+
78
+ person = Person.find("adamhunter")
79
+ person.friends << Person.find("seancribbs") # Links to people/seancribbs with tag "friend"
80
+ person.addresses << Address.new(:street => "100 Main Street") # Adds an embedded address
81
+ person.account.paid_until = 3.months.from_now
82
+ ```
83
+
84
+
85
+ ## Configuration Example
86
+
87
+ When using Ripple with Rails 3, add ripple to your Gemfile and then run the `ripple` generator. This will generate a test harness, some MapReduce functions and a configuration file. Example:
88
+
89
+ ```
90
+ $ rails g ripple
91
+ create config/ripple.yml
92
+ create app/mapreduce
93
+ create app/mapreduce/contrib.js
94
+ create app/mapreduce/ripple.js
95
+ create test/ripple_test_helper.rb
96
+ insert test/test_helper.rb
97
+ insert test/test_helper.rb
98
+ ```
99
+
100
+ `config/ripple.yml` should contain your Riak connection information, and settings for the test server. Example:
101
+
102
+ ``` yaml
103
+ # Configure Riak connections for the Ripple library.
104
+ development:
105
+ http_port: 8098
106
+ pb_port: 8087
107
+ host: 127.0.0.1
108
+
109
+ # The test environment has additional keys for configuring the
110
+ # Riak::TestServer for your test/spec suite:
111
+ #
112
+ # * bin_dir specifies the path to the "riak" script that you use to
113
+ # start Riak (just the directory)
114
+ # * js_source_dir specifies where your custom Javascript functions for
115
+ # MapReduce should be loaded from. Usually app/mapreduce.
116
+ test:
117
+ http_port: 9000
118
+ pb_port: 9002
119
+ host: 127.0.0.1
120
+ bin_dir: /usr/local/bin # Default for Homebrew.
121
+ js_source_dir: <%%= Rails.root + "app/mapreduce" %>
122
+
123
+ production:
124
+ http_port: 8098
125
+ pb_port: 8087
126
+ host: 127.0.0.1
127
+ ```
128
+
129
+ `require 'ripple/railtie'` from your `config/application.rb` file to complete the integration.
130
+
131
+
132
+ ## How to Contribute
133
+
134
+ * Fork the project on [Github](http://github.com/basho/ripple). If you have already forked, use `git pull --rebase` to reapply your changes on top of the mainline. Example:
135
+
136
+ ``` bash
137
+ $ git checkout master
138
+ $ git pull --rebase basho master
139
+ ```
140
+ * Create a topic branch. If you've already created a topic branch, rebase it on top of changes from the mainline "master" branch. Examples:
141
+ * New branch:
142
+
143
+ ``` bash
144
+ $ git checkout -b topic
145
+ ```
146
+ * Existing branch:
147
+
148
+ ``` bash
149
+ $ git rebase master
150
+ ```
151
+ * Write an RSpec example or set of examples that demonstrate the necessity and validity of your changes. **Patches without specs will most often be ignored. Just do it, you'll thank me later.** Documentation patches need no specs, of course.
152
+ * Make your feature addition or bug fix. Make your specs and stories pass (green).
153
+ * Run the suite using multiruby or rvm to ensure cross-version compatibility.
154
+ * Cleanup any trailing whitespace in your code (try @whitespace-mode@ in Emacs, or "Remove Trailing Spaces in Document" in the "Text" bundle in Textmate).
155
+ * Commit, do not mess with Rakefile or VERSION. If related to an existing issue in the [tracker](http://github.com/basho/ripple/issues), include "Closes #X" in the commit message (where X is the issue number).
156
+ * Send me a pull request.
157
+
158
+ ## License & Copyright
159
+
160
+ Copyright &copy;2010-2012 Sean Cribbs and Basho Technologies, Inc.
161
+
162
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
163
+
164
+ [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
165
+
166
+ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
@@ -0,0 +1,286 @@
1
+ h1. Ripple Release Notes
2
+
3
+ h2. 0.9.5 Patch Release - 2011-06-14
4
+
5
+ Release 0.9.5 is a minor bugfix release but also includes some small features.
6
+
7
+ Full notes:
8
+
9
+ * Allow IO-like objects to be used as RObject data. [Josh Nichols]
10
+ * Set the content-length or transfer-encoding appropriately for Net::HTTP. Fixes #162.
11
+ * Fix MapReduce jobs on PBC when keep=false on certain phases. [Alexander Lang]
12
+ * Invalidate the key-cache for a bucket when streaming.
13
+ * Pass options through Document#all to Bucket#keys.
14
+ * Make Hash#to_param compatible with ActiveSupport. [Dave Perrett]
15
+ * Add support for previous_changes functionality and make available to callbacks. [Nathaniel Talbott, Sean Cribbs
16
+
17
+ h2. 0.9.4 Patch Release - 2011-05-10
18
+
19
+ Release 0.9.4 is a minor bugfix release.
20
+
21
+ Full notes:
22
+
23
+ * Allow global JSON options to be set so that deeply nested objects can be serialized.
24
+ * Set TCP_NODELAY on PBC sockets and send messages in a single write to reduce latency. [Technorama, Dan Hodge]
25
+ * X510 should be X509 in OpenSSL. [Adam Hunter]
26
+
27
+ h2. 0.9.3 Patch Release - 2011-04-18
28
+
29
+ Release 0.9.3 is a minor bugfix release.
30
+
31
+ Full notes:
32
+
33
+ * Make YAML serialization spec immune to engine differences. [Jeff Pollard]
34
+ * Key-streaming over HTTP are immune to JSON objects that cross chunk boundaries.
35
+ * Require 'yaml' so we can read the config file.
36
+ * Require 'erb' so we can eval the config. [Myron Marston]
37
+ * Move definition of validates_associated back into the validator. [Myron Marston]
38
+ * Require 'set' before Set is extended. [André Silva]
39
+
40
+ h2. 0.9.2 Patch Release - 2011-04-11
41
+
42
+ Release 0.9.2 is a minor bugfix release.
43
+
44
+ Full notes:
45
+
46
+ * Remove usage of autoload from all projects to reduce thread-safety problems.
47
+ * Fix Excon backend to properly initialize response headers under error conditions. [Jeff Pollard, Myron Marston]
48
+ * Excon yields multiple arguments to the streaming block.
49
+
50
+ h2. 0.9.1 Patch Release - 2011-04-07
51
+
52
+ Release 0.9.1 is a minor bugfix release.
53
+
54
+ Full notes:
55
+
56
+ * Fix strange encoding problems on Ruby 1.9 when using Protocol Buffers.
57
+ * Use http_port rather than port in the generated TestServer. [Myron Marston]
58
+
59
+ h2. 0.9.0 Feature Release - 2011-04-03
60
+
61
+ Release 0.9.0 is a huge step forward from the 0.8 series, including support for Riak 0.14.x features, Protocol Buffers transport, and many bugfixes.
62
+
63
+ Following this release, the code will be branched into a 0.9-stable branch, which will only receive critical bugfixes. Development of 1.0 features will occur on the master branch.
64
+
65
+ Full notes:
66
+
67
+ * Fixed some client semantics: separate ports for protocols, client ID responsibility.
68
+ * Add definition of EmbeddedDocument#==. [Myron Marston]
69
+ * Allow a many-linked doc to be removed from an association. [Myron Marston]
70
+ * Fix one-linked association to return nil appropriately. [Myron Marston]
71
+ * Added external JSON serialization for Ripple documents.
72
+ * Fixed validates_associated. [Myron Marston]
73
+ * Fixed assignment bug in one-embedded associations. [Myron Marston]
74
+ * Added integration tests that work across all client backends.
75
+ * Added support for Protocol Buffers transport with Beefcake library.
76
+ * Added HTTP Basic authorization support. [Adam Hunter]
77
+ * Added HTTPS support. [Adam Hunter]
78
+ * Normalized project Gemfiles.
79
+ * Extracted stream-isolating pump pattern from client backends.
80
+ * Improve speed and reliability of test server.
81
+ * Bubble up errors when saving a document. [Duff OMelia]
82
+ * Add automatic expiration to Rack session store.
83
+ * Use ISO8601 datetime format in stored documents (configurable). [Nicolas Fouché]
84
+ * Access document attributes that do not have a declared property. [Duff OMelia]
85
+ * Fix document callback ordering. [Nathaniel Talbott]
86
+ * Consolidate setting of the object key when link-walking. [Kyle Kingsbury]
87
+ * Added support for streaming MapReduce.
88
+ * Bucket instances are now memoized in the Client. [Woody Peterson]
89
+ * Client backends were refactored so that higher layers are not concerned with transport semantics.
90
+ * Fix false.present? bug.
91
+ * Riak 0.14 features:
92
+ ** MapReduce has support for key-filters.
93
+ ** Add list_buckets operation.
94
+ ** HTTP resources prefixes can be discovered from the root URL.
95
+ * Added document observers using ActiveModel::Observer. [Stefan Sprenger]
96
+ * :key is a protected attribute on Document models. [Adam Hunter]
97
+
98
+ h2. 0.8.3 Patch/Minor Feature Release - 2010-12-13
99
+
100
+ Release 0.8.3 includes new generators for Rails 3 projects, a new HTTP backend based on Wesley Beary's Excon library, and significant bugfixes for Document models.
101
+
102
+ @riak-client@ is now also completely independent of ActiveSupport, and all three libraries have better support for JRuby.
103
+
104
+ Full notes:
105
+
106
+ * Fix edge case where NetHTTPBackend would not #to_i the response code.
107
+ * Improve handling of Time properties, including ActiveSupport::TimeWithZone. [Duff O'Melia]
108
+ * Don't cast empty string for Numeric property types. [Marco Campana]
109
+ * Add MapReduce built-ins generator.
110
+ * Add generators to help with Riak::TestServer and initial Rails 3 setup. [Duff O'Melia, Sean Cribbs]
111
+ * Improve handling of Document properties we don't know about.
112
+ * Refactored RequestHeaders so it can be used by multiple backends.
113
+ * Add Excon HTTP backend.
114
+ * Control mock HTTP server via DRb so as to avoid deadlocks.
115
+ * Monkeypatch #present? seperately from #blank?. [Kyle Kingsbury]
116
+ * Improved RObject#inspect output. [Jay Adkisson]
117
+ * Fix Bucket#keys raising exceptions on rare occasions. [Kyle Kingsbury]
118
+ * Add support for mass-assignment security on Document models.
119
+ * Moved ActiveSupport version check into CacheStore.
120
+ * Added example TestServer config files.
121
+ * Allow document assignment even if the value is a proxy. [Duff O'Melia]
122
+ * Remove "install curb" warnings.
123
+ * Improve JRuby compatibility.
124
+ * Resolve Hash-ordering differences between 1.9 and 1.8 in specs.
125
+ * Fix 1.8.x issue with Open3 returning a nil waitthread in the TestServer.
126
+ * Removed riak-client dependency on ActiveSupport. [Kyle Kingsbury]
127
+ * Report a changed attribute only if its value changes. [Duff O'Melia]
128
+ * Reloading a Ripple::Document now casts property values. [Duff O'Melia]
129
+
130
+ h2. 0.8.2 Patch/Minor Feature Release - 2010-10-22
131
+
132
+ Release 0.8.2 includes significant additions to support features in Riak 0.13, including Riak Search and Luwak.
133
+
134
+ Simply @require 'riak/search'@ to add Search-related features to riak-client.
135
+
136
+ Full notes:
137
+
138
+ * Fixed bug in embedded associations where associated validators would be added every time the association was instantiated. [Adam Hunter]
139
+ * Update and loosen dependencies to Rails 3.0.1 and RSpec 2.
140
+ * Add support for file-existence check in Luwak. [John Axel Eriksson]
141
+ * Avoid clobbering an existing Boolean class or module.
142
+ * Add Luwak support.
143
+ * Add Search features. [Sean Cribbs, Rusty Klophaus]
144
+
145
+ h2. 0.8.1 Patch/Minor Feature Release - 2010-10-11
146
+
147
+ Release 0.8.1 includes several new features and bugfixes.
148
+
149
+ Full notes:
150
+
151
+ * Riak::TestServer makes it easier and faster to run automated tests that need to store data in Riak. It includes an in-memory Riak backend that quickly clears its contents at the end of a test/example. All included integration tests now use this.
152
+ * Headers are turned into strings before splitting into 8KB chunks. [Nicolas Fouché]
153
+ * Riak::RObject#prevent_stale_writes option allows conditional PUT semantics, matching on ETag. [Lee Jensen]
154
+ * Riak::RObject#raw_data gives access to the object data before deserialization. [Lee Jensen]
155
+ * Boolean properties on Ripple documents now allow a default value of false. [Duff O'Melia]
156
+ * Ripple documents now support accepts_nested_attributes_for. [Brian Kaney]
157
+
158
+ h2. 0.8.0 Feature Release - 2010-08-31
159
+
160
+ The 0.8.0 release is packed full of new features and bugfixes. Of particular note are:
161
+
162
+ * Rails 3 final support
163
+ * Session stores
164
+ * Linked associations
165
+ * Riak 0.12 support
166
+
167
+ Full notes:
168
+
169
+ * Ripple::Document classes can define their desired quorum parameters.
170
+ * ripple and riak-sessions use Rails 3 final. riak-client is still compatible with active_support >= 2.3.5.
171
+ * Keys are not loaded by default when requesting a Riak::Bucket. This matches the default for Riak 0.12.
172
+ * Ripple::Document now supports update_attributes and update_attribute.
173
+ * Inspection output has been improved for Ripple documents.
174
+ * Ripple::Document classes can now have associations that use links.
175
+ * Property-casting patches are now eagerly loaded.
176
+ * Certain responses from MapReduce can be converted into Riak::RObjects. [Misha Gorodnitzky]
177
+ * Key/bucket (un)escaping has been improved. [Nicolas Fouché]
178
+ * Riak::CacheStore sets and uses bucket-default quorums instead of per-request parameters.
179
+ * Riak::Bucket supports new quorum defaults.
180
+ * The default configuration file for Ripple is now config/ripple.yml. [Ashley Woodard]
181
+ * Added a Rails 3 model generator. [Ashley Woodard]
182
+ * Serializing RObject data via Marshal is now simpler, using "application/x-ruby-marshal" content-type.
183
+ * Large HTTP headers (Link tends to be one) are split into 8KB chunks for both backends.
184
+ * Added session stores for Rack and Rails 3.
185
+ * Document#find returns nil when all arguments are blank.
186
+ * CurbBackend now properly handles IO objects as the request body data.
187
+ * Ripple::Document classes that have the same bucket/key are equivalent using ==.
188
+ * Ripple::Document classes can use a property as the key, as long as it's a String.
189
+
190
+ h2. 0.7.1 Patch Release - 2010-06-08
191
+
192
+ This release has no new features but includes bug fixes and some internal refactoring of the Ripple::Document hierarchy.
193
+
194
+ * The Net::HTTP backend should handle streamed keys better (although
195
+ still not perfectly).
196
+ * The Riak::MapReduce#timeout method now returns self, allowing
197
+ chaining.
198
+ * The Ripple::Document and Ripple::EmbeddedDocument are less coupled
199
+ from one another so numerous internal confusions about calling order
200
+ are fixed.
201
+ * When using Riak::RObject#to_link, a blank tag is no longer allowed.
202
+
203
+ h2. 0.7.0 Feature Release - 2010-05-06
204
+
205
+ This release includes a number of new features. The largest change is that the library is now split into two gems, 'riak-client' and 'ripple'. 'riak-client' supports ActiveSupport 2.3.5, 'ripple' only supports 3.0.0.beta3.
206
+
207
+ A big kudos goes to Adam Hunter who contributed the majority of the new associations code.
208
+
209
+ In addition, these changes were made:
210
+
211
+ * Keys should stream properly now from Bucket#keys (the "stream" option was left off).
212
+ * Deletes can be issued directly from a Bucket without instantiating an RObject.
213
+ * Added a ActiveSupport 3.0-compatible Cache Store. [Shay Frendt]
214
+ * Added Bucket#exists?
215
+ * A provisionally complete implementation of embedded document associations. [Adam Hunter]
216
+ * Ripple::Document passes ActiveModel::Lint tests.
217
+ * Updated Rails 3 dependencies to beta3 and RSpec to 2.0.0.beta6
218
+ * Ripple::Document handles nil keys better. [John Lynch]
219
+
220
+
221
+ h2. 0.6.1 Patch Release - 2010-03-17
222
+
223
+ This is a minor release with fixes for a few issues:
224
+
225
+ * Riak::Link objects will now be unique when added to RObject#links
226
+ Set. [John Lynch]
227
+ * Attributes on Ripple::Document classes are no longer clone, which had
228
+ prevented non-scalar properties from being modified directly (e.g. Array).
229
+ * Buckets, keys, and walk specs are properly escaped in URLs
230
+ (including slashes).
231
+ * Time-related properties properly convert to string formats in JSON that
232
+ they will work in the context of MapReduce jobs.
233
+
234
+ h2. 0.6.0 Feature Release - 2010-03-05
235
+
236
+ This release contains enhancements and bugfixes in preparation for the
237
+ Riak 0.9 release.
238
+
239
+ * The CurbBackend now uses fibers to prevent curl-handle corruption when
240
+ a block is given to streaming operations.
241
+ * The default prefix is now "/riak/" to match the latest version of Riak.
242
+ * The client configuration for Ripple is now used.
243
+ * Added Bucket#new and Bucket#get_or_new for easily creating new objects.
244
+ * Added Bucket#allow_mult and Bucket#n_value accessors for more easily setting
245
+ bucket properties.
246
+ * Added timestamps! method for easily adding created_at/updated_at to documents.
247
+ [Adam Hunter]
248
+ * The 'links' collection on RObject is now a Set instead of an Array.
249
+ * All literal messages are now stored in YAML localization files.
250
+ * Object siblings (caused by concurrent updates when allow_mult is true) can now
251
+ be accessed directly.
252
+ * Map-reduce jobs now have timeouts (in parity with Riak).
253
+
254
+ h2. 0.5.1 Patch Release - 2010-02-22
255
+
256
+ This is a minor release with fixes for Ruby 1.9, bundler/edge Rails,
257
+ and a minor feature addition. Changes:
258
+
259
+ * Qualify namespaces for Ruby 1.9.
260
+ * Decoupled a few specs that gave the appearance of failure.
261
+ * Added "bucket" and "key" properties on Riak::Link objects. [John Lynch]
262
+ * Fully-qualify the @JSON@ constant, using @ActiveSupport::JSON@ instead.
263
+ * Adjusted gem specification to accommodate edge Rails. [Preston Marshall]
264
+
265
+ h2. 0.5 Initial Release - 2010-02-10
266
+
267
+ This is the first release of Ripple, which would not have been possible
268
+ without the generous support of Sonian and Basho Technologies. Many thanks.
269
+ It includes:
270
+
271
+ * A robust basic client, @Riak@, with:
272
+ ** multiple HTTP backends (curb, net/http)
273
+ ** sensible client defaults (local, default port)
274
+ ** bucket access and manipulation, including key-streaming
275
+ ** object reading, storing, deleting and reloading
276
+ ** automatic de-serialization of JSON, YAML, and Marshal (when given the right content type)
277
+ ** streaming POST/PUT bodies (when given an IO)
278
+ ** method-chained map-reduce job construction
279
+ * A document-style modeling library, Ripple, with:
280
+ ** ActiveModel 3.0 compatibility
281
+ ** Property/attribute definition with automatic type-casting
282
+ ** Bucket selection based on class name, with single-bucket inheritance (configurable)
283
+ ** Validations
284
+ ** Dirty-tracking
285
+ ** Simple finders - all documents, by key
286
+ ** Reloading