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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85525f8d2adf2b223e777689f28c07583ef03eca
4
- data.tar.gz: 3ddae37272e67fb3b2a3f17601b140e3a768ed1d
3
+ metadata.gz: a10b284fa17f596b6c6b8609f6809e12d037b577
4
+ data.tar.gz: 23173e0c419135398b2df7fd5d0bef36d2a54542
5
5
  SHA512:
6
- metadata.gz: 2d5d8251fc0e4cf34676ecd69b3b8dfc663790374c88b166493ab0d3e8337a1a080db943d09ec4ff0329c5334dd8ce93de4701a2d6f7bffa135aae30e9448a52
7
- data.tar.gz: 35753e2406ce9b9065c4ebd30e8310d17b864df541866959cf6af8400e60cf31cdfc7498e6bcfdd9bcb7c6153e0e552aad2cf6bab974e5a12e9ff3197b41a45a
6
+ metadata.gz: e89ca6f4f76fbfb93f97dc48dd114681a6fb43631f32d1e558597318654b03599f3ca508bb3c3c73d4ad5f430b764512b545c99c47f0b8c3746e7bcc82161e3f
7
+ data.tar.gz: c2b5ae2664218099af0489d7cc4cc503e474ad5b16f13804b1cac5bd3c45b6627b0aed514f6af95144e692fa4d517d16c27298713f5107c7fb6702ac03515931
data/Rakefile CHANGED
@@ -14,10 +14,4 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
-
18
-
19
-
20
-
21
-
22
17
  Bundler::GemHelper.install_tasks
23
-
@@ -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
- timestamp = timestamp.utc.to_s(:nsec)
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
- timestamp = timestamp.utc.to_s(:nsec)
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
 
@@ -12,7 +12,7 @@ module Fish0
12
12
  end
13
13
 
14
14
  def to_partial_path
15
- "#{type}"
15
+ type.to_s
16
16
  end
17
17
  end
18
18
  end
@@ -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 || (fail ArgumentError)
9
+ @collection = collection || (raise ArgumentError)
10
10
  @per = per_page
11
11
  @page = page_number - 1
12
12
  @padding = padding
@@ -14,7 +14,7 @@ module Fish0
14
14
  delegate :each, to: :all
15
15
 
16
16
  def initialize(collection, entity_class = nil)
17
- fail ArgumentError, "you should provide collection name" unless collection
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 || fail(RecordNotFound, "can't find in #{collection} with #{conditions}")
42
+ first || raise(RecordNotFound, "can't find in #{collection} with #{conditions}")
43
43
  end
44
44
 
45
45
  def where(query)
46
- self.conditions.merge!(query)
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
- fail ArgumentError unless item.respond_to?(:published_at)
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
@@ -1,3 +1,3 @@
1
1
  module Fish0
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.2'.freeze
3
3
  end
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.1
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: Plugin for read-only content websites with MongoDB storage. Works perfect
70
- with Rambler&Co CQRS projects
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
  - - ">="
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :fish0 do
3
- # # Task goes here
4
- # end