fish0 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +0 -6
- data/lib/fish0/concerns/cacheable.rb +3 -5
- data/lib/fish0/concerns/view_model.rb +1 -1
- data/lib/fish0/paginator.rb +1 -1
- data/lib/fish0/repository.rb +4 -4
- data/lib/fish0/version.rb +1 -1
- metadata +6 -6
- data/lib/tasks/fish0_tasks.rake +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a10b284fa17f596b6c6b8609f6809e12d037b577
|
4
|
+
data.tar.gz: 23173e0c419135398b2df7fd5d0bef36d2a54542
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e89ca6f4f76fbfb93f97dc48dd114681a6fb43631f32d1e558597318654b03599f3ca508bb3c3c73d4ad5f430b764512b545c99c47f0b8c3746e7bcc82161e3f
|
7
|
+
data.tar.gz: c2b5ae2664218099af0489d7cc4cc503e474ad5b16f13804b1cac5bd3c45b6627b0aed514f6af95144e692fa4d517d16c27298713f5107c7fb6702ac03515931
|
data/Rakefile
CHANGED
@@ -8,13 +8,11 @@ module Fish0
|
|
8
8
|
case
|
9
9
|
when timestamp_names.any?
|
10
10
|
timestamp = max_updated_column_timestamp(timestamp_names)
|
11
|
-
|
12
|
-
"#{self.class.to_s.tableize}/#{slug}-#{timestamp}"
|
11
|
+
"#{self.class.to_s.tableize}/#{slug || id}-#{timestamp.utc.to_s(:nsec)}"
|
13
12
|
when timestamp = max_updated_column_timestamp
|
14
|
-
|
15
|
-
"#{self.class.to_s.tableize}/#{slug}-#{timestamp}"
|
13
|
+
"#{self.class.to_s.tableize}/#{slug || id}-#{timestamp.utc.to_s(:nsec)}"
|
16
14
|
else
|
17
|
-
"#{self.class.to_s.tableize}/#{slug}"
|
15
|
+
"#{self.class.to_s.tableize}/#{slug || id}"
|
18
16
|
end
|
19
17
|
end
|
20
18
|
|
data/lib/fish0/paginator.rb
CHANGED
@@ -6,7 +6,7 @@ module Fish0
|
|
6
6
|
attr_reader :collection
|
7
7
|
|
8
8
|
def initialize(collection, page_number: 1, per_page: 22, padding: 0)
|
9
|
-
@collection = collection || (
|
9
|
+
@collection = collection || (raise ArgumentError)
|
10
10
|
@per = per_page
|
11
11
|
@page = page_number - 1
|
12
12
|
@padding = padding
|
data/lib/fish0/repository.rb
CHANGED
@@ -14,7 +14,7 @@ module Fish0
|
|
14
14
|
delegate :each, to: :all
|
15
15
|
|
16
16
|
def initialize(collection, entity_class = nil)
|
17
|
-
|
17
|
+
raise ArgumentError, 'you should provide collection name' unless collection
|
18
18
|
@collection = collection
|
19
19
|
@source = Fish0.mongo_reader[collection]
|
20
20
|
@conditions = {}
|
@@ -39,11 +39,11 @@ module Fish0
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def first!
|
42
|
-
first ||
|
42
|
+
first || raise(RecordNotFound, "can't find in #{collection} with #{conditions}")
|
43
43
|
end
|
44
44
|
|
45
45
|
def where(query)
|
46
|
-
|
46
|
+
conditions.merge!(query)
|
47
47
|
self
|
48
48
|
end
|
49
49
|
|
@@ -68,7 +68,7 @@ module Fish0
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def follow_after(item)
|
71
|
-
|
71
|
+
raise ArgumentError unless item.respond_to?(:published_at)
|
72
72
|
|
73
73
|
order_by(published_at: -1).where(published_at: { '$lt': item.published_at })
|
74
74
|
end
|
data/lib/fish0/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fish0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Zuev
|
@@ -66,8 +66,9 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.35'
|
69
|
-
description:
|
70
|
-
with
|
69
|
+
description: |-
|
70
|
+
Plugin for read-only content websites with MongoDB storage.
|
71
|
+
Works perfect with Rambler&Co CQRS projects
|
71
72
|
email:
|
72
73
|
- d.zuev@rambler-co.ru
|
73
74
|
executables: []
|
@@ -85,7 +86,6 @@ files:
|
|
85
86
|
- lib/fish0/record_not_found.rb
|
86
87
|
- lib/fish0/repository.rb
|
87
88
|
- lib/fish0/version.rb
|
88
|
-
- lib/tasks/fish0_tasks.rake
|
89
89
|
homepage: https://github.com/rambler-digital-solutions/fish0
|
90
90
|
licenses:
|
91
91
|
- MIT
|
@@ -96,9 +96,9 @@ require_paths:
|
|
96
96
|
- lib
|
97
97
|
required_ruby_version: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
|
-
- - "
|
99
|
+
- - "~>"
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
101
|
+
version: '2.0'
|
102
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
103
|
requirements:
|
104
104
|
- - ">="
|
data/lib/tasks/fish0_tasks.rake
DELETED