mongous 0.4.2 → 0.4.4

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
  SHA256:
3
- metadata.gz: 6a7aef9ade90f7665f9152ca0fce4831c5f9ac3263bba36f1014b2f51d1596fb
4
- data.tar.gz: 5b69a145e019b335bb49de2eec293fbe2109ada1d1702dcd58e27e7e918ff408
3
+ metadata.gz: 6fec2b64e882095a188352b441075601ca5e84ba7063d70a04e7d182533ebb34
4
+ data.tar.gz: b332b82c2d95dab25b3c69c1786757e17c0c599319f88defacad44303f8d828c
5
5
  SHA512:
6
- metadata.gz: 6d81649ab8678859734b621712493adde5d7d0056f532c4abcb0297894442acd1be905b60e725eb85070aa95a75f4c2353d9e54bcbb44fb20346afd398cc3448
7
- data.tar.gz: 0e7001c64b912df122d67c1bd67cbc378b6e9974c24b1a94235348c8ed74cd1fa22d4c65eba2d14e7968387ae8ca22ae375ae46ece75faa039cd8d4936cf1bc3
6
+ metadata.gz: 6cb477d1f25353cecc88f333136840ed75880b2ab38e7825f6053c01134f7bb5aa24950777a626cd46cc93e2fc88a857a1093f7cf925362e524bd857f6eb794b
7
+ data.tar.gz: d8ee46a451a09ab429b9754e861f21e276d311cb6b6467faef093f79a4e4868881cbc0dfe7679aa5205b5838c2ca93d1d7ff48150cc12226a0efa8ff8d5e27d5
@@ -10,6 +10,7 @@ Yet another mongo wrapper library.
10
10
  * Check if the constraint condition is satisfied when setting the item value of the document.
11
11
  * The contents of undefined items in the document can be described by value or Proc.
12
12
  * Item contents at the time of document creation and update can be described by value or Proc.
13
+ * The database collection name corresponding to the class name is not converted to the plural form.
13
14
 
14
15
  == Installation
15
16
 
@@ -55,7 +56,7 @@ class Book
55
56
  field :title, String, :must
56
57
  field :author, String
57
58
  field :publisher, String
58
- field :style, String, %w[hardcover, softcover, paperback]
59
+ field :style, String, %w[hardcover softcover paperback]
59
60
  field :size, String, /[AB]\d/
60
61
  field :price, Integer, (0..1_000_000)
61
62
  field :page, Integer, proc{ page % 4 == 0 }
@@ -10,6 +10,7 @@
10
10
  * ドキュメントの項目値設定時に制約条件を満たすか検査する.
11
11
  * ドキュメントの未定義項目の内容を値または Proc で記述できる.
12
12
  * ドキュメント作成時および更新時の項目内容を値または Proc で記述できる.
13
+ * クラス名に対応するデータベースのコレクション名は、複数形へ変換しない.
13
14
 
14
15
  == 導入
15
16
 
@@ -55,7 +56,7 @@ class Book
55
56
  field :title, String, :must
56
57
  field :author, String
57
58
  field :publisher, String
58
- field :style, String, %w[hardcover, softcover, paperback]
59
+ field :style, String, %w[hardcover softcover paperback]
59
60
  field :size, String, /[AB]\d/
60
61
  field :price, Integer, (0..1_000_000)
61
62
  field :page, Integer, proc{ page % 4 == 0 }
@@ -0,0 +1,38 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mongous (0.4.3)
5
+ mongo
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ bson (4.11.1)
11
+ diff-lcs (1.4.4)
12
+ mongo (2.14.0)
13
+ bson (>= 4.8.2, < 5.0.0)
14
+ rake (13.0.3)
15
+ rspec (3.10.0)
16
+ rspec-core (~> 3.10.0)
17
+ rspec-expectations (~> 3.10.0)
18
+ rspec-mocks (~> 3.10.0)
19
+ rspec-core (3.10.1)
20
+ rspec-support (~> 3.10.0)
21
+ rspec-expectations (3.10.1)
22
+ diff-lcs (>= 1.2.0, < 2.0)
23
+ rspec-support (~> 3.10.0)
24
+ rspec-mocks (3.10.1)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.10.0)
27
+ rspec-support (3.10.1)
28
+
29
+ PLATFORMS
30
+ x86_64-linux
31
+
32
+ DEPENDENCIES
33
+ mongous!
34
+ rake
35
+ rspec
36
+
37
+ BUNDLED WITH
38
+ 2.2.6
@@ -1,3 +1,3 @@
1
1
  module Mongous
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.4"
3
3
  end
@@ -19,7 +19,7 @@ book.isbn = "978-3-16-148410-0"
19
19
  # book.updated_at = nil # (updated)
20
20
  book.save
21
21
 
22
- Book.each do |book|
23
- pp book
22
+ Book.each do |a_book|
23
+ pp a_book
24
24
  end
