Skip to content

Commit

Permalink
Merge pull request #181 from razorpay/release/1.5.2
Browse files Browse the repository at this point in the history
Release/1.5.2
  • Loading branch information
Nemo authored Mar 29, 2020
2 parents 7c97797 + f8b7ee4 commit 668f2ed
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ mix.lock
Gemfile.lock
InstalledFiles
.wercker

# One-off scripts
*.php
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ src/IFSC-list.json
.wercker
.phpunit.result.cache
src/patches/*
tests/
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## UNRELEASED

## 1.5.2

### Changed

- Metadata updates

## 1.5.1

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in razorpay-ruby.gemspec
# Specify your gem's dependencies in ifsc.gemspec
gemspec
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This is part of the IFSC toolset released by Razorpay.
You can find more details about the entire release at
[ifsc.razorpay.com](https://ifsc.razorpay.com).

[![wercker status](https://app.wercker.com/status/bc9b22047e1b8eb55ce98ba451d7b504/s/master 'wercker status')](https://app.wercker.com/project/byKey/bc9b22047e1b8eb55ce98ba451d7b504) [![](https://images.microbadger.com/badges/image/razorpay/ifsc:1.5.1.svg)](https://microbadger.com/images/razorpay/ifsc:1.5.1) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![wercker status](https://app.wercker.com/status/bc9b22047e1b8eb55ce98ba451d7b504/s/master 'wercker status')](https://app.wercker.com/project/byKey/bc9b22047e1b8eb55ce98ba451d7b504) [![](https://images.microbadger.com/badges/image/razorpay/ifsc:1.5.2.svg)](https://microbadger.com/images/razorpay/ifsc:1.5.2) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

[![](https://images.microbadger.com/badges/version/razorpay/ifsc:1.5.1.svg)](https://microbadger.com/images/razorpay/ifsc:1.5.1) [![npm version](https://badge.fury.io/js/ifsc.svg)](https://badge.fury.io/js/ifsc) [![Gem Version](https://badge.fury.io/rb/ifsc.svg)](https://badge.fury.io/rb/ifsc) [![PHP version](https://badge.fury.io/ph/razorpay%2Fifsc.svg)](https://badge.fury.io/ph/razorpay%2Fifsc) [![Hex pm](http://img.shields.io/hexpm/v/ifsc.svg)](https://hex.pm/packages/ifsc)
[![](https://images.microbadger.com/badges/version/razorpay/ifsc:1.5.2.svg)](https://microbadger.com/images/razorpay/ifsc:1.5.2) [![npm version](https://badge.fury.io/js/ifsc.svg)](https://badge.fury.io/js/ifsc) [![Gem Version](https://badge.fury.io/rb/ifsc.svg)](https://badge.fury.io/rb/ifsc) [![PHP version](https://badge.fury.io/ph/razorpay%2Fifsc.svg)](https://badge.fury.io/ph/razorpay%2Fifsc) [![Hex pm](http://img.shields.io/hexpm/v/ifsc.svg)](https://hex.pm/packages/ifsc)

## Dataset

Expand Down
4 changes: 2 additions & 2 deletions ifsc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |s|
s.name = 'ifsc'
s.version = '1.5.1'
s.date = '2020-03-12'
s.version = '1.5.2'
s.date = '2020-03-27'
s.summary = 'IFSC code database to help you validate IFSC codes'
s.description = 'A simple gem by @razorpay to help you validate your IFSC codes. IFSC codes are bank codes within India'
s.authors = ['Abhay Rana', 'Nihal Gonsalves']
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule IFSC.Mixfile do
def project do
[
app: :ifsc,
version: "1.5.1",
version: "1.5.2",
elixir: "~> 1.5",
start_permanent: Mix.env == :prod,
description: description(),
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ifsc",
"version": "1.5.1-1",
"version": "1.5.2",
"description": "This is part of the IFSC toolset released by Razorpay. You can find more details about the entire release at [ifsc.razorpay.com](https://ifsc.razorpay.com). Includes only a validation library as of now.",
"main": "src/node/index.js",
"directories": {
Expand Down
4 changes: 1 addition & 3 deletions scraper/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ cp data/by-bank/* ifsc-api/data/
pushd ifsc-api
git add data/
# Generate the complete diff
git diff --staged -U0 |grep '"IFSC": "' |awk '{print $1substr($3,2,11)}'|sort -u > diff.txt
# Generate the summarized diff
cat diff.txt | cut -c-5 | sort |uniq -c | sort -n > diffsummary.txt
git diff --ignore-all-space --staged -U0 |grep '"IFSC": "' |awk '{print $1substr($3,2,11)}'|sort -u > diff.txt
popd
# Run the php script
php releasenotes.php > release.md
53 changes: 50 additions & 3 deletions scraper/scripts/releasenotes.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,44 @@
**Release Date**: `TODO`
**RBI Update Date**: `TODO`
<?php
// Do some pre-processing
$plus = $minus = [];
foreach(file('ifsc-api/diff.txt') as $row) {
$ifsc = substr($row, 1, -1);
if (substr($row,0,1) === '+') {
$plus[] = $ifsc;
}
elseif (substr($row, 0, 1) === '-') {
$minus[] = $ifsc;
}
}

$common = array_intersect($plus, $minus);
$plus = array_diff($plus, $common);
$minus = array_diff($minus, $common);
$summary = [];

foreach ($plus as $ifsc){
$bank = substr($ifsc, 0, 4);
if(!isset($summary[$bank])) {
$summary[$bank] = 0;
}
$summary[$bank] +=1;
}
foreach ($minus as $ifsc) {
if(!isset($summary[$bank])) {
$summary[$bank] = 0;
}
$summary[$bank] -=1;
}
asort($summary);

sort($plus);sort($minus);

$diffSize = count($plus) + count($minus);

// Reduce one for the final newline
$ifscCount = (((int) `wc -l data/IFSC.csv`) - 1);
$diffSize = (((int) `wc -l ifsc-api/diff.txt`) - 1);
?>**IFSC Count**: <?=$ifscCount;?>

**Diff Size**: <?=$diffSize?> (This only counts new or deleted IFSCs from previous release)
Expand All @@ -14,14 +50,25 @@
</summary>

```
<?=file_get_contents('ifsc-api/diffsummary.txt');?>
<?php
foreach ($summary as $bank => $count) {
echo str_pad(sprintf("%+d",$count), 4) . "\t" . $bank . "\n";
}
?>
```
</details>

<details><summary><strong>Exact IFSC Diff</strong></summary>

```diff
<?=file_get_contents('ifsc-api/diff.txt');?>
<?php
foreach ($plus as $ifsc) {
echo "+$ifsc\n";
}
foreach ($minus as $ifsc) {
echo "-$ifsc\n";
}
?>
```
</details>

Expand Down
2 changes: 1 addition & 1 deletion src/IFSC.json

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions src/banks.json
Original file line number Diff line number Diff line change
Expand Up @@ -14199,10 +14199,7 @@
"ach_credit": true,
"ach_debit": true,
"nach_debit": false,
"upi": true,
"neft": false,
"imps": false,
"rtgs": false
"upi": true
},
"YLNX": {
"code": "YLNX",
Expand Down
4 changes: 3 additions & 1 deletion tests/validator_asserts.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"IDIB000J052": true,
"KARB0000001": true,
"KKBK0000261": true,
"UTIB0001688": true
"UTIB0001688": true,
"BARB0DBAGIY": true,
"BARB0DBAAHM": true
},
"testValidateStringLookup": {
"BOTM0NEEMRA": true,
Expand Down

0 comments on commit 668f2ed

Please sign in to comment.