-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'haskell/repohs/' from commit '35c552e96366bb2f0ad5ba1861c0de0017…
- Loading branch information
Showing
14 changed files
with
806 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
:load app/Main.hs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.stack-work/ | ||
*~ | ||
.vscode | ||
repos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Changelog for repohs | ||
|
||
## Unreleased changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Copyright Author name here (c) 2022 | ||
|
||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
|
||
* Neither the name of Author name here nor the names of other | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# repohs | ||
|
||
Provides a convenient way to download several archives with source code | ||
|
||
## How it works | ||
* It defines several constants: | ||
* `_PATH` - where all files will be stored | ||
* `_LANGUAGE` - extension of files written in language of interest. For now, defines a single extension. E.g., `.py` for `Python` | ||
* `_ZIPPED` - name of subdirectory in `_PATH` where the zipped archives will be stored | ||
* `_UNZIPPED` - name of subdirectory in `_PATH` where the unzipped folders will be stored | ||
* `_URLs` - a list of URLs of interest | ||
|
||
* It will concurrently download the files and unpack them into corresponding folders | ||
* Each zip-archive will be named after URL's path: file for `https://github.com/django/django/archive/refs/heads/main.zip` will become `django.django.archive.refs.heads.main.zip` | ||
* Contents of such archive will be unpacked into subdirectory `django.django.archive.refs.heads.main` | ||
|
||
* If you have any questions, have a look at [Main.hs](./app/Main.hs) | ||
|
||
## SLOC | ||
* See current results in the [report](./report) | ||
|
||
## Requirements | ||
1. `npm` | ||
```sh | ||
sudo apt install nodejs | ||
``` | ||
1. A utility for counting code lines ([link](https://github.com/flosse/sloc)) | ||
```sh | ||
sudo npm install -g sloc | ||
``` | ||
1. `stack` ([link](https://docs.haskellstack.org/en/stable/install_and_upgrade/)) | ||
|
||
## Running | ||
* From this project's root | ||
```sh | ||
stack run | ||
``` | ||
* As a script. Assume you put the code into `script.hs` somewhere | ||
```sh | ||
chmod +x script.hs | ||
./script.hs | ||
``` | ||
|
||
## Articles | ||
* [Resource Management in Haskell](https://aherrmann.github.io/programming/2016/01/04/resource-management-in-haskell/index.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Distribution.Simple | ||
main = defaultMain |
Oops, something went wrong.