rrule 0.4.4 → 0.5.0
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/.travis.yml +7 -0
- data/CHANGELOG.md +4 -0
- data/lib/rrule/rule.rb +13 -1
- data/lib/rrule/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 102a445f4ce73b7678d2ba5ce981dd97265cd96eaba985a1a88fc65bef7dd6f5
         | 
| 4 | 
            +
              data.tar.gz: 436d7cf84a7e8673e3909a6b0dc6b629c348ca1b0a2df83b133201e7e46413b0
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 6b59c32ff4f679d3f7d1e8944b87e460d1a2ea5aa0bd7c38d3039cd62fb60af56dbc41e23eef63b42add7c3136e4af4ab62ef166e1c1cb643cff89e9a4784d9c
         | 
| 7 | 
            +
              data.tar.gz: 8040ef1e6d6c127e33352032e0bb146a46a1ba22c01237fac1a14343bac6f751803cd2582ec7058dd1d32cf0e319aa8e439be5f312ff189a755b28c48efaa985
         | 
    
        data/.travis.yml
    CHANGED
    
    | @@ -4,6 +4,7 @@ rvm: | |
| 4 4 | 
             
              - 2.6.5
         | 
| 5 5 | 
             
              - 2.7.0
         | 
| 6 6 | 
             
              - 3.0.0
         | 
| 7 | 
            +
              - 3.1.0
         | 
| 7 8 |  | 
| 8 9 | 
             
            gemfile:
         | 
| 9 10 | 
             
              - gemfiles/activesupport_2.3_LTS.gemfile
         | 
| @@ -15,6 +16,8 @@ gemfile: | |
| 15 16 |  | 
| 16 17 | 
             
            jobs:
         | 
| 17 18 | 
             
              exclude:
         | 
| 19 | 
            +
              - rvm: 2.6.5
         | 
| 20 | 
            +
                gemfile: gemfiles/activesupport_7.gemfile
         | 
| 18 21 | 
             
              - rvm: 2.7.0
         | 
| 19 22 | 
             
                gemfile: gemfiles/activesupport_3.gemfile
         | 
| 20 23 | 
             
              - rvm: 2.7.0
         | 
| @@ -23,6 +26,10 @@ jobs: | |
| 23 26 | 
             
                gemfile: gemfiles/activesupport_3.gemfile
         | 
| 24 27 | 
             
              - rvm: 3.0.0
         | 
| 25 28 | 
             
                gemfile: gemfiles/activesupport_4.gemfile
         | 
| 29 | 
            +
              - rvm: 3.1.0
         | 
| 30 | 
            +
                gemfile: gemfiles/activesupport_3.gemfile
         | 
| 31 | 
            +
              - rvm: 3.1.0
         | 
| 32 | 
            +
                gemfile: gemfiles/activesupport_4.gemfile
         | 
| 26 33 |  | 
| 27 34 | 
             
            before_install:
         | 
| 28 35 | 
             
              - yes | gem update --system --force
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/lib/rrule/rule.rb
    CHANGED
    
    | @@ -26,6 +26,11 @@ module RRule | |
| 26 26 | 
             
                  all_until(start_date: floored_start_date, end_date: floored_end_date, limit: limit).reject { |instance| instance < floored_start_date }
         | 
| 27 27 | 
             
                end
         | 
| 28 28 |  | 
| 29 | 
            +
                def from(start_date, limit:)
         | 
| 30 | 
            +
                  floored_start_date = floor_to_seconds_in_timezone(start_date)
         | 
| 31 | 
            +
                  all_until(start_date: floored_start_date, limit: limit).reject { |instance| instance < floored_start_date }
         | 
| 32 | 
            +
                end
         | 
| 33 | 
            +
             | 
| 29 34 | 
             
                def each(floor_date: nil)
         | 
| 30 35 | 
             
                  # If we have a COUNT or INTERVAL option, we have to start at dtstart, because those are relative to dtstart
         | 
| 31 36 | 
             
                  floor_date = dtstart if count_or_interval_present? || floor_date.nil? || dtstart > floor_date
         | 
| @@ -89,7 +94,14 @@ module RRule | |
| 89 94 | 
             
                end
         | 
| 90 95 |  | 
| 91 96 | 
             
                def all_until(start_date: nil, end_date: max_date, limit: nil)
         | 
| 92 | 
            -
                   | 
| 97 | 
            +
                  count = 0
         | 
| 98 | 
            +
                  each(floor_date: start_date).take_while do |date|
         | 
| 99 | 
            +
                    if limit
         | 
| 100 | 
            +
                      date <= end_date && (count += 1) <= limit
         | 
| 101 | 
            +
                    else
         | 
| 102 | 
            +
                      date <= end_date
         | 
| 103 | 
            +
                    end
         | 
| 104 | 
            +
                  end
         | 
| 93 105 | 
             
                end
         | 
| 94 106 |  | 
| 95 107 | 
             
                def parse_options(rule)
         | 
    
        data/lib/rrule/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rrule
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.5.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ryan Mitchell
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022-03- | 
| 11 | 
            +
            date: 2022-03-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activesupport
         |