mongoid_recurring 0.1.2 → 0.1.3

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: d85b73b3c24c54091208f08e81cacb20de632f14
4
- data.tar.gz: eac9e4fc14653e733a10d782a5b684f5bd4c1856
3
+ metadata.gz: bdb70c676c42a5424af0bdf634c7560adde98edc
4
+ data.tar.gz: bb6b1ef7c7289d47af554149365efe65ca03c217
5
5
  SHA512:
6
- metadata.gz: 0a01e15f26a9c90f8d3676a936fb031c912012db423407ba1af13a10b53960bcf31661b1b85f5acfa00d2600b3b3f28f9a4ffac8b700023838b1c6681cdf2382
7
- data.tar.gz: 97aade14ef57dbfb29987a44fc5b7a2c2a7bc011d435b18e45e0d0d8ea1ad94c13802d4d249d9d6f3b97e0de3a4e1790875dbcac93b429c3a03fa002119ff5e6
6
+ metadata.gz: 9ecde7e7953dccb1c7715c8a277e51ffc38839d3f09508df8115ed00030dd59a4647e54ec0b51e4d1e6d8f8df8c1446568161b318df72b5c03243afdb3ac704d
7
+ data.tar.gz: 6cb606eee0f746deb327420bf797bf8c3c99a11611f9ac572769631829199e5a8fffaa4c2a6a310e3ac1c17ad6204217d5f9537b03d5b02c0be55c3963096add
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # MongoidRecurring
1
+ # Mongoid Recurring
2
2
 
3
3
  [![Build Status](https://travis-ci.org/tomasc/mongoid_recurring.svg)](https://travis-ci.org/tomasc/mongoid_recurring) [![Gem Version](https://badge.fury.io/rb/mongoid_recurring.svg)](http://badge.fury.io/rb/mongoid_recurring) [![Coverage Status](https://img.shields.io/coveralls/tomasc/mongoid_recurring.svg)](https://coveralls.io/r/tomasc/mongoid_recurring)
4
4
 
5
5
  Recurring date time fields for Mongoid models, using [IceCube](https://github.com/seejohnrun/ice_cube/).
6
6
 
7
- When included in a model, this gem expands the recurring rules set of an `IceCube` schedule on save into an array of embedded `MongoidRecurring::Occurence` models.
7
+ When included in a model, this gem expands the recurring rules set of an `IceCube` schedule on save into an array of embedded `MongoidRecurring::Occurrence` models.
8
8
 
9
9
  It also adds definitions of several scopes that allow for convenient querying of models stored in the db.
10
10
 
@@ -26,7 +26,7 @@ module MongoidRecurring
26
26
 
27
27
  # ---------------------------------------------------------------------
28
28
 
29
- embeds_many :occurrences, class_name: 'MongoidRecurring::Occurence', order: :dtstart.asc
29
+ embeds_many :occurrences, class_name: 'MongoidRecurring::Occurrence', order: :dtstart.asc
30
30
 
31
31
  validates :dtstart, presence: true
32
32
 
@@ -35,15 +35,15 @@ module MongoidRecurring
35
35
  # ---------------------------------------------------------------------
36
36
 
37
37
  scope :for_datetime_range, -> (dtstart, dtend) {
38
- where({ occurrences: { "$elemMatch" => Occurence.for_datetime_range(dtstart, dtend).selector } })
38
+ where({ occurrences: { "$elemMatch" => Occurrence.for_datetime_range(dtstart, dtend).selector } })
39
39
  }
40
40
 
41
41
  scope :from_datetime, -> (dtstart) {
42
- where( occurrences: { "$elemMatch" => Occurence.from_datetime(dtstart).selector } )
42
+ where( occurrences: { "$elemMatch" => Occurrence.from_datetime(dtstart).selector } )
43
43
  }
44
44
 
45
45
  scope :to_datetime, -> (dtend) {
46
- where( occurrences: { "$elemMatch" => Occurence.to_datetime(dtend).selector } )
46
+ where( occurrences: { "$elemMatch" => Occurrence.to_datetime(dtend).selector } )
47
47
  }
48
48
  end
49
49
  end
@@ -55,11 +55,11 @@ module MongoidRecurring
55
55
  end
56
56
 
57
57
  def occurrences_from_schedule
58
- schedule.occurrences(schedule_dtend || (schedule.start_time + @@schedule_duration)).collect { |o| MongoidRecurring::Occurence.new( dtstart: o.start_time, dtend: o.end_time, all_day: all_day ) }
58
+ schedule.occurrences(schedule_dtend || (schedule.start_time + @@schedule_duration)).collect { |o| MongoidRecurring::Occurrence.new( dtstart: o.start_time, dtend: o.end_time, all_day: all_day ) }
59
59
  end
60
60
 
61
61
  def occurrences_from_model
62
- [ MongoidRecurring::Occurence.new( dtstart: dtstart, dtend: dtend, all_day: all_day ) ]
62
+ [ MongoidRecurring::Occurrence.new( dtstart: dtstart, dtend: dtend, all_day: all_day ) ]
63
63
  end
64
64
 
65
65
  end
@@ -1,7 +1,7 @@
1
1
  require 'mongoid'
2
2
 
3
3
  module MongoidRecurring
4
- class Occurence
4
+ class Occurrence
5
5
  include Mongoid::Document
6
6
 
7
7
  field :dtstart, type: DateTime
@@ -9,7 +9,7 @@ module MongoidRecurring
9
9
 
10
10
  attr_accessor :all_day
11
11
 
12
- embedded_in :schedule, class_name: 'MongoidRecurring::Occurence'
12
+ embedded_in :schedule, class_name: 'MongoidRecurring::Occurrence'
13
13
 
14
14
  validates :dtstart, presence: true
15
15
  validates :dtend, presence: true
@@ -1,3 +1,3 @@
1
1
  module MongoidRecurring
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require 'active_support/core_ext/date'
2
2
  require 'active_support/core_ext/date_time'
3
3
 
4
- require "mongoid_recurring/occurence"
4
+ require "mongoid_recurring/occurrence"
5
5
  require "mongoid_recurring/has_recurring_fields"
6
6
 
7
7
  require "mongoid_recurring/version"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_recurring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomáš Celizna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-26 00:00:00.000000000 Z
11
+ date: 2015-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -183,7 +183,7 @@ files:
183
183
  - bin/setup
184
184
  - lib/mongoid_recurring.rb
185
185
  - lib/mongoid_recurring/has_recurring_fields.rb
186
- - lib/mongoid_recurring/occurence.rb
186
+ - lib/mongoid_recurring/occurrence.rb
187
187
  - lib/mongoid_recurring/version.rb
188
188
  - mongoid_recurring.gemspec
189
189
  homepage: https://github.com/tomasc/mongoid_recurring