25
25
 
@@ -11,8 +11,8 @@ book = Book1.where( title: "book1" ).first
11
11
  book.author = "alice"
12
12
  book.save
13
13
 
14
- Book1.each do |book|
15
- pp book
14
+ Book1.each do |a_book|
15
+ pp a_book
16
16
  end
17
17
  puts
18
18
 
@@ -29,8 +29,8 @@ book = Book2.where( title: "book2" ).first
29
29
  book.author = "bob"
30
30
  book.save
31
31
 
32
- Book2.each do |book|
33
- pp book
32
+ Book2.each do |a_book|
33
+ pp a_book
34
34
  end
35
35
  puts
36
36
 
@@ -35,7 +35,7 @@ book.isbn = "978-3-16-148410-0"
35
35
  book.save
36
36
 
37
37
 
38
- Book.each do |book|
39
- pp book
38
+ Book.each do |a_book|
39
+ pp a_book
40
40
  end
41
41
 
@@ -37,7 +37,7 @@ book.isbn = "978-3-16-148410-0"
37
37
  book.save
38
38
 
39
39
 
40
- Book.each do |book|
41
- pp book
40
+ Book.each do |a_book|
41
+ pp a_book
42
42
  end
43
43
 
@@ -37,7 +37,7 @@ book.isbn = "978-3-16-148410-0"
37
37
  book.save
38
38
 
39
39
 
40
- Book.each do |book|
41
- pp book
40
+ Book.each do |a_book|
41
+ pp a_book
42
42
  end
43
43
 
@@ -43,7 +43,7 @@ book.isbn = "978-3-16-148410-0"
43
43
  book.save
44
44
 
45
45
 
46
- Book.each do |book|
47
- pp book
46
+ Book.each do |a_book|
47
+ pp a_book
48
48
  end
49
49
 
@@ -24,9 +24,9 @@ class Book
24
24
  end
25
25
 
26
26
 
27
- Book.each do |book|
27
+ Book.each do |a_book|
28
28
  begin
29
- pp book
29
+ pp a_book
30
30
  book.save # cause exception when detected violation.
31
31
  rescue => e
32
32
  p e.message
@@ -22,8 +22,8 @@ pp books = Book.all
22
22
  puts
23
23
 
24
24
  p "Book.each do |book|"
25
- Book.each do |book|
26
- p book
25
+ Book.each do |a_book|
26
+ p a_book
27
27
  end
28
28
  puts
29
29
 
@@ -22,8 +22,8 @@ pp books = Book.where( title: /title/ ).all
22
22
  puts
23
23
 
24
24
  p "Book.where( title: /title/ ).each do |book|"
25
- Book.where( title: /title/ ).each do |book|
26
- p book
25
+ Book.where( title: /title/ ).each do |a_book|
26
+ p a_book
27
27
  end
28
28
  puts
29
29
 
@@ -8,25 +8,25 @@ p book = Book.find.first
8
8
  puts
9
9
 
10
10
  p "Book.find.each do |book|"
11
- Book.find.each do |book|
12
- p book
11
+ Book.find.each do |a_book|
12
+ p a_book
13
13
  end
14
14
  puts
15
15
 
16
16
  p "Book.find( title: /title/ ).each do |book|"
17
- Book.find( title: /title/ ).each do |book|
18
- p book
17
+ Book.find( title: /title/ ).each do |a_book|
18
+ p a_book
19
19
  end
20
20
  puts
21
21
 
22
22
  p "Book.find( {}, { projection: {_id: 0} } ).each do |book|"
23
- Book.find( {}, { projection: {_id: 0} } ).each do |book|
24
- p book
23
+ Book.find( {}, { projection: {_id: 0} } ).each do |a_book|
24
+ p a_book
25
25
  end
26
26
  puts
27
27
 
28
28
  p "Book.find( {title: /title/}, { projection: {_id: 0} } ).each do |book|"
29
- Book.find( {title: /title/}, { projection: {_id: 0} } ).each do |book|
30
- p book
29
+ Book.find( {title: /title/}, { projection: {_id: 0} } ).each do |a_book|
30
+ p a_book
31
31
  end
32
32
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongous
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - arimay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-24 00:00:00.000000000 Z
11
+ date: 2021-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongo
@@ -62,11 +62,11 @@ files:
62
62
  - ".gitignore"
63
63
  - ".rspec"
64
64
  - ".rubocop.yml"
65
- - ".travis.yml"
66
65
  - Gemfile
67
66
  - README.adoc
68
67
  - README.ja.adoc
69
68
  - Rakefile
69
+ - _Gemfile.lock
70
70
  - bin/console
71
71
  - bin/setup
72
72
  - lib/mongous.rb
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.7.1
6
- before_install: gem install bundler -v 2.1.4