Compare commits

...

5 Commits

Author SHA1 Message Date
Alex Ling
aa147602fc Bump version number 0.2.2 -> 0.2.3 2020-03-27 05:00:14 +00:00
Alex Ling
d58c83fbd8 Use BigInt when sorting filenames (#22) 2020-03-27 04:45:03 +00:00
Alex Ling
1a0c3d81ce Add Patreon 2020-03-21 05:18:53 +00:00
Alex Ling
33c61fd8c1 Add build badge 2020-03-19 16:04:06 -04:00
Alex Ling
6eba3fe351 Create build.yml 2020-03-19 19:58:59 +00:00
7 changed files with 41 additions and 4 deletions

3
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
# These are supported funding model platforms
patreon: hkalexling

24
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Build
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
jobs:
build:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:0.32.1-alpine
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: apk add --no-cache yarn yaml sqlite-static
- name: Build
run: make
- name: Run tests
run: make test

View File

@@ -5,7 +5,7 @@
# Mango
[![Gitter](https://badges.gitter.im/mango-cr/mango.svg)](https://gitter.im/mango-cr/mango?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Patreon](https://img.shields.io/badge/support-patreon-brightgreen?link=https://www.patreon.com/hkalexling)](https://www.patreon.com/hkalexling) ![Build](https://github.com/hkalexling/Mango/workflows/Build/badge.svg) [![Gitter](https://badges.gitter.im/mango-cr/mango.svg)](https://gitter.im/mango-cr/mango?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
Mango is a self-hosted manga server and reader. Its features include

View File

@@ -1,5 +1,5 @@
name: mango
version: 0.2.1
version: 0.2.3
authors:
- Alex Ling <hkalexling@gmail.com>

View File

@@ -25,4 +25,12 @@ describe "compare_alphanumerically" do
compare_alphanumerically a, b
}.should eq ary
end
# https://github.com/hkalexling/Mango/issues/22
it "handles numbers larger than Int32" do
ary = ["14410155591588.jpg", "21410155591588.png", "104410155591588.jpg"]
ary.reverse.sort {|a, b|
compare_alphanumerically a, b
}.should eq ary
end
end

View File

@@ -3,7 +3,7 @@ require "./context"
require "./mangadex/*"
require "option_parser"
VERSION = "0.2.1"
VERSION = "0.2.3"
config_path = nil

View File

@@ -1,3 +1,5 @@
require "big"
IMGS_PER_PAGE = 5
macro layout(name)
@@ -56,7 +58,7 @@ def compare_alphanumerically(c, d)
return -1 if a.nil?
return 1 if b.nil?
if is_numeric(a) && is_numeric(b)
compare = a.to_i <=> b.to_i
compare = a.to_big_i <=> b.to_big_i
return compare if compare != 0
else
compare = a <=> b