istox 0.2.4 → 0.2.6.pre.1

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: 5d4f2a0587825e06d3ff6a6a3ad516f20b90f1ca7e59e11d686b03c892b8c441
4
- data.tar.gz: 3b6f8c0f67615b5165f9030343e0713f2b4562109632f93306ebb6a412d87aeb
3
+ metadata.gz: 31b10e86074acf007a9ed865a470cf64d86e8d933cb28580cc253dbc2014a32f
4
+ data.tar.gz: cb8728accbc4177d887a29b93f836dcfe710924ece8c0be52db7e428e72d724c
5
5
  SHA512:
6
- metadata.gz: 6fb65f68fed5082be9d4b8ecd73547a06cc77224baf3e57296974768351127c0d39dc51d063c7855d38921bb7ca4925a1edd36eb097747ceb7da83bd1568379f
7
- data.tar.gz: 0be64c5925913cd5fad7242bc0604bf2f553f3d69a5969c1d3165571967d570d8cd2380d8b57b9e15b1af230b2c2f8a516c0bdd59ce59b9a8f9688d948b7406c
6
+ metadata.gz: 3b04f52ed3c4853b4a269a8fab6dacc2aa840c884532281f44bee09dc8166c9a01d23794d0302b0258ed82ec14999dc32e67a6b18ede9adcc0ed1beb6191c576
7
+ data.tar.gz: 6ca120b5e33a5b5c037e72b114b208df8a010cd2aef8c0dba32a64151a88b30a2f16cc105a70a94012e249c16c1cd2f4ad3eebba9587ac6e85ef23f74f5b5484
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- istox (0.1.157.9)
4
+ istox (0.2.6.pre.1)
5
5
  amazing_print
6
6
  awesome_print
7
7
  aws-sdk-sns (~> 1)
@@ -9,7 +9,6 @@ PATH
9
9
  bunny (>= 2.12.0)
10
10
  exponential-backoff (= 0.0.4)
11
11
  graphlient
12
- gruf
13
12
  hashie (~> 3.5.7)
14
13
  istox_gruf (~> 2.7.3)
15
14
  listen (~> 3.0.5)
@@ -64,7 +63,7 @@ GEM
64
63
  i18n (>= 0.7, < 2)
65
64
  minitest (~> 5.1)
66
65
  tzinfo (~> 1.1)
67
- amazing_print (1.2.1)
66
+ amazing_print (1.3.0)
68
67
  amq-protocol (2.3.2)
69
68
  arel (9.0.0)
70
69
  awesome_print (1.8.0)
@@ -86,7 +85,7 @@ GEM
86
85
  aws-xray-sdk (0.11.4)
87
86
  aws-sdk-xray (~> 1.4.0)
88
87
  multi_json (~> 1)
89
- binding_of_caller (0.8.0)
88
+ binding_of_caller (1.0.0)
90
89
  debug_inspector (>= 0.0.1)
91
90
  builder (3.2.4)
92
91
  bullet (5.7.6)
@@ -99,7 +98,7 @@ GEM
99
98
  concurrent-ruby (1.1.6)
100
99
  crass (1.0.6)
101
100
  database_cleaner (1.6.2)
102
- debug_inspector (0.0.3)
101
+ debug_inspector (1.1.0)
103
102
  diff-lcs (1.3)
104
103
  erubi (1.9.0)
105
104
  exponential-backoff (0.0.4)
@@ -112,21 +111,24 @@ GEM
112
111
  i18n (~> 0.5)
113
112
  fakeredis (0.7.0)
114
113
  redis (>= 3.2, < 5.0)
115
- faraday (1.0.1)
114
+ faraday (1.3.0)
115
+ faraday-net_http (~> 1.0)
116
116
  multipart-post (>= 1.2, < 3)
117
+ ruby2_keywords
118
+ faraday-net_http (1.0.1)
117
119
  faraday_middleware (1.0.0)
118
120
  faraday (~> 1.0)
119
- ffi (1.13.1)
121
+ ffi (1.15.0)
120
122
  globalid (0.4.2)
121
123
  activesupport (>= 4.2.0)
122
124
  google-protobuf (3.13.0-universal-darwin)
123
125
  googleapis-common-protos-types (1.0.5)
124
126
  google-protobuf (~> 3.11)
125
- graphlient (0.4.0)
127
+ graphlient (0.5.0)
126
128
  faraday (>= 1.0)
127
129
  faraday_middleware
128
130
  graphql-client
129
- graphql (1.11.4)
131
+ graphql (1.11.5)
130
132
  graphql-client (0.16.0)
131
133
  activesupport (>= 3.0)
132
134
  graphql (~> 1.8)
@@ -134,12 +136,6 @@ GEM
134
136
  google-protobuf (~> 3.13)
135
137
  googleapis-common-protos-types (~> 1.0)
136
138
  grpc-tools (1.32.0)
137
- gruf (2.8.1)
138
- activesupport (> 4)
139
- concurrent-ruby (> 1)
140
- grpc (~> 1.10)
141
- grpc-tools (~> 1.10)
142
- slop (~> 4.6)
143
139
  hashie (3.5.7)
144
140
  i18n (0.9.5)
145
141
  concurrent-ruby (~> 1.0)
@@ -173,8 +169,8 @@ GEM
173
169
  oj (3.10.14)
174
170
  ougai (1.8.5)
175
171
  oj (~> 3.10)
