dynamoid 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d03723c3178362472031077f90ef4d732c9f6a59
4
- data.tar.gz: d5255b0e842355e872056f10c2619f9c9609e96a
3
+ metadata.gz: 79a156ccd69a903440d15d65b4eeb89f5f875d9e
4
+ data.tar.gz: f4cfabc262d301f92bed990a217f188ac7956c8c
5
5
  SHA512:
6
- metadata.gz: de28cab30c3bd935e588f481986fddc5ad25e46a40a0e5a9675524e71e112f67333f2a663b8951253742b33e655ec556381834acf122c9cb484829c68beb48dc
7
- data.tar.gz: 2514d74830f6f8fa4f427eb0ddbed13eec808aaa437a7cac7dc1772a8eb4592dbb1d35551b426cad71ed0e693e6c9d2d532f7d2d1949f72c59c6712136582615
6
+ metadata.gz: 1f3d1a4e7fad25f44a098c1cbcfbe5807ddc49f6558835b1411c4abe1171f51980b653b3391eab0d761d37650d38e0cca428dfa5e078d5f58688e95e1f023961
7
+ data.tar.gz: fae777d74e2b1477ae8c688491ad48b2a6f8f0fd4c2dc2b229a40970ceae1aeaa54fd9fc8a490534fc1013db877eb3a4abe23ffbadd8fbe674d7c3f9a1af9984
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.gitignore ADDED
@@ -0,0 +1,67 @@
1
+ .project
2
+
3
+ # rcov generated
4
+ coverage
5
+
6
+ # rdoc generated
7
+ rdoc
8
+
9
+ # yardoc generated
10
+ .yardoc
11
+ /_yardoc/
12
+
13
+ # bundler
14
+ /.bundle/
15
+
16
+ # jeweler generated
17
+ /pkg/
18
+
19
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
20
+ #
21
+ # * Create a file at ~/.gitignore
22
+ # * Include files you want ignored
23
+ # * Run: git config --global core.excludesfile ~/.gitignore
24
+ #
25
+ # After doing this, these files will be ignored in all your git projects,
26
+ # saving you from having to 'pollute' every project you touch with them
27
+ #
28
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
29
+ #
30
+ # For MacOS:
31
+ #
32
+ #.DS_Store
33
+
34
+ # For TextMate
35
+ #*.tmproj
36
+ #tmtags
37
+
38
+ # For emacs:
39
+ #*~
40
+ #\#*
41
+ #.\#*
42
+
43
+ # For vim:
44
+ #*.swp
45
+
46
+ # For redcar:
47
+ #.redcar
48
+
49
+ # For rubinius:
50
+ #*.rbc
51
+
52
+ # for RVM
53
+ .rvmrc
54
+
55
+ # For RubyMine:
56
+ /.idea/
57
+
58
+ # For Ctags
59
+ .gemtags
60
+ .tags
61
+ .tags_sorted_by_file
62
+
63
+ /Gemfile.lock
64
+ /doc/
65
+ /spec/reports/
66
+ /tmp/
67
+ /spec/DynamoDBLocal-latest/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,15 @@
1
+ language: ruby
2
+ rvm:
3
+ - ruby-2.0.0-p648
4
+ - ruby-2.1.10
5
+ - ruby-2.2.5
6
+ - ruby-2.3.1
7
+ - jruby-9.1.4.0
8
+ before_install: gem install bundler -v 1.12.5
9
+ install:
10
+ - wget http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.zip --quiet -O spec/dynamodb_temp.zip
11
+ - unzip -qq spec/dynamodb_temp.zip -d spec/DynamoDBLocal-latest
12
+ - rm spec/dynamodb_temp.zip
13
+ script:
14
+ - bundle install
15
+ - bundle exec rake unattended_spec
data/CHANGELOG.md CHANGED
@@ -1,7 +1,25 @@
1
+ # 1.2.0
2
+
3
+ * Add create_table_syncronously, and sync: option to regular create_table (@pboling)
4
+ * make required for tables created with secondary indexes
5
+ * Expose and fix truncate method on adapter (#52, @pcorpet)
6
+ * Enable saving without updating timestamps (#58, @cignoir)
7
+ * Fix projected attributes by checking for :include (#56, @yoshida_tetsuhiro)
8
+ * Make behavior of association where method closer to AR by cloning instead of modifying (#51, @pcorpet)
9
+ * Add boolean field presence validator (#50, @pcorpet)
10
+ * Add association build method (#49, @pcorpet)
11
+ * Fix association create method (#47, #48, @pcorpet)
12
+ * Support range_between (#42, @ayemos)
13
+ * Fix problems with range query (#42, @ayemos)
14
+ * Don't prefix table names when namespace is nil (#40, @brenden)
15
+ * Added basic secondary index support (#34, @sumocoder)
16
+ * Fix query attribute behavior for booleans (#35, @amirmanji)
17
+ * Ignore unknown fields on model initialize (PR #33, @sumocoder)
18
+
1
19
  # 1.1.0
2
20
 
3
- * Added support for optimistic locking on delete (PR #29, sumocoder)
4
- * upgrade concurrent-ruby requirement to 1.0 (PR #31, keithmgould)
21
+ * Added support for optimistic locking on delete (PR #29, @sumocoder)
22
+ * upgrade concurrent-ruby requirement to 1.0 (PR #31, @keithmgould)
5
23
 
6
24
  # 1.0.0
7
25
 
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
- source "http://www.rubygems.org"
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in dynamoid.gemspec
2
4
  gemspec
@@ -56,10 +56,10 @@ Then you need to initialize Dynamoid config to get it going. Put code similar to
56
56
  ```ruby
57
57
  Dynamoid.configure do |config|
58
58
  config.adapter = 'aws_sdk_v2' # This adapter establishes a connection to the DynamoDB servers using Amazon's own AWS gem.
59
- config.namespace = "dynamoid_app_development" # To namespace tables created by Dynamoid from other tables you might have.
59
+ config.namespace = "dynamoid_app_development" # To namespace tables created by Dynamoid from other tables you might have. Set to nil to avoid namespacing.
60
60
  config.warn_on_scan = true # Output a warning to the logger when you perform a scan rather than a query on a table.
61
- config.read_capacity = 100 # Read capacity for your tables
62
- config.write_capacity = 20 # Write capacity for your tables
61
+ config.read_capacity = 5 # Read capacity for your tables
62
+ config.write_capacity = 5 # Write capacity for your tables
63
63
  config.endpoint = 'http://localhost:3000' # [Optional]. If provided, it communicates with the DB listening at the endpoint. This is useful for testing with [Amazon Local DB] (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html).
64
64
  end
65
65
 
@@ -86,7 +86,7 @@ Dynamoid has some sensible defaults for you when you create a new table, includi
86
86
  class User
87
87
  include Dynamoid::Document
88
88
 
89
- table :name => :awesome_users, :key => :user_id, :read_capacity => 400, :write_capacity => 400
89
+ table :name => :awesome_users, :key => :user_id, :read_capacity => 5, :write_capacity => 5
90
90
  end
91
91
  ```
92
92
 
@@ -356,12 +356,36 @@ Also, without contributors the project wouldn't be nearly as awesome. So many th
356
356
  * [Jason Dew](https://github.com/jasondew)
357
357
  * [Luis Arias](https://github.com/luisantonioa)
358
358
  * [Stefan Neculai](https://github.com/stefanneculai)
359
- * [Philip White](https://github.com/philipmw)
359
+ * [Philip White](https://github.com/philipmw) *
360
360
  * [Peeyush Kumar](https://github.com/peeyush1234)
361
+ * [Sumanth Ravipati](https://github.com/sumocoder)
362
+ * [Pascal Corpet](https://github.com/pcorpet)
363
+ * [Brian Glusman](https://github.com/bglusman) *
364
+ * [Peter Boling](https://github.com/pboling) *
365
+
366
+ \* Current Maintianers
361
367
 
362
368
  ## Running the tests
363
369
 
364
- Running the tests is fairly simple. In one window, run `bin/start_dynamodblocal`, and in the other, use `rake`.
370
+ Running the tests is fairly simple. You should have an instance of DynamoDB running locally. Follow this steps to be able to run the tests:
371
+
372
+ * First download and unpack the latest version of DynamoDB.
373
+
374
+ ```shell
375
+ bin/setup
376
+ ```
377
+
378
+ * Start the local instance of DynamoDB to listen in ***8000*** port
379
+
380
+ ```shell
381
+ bin/start_dynamodblocal
382
+ ```
383
+
384
+ * and lastly, use `rake` to run the tests.
385
+
386
+ ```shell
387
+ rake
388
+ ```
365
389
 
366
390
  [![Build Status](https://travis-ci.org/Dynamoid/Dynamoid.svg)](https://travis-ci.org/Dynamoid/Dynamoid)
367
391
  [![Coverage Status](https://coveralls.io/repos/Dynamoid/Dynamoid/badge.svg?branch=master&service=github)](https://coveralls.io/github/Dynamoid/Dynamoid?branch=master)
data/Rakefile CHANGED
@@ -1,7 +1,5 @@
1
- # encoding: utf-8
1
+ require "bundler/gem_tasks"
2
2
 
3
- require 'rubygems'
4
- require 'bundler'
5
3
  begin
6
4
  Bundler.setup(:default, :development)
7
5
  rescue Bundler::BundlerError => e
@@ -9,47 +7,46 @@ rescue Bundler::BundlerError => e
9
7
  $stderr.puts "Run `bundle install` to install missing gems"
10
8
  exit e.status_code
11
9
  end
12
- require 'rake'
13
10
 
14
- require 'rspec/core'
15
- require 'rspec/core/rake_task'
11
+ require "rake"
12
+ require "rspec/core/rake_task"
16
13
  RSpec::Core::RakeTask.new(:spec) do |spec|
17
- spec.pattern = FileList['spec/**/*_spec.rb']
14
+ spec.pattern = FileList["spec/**/*_spec.rb"]
18
15
  end
19
16
 
20
17
  RSpec::Core::RakeTask.new(:rcov) do |spec|
21
- spec.pattern = 'spec/**/*_spec.rb'
18
+ spec.pattern = "spec/**/*_spec.rb"
22
19
  spec.rcov = true
23
20
  end
24
21
 
25
22
  desc "Start DynamoDBLocal, run tests, clean up"
26
23
  task :unattended_spec do |t|
27
-
28
- if system('bin/start_dynamodblocal')
29
- puts 'DynamoDBLocal started; proceeding with specs.'
24
+
25
+ if system("bin/start_dynamodblocal")
26
+ puts "DynamoDBLocal started; proceeding with specs."
30
27
  else
31
- raise 'Unable to start DynamoDBLocal. Cannot run unattended specs.'
28
+ raise "Unable to start DynamoDBLocal. Cannot run unattended specs."
32
29
  end
33
30
 
34
31
  #Cleanup
35
32
  at_exit do
36
- unless system('bin/stop_dynamodblocal')
37
- $stderr.puts 'Unable to cleanly stop DynamoDBLocal.'
33
+ unless system("bin/stop_dynamodblocal")
34
+ $stderr.puts "Unable to cleanly stop DynamoDBLocal."
38
35
  end
39
36
  end
40
-
37
+
41
38
  Rake::Task["spec"].invoke
42
39
  end
43
40
 
44
- require 'yard'
41
+ require "yard"
45
42
  YARD::Rake::YardocTask.new do |t|
46
- t.files = ['lib/**/*.rb', "README", "LICENSE"] # optional
47
- t.options = ['-m', 'markdown'] # optional
43
+ t.files = ["lib/**/*.rb", "README", "LICENSE"] # optional
44
+ t.options = ["-m", "markdown"] # optional
48
45
  end
49
46
 
50
- desc 'Publish documentation to gh-pages'
47
+ desc "Publish documentation to gh-pages"
51
48
  task :publish do
52
- Rake::Task['yard'].invoke
49
+ Rake::Task["yard"].invoke
53
50
  `git add .`
54
51
  `git commit -m 'Regenerated documentation'`
55
52
  `git checkout gh-pages`
data/dynamoid.gemspec CHANGED
@@ -1,75 +1,52 @@
1
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "dynamoid/version"
2
5
 
3
- Gem::Specification.new do |s|
4
- s.name = "dynamoid"
5
- s.version = "1.1.0"
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "dynamoid"
8
+ spec.version = Dynamoid::VERSION
6
9
 
7
10
  # Keep in sync with README
8
- s.authors = [
9
- 'Josh Symonds',
10
- 'Logan Bowers',
11
- 'Craig Heneveld',
12
- 'Anatha Kumaran',
13
- 'Jason Dew',
14
- 'Luis Arias',
15
- 'Stefan Neculai',
16
- 'Philip White',
17
- 'Peeyush Kumar',
11
+ spec.authors = [
12
+ "Josh Symonds",
13
+ "Logan Bowers",
14
+ "Craig Heneveld",
15
+ "Anatha Kumaran",
16
+ "Jason Dew",
17
+ "Luis Arias",
18
+ "Stefan Neculai",
19
+ "Philip White",
20
+ "Peeyush Kumar",
21
+ "Sumanth Ravipati",
22
+ "Pascal Corpet",
23
+ "Brian Glusman",
24
+ "Peter Boling"
18
25
  ]
19
- s.description = "Dynamoid is an ORM for Amazon's DynamoDB that supports offline development, associations, querying, and everything else you'd expect from an ActiveRecord-style replacement."
20
- s.extra_rdoc_files = [
21
- "LICENSE.txt",
22
- "README.markdown"
26
+ spec.email = ["peter.boling@gmail.com", "brian@stellaservice.com"]
27
+
28
+ spec.description = "Dynamoid is an ORM for Amazon's DynamoDB that supports offline development, associations, querying, and everything else you'd expect from an ActiveRecord-style replacement."
29
+ spec.summary = "Dynamoid is an ORM for Amazon's DynamoDB"
30
+ spec.extra_rdoc_files = [
31
+ "LICENSE.txt",
32
+ "README.md"
23
33
  ]
24
- # file list is generated with `git ls-files | grep -v -E -e '^spec/' -e '^\.' -e 'bin/'`
25
- s.files = %w(
26
- CHANGELOG.md
27
- Gemfile
28
- LICENSE.txt
29
- README.markdown
30
- Rakefile
31
- dynamoid.gemspec
32
- lib/dynamoid.rb
33
- lib/dynamoid/adapter.rb
34
- lib/dynamoid/adapter_plugin/aws_sdk_v2.rb
35
- lib/dynamoid/associations.rb
36
- lib/dynamoid/associations/association.rb
37
- lib/dynamoid/associations/belongs_to.rb
38
- lib/dynamoid/associations/has_and_belongs_to_many.rb
39
- lib/dynamoid/associations/has_many.rb
40
- lib/dynamoid/associations/has_one.rb
41
- lib/dynamoid/associations/many_association.rb
42
- lib/dynamoid/associations/single_association.rb
43
- lib/dynamoid/components.rb
44
- lib/dynamoid/config.rb
45
- lib/dynamoid/config/options.rb
46
- lib/dynamoid/criteria.rb
47
- lib/dynamoid/criteria/chain.rb
48
- lib/dynamoid/dirty.rb
49
- lib/dynamoid/document.rb
50
- lib/dynamoid/errors.rb
51
- lib/dynamoid/fields.rb
52
- lib/dynamoid/finders.rb
53
- lib/dynamoid/identity_map.rb
54
- lib/dynamoid/middleware/identity_map.rb
55
- lib/dynamoid/persistence.rb
56
- lib/dynamoid/validations.rb
57
- )
58
- s.homepage = "http://github.com/Dynamoid/Dynamoid"
59
- s.licenses = ["MIT"]
60
- s.require_paths = ["lib"]
61
- s.rubygems_version = "1.8.24"
62
- s.summary = "Dynamoid is an ORM for Amazon's DynamoDB"
34
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(bin|test|spec|features)/}) }
35
+ spec.homepage = "http://github.com/Dynamoid/Dynamoid"
36
+ spec.licenses = ["MIT"]
37
+ spec.bindir = "exe"
38
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
39
+ spec.require_paths = ["lib"]
63
40
 
64
- s.add_runtime_dependency(%q<activemodel>, ["~> 4"])
65
- s.add_runtime_dependency(%q<aws-sdk-resources>, ["~> 2"])
66
- s.add_runtime_dependency(%q<concurrent-ruby>, [">= 1.0"])
67
- s.add_development_dependency(%q<rake>, [">= 0"])
68
- s.add_development_dependency(%q<rspec>, ["~> 3"])
69
- s.add_development_dependency(%q<bundler>, [">= 0"])
70
- s.add_development_dependency(%q<yard>, [">= 0"])
71
- s.add_development_dependency(%q<github-markup>, [">= 0"])
72
- s.add_development_dependency(%q<pry>, [">= 0"])
73
- s.add_development_dependency(%q<coveralls>, [">= 0"])
41
+ spec.add_runtime_dependency(%q<activemodel>, ["~> 4"])
42
+ spec.add_runtime_dependency(%q<aws-sdk-resources>, ["~> 2"])
43
+ spec.add_runtime_dependency(%q<concurrent-ruby>, [">= 1.0"])
44
+ spec.add_development_dependency(%q<rake>, [">= 10"])
45
+ spec.add_development_dependency(%q<bundler>, ["~> 1.12"])
46
+ spec.add_development_dependency(%q<rspec>, [">= 3"])
47
+ spec.add_development_dependency(%q<yard>, [">= 0"])
48
+ spec.add_development_dependency(%q<github-markup>, [">= 0"])
49
+ spec.add_development_dependency(%q<pry>, [">= 0"])
50
+ spec.add_development_dependency(%q<coveralls>, [">= 0"])
51
+ spec.add_development_dependency(%q<rspec-retry>, [">= 0"])
74
52
  end
75
-
data/lib/dynamoid.rb CHANGED
@@ -3,27 +3,29 @@ require "time"
3
3
  require "securerandom"
4
4
  require "active_support"
5
5
  require "active_support/core_ext"
6
- require 'active_support/json'
6
+ require "active_support/json"
7
7
  require "active_support/inflector"
8
8
  require "active_support/lazy_load_hooks"
9
9
  require "active_support/time_with_zone"
10
10
  require "active_model"
11
11
 
12
- require 'dynamoid/errors'
13
- require 'dynamoid/fields'
14
- require 'dynamoid/associations'
15
- require 'dynamoid/persistence'
16
- require 'dynamoid/dirty'
17
- require 'dynamoid/validations'
18
- require 'dynamoid/criteria'
19
- require 'dynamoid/finders'
20
- require 'dynamoid/identity_map'
21
- require 'dynamoid/config'
22
- require 'dynamoid/components'
23
- require 'dynamoid/document'
24
- require 'dynamoid/adapter'
25
-
26
- require 'dynamoid/middleware/identity_map'
12
+ require "dynamoid/version"
13
+ require "dynamoid/errors"
14
+ require "dynamoid/fields"
15
+ require "dynamoid/indexes"
16
+ require "dynamoid/associations"
17
+ require "dynamoid/persistence"
18
+ require "dynamoid/dirty"
19
+ require "dynamoid/validations"
20
+ require "dynamoid/criteria"
21
+ require "dynamoid/finders"
22
+ require "dynamoid/identity_map"
23
+ require "dynamoid/config"
24
+ require "dynamoid/components"
25
+ require "dynamoid/document"
26
+ require "dynamoid/adapter"
27
+
28
+ require "dynamoid/middleware/identity_map"
27
29
 
28
30
  module Dynamoid
29
31
  extend self
@@ -34,11 +36,11 @@ module Dynamoid
34
36
  block_given? ? yield(Dynamoid::Config) : Dynamoid::Config
35
37
  end
36
38
  alias :config :configure
37
-
39
+
38
40
  def logger
39
41
  Dynamoid::Config.logger
40
42
  end
41
-
43
+
42
44
  def included_models
43
45
  @included_models ||= []
44
46
  end