fat_period 2.1.0 → 3.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 875ad1917477c27f17278fb0d5aad18423f4dcf52f32c9957651c829a1164f4b
4
- data.tar.gz: 1495e04adb60e49dfc26f1b94c9699a129f30b7a15c36e9fa82d0e68d87ed183
3
+ metadata.gz: 0e3eda6535209cd894a7d4dae2e4185e6a7ca7890bedca9662e5a017b38fa6cc
4
+ data.tar.gz: c7d3a27c9ea484f3ba68988627e84b42c9fa1916cc496a823afcdf8321be3084
5
5
  SHA512:
6
- metadata.gz: f7e5ece151032b3ce11aad94225ef649c9e217a2d9239406f3ef030b335169cc33a130ff860b11b65a2e9d90ab4d9f900eb6df713f904beb9d841a7068ebcb96
7
- data.tar.gz: 91a94d16666150d0eba4cd4bd5cb24813150d714f2e534a15746bd70119e87996d39940d8da40c5ab7589707975fe53f60a53cd4ae7d9bd58254b710d7d3c4ee
6
+ metadata.gz: 58a7f0386cc6b84ca713bc4ff1775af9c08e5b0fe95b3125d2cd9ff2ea2495e9440ad845d37517822b07e4eebdb813a44979522b58f146997aab40665051c46e
7
+ data.tar.gz: 937c97b9d3c3a359854f85d3ba611882d86f1fb4f7d27213820b53a4f93e82edad05cf1385a33da28d3fcfbf6a34cc86ee7a19f6139c5141e25197ff4970fffe
data/.envrc CHANGED
@@ -1,5 +1,4 @@
1
1
  PATH_add .bundle/bin
2
- PATH_add ./scripts
3
2
  # Ensure that we use the development DB when in the src dir.
4
3
  export DB=development
5
4
  export COMPOSE_FILE=.devcontainer/docker-compose.yml
