ylansegal / franklin.cr Goto Github PK
View Code? Open in Web Editor NEWCLI utility to search public libraries powered by Overdrive. Written in crystal (ported from my ruby version).
License: MIT License
CLI utility to search public libraries powered by Overdrive. Written in crystal (ported from my ruby version).
License: MIT License
This is an interesting project. But I'm new to crystal and can't compile it.
I installed crystal by using the documentation on https://crystal-lang.org.
$crystal -v
Crystal 0.35.1 [5999ae29b] (2020-06-19)
LLVM: 8.0.0
Default target: x86_64-unknown-linux-gnu
Here I got the following error:
A total of 7 warnings were found.
Showing last frame. Use --error-trace for full trace.
In spec/spec_helper.cr:4:1
4 | require "webmock"
^
Error: can't find file 'webmock'
If you're trying to require a shard:
- Did you remember to run `shards install`?
- Did you make sure you're running the compiler in the same directory as your shard.yml?
Makefile:5: recipe for target 'test' failed
make: *** [test] Error 1
Then I changed 0.9
to master
shard.yml to:
development_dependencies:
webmock:
github: manastech/webmock.cr
branch: master
I have no idea, if this is correct. But the test seems to run fine.
A total of 7 warnings were found.
.......................................
Finished in 19.3 milliseconds
39 examples, 0 failures, 0 errors, 0 pending
Makefile:5: recipe for target 'test' failed
make: *** [test] Error 1
$ make bin/franklin
/usr/bin/crystal build --release --no-debug -o bin/franklin src/cli.cr
In src/franklin/library.cr:5:10
5 | YAML.mapping(
^------
Warning: Deprecated YAML.mapping. use YAML::Serializable instead (the legacy behaviour is also available in a shard at github:crystal-lang/yaml_mapping.cr)
In src/franklin/library.cr:5:5
5 | YAML.mapping(
^
Warning: expanding macro
There was a problem expanding macro 'mapping'
Called macro defined in /usr/share/crystal/src/yaml/mapping.cr:222:3
222 | macro mapping(**_properties_)
Which expanded to:
> 1 | ::YAML.mapping({name: String, url: String})
2 |
Warning: Deprecated YAML.mapping. use YAML::Serializable instead (the legacy behaviour is also available in a shard at github:crystal-lang/yaml_mapping.cr)
In src/franklin/config.cr:8:10
8 | YAML.mapping(
^------
Warning: Deprecated YAML.mapping. use YAML::Serializable instead (the legacy behaviour is also available in a shard at github:crystal-lang/yaml_mapping.cr)
In src/franklin/overdrive.cr:6:12
6 | JSON.mapping(
^------
Warning: Deprecated JSON.mapping. use JSON::Serializable instead (the legacy behaviour is also available in a shard at github:crystal-lang/json_mapping.cr)
In src/franklin/overdrive.cr:6:7
6 | JSON.mapping(
^
Warning: expanding macro
There was a problem expanding macro 'mapping'
Called macro defined in /usr/share/crystal/src/json/mapping.cr:232:3
232 | macro mapping(**_properties_)
Which expanded to:
> 1 | ::JSON.mapping({data: Hash(String, Overdrive::Entry)})
2 |
Warning: Deprecated JSON.mapping. use JSON::Serializable instead (the legacy behaviour is also available in a shard at github:crystal-lang/json_mapping.cr)
In src/franklin/overdrive.cr:12:12
12 | JSON.mapping(
^------
Warning: Deprecated JSON.mapping. use JSON::Serializable instead (the legacy behaviour is also available in a shard at github:crystal-lang/json_mapping.cr)
In src/franklin/overdrive.cr:31:12
31 | JSON.mapping(
^------
Warning: Deprecated JSON.mapping. use JSON::Serializable instead (the legacy behaviour is also available in a shard at github:crystal-lang/json_mapping.cr)
A total of 7 warnings were found.
Showing last frame. Use --error-trace for full trace.
In src/cli.cr:33:8
33 | rescue Errno
^
Error: Errno is not a subclass of Exception
Makefile:20: recipe for target 'bin/franklin' failed
make: *** [bin/franklin] Error 1
Do you know how to solve this?
PS: It seems there is a change in v0.34 regarding Errno (https://crystal-lang.org/2020/04/06/crystal-0.34.0-released.html).
This is the issue body
Any idea what "Unhandled exception in spawn" means? I can def dig into it any figure it out, but if it's something simple...
Thanks for contributing this code to the community!
$ make test
/opt/local/bin/crystal spec
......................................
Finished in 53.99 milliseconds
38 examples, 0 failures, 0 errors, 0 pending
$ bin/franklin chamber of secrets
Unhandled exception in spawn: Index out of bounds (IndexError)
from ~procProc(Nil)@src/franklin/concurrent_search.cr:13
from Fiber#run:(IO::FileDescriptor | Nil)
$ crystal -v
Crystal 0.27.0 (2019-01-05)
LLVM: 6.0.1
$ cat ~/.franklin
libraries:
- name: San Francisco Public Library
url: http://sfpl.lib.overdrive.com
- name: Berkeley Public
url: https://berkeleypubliclibrary.overdrive.com
- name: Alameda County
url: https://aclibrary.overdrive.com
default_type: eBook # Optional, will show all types if not set.
I've never written any Crystal before. :-)
Next up: a PR to set exit code when nothing is found.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.