aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Conway <john.a.conway@gmail.com>2019-05-08 10:37:10 +0100
committerJohn Conway <john.a.conway@gmail.com>2019-05-08 10:37:10 +0100
commitf45b14403744f99ae265cff2e05e98e74836e501 (patch)
treefa2bc6022bb42411bf8b001f857a107f4b6ed71f
parented9adeb45b0f8d25585df8fdc5e769be021fa1b2 (diff)
downloadfeed-nim-f45b14403744f99ae265cff2e05e98e74836e501.tar.gz
feed-nim-f45b14403744f99ae265cff2e05e98e74836e501.zip
Changed tothe Nimble package structure
-rw-r--r--.DS_Storebin6148 -> 6148 bytes
-rw-r--r--.gitignore53
-rw-r--r--FeedNim.nimble12
-rw-r--r--feed_nim.nim33
-rw-r--r--src/feednim.nim7
-rw-r--r--src/feednim/atom.nim (renamed from modules/atom.nim)0
-rw-r--r--src/feednim/jsonfeed.nim (renamed from modules/jsonfeed.nim)0
-rw-r--r--src/feednim/rss.nim (renamed from modules/rss.nim)0
-rw-r--r--src/feednim/submodule.nim12
-rw-r--r--tests/config.nims1
-rw-r--r--tests/test1.nim12
11 files changed, 97 insertions, 33 deletions
diff --git a/.DS_Store b/.DS_Store
index 5008ddf..1e8c07c 100644
--- a/.DS_Store
+++ b/.DS_Store
Binary files differ
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..23f585f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,53 @@
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+# ---> Kate
+# Swap Files #
+.*.kate-swp
+.swp.*
+
+# ---> Nim
+nimcache/
+
+# ---> Vim
+# Swap
+[._]*.s[a-v][a-z]
+[._]*.sw[a-p]
+[._]s[a-rt-v][a-z]
+[._]ss[a-gi-z]
+[._]sw[a-p]
+
+# Session
+Session.vim
+
+# Temporary
+.netrwhist
+*~
+# Auto-generated tag files
+tags
+# Persistent undo
+[._]*.un~ \ No newline at end of file
diff --git a/FeedNim.nimble b/FeedNim.nimble
new file mode 100644
index 0000000..e17914f
--- /dev/null
+++ b/FeedNim.nimble
@@ -0,0 +1,12 @@
+# Package
+
+version = "0.1.0"
+author = "John Conway"
+description = "An Atom, RSS, and JSONfeed parser"
+license = "MIT"
+srcDir = "src"
+
+
+# Dependencies
+
+requires "nim >= 0.19.4"
diff --git a/feed_nim.nim b/feed_nim.nim
deleted file mode 100644
index 2945fdf..0000000
--- a/feed_nim.nim
+++ /dev/null
@@ -1,33 +0,0 @@
-import httpclient
-
-import modules/atom
-import modules/rss
-import modules/jsonfeed
-
-proc loadAtom*(filename: string): Atom = ## Loads the Atom from the given ``filename``.
- var Atom: string = readFile(filename) # Load the data from the file.
- return parseAtom(Atom)
-
-
-proc getAtom*(url: string): Atom = ## Gets the Atom over from the specified ``url``.
- var Atom: string = newHttpClient().getContent(url) # Get the data.
- return parseAtom(Atom)
-
-
-proc loadRSS*(filename: string): Rss = ## Loads the RSS from the given ``filename``.
- var rss: string = readFile(filename) # Load the data from the file.
- return parseRSS(rss)
-
-
-proc getRSS*(url: string): Rss = ## Gets the RSS over from the specified ``url``.
- var rss: string = newHttpClient().getContent(url) # Get the data.
- return parseRSS(rss)
-
-proc loadJsonFeed*(filename: string): JsonFeed = ## Loads the JSONFeed from the given ``filename``.
- var jsonFeed: string = readFile(filename) # Load the data from the file.
- return parseJSONFeed(jsonFeed)
-
-
-proc getJsonFeed*(url: string): JsonFeed = ## Gets the JSONFeed over from the specified ``url``.
- var jsonFeed: string = newHttpClient().getContent(url) # Get the data.
- return parseJSONFeed(jsonFeed) \ No newline at end of file
diff --git a/src/feednim.nim b/src/feednim.nim
new file mode 100644
index 0000000..4b2a270
--- /dev/null
+++ b/src/feednim.nim
@@ -0,0 +1,7 @@
+# This is just an example to get you started. A typical library package
+# exports the main API in this file. Note that you cannot rename this file
+# but you can remove it if you wish.
+
+proc add*(x, y: int): int =
+ ## Adds two files together.
+ return x + y
diff --git a/modules/atom.nim b/src/feednim/atom.nim
index cce9c44..cce9c44 100644
--- a/modules/atom.nim
+++ b/src/feednim/atom.nim
diff --git a/modules/jsonfeed.nim b/src/feednim/jsonfeed.nim
index 8ff246f..8ff246f 100644
--- a/modules/jsonfeed.nim
+++ b/src/feednim/jsonfeed.nim
diff --git a/modules/rss.nim b/src/feednim/rss.nim
index abd4883..abd4883 100644
--- a/modules/rss.nim
+++ b/src/feednim/rss.nim
diff --git a/src/feednim/submodule.nim b/src/feednim/submodule.nim
new file mode 100644
index 0000000..1af4e81
--- /dev/null
+++ b/src/feednim/submodule.nim
@@ -0,0 +1,12 @@
+# This is just an example to get you started. Users of your library will
+# import this file by writing ``import FeedNim/submodule``. Feel free to rename or
+# remove this file altogether. You may create additional modules alongside
+# this file as required.
+
+type
+ Submodule* = object
+ name*: string
+
+proc initSubmodule*(): Submodule =
+ ## Initialises a new ``Submodule`` object.
+ Submodule(name: "Anonymous")
diff --git a/tests/config.nims b/tests/config.nims
new file mode 100644
index 0000000..3bb69f8
--- /dev/null
+++ b/tests/config.nims
@@ -0,0 +1 @@
+switch("path", "$projectDir/../src") \ No newline at end of file
diff --git a/tests/test1.nim b/tests/test1.nim
new file mode 100644
index 0000000..0ff07eb
--- /dev/null
+++ b/tests/test1.nim
@@ -0,0 +1,12 @@
+# This is just an example to get you started. You may wish to put all of your
+# tests into a single file, or separate them into multiple `test1`, `test2`
+# etc. files (better names are recommended, just make sure the name starts with
+# the letter 't').
+#
+# To run these tests, simply execute `nimble test`.
+
+import unittest
+
+import FeedNim
+test "can add":
+ check add(5, 5) == 10