@@ -0,0 +1,57 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby CI (setup-ruby)
9
+
10
+ on:
11
+ push:
12
+ pull_request:
13
+
14
+ jobs:
15
+ test:
16
+ runs-on: ubuntu-24.04
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ # Supported stable series; setup-ruby selects the latest patch release.
21
+ # https://www.ruby-lang.org/en/downloads/branches/
22
+ ruby: ['3.3', '3.4', '4.0']
23
+ steps:
24
+ - name: Check out code
25
+ uses: actions/checkout@v7
26
+
27
+ - name: Install build dependencies (needed if Ruby must be compiled)
28
+ run: |
29
+ sudo apt-get update
30
+ sudo apt-get install -y --no-install-recommends \
31
+ build-essential autoconf bison libssl-dev libreadline-dev \
32
+ zlib1g-dev libyaml-dev libffi-dev libgdbm-dev libncurses5-dev \
33
+ libgmp-dev pkg-config
34
+
35
+ - name: Set up Ruby
36
+ uses: ruby/setup-ruby@v1
37
+ with:
38
+ ruby-version: ${{ matrix.ruby }}
39
+ bundler-cache: true
40
+
41
+ - name: Verify Ruby
42
+ run: |
43
+ ruby -v
44
+ gem -v
45
+ shell: bash
46
+
47
+ - name: Install gems
48
+ run: |
49
+ gem install bundler --conservative
50
+ # optional: use vendor/bundle to keep gems within repo workspace
51
+ bundle config set --local path 'vendor/bundle' || true
52
+ bundle install --jobs 4 --retry 3
53
+ shell: bash
54
+
55
+ - name: Run tests
56
+ run: bundle exec rake
57
+ shell: bash
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+ /.yardopts
data/.rubocop.yml ADDED
@@ -0,0 +1,3 @@
1
+ # Inherit the shared config from the rubocop-ddoherty gem (git-hosted on GitHub)
2
+ inherit_gem:
3
+ rubocop-ddoherty: 'config/default.yml'
data/CHANGELOG.org ADDED
@@ -0,0 +1,43 @@
1
+ * Version 3.1.0
2
+ - Add ~Period#year_fraction~ to calculate a ~BigDecimal~ interest-accrual
3
+ factor from the period's start to a payment or settlement date. Support
4
+ twelve day-count conventions: four 30/360 variants, Actual/Actual ICMA,
5
+ Actual/Actual ISDA, Actual/365 Fixed, Actual/360, Actual/364, Actual/365L,
6
+ Actual/Actual AFB, and 1/1. Default to 30/360 US (~convention: 1~).
7
+ - Support optional February end-of-month adjustments for 30/360 US and a
8
+ maturity-date exception for 30E/360 ISDA. Require settlement to fall
9
+ within the period; ICMA supports regular coupon periods only.
10
+ - Add ~Period#freq_per_year~ to infer payment frequency from period length.
11
+ - Document the conventions and examples in ~README.org~, with references
12
+ to Wikipedia and Section 4.16 of the /2006 ISDA Definitions/. Add specs
13
+ covering month ends, leap years, maturity dates, and frequency boundaries.
14
+
15
+ * Version 3.0.0
16
+ - Use the newly-spun-out fat_date library in place of fat_core/date, which no
17
+ longer exists starting with fat_core version 6.0.0.
18
+ - The fat_date library uses ~Date.spec~ instead of ~Date.parse_spec~, which is
19
+ just cleaner to type.
20
+ - The new ~fat_date~ libraries come with some notable enhancements to date
21
+ specs, including:
22
+ 1. Skip modifiers, which allow the spec to "skip" from its usual target date
23
+ to the nearest day-of-week, either before or after the target date, and
24
+ either including or not including the target date as a candidate.
25
+ 2. Changes the semimonth specifier from uppercase roman to A or B, so
26
+ 2025-10-A (rather than 2025-I) is now the first semimonth for October,
27
+ 2025, and 2025-10-B (rather than 2025-II) is now the second semimonth.
28
+ This allows week-of-month specs to be case insensitive, so 2025-10-i,
29
+ 2025-10-ii, 2025-10-iii, 2025-10-iv, and 2025-10-v, can represent the
30
+ first through fifth week of October, 2025, as well as 2025-10-I,
31
+ 2025-10-II, 2025-10-III, 2025-10-IV, and 2025-10-V.
32
+ 3. In general, all the spec involving letters should now be case insensitive.
33
+ - Some other code cleanup with no impact on the API.
34
+
35
+ * Version 2.1.0
36
+ - When the first date is later than the second in ~Period.new~, raise
37
+ ~ArgumentError~ exception instead of returning nil.
38
+ - Allow ~Period.parse_phrase~ to parse a 'per' clause and return an Array of
39
+ Periods that are sub-periods of the period given by the from- and
40
+ to-clauses.
41
+ - Add ~Period.ensure(arg)~ to try to return a ~Period~ from a string that can
42
+ be parsed as a ~Period~, an object that has a ~to_period~ method, or return
43
+ the ~arg~ if its already a ~Period~.
data/Gemfile CHANGED
@@ -1,16 +1,18 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in fat_period.gemspec
4
6
  gemspec
5
7
 
6
- gem 'bundler'
7
- gem 'debug'
8
- gem 'pry'
9
- gem 'pry-doc'
10
- gem 'rake'
11
- gem 'rspec'
12
- gem 'rubocop'
13
- gem 'rubocop-rspec'
14
- gem 'rubocop-performance'
15
- gem 'rubocop-rake'
16
- gem 'rubocop-shopify'
8
+ group :development do
9
+ gem 'bundler'
10
+ gem 'debug'
11
+ gem 'pry'
12
+ gem 'pry-doc'
13
+ gem 'rake'
14
+ gem 'rspec'
15
+ gem 'rubocop', require: false
16
+ gem 'rubocop-ddoherty', git: 'https://github.com/ddoherty03/rubocop-ddoherty.git', branch: 'master', require: false
17
+ gem 'gem_docs', '>=0.2.0'
18
+ end