176
- paranoia (2.4.2)
177
- activerecord (>= 4.0, < 6.1)
172
+ paranoia (2.4.3)
173
+ activerecord (>= 4.0, < 6.2)
178
174
  pry (0.12.2)
179
175
  coderay (~> 1.1.0)
180
176
  method_source (~> 0.9.0)
@@ -254,6 +250,7 @@ GEM
254
250
  rspec-mocks (~> 3.8.0)
255
251
  rspec-support (~> 3.8.0)
256
252
  rspec-support (3.8.0)
253
+ ruby2_keywords (0.0.2)
257
254
  slop (4.8.2)
258
255
  sprockets (3.7.2)
259
256
  concurrent-ruby (~> 1.0)
@@ -269,7 +266,7 @@ GEM
269
266
  tzinfo (1.2.6)
270
267
  thread_safe (~> 0.1)
271
268
  uniform_notifier (1.11.0)
272
- vault (0.15.0)
269
+ vault (0.16.0)
273
270
  aws-sigv4
274
271
  websocket-driver (0.7.0)
275
272
  websocket-extensions (>= 0.1.0)
data/istox.gemspec CHANGED
@@ -37,7 +37,6 @@ Gem::Specification.new do |spec|
37
37
  spec.add_dependency 'bunny', '>= 2.12.0'
38
38
  spec.add_dependency 'exponential-backoff', '0.0.4'
39
39
  spec.add_dependency 'graphlient'
40
- spec.add_dependency 'gruf'
41
40
  spec.add_dependency 'hashie', '~> 3.5.7'
42
41
  spec.add_dependency 'istox_gruf', '~> 2.7.3'
43
42
  spec.add_dependency 'listen', '~> 3.0.5'
@@ -93,6 +93,7 @@ module Istox
93
93
  # sample template data, it should be an array
94
94
  # [{
95
95
  # email: email,
96
+ # sid: xxxxx,
96
97
  # istoxP1: auth.first_name,
97
98
  # <more other sample template attributes>: <other sample template data>,
98
99
  # }]
@@ -137,7 +138,8 @@ module Istox
137
138
  else
138
139
  # if it is a object hash
139
140
  # {
140
- # email: xxxx
141
+ # email: xxxx,
142
+ # sid: xxxx,
141
143
  # params: {
142
144
  # istoxP1: xxxx,
143
145
  # istoxP2: xxxx
@@ -146,7 +148,8 @@ module Istox
146
148
  next unless ce[:email].present?
147
149
 
148
150
  copy_email_data[:email] = ce[:email]
149
- copy_email_data = copy_email_data.merge(ce[:params])
151
+ copy_email_data[:sid] = ce[:sid]
152
+ copy_email_data = copy_email_data.merge(ce[:params]) if ce[:params].present?
150
153
  end
151
154
 
152
155
  copy_email_data.delete(:copy_emails)
@@ -16,6 +16,14 @@ module Istox
16
16
  db: 6
17
17
  ))
18
18
  end
19
+
20
+ # for general redis cache
21
+ def redis
22
+ @redis ||= Redis::Namespace.new(:redis_cache, redis: Redis.new(
23
+ url: ENV['REDIS_URL'] || 'redis://127.0.0.1:16379',
24
+ db: 6
25
+ ))
26
+ end
19
27
  end
20
28
  end
21
29
  end
@@ -190,7 +190,7 @@ module Istox
190
190
  if @pay_accrued_interest
191
191
  # accrued interest + face value discounted to the current date
192
192
  discounted_accrued_interest = 0
193
- if ex_coupon_date.nil? || ex_coupon_date == @maturity_date
193
+ if ex_coupon_date.nil? || date < ex_coupon_date
194
194
  discounted_accrued_interest = @coupon*@face_value*accrued_interest_factor*discount_factor
195
195
  end
196
196
  discounted_face_value = @face_value*discount_factor
@@ -198,7 +198,7 @@ module Istox
198
198
  return price
199
199
  else
200
200
  discounted_last_coupon = 0
201
- if ex_coupon_date.nil? || ex_coupon_date == @maturity_date
201
+ if ex_coupon_date.nil? || date < ex_coupon_date
202
202
  discounted_last_coupon = @coupon*@face_value/@coupon_frequency*discount_factor
203
203
  end
204
204
  discounted_face_value = @face_value*discount_factor
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.2.6-1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-08 00:00:00.000000000 Z
11
+ date: 2021-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print
@@ -108,20 +108,6 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: gruf
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: hashie
127
113
  requirement: !ruby/object:Gem::Requirement
@@ -531,7 +517,7 @@ files:
531
517
  homepage: http://www.abc.com
532
518
  licenses: []
533
519
  metadata: {}
534
- post_install_message:
520
+ post_install_message:
535
521
  rdoc_options: []
536
522
  require_paths:
537
523
  - lib
@@ -542,12 +528,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
542
528
  version: '0'
543
529
  required_rubygems_version: !ruby/object:Gem::Requirement
544
530
  requirements:
545
- - - ">="
531
+ - - ">"
546
532
  - !ruby/object:Gem::Version
547
- version: '0'
533
+ version: 1.3.1
548
534
  requirements: []
549
- rubygems_version: 3.0.6
550
- signing_key:
535
+ rubygems_version: 3.0.8
536
+ signing_key:
551
537
  specification_version: 4
552
538
  summary: istox backend shared gem
553
539
  test_files: []