Merge: Text attribute accesses optimization
authorJean Privat <jean@pryen.org>
Fri, 4 Sep 2015 03:33:29 +0000 (23:33 -0400)
committerJean Privat <jean@pryen.org>
Fri, 4 Sep 2015 03:33:29 +0000 (23:33 -0400)
As a small optimization, accesses to private attributes in Text are replaced by direct accesses as in `file` or `collection`.

On the compiler this yields between 3 and 4% improvement in performances, however in some programs like nitmd, this yields around 15% optimization.

Pull-Request: #1683
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

231 files changed:
.mailmap
contrib/benitlux/README.md
contrib/benitlux/project.ini [new file with mode: 0644]
contrib/benitlux/src/benitlux_daily.nit
contrib/benitlux/src/benitlux_model.nit
contrib/brainfuck/project.ini [new file with mode: 0644]
contrib/crazy_moles/README.md [new file with mode: 0644]
contrib/crazy_moles/project.ini [new file with mode: 0644]
contrib/crazy_moles/src/moles_android.nit
contrib/crazy_moles/src/moles_linux.nit
contrib/friendz/project.ini [new file with mode: 0644]
contrib/friendz/src/friendz_android.nit
contrib/friendz/src/friendz_linux.nit
contrib/github_merge.ini [new file with mode: 0644]
contrib/github_merge.nit
contrib/github_search_for_jni/README.md [new file with mode: 0644]
contrib/github_search_for_jni/project.ini [new file with mode: 0644]
contrib/header_keeper/project.ini [new file with mode: 0644]
contrib/inkscape_tools/README.md
contrib/inkscape_tools/project.ini [new file with mode: 0644]
contrib/inkscape_tools/tests/app/src/s2pn_android.nit
contrib/inkscape_tools/tests/app/src/s2pn_linux.nit
contrib/jwrapper/README.md
contrib/jwrapper/project.ini [new file with mode: 0644]
contrib/jwrapper/tests/projects.ini [new file with mode: 0644]
contrib/mnit_test/project.ini [new file with mode: 0644]
contrib/mnit_test/src/simple_android.nit
contrib/mnit_test/src/simple_linux.nit
contrib/neo_doxygen/project.ini [new file with mode: 0644]
contrib/nitcc/project.ini [new file with mode: 0644]
contrib/nitcc/tests/projects.ini [new file with mode: 0644]
contrib/nitester/project.ini [new file with mode: 0644]
contrib/nitiwiki/project.ini [new file with mode: 0644]
contrib/nitrpg/project.ini [new file with mode: 0644]
contrib/objcwrapper/project.ini [new file with mode: 0644]
contrib/online_ide/project.ini [new file with mode: 0644]
contrib/opportunity/project.ini [new file with mode: 0644]
contrib/pep8analysis/README.md
contrib/pep8analysis/project.ini [new file with mode: 0644]
contrib/physical_interface_for_mpd_on_rpi/physical_interface_for_mpd_on_rpi.nit
contrib/physical_interface_for_mpd_on_rpi/project.ini [new file with mode: 0644]
contrib/refund/project.ini [new file with mode: 0644]
contrib/rss_downloader/README.md
contrib/rss_downloader/project.ini [new file with mode: 0644]
contrib/simplan/project.ini [new file with mode: 0644]
contrib/sort_downloads/README.md
contrib/sort_downloads/project.ini [new file with mode: 0644]
contrib/tinks/project.ini [new file with mode: 0644]
contrib/tinks/src/client/android_client.nit
contrib/tinks/src/client/linux_client.nit
contrib/tnitter/README.md
contrib/tnitter/project.ini [new file with mode: 0644]
contrib/wiringPi/project.ini [new file with mode: 0644]
examples/calculator/README.md [new file with mode: 0644]
examples/calculator/project.ini [new file with mode: 0644]
examples/circular_list.ini [new file with mode: 0644]
examples/clock.ini [new file with mode: 0644]
examples/clock_more.ini [new file with mode: 0644]
examples/draw_operation.ini [new file with mode: 0644]
examples/draw_operation.nit
examples/extern_methods.ini [new file with mode: 0644]
examples/extern_methods.nit
examples/fibonacci.ini [new file with mode: 0644]
examples/hello_world.ini [new file with mode: 0644]
examples/int_stack.ini [new file with mode: 0644]
examples/leapfrog/project.ini [new file with mode: 0644]
examples/mnit_ballz/project.ini [new file with mode: 0644]
examples/mnit_ballz/src/game_logic.nit
examples/mnit_dino/README.md [new file with mode: 0644]
examples/mnit_dino/project.ini [new file with mode: 0644]
examples/mnit_dino/src/dino_android.nit
examples/mnit_dino/src/dino_linux.nit
examples/montecarlo.ini [new file with mode: 0644]
examples/print_arguments.ini [new file with mode: 0644]
examples/procedural_array.ini [new file with mode: 0644]
examples/rosettacode/project.ini [new file with mode: 0644]
examples/shoot/project.ini [new file with mode: 0644]
examples/shoot/src/shoot_android.nit
examples/shoot/src/shoot_linux.nit
lib/a_star.ini [new file with mode: 0644]
lib/a_star.nit
lib/ai/project.ini [new file with mode: 0644]
lib/android/README.md
lib/android/input_events.nit
lib/android/project.ini [new file with mode: 0644]
lib/app/README.md
lib/app/project.ini [new file with mode: 0644]
lib/array_debug.ini [new file with mode: 0644]
lib/base64.ini [new file with mode: 0644]
lib/bcm2835/bcm2835.nit
lib/bcm2835/project.ini [new file with mode: 0644]
lib/binary/binary.nit
lib/binary/project.ini [new file with mode: 0644]
lib/bitmap/project.ini [new file with mode: 0644]
lib/bucketed_game.ini [new file with mode: 0644]
lib/bucketed_game.nit
lib/buffered_ropes.ini [new file with mode: 0644]
lib/c.ini [new file with mode: 0644]
lib/c.nit
lib/cartesian.ini [new file with mode: 0644]
lib/cocoa/cocoa.nit
lib/cocoa/project.ini [new file with mode: 0644]
lib/combinations.ini [new file with mode: 0644]
lib/console.ini [new file with mode: 0644]
lib/core/project.ini [new file with mode: 0644]
lib/core/re.nit
lib/counter.ini [new file with mode: 0644]
lib/cpp.ini [new file with mode: 0644]
lib/cpp.nit
lib/crypto.ini [new file with mode: 0644]
lib/csv/project.ini [new file with mode: 0644]
lib/curl/curl.nit
lib/curl/project.ini [new file with mode: 0644]
lib/curses/project.ini [new file with mode: 0644]
lib/date.ini [new file with mode: 0644]
lib/deriving.ini [new file with mode: 0644]
lib/dom/project.ini [new file with mode: 0644]
lib/dummy_array.ini [new file with mode: 0644]
lib/egl.ini [new file with mode: 0644]
lib/egl.nit
lib/emscripten/project.ini [new file with mode: 0644]
lib/filter_stream.ini [new file with mode: 0644]
lib/for_abuse.ini [new file with mode: 0644]
lib/gamnit/project.ini [new file with mode: 0644]
lib/geometry/project.ini [new file with mode: 0644]
lib/gettext/project.ini [new file with mode: 0644]
lib/github/project.ini [new file with mode: 0644]
lib/glesv2/project.ini [new file with mode: 0644]
lib/gpio.nit [deleted file]
lib/graphs/project.ini [new file with mode: 0644]
lib/gtk/gtk.nit
lib/gtk/project.ini [new file with mode: 0644]
lib/hash_debug.ini [new file with mode: 0644]
lib/html/project.ini [new file with mode: 0644]
lib/ini.ini [new file with mode: 0644]
lib/ios/ios.nit
lib/ios/project.ini [new file with mode: 0644]
lib/java/project.ini [new file with mode: 0644]
lib/json/json.nit
lib/json/project.ini [new file with mode: 0644]
lib/jvm.ini [new file with mode: 0644]
lib/jvm.nit
lib/libevent.ini [new file with mode: 0644]
lib/linux/audio.nit
lib/linux/project.ini [new file with mode: 0644]
lib/markdown/project.ini [new file with mode: 0644]
lib/md5.ini [new file with mode: 0644]
lib/md5.nit
lib/meta.ini [new file with mode: 0644]
lib/mnit/android/android.nit [moved from lib/mnit_android/mnit_android.nit with 97% similarity]
lib/mnit/android/android_app.nit [moved from lib/mnit_android/android_app.nit with 99% similarity]
lib/mnit/android/android_assets.nit [moved from lib/mnit_android/android_assets.nit with 100% similarity]
lib/mnit/android/android_opengles1.nit [moved from lib/mnit_android/android_opengles1.nit with 98% similarity]
lib/mnit/assets.nit
lib/mnit/display.nit [moved from lib/mnit_display.nit with 98% similarity]
lib/mnit/input.nit [moved from lib/mnit_input.nit with 99% similarity]
lib/mnit/linux/linux.nit [moved from lib/mnit_linux/mnit_linux.nit with 97% similarity]
lib/mnit/linux/linux_app.nit [moved from lib/mnit_linux/linux_app.nit with 98% similarity]
lib/mnit/linux/linux_assets.nit [moved from lib/mnit_linux/linux_assets.nit with 100% similarity]
lib/mnit/linux/linux_opengles1.nit [moved from lib/mnit_linux/linux_opengles1.nit with 100% similarity]
lib/mnit/mnit.nit
lib/mnit/mnit_app.nit
lib/mnit/opengles1.nit
lib/mnit/project.ini [new file with mode: 0644]
lib/mnit/tileset.nit
lib/mongodb/project.ini [new file with mode: 0644]
lib/more_collections.ini [new file with mode: 0644]
lib/mpd.ini [new file with mode: 0644]
lib/mpd.nit
lib/mpi/project.ini [new file with mode: 0644]
lib/neo4j/project.ini [new file with mode: 0644]
lib/nitcc_runtime.ini [new file with mode: 0644]
lib/nitcorn/examples/Makefile [moved from examples/nitcorn/Makefile with 100% similarity]
lib/nitcorn/examples/src/file_server_on_port_80.nit [moved from examples/nitcorn/src/file_server_on_port_80.nit with 100% similarity]
lib/nitcorn/examples/src/nitcorn_hello_world.nit [moved from examples/nitcorn/src/nitcorn_hello_world.nit with 100% similarity]
lib/nitcorn/examples/src/xymus_net.nit [moved from examples/nitcorn/src/xymus_net.nit with 100% similarity]
lib/nitcorn/examples/www/hello_world/dir/a.txt [moved from examples/nitcorn/www/hello_world/dir/a.txt with 100% similarity]
lib/nitcorn/examples/www/hello_world/dir/b.txt [moved from examples/nitcorn/www/hello_world/dir/b.txt with 100% similarity]
lib/nitcorn/examples/www/hello_world/favicon.ico [moved from examples/nitcorn/www/hello_world/favicon.ico with 100% similarity]
lib/nitcorn/project.ini [new file with mode: 0644]
lib/niti_runtime.ini [new file with mode: 0644]
lib/noise.ini [new file with mode: 0644]
lib/noise.nit
lib/opts.ini [new file with mode: 0644]
lib/ordered_tree.ini [new file with mode: 0644]
lib/parser_base.ini [new file with mode: 0644]
lib/perfect_hashing.ini [new file with mode: 0644]
lib/performance_analysis.ini [new file with mode: 0644]
lib/pipeline.ini [new file with mode: 0644]
lib/pnacl/project.ini [new file with mode: 0644]
lib/poset.ini [new file with mode: 0644]
lib/posix_ext.ini [new file with mode: 0644]
lib/privileges/project.ini [new file with mode: 0644]
lib/progression.ini [new file with mode: 0644]
lib/pthreads/project.ini [new file with mode: 0644]
lib/realtime.ini [new file with mode: 0644]
lib/realtime.nit
lib/ropes_debug.ini [new file with mode: 0644]
lib/sax/project.ini [new file with mode: 0644]
lib/saxophonit/project.ini [new file with mode: 0644]
lib/saxophonit/reader_model.nit
lib/scene2d.ini [new file with mode: 0644]
lib/sdl.ini [new file with mode: 0644]
lib/sdl.nit
lib/sdl2/project.ini [new file with mode: 0644]
lib/sendmail.ini [new file with mode: 0644]
lib/serialization/project.ini [new file with mode: 0644]
lib/sexp.ini [new file with mode: 0644]
lib/sha1.ini [new file with mode: 0644]
lib/signals.ini [new file with mode: 0644]
lib/signals.nit
lib/socket/project.ini [new file with mode: 0644]
lib/sqlite3/project.ini [new file with mode: 0644]
lib/standard.ini [new file with mode: 0644]
lib/symbol.ini [new file with mode: 0644]
lib/template/project.ini [new file with mode: 0644]
lib/test_suite.ini [new file with mode: 0644]
lib/trees/project.ini [new file with mode: 0644]
lib/websocket/project.ini [new file with mode: 0644]
lib/x11.ini [new file with mode: 0644]
lib/x11.nit
lib/xdg_basedir/project.ini [new file with mode: 0644]
src/nitcatalog.nit [new file with mode: 0644]
src/project.ini
tests/sav/dino_linux.res
tests/sav/nitcatalog.res [new file with mode: 0644]
tests/sav/shoot_linux.res
tests/sav/test_c_alt1.res
tests/sav/test_c_alt2.res
tests/sav/test_c_alt3.res
tests/sav/test_c_alt4.res

index 452266a..a1e995c 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -26,3 +26,7 @@ Clement de Figueiredo <clement.defigueiredo@gmail.com>
 Christophe Gigax <christophe.gigax@viacesi.fr>
 
 Julien Pagès <julien.projet@gmail.com>
+
+Mehdi Ait Younes <overpex@gmail.com>
+
+Hervé Matysiak <herve.matysiak@viacesi.fr>
index db4c127..6f4ce46 100644 (file)
@@ -1,4 +1,4 @@
-Benitlux is an unofficial mailing list to keep faithful bargoers informed of the current beer offer at the excellent Brasserie Bénélux <http://brasseriebenelux.com/>.
+An unofficial mailing list and other tools to keep faithful bargoers informed of the beers available at the excellent Brasserie Bénélux.
 
 This project is composed of two softwares:
 
diff --git a/contrib/benitlux/project.ini b/contrib/benitlux/project.ini
new file mode 100644 (file)
index 0000000..a9eff3b
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=benitlux
+tags=network
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/benitlux/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/benitlux/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index f4a3f25..d242751 100644 (file)
@@ -171,7 +171,7 @@ class Benitlux
        # Generate email and fill the attributes `email_content` and `email_title`
        fun generate_email(beer_events: BeerEvents)
        do
-               email_title = beer_events.to_email_title
+               email_title = "Benitlux {street.capitalized}{beer_events.to_email_title}"
                email_content = beer_events.to_email_content
        end
 
@@ -189,6 +189,8 @@ To unsubscribe, go to <a href="{{{unsub_link}}}">{{{unsub_link}}}</a>
                        var mail = new Mail("Benitlux <benitlux@xymus.net>", email_title, content)
                        mail.to.add email
                        mail.header["Content-Type"] = "text/html; charset=\"UTF-8\""
+                       mail.header["List-Unsubscribe"] = unsub_link
+                       mail.header["Precedence"] = "bulk"
                        mail.encrypt_with_base64
 
                        mail.send
index d3e440d..4649a5c 100644 (file)
@@ -71,16 +71,14 @@ class BeerEvents
        # Get a pretty and short version of `self`
        fun to_email_title: String
        do
-               var title = "Benelux Beer Menu"
-
                # New beers
                var new_beers_name = new Array[String]
                for beer in self.new_beers do new_beers_name.add beer.name
 
                if not new_beers_name.is_empty then
-                       title += " (+ {new_beers_name.join(", ")})"
+                       return " (+ {new_beers_name.join(", ")})"
                end
 
-               return title
+               return ""
        end
 end
diff --git a/contrib/brainfuck/project.ini b/contrib/brainfuck/project.ini
new file mode 100644 (file)
index 0000000..440c8d5
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=brainfuck
+tags=language
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/brainfuck/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/brainfuck/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/crazy_moles/README.md b/contrib/crazy_moles/README.md
new file mode 100644 (file)
index 0000000..a4c7b2d
--- /dev/null
@@ -0,0 +1 @@
+Crazy Moles, a very simple portable whack-a-mole style game with particle effects!
diff --git a/contrib/crazy_moles/project.ini b/contrib/crazy_moles/project.ini
new file mode 100644 (file)
index 0000000..0369bd7
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=crazy_moles
+tags=game
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/crazy_moles/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/crazy_moles/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 1da39be..edf1251 100644 (file)
@@ -16,7 +16,7 @@
 
 module moles_android
 
-import mnit_android
+import mnit::android
 import android::portrait
 
 import moles
index 66a645a..c46b29b 100644 (file)
@@ -16,7 +16,7 @@
 
 module moles_linux
 
-import mnit_linux
+import mnit::linux
 
 import moles
 import effects
diff --git a/contrib/friendz/project.ini b/contrib/friendz/project.ini
new file mode 100644 (file)
index 0000000..dfb04ba
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=friendz
+tags=game
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/friendz/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/friendz/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index e0dec75..4f40ca7 100644 (file)
@@ -11,7 +11,7 @@
 module friendz_android
 
 import friendz
-import mnit_android
+import mnit::android
 import android::landscape
 
 redef class App
index 7940843..e8ada20 100644 (file)
@@ -11,7 +11,7 @@
 module friendz_linux
 
 import friendz
-import mnit_linux
+import mnit::linux
 
 redef class Display
        redef fun wanted_width do return app.screen_width
diff --git a/contrib/github_merge.ini b/contrib/github_merge.ini
new file mode 100644 (file)
index 0000000..0615986
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=github_merge
+tags=cli
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/github_merge.nit
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/github_merge.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 3a98c10..52afa49 100644 (file)
@@ -68,8 +68,8 @@ redef class GithubCurl
                var res = new Array[String]
                for l in logins do
                        var u = get_and_check("https://api.github.com/users/{l}").json_as_map
-                       if not u.has_key("name") then
-                               print "No public name for user {l}"
+                       if not u.has_key("name") or u["name"] == null or not u.has_key("email")or u["email"] == null then
+                               print "No public name/email for user {l}"
                                continue
                        end
                        var r = "{u["name"].to_s} <{u["email"].to_s}>"
diff --git a/contrib/github_search_for_jni/README.md b/contrib/github_search_for_jni/README.md
new file mode 100644 (file)
index 0000000..e934507
--- /dev/null
@@ -0,0 +1 @@
+Seach Github for repositories possibly using the JNI.
diff --git a/contrib/github_search_for_jni/project.ini b/contrib/github_search_for_jni/project.ini
new file mode 100644 (file)
index 0000000..5b5c36b
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=github_search_for_jni
+tags=cli
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/github_search_for_jni/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/github_search_for_jni/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/header_keeper/project.ini b/contrib/header_keeper/project.ini
new file mode 100644 (file)
index 0000000..f2783c0
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=header_keeper
+tags=devel,cli
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/header_keeper/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/header_keeper/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index c338656..f1dccff 100644 (file)
@@ -1,4 +1,4 @@
-# SVG to PNG and Nit
+# Tools to extract images from SVG files using Inkscape, either to create icons or game sprites
 
 This tool uses Inkscape to prepare assets for Nit applications from a single SVG file.
 It selects objects to extract from the SVG file when their id begins with `0`.
@@ -25,7 +25,3 @@ It will produce two files:
 The minimal test in `tests/app/` shows the basic usage of this tool.
 
 The Dino example `../../../../examples/mnit_dino` also uses this tool and is a more complete and practical example.
-
-# Authors
-
-Alexis Laferrière <alexis.laf@xymus.net>
diff --git a/contrib/inkscape_tools/project.ini b/contrib/inkscape_tools/project.ini
new file mode 100644 (file)
index 0000000..d8cc3c4
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=inkscape_tools
+tags=devel,cli
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/inkscape_tools/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/inkscape_tools/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index d91ade5..350a5b2 100644 (file)
@@ -15,4 +15,4 @@
 # limitations under the License.
 
 import s2pn
-import mnit_android
+import mnit::android
index c7ce636..7cc5cee 100644 (file)
@@ -15,4 +15,4 @@
 # limitations under the License.
 
 import s2pn
-import mnit_linux
+import mnit::linux
index da33dd2..8cc1830 100644 (file)
@@ -1,4 +1,4 @@
-_jwrapper_, an extern class generator from Java class files
+Generator of Nit extern classes to wrap Java APIs.
 
 # Description
 _jwrapper_ automates wrapping Java classes so they can be accessed from Nit code. It generates Nit extern classes by analyzing Java class files.
diff --git a/contrib/jwrapper/project.ini b/contrib/jwrapper/project.ini
new file mode 100644 (file)
index 0000000..b43cd0e
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=jwrapper
+tags=java,devel,cli
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/jwrapper/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/jwrapper/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/jwrapper/tests/projects.ini b/contrib/jwrapper/tests/projects.ini
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/contrib/mnit_test/project.ini b/contrib/mnit_test/project.ini
new file mode 100644 (file)
index 0000000..e595abe
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=mnit_test
+tags=
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/mnit_simple/
+git=https://github.com/nitlang/nit.git
+git.directory=examples/mnit_simple/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index bc5e69d..6e237d6 100644 (file)
@@ -19,7 +19,7 @@ module simple_android is
        android_manifest """<uses-permission android:name="android.permission.VIBRATE" />"""
 end
 
-import mnit_android
+import mnit::android
 import android::portrait
 import serialization
 
index c0d8d0f..1ff4235 100644 (file)
@@ -17,7 +17,7 @@
 module simple_linux
 
 import simple
-import mnit_linux
+import mnit::linux
 
 import test_data_store
 
diff --git a/contrib/neo_doxygen/project.ini b/contrib/neo_doxygen/project.ini
new file mode 100644 (file)
index 0000000..9f5ceaf
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=neo_doxygen
+tags=devel,cli
+maintainer=Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/neo_doxygen/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/neo_doxygen/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/nitcc/project.ini b/contrib/nitcc/project.ini
new file mode 100644 (file)
index 0000000..bdc1258
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=nitcc
+tags=devel,cli
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/nitcc/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/nitcc/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/nitcc/tests/projects.ini b/contrib/nitcc/tests/projects.ini
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/contrib/nitester/project.ini b/contrib/nitester/project.ini
new file mode 100644 (file)
index 0000000..10897ac
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=nitester
+tags=devel,cli
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/nitester/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/nitester/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/nitiwiki/project.ini b/contrib/nitiwiki/project.ini
new file mode 100644 (file)
index 0000000..0ebf3a8
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=nitiwiki
+tags=web,cli
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/nitiwiki/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/nitiwiki/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/nitrpg/project.ini b/contrib/nitrpg/project.ini
new file mode 100644 (file)
index 0000000..e697771
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=nitrpg
+tags=devel,web,cli
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/nitrpg/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/nitrpg/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/objcwrapper/project.ini b/contrib/objcwrapper/project.ini
new file mode 100644 (file)
index 0000000..4359608
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=objcwrapper
+tags=devel,cli
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/objcwrapper/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/objcwrapper/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/online_ide/project.ini b/contrib/online_ide/project.ini
new file mode 100644 (file)
index 0000000..2729576
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=online_ide
+tags=devel,web
+maintainer=Johan Kayser <johan.kayser@viacesi.fr>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/online_ide/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/online_ide/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/opportunity/project.ini b/contrib/opportunity/project.ini
new file mode 100644 (file)
index 0000000..f19f154
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=opportunity
+tags=web
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/opportunity/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/opportunity/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 216b878..6723296 100644 (file)
@@ -1,6 +1,4 @@
-# Pep/8 Analysis
-
-This project provides tools to statically analyze Pep/8 programs in order to detect bugs or bad programming practices.
+# Pep/8 Analysis, static checker to detect bugs and bad programming practices in Pep/8 programs
 
 For more information about the Pep/8 assembly language visit http://code.google.com/p/pep8-1/.
 
diff --git a/contrib/pep8analysis/project.ini b/contrib/pep8analysis/project.ini
new file mode 100644 (file)
index 0000000..9a50402
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=pep8analysis
+tags=educ,web,cli
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/pep8analysis/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/pep8analysis/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 335444a..1c73e64 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# This programs interprets the input of a physical interface thought the
-# GPIO pins of a Raspberry Pi to control an MPD server.
+# Backend to a hardware interface to control an MPD server from a Raspberry Pi
 #
-# It suppot two inputs: a play/pause button and a rotary encoder to adjust
+# It supports two inputs: a play/pause button and a rotary encoder to adjust
 # the volume.
 #
 # The each data output of the volume control are connected to the board
diff --git a/contrib/physical_interface_for_mpd_on_rpi/project.ini b/contrib/physical_interface_for_mpd_on_rpi/project.ini
new file mode 100644 (file)
index 0000000..5c1fe75
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=physical_interface_for_mpd_on_rpi
+tags=embedded,cli
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/physical_interface_for_mpd_on_rpi/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/physical_interface_for_mpd_on_rpi/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/refund/project.ini b/contrib/refund/project.ini
new file mode 100644 (file)
index 0000000..6e7591b
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=refund
+tags=example,cli
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/refund/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/refund/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index eddc63b..b3b85aa 100644 (file)
@@ -1,4 +1,4 @@
-This tool downloads files pointed by RSS feeds.
+A tool to download files listed in RSS feeds according to local folders.
 
 It fetches the content of the RSS feed, then filters it according to custom patterns and to existing folders on disk. Selected elements will be downloaded to the given folder.
 
diff --git a/contrib/rss_downloader/project.ini b/contrib/rss_downloader/project.ini
new file mode 100644 (file)
index 0000000..162816a
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=rss_downloader
+tags=network,cli
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/rss_downloader/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/rss_downloader/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/simplan/project.ini b/contrib/simplan/project.ini
new file mode 100644 (file)
index 0000000..bab2310
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=simplan
+tags=ai,example,cli
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/simplan/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/simplan/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 00cb3e1..0a42ca2 100644 (file)
@@ -1,4 +1,4 @@
-# sort_downloads
+Script to sort content of a folder in many folders according to their names.
 
 This scripts sorts files from a given directory to subfolders in the destination directory. It uses directory names as patterns to sort the files and thus moves each file to a directory with a similar name. Multiple directories may be used to specify the patterns to look for, but the files will only be copied to subfolders in the target directory. This features ensures a clean support for a multi-disk system.
 
diff --git a/contrib/sort_downloads/project.ini b/contrib/sort_downloads/project.ini
new file mode 100644 (file)
index 0000000..acd2fe2
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=sort_downloads
+tags=cli
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/sort_downloads/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/sort_downloads/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/tinks/project.ini b/contrib/tinks/project.ini
new file mode 100644 (file)
index 0000000..ec34d3a
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=tinks
+tags=game
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/tinks/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/tinks/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index c90e3a4..376d5a6 100644 (file)
@@ -20,7 +20,7 @@ module android_client is
        android_api_target 10
 end
 
-import mnit_android
+import mnit::android
 import android::audio
 import android::vibration
 import android::landscape
index d464cc8..6ef6b15 100644 (file)
@@ -15,7 +15,7 @@
 # GNU/Linux client with config saved to `config.json`
 module linux_client
 
-import mnit_linux
+import mnit::linux
 import linux::audio
 import json::serialization
 
index 0eca29d..d2893ef 100644 (file)
@@ -1,4 +1,4 @@
-Tnitter is a Twitter-like micro-blogging platform
+Tnitter, a Twitter-like micro-blogging platform
 
 # Compile and execute
 
diff --git a/contrib/tnitter/project.ini b/contrib/tnitter/project.ini
new file mode 100644 (file)
index 0000000..d589d1f
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=tnitter
+tags=web
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/tnitter/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/tnitter/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/contrib/wiringPi/project.ini b/contrib/wiringPi/project.ini
new file mode 100644 (file)
index 0000000..b4c8c48
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=wiringPi
+tags=embedded,wrapper
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/contrib/wiringPi/
+git=https://github.com/nitlang/nit.git
+git.directory=contrib/wiringPi/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/calculator/README.md b/examples/calculator/README.md
new file mode 100644 (file)
index 0000000..9028013
--- /dev/null
@@ -0,0 +1,15 @@
+Portable calculator built using _app.nit_
+
+# Project structure
+
+* `calculator_logic` defines `CalculatorContext` with all the business logic of a calculator.
+  It takes as input operations and numbers, and outputs the text to display.
+* `calculator` implements the portable graphical interface using the _app.nit_ framework
+* `calculator_test` test `CalculatorContext` as a black box.
+
+# Usage
+
+1. Compile with a call to `make`.
+2. Run with either:
+       1. The desktop version, `bin/calculator`.
+       2. The Android version by install the APK at `bin/calculator.apk`.
diff --git a/examples/calculator/project.ini b/examples/calculator/project.ini
new file mode 100644 (file)
index 0000000..28b52fb
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=calculator
+tags=example
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/calculator/
+git=https://github.com/nitlang/nit.git
+git.directory=examples/calculator/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/circular_list.ini b/examples/circular_list.ini
new file mode 100644 (file)
index 0000000..c5ac8ce
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=circular_list
+tags=algo,example
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/circular_list.nit
+git=https://github.com/nitlang/nit.git
+git.directory=examples/circular_list.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/clock.ini b/examples/clock.ini
new file mode 100644 (file)
index 0000000..4edb9d3
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=clock
+tags=example
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/clock.nit
+git=https://github.com/nitlang/nit.git
+git.directory=examples/clock.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/clock_more.ini b/examples/clock_more.ini
new file mode 100644 (file)
index 0000000..669c71d
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=clock_more
+tags=example
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/clock_more.nit
+git=https://github.com/nitlang/nit.git
+git.directory=examples/clock_more.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/draw_operation.ini b/examples/draw_operation.ini
new file mode 100644 (file)
index 0000000..31772ef
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=draw_operation
+tags=
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/draw_operation.nit
+git=https://github.com/nitlang/nit.git
+git.directory=examples/draw_operation.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index a5ad1d5..61f14eb 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Draws an arithmetic operation to the terminal
+# Sample program which draws an arithmetic operation to the terminal
+#
+# Output (and input) example:
+# ~~~nitish
+# Left operand: 23
+# Right operand: 15
+# Operator (+, -, *, /, %): +
+# Char to display: #
+# Size of text: 5
+# Space between digits: 1
+#       ##### #####
+#           #     #
+#       ##### #####
+#       #         #
+#       ##### #####
+#
+#         #   #####
+#   +    ##   #
+# +++++   #   #####
+#   +     #       #
+#       ##### #####
+#
+# __________________
+#
+#       ##### #####
+#           # #   #
+#       ##### #####
+#           # #   #
+#       ##### #####
+# ~~~
 module draw_operation
 
 `{
diff --git a/examples/extern_methods.ini b/examples/extern_methods.ini
new file mode 100644 (file)
index 0000000..460e02b
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=extern_methods
+tags=wrapper,example
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/extern_methods.nit
+git=https://github.com/nitlang/nit.git
+git.directory=examples/extern_methods.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 333540b..c91cdb7 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# This module illustrates some uses of the FFI, specifically
-# how to use extern methods. Which means to implement a Nit method in C.
+# Sample program using extern methods implemented in C and other FFI services
 module extern_methods
 
 redef enum Int
-       # Returns self'th fibonnaci number
-       # implemented here in C for optimization purposes
+       # Get the `self`th Fibonacci number
+       #
+       # The FFI can be used to optimize performance critical methods.
+       # Although this implementation is recursive, so there is not much gain.
+       # Notice the `import fib` telling the compiler that there is a callback to `foo` from the C code.
+       # From C, `foo` is called through the function `Int_fib` with the receiver as argument.
        fun fib: Int import fib `{
                if (self < 2)
                        return self;
@@ -28,22 +31,27 @@ redef enum Int
                        return Int_fib(self-1) + Int_fib(self-2);
        `}
 
-       # System call to sleep for "self" seconds
+       # System call to sleep for `self` seconds
+       #
+       # You can use the FFI to access any system functions, sometimes it's extremely simple.
        fun sleep `{
                sleep(self);
        `}
 
-       # Return atan2l(self, x) from libmath
-       fun atan_with(x: Int): Float `{
-               return atan2(self, x);
-       `}
-
-       # This method callback to Nit methods from C code
-       # It will use from C code:
-       # * the local fib method
-       # * the + operator, a method of Int
-       # * to_s, a method of all objects
-       # * String.to_cstring, a method of String to return an equivalent char*
+       # Print the result of adding `self` to `self.fib` with callbacks from C
+       #
+       # This method illustrates many forms of callbacks from C,
+       # but it would have been better implemented in Nit (as done by `bar`).
+       #
+       # It is recommended to avoid callbacks when possible, use each language according to their strengths.
+       # Nit is better than C to call methods and manipulate objects.
+       # C has easy access to system functions, native libraries and it does low-level stuff.
+       #
+       # The implementation calls:
+       # * the local `fib` method,
+       # * the `+` operator, a method of `Int`,
+       # * `to_s`, a method of all objects,
+       # * `String.to_cstring`, a method of `String` to get as a `char*`.
        fun foo import fib, +, to_s, String.to_cstring `{
                long self_fib = Int_fib(self);
                long self_plus_fib = Int__plus(self, self_fib);
@@ -54,16 +62,25 @@ redef enum Int
                printf("from C: self + fib(self) = %s\n", c_string);
        `}
 
-       # Equivalent to foo but written in pure Nit
+       # Equivalent to `foo` but written in pure Nit
        fun bar do print "from Nit: self + fib(self) = {self+self.fib}"
 end
 
+redef class Float
+       # Arctangent of `self` and `other` using `atan2` from `math.h`
+       #
+       # Universal types (Int, Float, Bool, etc.) are converted to their closest equivalent in C
+       # (long, double, int, etc.).
+       fun atan_with(other: Float): Float `{
+               return atan2(self, other);
+       `}
+end
+
 print 12.fib
 
 print "sleeping 1 second..."
 1.sleep
 
-print 100.atan_with(200)
+print 100.0.atan_with(200.0)
 8.foo
 8.bar
-
diff --git a/examples/fibonacci.ini b/examples/fibonacci.ini
new file mode 100644 (file)
index 0000000..303d9ed
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=fibonacci
+tags=example
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/fibonacci.nit
+git=https://github.com/nitlang/nit.git
+git.directory=examples/fibonacci.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/hello_world.ini b/examples/hello_world.ini
new file mode 100644 (file)
index 0000000..d666cf2
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=hello_world
+tags=example
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/hello_world.nit
+git=https://github.com/nitlang/nit.git
+git.directory=examples/hello_world.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/int_stack.ini b/examples/int_stack.ini
new file mode 100644 (file)
index 0000000..7b8b9fc
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=int_stack
+tags=example
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/int_stack.nit
+git=https://github.com/nitlang/nit.git
+git.directory=examples/int_stack.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/leapfrog/project.ini b/examples/leapfrog/project.ini
new file mode 100644 (file)
index 0000000..56c05d5
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=leapfrog
+tags=game,terminal
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/leapfrog/
+git=https://github.com/nitlang/nit.git
+git.directory=examples/leapfrog/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/mnit_ballz/project.ini b/examples/mnit_ballz/project.ini
new file mode 100644 (file)
index 0000000..7a252c1
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=mnit_ballz
+tags=game
+maintainer=Romain Chanoir <romain.chanoir@viacesi.fr>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/mnit_ballz/
+git=https://github.com/nitlang/nit.git
+git.directory=examples/mnit_ballz/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 38cf9e5..7ece167 100644 (file)
@@ -16,7 +16,7 @@
 
 module game_logic
 
-import mnit_android
+import mnit::android
 import android::sensors
 
 class Ball
diff --git a/examples/mnit_dino/README.md b/examples/mnit_dino/README.md
new file mode 100644 (file)
index 0000000..dc46a12
--- /dev/null
@@ -0,0 +1,11 @@
+Dino vs cavemen portable action game where the player plays the dino
+
+# Project Structure
+
+* `game_logic` defines, as its name implies, the full game logic and the basic entities.
+* `graphism` defines how the game is drawn on screen with fully portable code.
+* `dino` implements the the portable app structure.
+* `dino_android` and `dino_linux` adapt the portable game for specific platforms.
+* `fancy_dino` is an optional module which tweaks how the dino itself is drawn on screen
+  to create the flat rotation effect.
+* `splash` defines the splash screen used while the app loads.
diff --git a/examples/mnit_dino/project.ini b/examples/mnit_dino/project.ini
new file mode 100644 (file)
index 0000000..a4a5c6c
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=mnit_dino
+tags=game
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/mnit_dino/
+git=https://github.com/nitlang/nit.git
+git.directory=examples/mnit_dino/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index be92d49..ebf1eaf 100644 (file)
@@ -20,7 +20,7 @@ end
 
 import dino
 
-import mnit_android
+import mnit::android
 import android::portrait
 import android::vibration
 
index 757cc0b..5d7f97d 100644 (file)
@@ -18,7 +18,7 @@ module dino_linux
 
 import dino
 
-import mnit_linux
+import mnit::linux
 
 redef class ImageSet
        redef fun start_over_path do return "images/play_again.png"
diff --git a/examples/montecarlo.ini b/examples/montecarlo.ini
new file mode 100644 (file)
index 0000000..d789aa4
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=montecarlo
+tags=example
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/montecarlo.nit
+git=https://github.com/nitlang/nit.git
+git.directory=examples/montecarlo.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/print_arguments.ini b/examples/print_arguments.ini
new file mode 100644 (file)
index 0000000..888fd2b
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=print_arguments
+tags=example
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/print_arguments.nit
+git=https://github.com/nitlang/nit.git
+git.directory=examples/print_arguments.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/procedural_array.ini b/examples/procedural_array.ini
new file mode 100644 (file)
index 0000000..90e31a7
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=procedural_array
+tags=example
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/procedural_array.nit
+git=https://github.com/nitlang/nit.git
+git.directory=examples/procedural_array.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/rosettacode/project.ini b/examples/rosettacode/project.ini
new file mode 100644 (file)
index 0000000..3452885
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=rosettacode
+tags=example
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/rosettacode/
+git=https://github.com/nitlang/nit.git
+git.directory=examples/rosettacode/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/examples/shoot/project.ini b/examples/shoot/project.ini
new file mode 100644 (file)
index 0000000..a2ea7c3
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=shoot
+tags=game
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/examples/shoot/
+git=https://github.com/nitlang/nit.git
+git.directory=examples/shoot/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 22b9b35..4de7f66 100644 (file)
@@ -16,6 +16,6 @@
 module shoot_android
 
 import shoot
-import mnit_android
+import mnit::android
 
 super
index 6b80432..1587d36 100644 (file)
@@ -16,6 +16,6 @@
 module shoot_linux
 
 import shoot
-import mnit_linux
+import mnit::linux
 
 super
diff --git a/lib/a_star.ini b/lib/a_star.ini
new file mode 100644 (file)
index 0000000..64e1f61
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=a_star
+tags=algo,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/a_star.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/a_star.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index ba6b45e..7b7ce02 100644 (file)
@@ -14,9 +14,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Services related to pathfinding of graphs using A*
-# A single graph may have different properties according to the `PathContext` used
+# A* pathfinding in graphs
 #
+# A single graph may have different properties according to the `PathContext` used
 #
 # Usage:
 #
@@ -194,7 +194,7 @@ class Node
        # With a large graph it can cause a stack overflow.
        #
        # Instead, we serialize the nodes first and then the links.
-       redef fun core_serialize_to(serializer: Serializer)
+       redef fun core_serialize_to(serializer)
        do
                serializer.serialize_attribute("graph", graph)
        end
@@ -265,7 +265,7 @@ class Graph[N: Node, L: Link]
        # Used to check if nodes have been searched in one pathfinding
        private var pathfinding_current_evocation: Int = 0
 
-       redef fun core_serialize_to(serializer: Serializer)
+       redef fun core_serialize_to(serializer)
        do
                serializer.serialize_attribute("nodes", nodes)
                serializer.serialize_attribute("links", links)
@@ -380,7 +380,7 @@ class WeightedPathContext
                self.worst_cost = worst_cost
        end
 
-       redef var worst_cost: Int is noinit
+       redef var worst_cost is noinit
 
        redef fun cost(l) do
                return l.weight
diff --git a/lib/ai/project.ini b/lib/ai/project.ini
new file mode 100644 (file)
index 0000000..cff8fc6
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=ai
+tags=ai,algo,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/ai/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/ai/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 47c0e4b..50ac38d 100644 (file)
@@ -1,4 +1,4 @@
-The `android` module provides support for the Android platform
+Android platform support and APIs
 
 # Compilation for Android
 
index cbb10b1..c1709ae 100644 (file)
@@ -17,7 +17,7 @@
 # Pointer and hardware key events
 module input_events
 
-import mnit_input
+import mnit::input
 import android
 
 in "C header" `{
diff --git a/lib/android/project.ini b/lib/android/project.ini
new file mode 100644 (file)
index 0000000..d378b05
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=android
+tags=platform,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/android/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/android/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 22f4f77..c5caa4b 100644 (file)
@@ -1,4 +1,4 @@
-_app.nit_ is a framework to create cross-platform applications
+_app.nit_, a framework for portable applications
 
 The framework provides services to manage common needs of modern mobile applications:
 
diff --git a/lib/app/project.ini b/lib/app/project.ini
new file mode 100644 (file)
index 0000000..7032d20
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=app
+tags=lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/app/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/app/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/array_debug.ini b/lib/array_debug.ini
new file mode 100644 (file)
index 0000000..8317cf9
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=array_debug
+tags=debug,lib
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/array_debug.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/array_debug.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/base64.ini b/lib/base64.ini
new file mode 100644 (file)
index 0000000..629c07b
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=base64
+tags=encoding,lib
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/base64.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/base64.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index a7f9d69..dad9899 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Services to control the bcm2835 chipset as used in the Raspberry Pi
-# model B revision 1 Uses the C library by Mike McCauley from
-# http://www.airspayce.com/mikem/bcm2835/
+# Services to control the bcm2835 chipset used in the Raspberry Pi
+#
+# Uses the C library by Mike McCauley available at http://www.airspayce.com/mikem/bcm2835/
+#
+# This module targets the model B revision 1, it could be tweaked for other versions.
 module bcm2835
 
-import gpio
-
 in "C Header" `{
        #include <bcm2835.h>
 `}
@@ -31,6 +31,12 @@ redef class Object
        protected fun bcm2835_debug=(v: Bool) `{ bcm2835_set_debug(v); `}
 end
 
+# A physical binary pin
+interface Pin
+       # Set the output of this pin
+       fun write(high: Bool) is abstract
+end
+
 extern class RPiPin `{ RPiGPIOPin `}
        super Pin
 
diff --git a/lib/bcm2835/project.ini b/lib/bcm2835/project.ini
new file mode 100644 (file)
index 0000000..07ade4d
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=bcm2835
+tags=embedded,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/bcm2835/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/bcm2835/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 7e5c180..b6909cd 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Add reading and writing binary services
+# Read and write binary data with any `Reader` and `Writer`
 #
 # ~~~
 # var w = new FileWriter.open("/tmp/data.bin")
diff --git a/lib/binary/project.ini b/lib/binary/project.ini
new file mode 100644 (file)
index 0000000..c9f47da
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=binary
+tags=io,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/binary/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/binary/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/bitmap/project.ini b/lib/bitmap/project.ini
new file mode 100644 (file)
index 0000000..54ff7c2
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=bitmap
+tags=lib
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/bitmap/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/bitmap/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/bucketed_game.ini b/lib/bucketed_game.ini
new file mode 100644 (file)
index 0000000..b419878
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=bucketed_game
+tags=game,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/bucketed_game.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/bucketed_game.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 4060dc4..b5542e4 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Provides basic game logic utilities using buckets to coordinate and
-# optimize actions on game turn ends. Supports both action at each
-# end of turn as well as actions on some end of turns.
+# Game framework with an emphasis on efficient event coordination
 #
-# Allows for fast support of a large number of entities with rare actions,
-# such as a forest with many individual trees.
+# Provides basic game logic entities to manage a game where the logic is executed by turns:
+# `Game`, `GameTurn`, `GameEvent`, `Turnable`.
+# Also offers a bucket system to plan future events at a known number of turns in the future:
+# `Bucketable` and the services `act_next` and `act_in`.
+#
+# Efficiently support large number of entities with rare or sparse actions,
+# such as a forest with many individual trees growing slowly.
 module bucketed_game is serialize
 
 import serialization
diff --git a/lib/buffered_ropes.ini b/lib/buffered_ropes.ini
new file mode 100644 (file)
index 0000000..b221516
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=buffered_ropes
+tags=algo,text,lib
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/buffered_ropes.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/buffered_ropes.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/c.ini b/lib/c.ini
new file mode 100644 (file)
index 0000000..415a61b
--- /dev/null
+++ b/lib/c.ini
@@ -0,0 +1,11 @@
+[project]
+name=c
+tags=language,wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/c.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/c.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index a4a8e01..deb6765 100644 (file)
--- a/lib/c.nit
+++ b/lib/c.nit
@@ -14,8 +14,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Utilities and performant structure for the FFI with C
+# Structures and services for compatibility with the C language
 module c
+
 import core
 intrude import core::collection::array
 
diff --git a/lib/cartesian.ini b/lib/cartesian.ini
new file mode 100644 (file)
index 0000000..7dd61d7
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=cartesian
+tags=algo,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/cartesian.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/cartesian.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 09e1291..3e20d87 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# The Cocoa API is the development layer of OS X
+# Cocoa API, the development layer of OS X
 #
 # This module is only compatible with OS X.
 #
diff --git a/lib/cocoa/project.ini b/lib/cocoa/project.ini
new file mode 100644 (file)
index 0000000..ceee0f1
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=cocoa
+tags=wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/cocoa/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/cocoa/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/combinations.ini b/lib/combinations.ini
new file mode 100644 (file)
index 0000000..bf0cda4
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=combinations
+tags=algo,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/combinations.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/combinations.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/console.ini b/lib/console.ini
new file mode 100644 (file)
index 0000000..ba89925
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=console
+tags=terminal,lib
+maintainer=Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/console.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/console.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/core/project.ini b/lib/core/project.ini
new file mode 100644 (file)
index 0000000..652d22e
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=core
+tags=lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/core
+git=https://github.com/nitlang/nit.git
+git.directory=lib/core
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 02e0b4f..c37bf25 100644 (file)
@@ -153,11 +153,11 @@ class Regex
        # Ignore case when matching letters
        var ignore_case = false is writable
 
-       # Optimize `self` for `is_in` and `String::has`, but do not support searches
+       # Optimize `self` for `String::has` and `is_in`, but do not support searches
        #
        # If `true`, `self` cannont be used with `String::search_all`, `String::replace`
        # or `String::split`.
-       var optimize_is_in = false is writable
+       var optimize_has = false is writable
 
        # Treat a newline in string as dividing string into multiple lines
        #
@@ -208,7 +208,7 @@ class Regex
                var cflags = 0
                if extended then cflags |= flag_extended
                if ignore_case then cflags |= flag_icase
-               if optimize_is_in then cflags |= flag_nosub
+               if optimize_has then cflags |= flag_nosub
                if newline then cflags |= flag_newline
 
                var native = self.native
@@ -272,6 +272,9 @@ class Regex
 
        private fun get_error(errcode: Int): String
        do
+               var native = native
+               assert native != null
+
                # Error, should be out of memory but we cover any possible error anyway
                var error_cstr = native.regerror(errcode)
 
@@ -291,6 +294,9 @@ class Regex
                var comp_res = compile
                assert comp_res == null else "Regex compilation failed with: {comp_res.message}\n".output
 
+               var native = native
+               assert native != null
+
                # Actually execute
                var eflags = gather_eflags
                var res = native.regexec_match_only(text.to_cstring, eflags)
@@ -307,7 +313,7 @@ class Regex
                abort
        end
 
-       # require: not optimize_is_in
+       # require: not optimize_has
        #
        #     assert "l".to_re.search_index_in("hello world", 0) == 2
        #     assert "el+o".to_re.search_index_in("hello world", 0) == 1
@@ -315,11 +321,14 @@ class Regex
        #     assert "z".to_re.search_index_in("hello world", 0) == -1
        redef fun search_index_in(text, from)
        do
-               assert not optimize_is_in
+               assert not optimize_has
 
                var comp_res = compile
                assert comp_res == null else "Regex compilation failed with: {comp_res.message}\n".output
 
+               var native = native
+               assert native != null
+
                # Actually execute
                text = text.to_s
                var cstr = text.substring_from(from).to_cstring
@@ -340,19 +349,23 @@ class Regex
                abort
        end
 
-       # require: not optimize_is_in
+       # require: not optimize_has
        #
        #     assert "l".to_re.search_in("hello world", 0).from == 2
        #     assert "el+o".to_re.search_in("hello world", 0).from == 1
        #     assert "l+".to_re.search_in("hello world", 3).from == 3
        #     assert "z".to_re.search_in("hello world", 0) == null
+       #     assert "cd(e)".to_re.search_in("abcdef", 2)[1].to_s == "e"
        redef fun search_in(text, from)
        do
-               assert not optimize_is_in
+               assert not optimize_has
 
                var comp_res = compile
                assert comp_res == null else "Regex compilation failed with: {comp_res.message}\n".output
 
+               var native = native
+               assert native != null
+
                # Actually execute
                text = text.to_s
                var sub = text.substring_from(from)
@@ -366,19 +379,19 @@ class Regex
 
                # Found one?
                if res == 0 then
-                       var bso = bstr.byte_to_char_index(native_match.rm_so)
-                       var ln = bstr.byte_to_char_index(native_match.rm_eo - native_match.rm_so - 1)
+                       var first_char = bstr.byte_to_char_index(native_match.rm_so)
+                       var length_char = bstr.byte_to_char_index(native_match.rm_eo - native_match.rm_so - 1) # FIXME For issue #1684
                        var match = new Match(text,
-                               from + bso,
-                               ln + 1)
+                               from + first_char,
+                               length_char + 1)
 
                        # Add sub expressions
                        for i in [1 .. nsub] do
-                               bso = bstr.byte_to_char_index(native_match[i].rm_so)
-                               ln = bstr.byte_to_char_index(native_match[i].rm_eo - native_match[i].rm_so - 1)
+                               first_char = bstr.byte_to_char_index(native_match[i].rm_so)
+                               length_char = bstr.byte_to_char_index(native_match[i].rm_eo - native_match[i].rm_so - 1) # FIXME For issue #1684
                                match.subs.add new Match( text,
-                                       bso ,
-                                       ln + 1)
+                                       from + first_char,
+                                       length_char + 1)
                        end
 
                        return match
@@ -393,17 +406,20 @@ class Regex
                abort
        end
 
-       # require: not optimize_is_in
+       # require: not optimize_has
        #
        #     assert "ab".to_re.search_all_in("abbab").join(", ") == "ab, ab"
        #     assert "b+".to_re.search_all_in("abbabaabbbbbcab").join(", ") == "bb, b, bbbbb, b"
        redef fun search_all_in(text)
        do
-               assert not optimize_is_in
+               assert not optimize_has
 
                var comp_res = compile
                assert comp_res == null else "Regex compilation failed with: {comp_res.message}\n".output
 
+               var native = native
+               assert native != null
+
                # Actually execute
                text = text.to_s
                var cstr = text.to_cstring
diff --git a/lib/counter.ini b/lib/counter.ini
new file mode 100644 (file)
index 0000000..cde38a3
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=counter
+tags=algo,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/counter.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/counter.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/cpp.ini b/lib/cpp.ini
new file mode 100644 (file)
index 0000000..7839cf6
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=cpp
+tags=language,wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/cpp.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/cpp.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index a2896d3..a09d634 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Offers features to interface with C++ code and libraries
+# Services for compatibility with C++ code and libraries
 module cpp is
        new_annotation cppflags
 end
diff --git a/lib/crypto.ini b/lib/crypto.ini
new file mode 100644 (file)
index 0000000..6487e51
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=crypto
+tags=crypto,algo,lib
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/crypto.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/crypto.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/csv/project.ini b/lib/csv/project.ini
new file mode 100644 (file)
index 0000000..b8008e0
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=csv
+tags=format,lib
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/csv/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/csv/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 11c39bf..f225a02 100644 (file)
@@ -14,7 +14,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Curl services: `CurlHTTPRequest` and `CurlMail`
+# Data transfer with URL syntax
+#
+# Download or upload over HTTP with `CurlHTTPRequest` and send emails with `CurlMail`.
 module curl
 
 import native_curl
diff --git a/lib/curl/project.ini b/lib/curl/project.ini
new file mode 100644 (file)
index 0000000..d399756
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=curl
+tags=network,wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/curl/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/curl/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/curses/project.ini b/lib/curses/project.ini
new file mode 100644 (file)
index 0000000..58813c5
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=curses
+tags=ui,terminal,wrapper,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/curses/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/curses/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/date.ini b/lib/date.ini
new file mode 100644 (file)
index 0000000..148d496
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=date
+tags=lib
+maintainer=Mehdi Ait Younes <overpex@gmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/date.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/date.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/deriving.ini b/lib/deriving.ini
new file mode 100644 (file)
index 0000000..a9205b6
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=deriving
+tags=lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/deriving.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/deriving.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/dom/project.ini b/lib/dom/project.ini
new file mode 100644 (file)
index 0000000..7b5938c
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=dom
+tags=xml,lib
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/dom/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/dom/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/dummy_array.ini b/lib/dummy_array.ini
new file mode 100644 (file)
index 0000000..b4db4f7
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=dummy_array
+tags=algo,lib
+maintainer=Floréal Morandat <morandat@lirmm.fr>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/dummy_array.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/dummy_array.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/egl.ini b/lib/egl.ini
new file mode 100644 (file)
index 0000000..b3bb784
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=egl
+tags=graphics,wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/egl.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/egl.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 781c2a4..8934b7e 100644 (file)
@@ -14,8 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# EGL is an interface between the rendering APIs OpenGL, OpenGL ES, etc.
-# and the native windowing system.
+# Interface between rendering APIs (OpenGL, OpenGL ES, etc.) and the native windowing system.
 #
 # Most services of this module are a direct wrapper of the underlying
 # C library. If a method or class is not documented in Nit, refer to
diff --git a/lib/emscripten/project.ini b/lib/emscripten/project.ini
new file mode 100644 (file)
index 0000000..9789637
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=emscripten
+tags=platform,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/emscripten
+git=https://github.com/nitlang/nit.git
+git.directory=lib/emscripten
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/filter_stream.ini b/lib/filter_stream.ini
new file mode 100644 (file)
index 0000000..5ba5b32
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=filter_stream
+tags=io,lib
+maintainer=Floréal Morandat <morandat@lirmm.fr>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/filter_stream.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/filter_stream.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/for_abuse.ini b/lib/for_abuse.ini
new file mode 100644 (file)
index 0000000..c88d7e9
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=for_abuse
+tags=algo,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/for_abuse.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/for_abuse.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/gamnit/project.ini b/lib/gamnit/project.ini
new file mode 100644 (file)
index 0000000..8a930eb
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=gamnit
+tags=game,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/gamnit/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/gamnit/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/geometry/project.ini b/lib/geometry/project.ini
new file mode 100644 (file)
index 0000000..2340920
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=geometry
+tags=algo,lib
+maintainer=Romain Chanoir <romain.chanoir@viacesi.fr>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/geometry/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/geometry/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/gettext/project.ini b/lib/gettext/project.ini
new file mode 100644 (file)
index 0000000..f16b6c4
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=gettext
+tags=i18n,lib
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/gettext
+git=https://github.com/nitlang/nit.git
+git.directory=lib/gettext
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/github/project.ini b/lib/github/project.ini
new file mode 100644 (file)
index 0000000..611019c
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=github
+tags=web,lib
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/github/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/github/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/glesv2/project.ini b/lib/glesv2/project.ini
new file mode 100644 (file)
index 0000000..9dec9a4
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=glesv2
+tags=graphics,wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/glesv2/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/glesv2/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/gpio.nit b/lib/gpio.nit
deleted file mode 100644 (file)
index cea53cb..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2013 Alexis Laferrière <alexis.laf@xymus.net>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# GPIO related functionnalities
-module gpio
-
-# A physical binary pin
-interface Pin
-       # Set the output of this pin
-       fun write(high: Bool) is abstract
-end
diff --git a/lib/graphs/project.ini b/lib/graphs/project.ini
new file mode 100644 (file)
index 0000000..a8c1513
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=graphs
+tags=algo,lib
+maintainer=Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/graphs/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/graphs/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 1d8ed48..405bb01 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Provides GTK+ widgets and functionalities
+# GTK+ widgets and services
 #
-# By default it provides services from GTK+ v3.4. You can get newer
-# features by importing submodules v3_6 or v3_8 with `import gtk::v3_6`.
+# By default provides services from GTK+ v3.4.
+# Newer features from v3.6 and v3.8 are available in the submodules v3_6 and v3_8 respectively.
 module gtk
 
 import v3_4
diff --git a/lib/gtk/project.ini b/lib/gtk/project.ini
new file mode 100644 (file)
index 0000000..a31bf4d
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=gtk
+tags=ui,wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/gtk/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/gtk/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/hash_debug.ini b/lib/hash_debug.ini
new file mode 100644 (file)
index 0000000..d1ca440
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=hash_debug
+tags=debug,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/hash_debug.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/hash_debug.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/html/project.ini b/lib/html/project.ini
new file mode 100644 (file)
index 0000000..098a6b1
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=html
+tags=format,lib
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/html/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/html/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/ini.ini b/lib/ini.ini
new file mode 100644 (file)
index 0000000..205c91a
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=ini
+tags=format,lib
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/ini.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/ini.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 9d5079d..98cb714 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# iOS services for Nit app on iOS
+# iOS platform support
 module ios
 
 import platform
diff --git a/lib/ios/project.ini b/lib/ios/project.ini
new file mode 100644 (file)
index 0000000..9f72e4d
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=ios
+tags=wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/ios/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/ios/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/java/project.ini b/lib/java/project.ini
new file mode 100644 (file)
index 0000000..59aa607
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=java
+tags=java,wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/java/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/java/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index b458d01..7df7e82 100644 (file)
@@ -15,7 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Provides two APIs to manipulate JSON strings.
+# Libraries to manipulate JSON strings.
 #
 # Both `dynamic` and `static` modules provide at least a method to parse a
 # value written in JSON, but only `static` provide a method to translate a
diff --git a/lib/json/project.ini b/lib/json/project.ini
new file mode 100644 (file)
index 0000000..0f67a08
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=json
+tags=format,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/json/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/json/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/jvm.ini b/lib/jvm.ini
new file mode 100644 (file)
index 0000000..2db3b5c
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=jvm
+tags=java,wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/jvm.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/jvm.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index a9e8920..62cebe1 100644 (file)
@@ -15,7 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Manipulates the Java Virtual Machine
+# Java Virtual Machine services
 #
 # See: http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html
 module jvm is
diff --git a/lib/libevent.ini b/lib/libevent.ini
new file mode 100644 (file)
index 0000000..28443b8
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=libevent
+tags=wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/libevent.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/libevent.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 34470ad..30f55a4 100644 (file)
@@ -18,7 +18,7 @@
 module audio
 
 import app::audio
-import mnit_linux::linux_assets
+import mnit::linux::linux_assets
 
 # Simple audio asset
 redef class Sound
diff --git a/lib/linux/project.ini b/lib/linux/project.ini
new file mode 100644 (file)
index 0000000..8a8f7e5
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=linux
+tags=lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/linux/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/linux/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/markdown/project.ini b/lib/markdown/project.ini
new file mode 100644 (file)
index 0000000..89446e0
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=markdown
+tags=format,lib
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/markdown/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/markdown/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/md5.ini b/lib/md5.ini
new file mode 100644 (file)
index 0000000..24082f0
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=md5
+tags=encoding,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/md5.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/md5.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 6495145..3fee2f8 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Implements the md5 function in C
+# Native MD5 digest implementation as `Text::md5`
 module md5
 
 in "C Header" `{
@@ -489,7 +489,7 @@ in "C Header" `{
        }
 `}
 
-redef class String
+redef class Text
        # MD5 digest of `self`
        #
        # ~~~
diff --git a/lib/meta.ini b/lib/meta.ini
new file mode 100644 (file)
index 0000000..f2bee33
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=meta
+tags=lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/meta.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/meta.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
similarity index 97%
rename from lib/mnit_android/mnit_android.nit
rename to lib/mnit/android/android.nit
index 9ba623b..5ebead7 100644 (file)
@@ -15,7 +15,7 @@
 # limitations under the License.
 
 # Android support for MNit
-module mnit_android
+module android
 
 import android_app
 import android_opengles1
similarity index 99%
rename from lib/mnit_android/android_app.nit
rename to lib/mnit/android/android_app.nit
index 41ed7f8..61af9df 100644 (file)
@@ -21,8 +21,8 @@ module android_app is android_manifest_activity """
 """
 
 import mnit
-import android
 import mnit::opengles1
+import ::android
 intrude import ::android::input_events
 
 in "C" `{
similarity index 98%
rename from lib/mnit_android/android_opengles1.nit
rename to lib/mnit/android/android_opengles1.nit
index 71e59aa..b85db15 100644 (file)
@@ -19,7 +19,6 @@
 module android_opengles1 is ldflags "-lEGL -lGLESv1_CM"
 
 import android_app
-import android
 
 in "C" `{
        #include <android_native_app_glue.h>
index d46b5e4..337304a 100644 (file)
@@ -18,7 +18,7 @@
 module assets
 
 import mnit_app
-import mnit_display
+import mnit::display
 
 # General asset
 interface Asset
similarity index 98%
rename from lib/mnit_display.nit
rename to lib/mnit/display.nit
index fad361e..8c67d13 100644 (file)
@@ -15,9 +15,9 @@
 # limitations under the License.
 
 # Defines abstract display classes
-module mnit_display
+module display
 
-import mnit_input
+import mnit::input
 
 # Any class with a size
 interface Sized
similarity index 99%
rename from lib/mnit_input.nit
rename to lib/mnit/input.nit
index ea035b3..dca8107 100644 (file)
@@ -16,7 +16,7 @@
 
 # Defines abstract classes for user and general inputs to the application.
 # Implemented independantly for each platforms and technologies.
-module mnit_input
+module input
 
 # Input to the App, propagated through `App::input`.
 interface InputEvent
similarity index 97%
rename from lib/mnit_linux/mnit_linux.nit
rename to lib/mnit/linux/linux.nit
index 3596d7e..d6515d1 100644 (file)
@@ -15,7 +15,7 @@
 # limitations under the License.
 
 # Linux support for MNit
-module mnit_linux
+module linux
 
 import linux_app
 import linux_opengles1
similarity index 98%
rename from lib/mnit_linux/linux_app.nit
rename to lib/mnit/linux/linux_app.nit
index 45d15c1..938bfd8 100644 (file)
@@ -19,7 +19,7 @@ module linux_app
 import mnit
 import sdl
 import linux_opengles1
-import linux
+import ::linux
 
 in "C" `{
        #include <EGL/egl.h>
index af897a2..98641f7 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# General module for cross-compatibility between multiple platforms
+# Multiplatform game framework for Nit
 module mnit
 
 import mnit_app
index 9987b8c..4ae8b89 100644 (file)
@@ -18,7 +18,7 @@
 module mnit_app
 
 import ::app
-import mnit_display
+import mnit::display
 
 # An App instance serves as base to every Mnit projects.
 #
index 3ee92fe..e2b02bc 100644 (file)
@@ -17,7 +17,7 @@
 # OpenGL ES1 general support (most of it)
 module opengles1 is pkgconfig("glesv1_cm", "egl")
 
-import mnit_display
+import mnit::display
 
 in "C header" `{
        #include <EGL/egl.h>
diff --git a/lib/mnit/project.ini b/lib/mnit/project.ini
new file mode 100644 (file)
index 0000000..8b19d29
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=mnit
+tags=lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/mnit/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/mnit/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index c9dbb16..3193993 100644 (file)
@@ -15,7 +15,7 @@
 # Manage images that are tileset or glyphset (for bitmap fonts)
 module tileset
 
-import mnit_display
+import mnit::display
 
 # Efficiently retrieve tiles in a big image
 class TileSet
diff --git a/lib/mongodb/project.ini b/lib/mongodb/project.ini
new file mode 100644 (file)
index 0000000..5c13675
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=mongodb
+tags=database,lib
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/mongodb/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/mongodb/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/more_collections.ini b/lib/more_collections.ini
new file mode 100644 (file)
index 0000000..0f4e4e3
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=more_collections
+tags=algo,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/more_collections.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/more_collections.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/mpd.ini b/lib/mpd.ini
new file mode 100644 (file)
index 0000000..c687789
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=mpd
+tags=sound,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/mpd.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/mpd.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index e814b56..727ac60 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Client for a MPD server
+# Music Player Daemon client library
 module mpd
 
 import socket
diff --git a/lib/mpi/project.ini b/lib/mpi/project.ini
new file mode 100644 (file)
index 0000000..8a3f9cd
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=mpi
+tags=parallelism,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/mpi
+git=https://github.com/nitlang/nit.git
+git.directory=lib/mpi
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/neo4j/project.ini b/lib/neo4j/project.ini
new file mode 100644 (file)
index 0000000..981b3ec
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=neo4j
+tags=database,lib
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/neo4j/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/neo4j/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/nitcc_runtime.ini b/lib/nitcc_runtime.ini
new file mode 100644 (file)
index 0000000..ae672b3
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=nitcc_runtime
+tags=lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/nitcc_runtime.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/nitcc_runtime.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/nitcorn/project.ini b/lib/nitcorn/project.ini
new file mode 100644 (file)
index 0000000..4dd2c83
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=nitcorn
+tags=network,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/nitcorn/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/nitcorn/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/niti_runtime.ini b/lib/niti_runtime.ini
new file mode 100644 (file)
index 0000000..200dbd0
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=niti_runtime
+tags=lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/niti_runtime.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/niti_runtime.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/noise.ini b/lib/noise.ini
new file mode 100644 (file)
index 0000000..2c1968d
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=noise
+tags=algo,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/noise.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/noise.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 9a1ecc0..ba09bc1 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Provides the noise generators `PerlinNoise` and `InterpolatedNoise`
+# Noise generators `PerlinNoise` and `InterpolatedNoise`
 module noise is serialize
 
 import serialization
diff --git a/lib/opts.ini b/lib/opts.ini
new file mode 100644 (file)
index 0000000..b7e8fc8
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=opts
+tags=cli,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/opts.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/opts.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/ordered_tree.ini b/lib/ordered_tree.ini
new file mode 100644 (file)
index 0000000..abb5df0
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=ordered_tree
+tags=algo,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/ordered_tree.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/ordered_tree.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/parser_base.ini b/lib/parser_base.ini
new file mode 100644 (file)
index 0000000..db32dbd
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=parser_base
+tags=format,lib
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/parser_base.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/parser_base.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/perfect_hashing.ini b/lib/perfect_hashing.ini
new file mode 100644 (file)
index 0000000..d309a96
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=perfect_hashing
+tags=algo,lib
+maintainer=Julien Pagès <julien.projet@gmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/perfect_hashing.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/perfect_hashing.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/performance_analysis.ini b/lib/performance_analysis.ini
new file mode 100644 (file)
index 0000000..a6977ec
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=performance_analysis
+tags=debug,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/performance_analysis.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/performance_analysis.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/pipeline.ini b/lib/pipeline.ini
new file mode 100644 (file)
index 0000000..1a558a0
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=pipeline
+tags=algo,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/pipeline.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/pipeline.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/pnacl/project.ini b/lib/pnacl/project.ini
new file mode 100644 (file)
index 0000000..dd0b3da
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=pnacl
+tags=platform,lib
+maintainer=Johan Kayser <johan.kayser@viacesi.fr>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/pnacl
+git=https://github.com/nitlang/nit.git
+git.directory=lib/pnacl
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/poset.ini b/lib/poset.ini
new file mode 100644 (file)
index 0000000..e5b5d3f
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=poset
+tags=algo,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/poset.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/poset.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/posix_ext.ini b/lib/posix_ext.ini
new file mode 100644 (file)
index 0000000..16b1708
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=posix_ext
+tags=wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/posix_ext.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/posix_ext.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/privileges/project.ini b/lib/privileges/project.ini
new file mode 100644 (file)
index 0000000..e92dfbc
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=privileges
+tags=lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/privileges/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/privileges/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/progression.ini b/lib/progression.ini
new file mode 100644 (file)
index 0000000..5297892
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=progression
+tags=lib
+maintainer=Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/progression.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/progression.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/pthreads/project.ini b/lib/pthreads/project.ini
new file mode 100644 (file)
index 0000000..292b853
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=pthreads
+tags=parallelism,wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/pthreads/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/pthreads/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/realtime.ini b/lib/realtime.ini
new file mode 100644 (file)
index 0000000..e80fb32
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=realtime
+tags=lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/realtime.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/realtime.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index ad64930..8cfa4da 100644 (file)
@@ -10,7 +10,7 @@
 # You  are  allowed  to  redistribute it and sell it, alone or is a part of
 # another product.
 
-# Provides the Clock utility class to keep time of real time flow
+# Services to keep time of the wall clock time
 module realtime is ldflags "-lrt"
 
 in "C header" `{
diff --git a/lib/ropes_debug.ini b/lib/ropes_debug.ini
new file mode 100644 (file)
index 0000000..8fa6a63
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=ropes_debug
+tags=debug,lib
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/ropes_debug.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/ropes_debug.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/sax/project.ini b/lib/sax/project.ini
new file mode 100644 (file)
index 0000000..71d9bc2
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=sax
+tags=xml,format,lib
+maintainer=Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/sax/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/sax/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/saxophonit/project.ini b/lib/saxophonit/project.ini
new file mode 100644 (file)
index 0000000..30e6534
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=saxophonit
+tags=xml,format,lib
+maintainer=Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/saxophonit/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/saxophonit/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index a5e1365..6e9254e 100644 (file)
@@ -67,7 +67,7 @@ class XophonReaderModel
 
 
        init do
-               qname_re.optimize_is_in = true
+               qname_re.optimize_has = true
                features[feature_namespaces_uri] = true
                features[feature_namespace_prefixes_uri] = false
        end
diff --git a/lib/scene2d.ini b/lib/scene2d.ini
new file mode 100644 (file)
index 0000000..8633dcd
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=scene2d
+tags=game,lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/scene2d.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/scene2d.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/sdl.ini b/lib/sdl.ini
new file mode 100644 (file)
index 0000000..4020e46
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=sdl
+tags=graphics,wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/sdl.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/sdl.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index db0f700..ed60975 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# SDL display support (used in Linux for windows and inputes only)
+# Simple DirectMedia Layer
 module sdl is
        cflags exec("sdl-config", "--cflags")
        ldflags(exec("sdl-config", "--libs"), "-lSDL_image -lSDL_ttf")
 end
 
-import mnit_display
+import mnit::display
 import c
 
 in "C header" `{
@@ -77,15 +77,15 @@ extern class SDLDisplay `{SDL_Surface *`}
                SDL_FillRect(self, NULL, SDL_MapRGB(self->format,r,g,b));
        `}
 
-       redef fun width: Int `{ return self->w; `}
-       redef fun height: Int `{ return self->h; `}
+       redef fun width `{ return self->w; `}
+       redef fun height `{ return self->h; `}
 
        # Fill a rectangle with given color
        fun fill_rect(rect: SDLRectangle, r, g, b: Int) `{
                SDL_FillRect(self, rect,  SDL_MapRGB(self->format,r,g,b));
        `}
 
-       redef fun clear(r, g, b: Float) `{
+       redef fun clear(r, g, b) `{
                Uint8 ri, gi, bi;
                ri = (Uint8)r*255;
                gi = (Uint8)g*255;
@@ -247,8 +247,8 @@ extern class SDLImage
        # Destroy the image and free the memory
        redef fun destroy `{ SDL_FreeSurface(self); `}
 
-       redef fun width: Int `{ return self->w; `}
-       redef fun height: Int `{ return self->h; `}
+       redef fun width `{ return self->w; `}
+       redef fun height `{ return self->h; `}
 
        fun is_ok: Bool do return not address_is_null
 
@@ -309,8 +309,8 @@ class SDLMouseButtonEvent
 
        var button: Int
 
-       redef var pressed: Bool
-       redef fun depressed: Bool do return not pressed
+       redef var pressed
+       redef fun depressed do return not pressed
 
        # Is this event raised by the left button?
        fun is_left_button: Bool do return button == 1
@@ -355,8 +355,8 @@ class SDLMouseMotionEvent
        var rel_x: Float
        var rel_y: Float
 
-       redef var pressed: Bool
-       redef fun depressed: Bool do return not pressed
+       redef var pressed
+       redef fun depressed do return not pressed
 
        init (x, y, rel_x, rel_y: Float, pressed: Bool)
        do
@@ -384,7 +384,7 @@ class SDLKeyEvent
                self.down = down
        end
 
-       redef fun to_c: nullable Char
+       redef fun to_c
        do
                if name.length == 1 then return name.chars.first
                return null
diff --git a/lib/sdl2/project.ini b/lib/sdl2/project.ini
new file mode 100644 (file)
index 0000000..5a919d5
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=sdl2
+tags=graphics,wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/sdl2/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/sdl2/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/sendmail.ini b/lib/sendmail.ini
new file mode 100644 (file)
index 0000000..09e35a1
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=sendmail
+tags=network,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/sendmail.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/sendmail.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/serialization/project.ini b/lib/serialization/project.ini
new file mode 100644 (file)
index 0000000..b124e84
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=serialization
+tags=lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/serialization/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/serialization/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/sexp.ini b/lib/sexp.ini
new file mode 100644 (file)
index 0000000..ff6a8e7
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=sexp
+tags=format,lib
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/sexp.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/sexp.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/sha1.ini b/lib/sha1.ini
new file mode 100644 (file)
index 0000000..3b0a2e2
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=sha1
+tags=encoding,lib
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/sha1.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/sha1.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/signals.ini b/lib/signals.ini
new file mode 100644 (file)
index 0000000..8dc022a
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=signals
+tags=wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/signals.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/signals.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 6fd06d0..440fd39 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Module to manage standard C signals
+# ANSI C signal handling
 #
 # Common usage imply 5 steps:
 #
diff --git a/lib/socket/project.ini b/lib/socket/project.ini
new file mode 100644 (file)
index 0000000..425c71e
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=socket
+tags=network,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/socket/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/socket/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/sqlite3/project.ini b/lib/sqlite3/project.ini
new file mode 100644 (file)
index 0000000..f995fb3
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=sqlite3
+tags=database,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/sqlite3/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/sqlite3/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/standard.ini b/lib/standard.ini
new file mode 100644 (file)
index 0000000..4e237cc
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=standard
+tags=lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/standard.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/standard.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/symbol.ini b/lib/symbol.ini
new file mode 100644 (file)
index 0000000..e26d60d
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=symbol
+tags=lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/symbol.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/symbol.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/template/project.ini b/lib/template/project.ini
new file mode 100644 (file)
index 0000000..110f7d1
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=template
+tags=lib
+maintainer=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/template/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/template/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/test_suite.ini b/lib/test_suite.ini
new file mode 100644 (file)
index 0000000..2004d3c
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=test_suite
+tags=devel,lib
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/test_suite.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/test_suite.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/trees/project.ini b/lib/trees/project.ini
new file mode 100644 (file)
index 0000000..20467d4
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=trees
+tags=algo,lib
+maintainer=Alexandre Terrasa <alexandre@moz-code.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/trees/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/trees/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/websocket/project.ini b/lib/websocket/project.ini
new file mode 100644 (file)
index 0000000..e6bd0fc
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=websocket
+tags=network,lib
+maintainer=Lucas Bajolet <r4pass@hotmail.com>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/websocket/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/websocket/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/lib/x11.ini b/lib/x11.ini
new file mode 100644 (file)
index 0000000..12fa59e
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=x11
+tags=ui,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/x11.nit
+git=https://github.com/nitlang/nit.git
+git.directory=lib/x11.nit
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index 1ba2d13..bd5d82a 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Serices from the X11 library
+# Services from the X11 library
 module x11 is pkgconfig
 
 `{
@@ -31,7 +31,7 @@ fun x_open_default_display: Pointer `{
 # Open a specific display
 #
 # `name` is in the format: "hostname:number.screen_number"
-# 
+#
 # See <http://www.x.org/releases/X11R7.7/doc/man/man3/XOpenDisplay.3.xhtml>
 fun x_open_display(name: String): Pointer import String.to_cstring `{
        return (void*)XOpenDisplay(String_to_cstring(name));
diff --git a/lib/xdg_basedir/project.ini b/lib/xdg_basedir/project.ini
new file mode 100644 (file)
index 0000000..cf51920
--- /dev/null
@@ -0,0 +1,11 @@
+[project]
+name=xdg_basedir
+tags=wrapper,lib
+maintainer=Alexis Laferrière <alexis.laf@xymus.net>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/lib/xdg_basedir/
+git=https://github.com/nitlang/nit.git
+git.directory=lib/xdg_basedir/
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
diff --git a/src/nitcatalog.nit b/src/nitcatalog.nit
new file mode 100644 (file)
index 0000000..6aba6f1
--- /dev/null
@@ -0,0 +1,815 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Basic catalog generator for Nit projects
+#
+# See: <http://nitlanguage.org/catalog/>
+#
+# The tool scans projects and generates the HTML files of a catalog.
+#
+# ## Features
+#
+# * [X] scan projects and their `.ini`
+# * [X] generate lists of projects
+# * [X] generate a page per project with the readme and most metadata
+# * [ ] link/include/be included in the documentation
+# * [ ] propose `related projects`
+# * [ ] show directory content (a la nitls)
+# * [X] gather git information from the working directory
+# * [ ] gather git information from the repository
+# * [ ] gather project information from github
+# * [ ] gather people information from github
+# * [ ] reify people
+# * [ ] separate information gathering from rendering
+# * [ ] move up information gathering in (existing or new) service modules
+# * [ ] add command line options
+# * [ ] harden HTML (escaping, path injection, etc)
+# * [ ] nitcorn server with RESTful API
+#
+# ## Issues and limitations
+#
+# The tool works likee the other tools and expects to find valid Nit source code in the directories
+#
+# * cruft and temporary files will be collected
+# * missing source file (e.g. not yet generated by nitcc) will make information
+#   incomplete (e.g. invalid module thus partial dependency and metrics)
+#
+# How to use the tool as the basis of a Nit code archive on the web usable with a package manager is not clear.
+module nitcatalog
+
+import loader # Scan&load projects, groups and modules
+import doc::doc_down # Display mdoc
+import md5 # To get gravatar images
+import counter # For statistics
+import modelize # To process and count classes and methods
+
+redef class MProject
+       # Return the associated metadata from the `ini`, if any
+       fun metadata(key: String): nullable String
+       do
+               var ini = self.ini
+               if ini == null then return null
+               return ini[key]
+       end
+
+       # The list of maintainers
+       var maintainers = new Array[String]
+
+       # The list of contributors
+       var contributors = new Array[String]
+
+       # The date of the most recent commit
+       var last_date: nullable String = null
+
+       # The date of the oldest commit
+       var first_date: nullable String = null
+end
+
+# A HTML page in a catalog
+#
+# This is just a template with the header pre-filled and the footer injected at rendering.
+# Therefore, once instantiated, the content can just be added to it.
+class CatalogPage
+       super Template
+
+       # Placeholder to include additional things before the `</head>`.
+       var more_head = new Template
+
+       redef init
+       do
+               add """
+<!DOCTYPE html>
+<html>
+<head>
+       <meta charset="utf-8">
+       <link rel="stylesheet" media="all" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
+       <link rel="stylesheet" media="all" href="style.css">
+"""
+               add more_head
+
+               add """
+</head>
+<body>
+<div class='container-fluid'>
+ <div class='row'>
+  <nav id='topmenu' class='navbar navbar-default navbar-fixed-top' role='navigation'>
+   <div class='container-fluid'>
+    <div class='navbar-header'>
+     <button type='button' class='navbar-toggle' data-toggle='collapse' data-target='#topmenu-collapse'>
+      <span class='sr-only'>Toggle menu</span>
+      <span class='icon-bar'></span>
+      <span class='icon-bar'></span>
+      <span class='icon-bar'></span>
+     </button>
+     <span class='navbar-brand'><a href="http://nitlanguage.org/">Nitlanguage.org</a></span>
+    </div>
+    <div class='collapse navbar-collapse' id='topmenu-collapse'>
+     <ul class='nav navbar-nav'>
+      <li><a href="index.html">Catalog</a></li>
+     </ul>
+    </div>
+   </div>
+  </nav>
+ </div>
+"""
+       end
+
+       redef fun rendering
+       do
+               add """
+</div> <!-- container-fluid -->
+<script src='https://code.jquery.com/jquery-latest.min.js'></script>
+<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js'></script>
+<script src='https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.8.1/bootstrap-table-all.min.js'></script>
+</body>
+</html>
+"""
+       end
+end
+
+redef class Int
+       # Returns `log(self+1)`. Used to compute score of projects
+       fun score: Float do return (self+1).to_f.log
+end
+
+# The main class of the calatog generator that has the knowledge
+class Catalog
+
+       # The modelbuilder
+       # used to access the files and count source lines of code
+       var modelbuilder: ModelBuilder
+
+       # Projects by tag
+       var tag2proj = new MultiHashMap[String, MProject]
+
+       # Projects by category
+       var cat2proj = new MultiHashMap[String, MProject]
+
+       # Projects by maintainer
+       var maint2proj = new MultiHashMap[String, MProject]
+
+       # Projects by contributors
+       var contrib2proj = new MultiHashMap[String, MProject]
+
+       # Dependency between projects
+       var deps = new POSet[MProject]
+
+       # Number of modules by project
+       var mmodules = new Counter[MProject]
+
+       # Number of classes by project
+       var mclasses = new Counter[MProject]
+
+       # Number of methods by project
+       var mmethods = new Counter[MProject]
+
+       # Number of line of code by project
+       var loc = new Counter[MProject]
+
+       # Number of commits by project
+       var commits = new Counter[MProject]
+
+       # Score by project
+       #
+       # The score is loosely computed using other metrics
+       var score = new Counter[MProject]
+
+       # Scan, register and add a contributor to a project
+       fun add_contrib(person: String, mproject: MProject, res: Template)
+       do
+               var projs = contrib2proj[person]
+               if not projs.has(mproject) then projs.add mproject
+               var name = person
+               var email = null
+               var page = null
+
+               # Regular expressions are broken, need to investigate.
+               # So split manually.
+               #
+               #var re = "([^<(]*?)(<([^>]*?)>)?(\\((.*)\\))?".to_re
+               #var m = (person+" ").search(re)
+               #print "{person}: `{m or else "?"}` `{m[1] or else "?"}` `{m[3] or else "?"}` `{m[5] or else "?"}`"
+               do
+                       var sp1 = person.split_once_on("<")
+                       if sp1.length < 2 then
+                               break
+                       end
+                       var sp2 = sp1.last.split_once_on(">")
+                       if sp2.length < 2 then
+                               break
+                       end
+                       name = sp1.first.trim
+                       email = sp2.first.trim
+                       var sp3 = sp2.last.split_once_on("(")
+                       if sp3.length < 2 then
+                               break
+                       end
+                       var sp4 = sp3.last.split_once_on(")")
+                       if sp4.length < 2 then
+                               break
+                       end
+                       page = sp4.first.trim
+               end
+
+               var e = name.html_escape
+               res.add "<li>"
+               if page != null then
+                       res.add "<a href=\"{page.html_escape}\">"
+               end
+               if email != null then
+                       # TODO get more things from github by using the email as a key
+                       # "https://api.github.com/search/users?q={email}+in:email"
+                       var md5 = email.md5.to_lower
+                       res.add "<img src=\"https://secure.gravatar.com/avatar/{md5}?size=20&amp;default=retro\">&nbsp;"
+               end
+               res.add "{e}"
+               if page != null then res.add "</a>"
+               res.add "</li>"
+       end
+
+
+       # Compute information and generate a full HTML page for a project
+       fun project_page(mproject: MProject): Writable
+       do
+               var res = new CatalogPage
+               var score = score[mproject].to_f
+               var name = mproject.name.html_escape
+               res.more_head.add """<title>{{{name}}}</title>"""
+
+               res.add """
+<div class="content">
+<h1 class="package-name">{{{name}}}</h1>
+"""
+               var mdoc = mproject.mdoc_or_fallback
+               if mdoc != null then
+                       score += 100.0
+                       res.add mdoc.html_documentation
+                       score += mdoc.content.length.score
+               end
+               res.add """
+</div>
+<div class="sidebar">
+<ul class="box">
+"""
+               var homepage = mproject.metadata("upstream.homepage")
+               if homepage != null then
+                       score += 5.0
+                       var e = homepage.html_escape
+                       res.add "<li><a href=\"{e}\">{e}</a></li>\n"
+               end
+               var maintainer = mproject.metadata("project.maintainer")
+               if maintainer != null then
+                       score += 5.0
+                       add_contrib(maintainer, mproject, res)
+                       mproject.maintainers.add maintainer
+                       var projs = maint2proj[maintainer]
+                       if not projs.has(mproject) then projs.add mproject
+               end
+               var license = mproject.metadata("project.license")
+               if license != null then
+                       score += 5.0
+                       var e = license.html_escape
+                       res.add "<li><a href=\"http://opensource.org/licenses/{e}\">{e}</a> license</li>\n"
+               end
+               res.add "</ul>\n"
+
+               res.add "<h3>Source Code</h3>\n<ul class=\"box\">\n"
+               var browse = mproject.metadata("upstream.browse")
+               if browse != null then
+                       score += 5.0
+                       var e = browse.html_escape
+                       res.add "<li><a href=\"{e}\">{e}</a></li>\n"
+               end
+               var git = mproject.metadata("upstream.git")
+               if git != null then
+                       var e = git.html_escape
+                       res.add "<li><tt>{e}</tt></li>\n"
+               end
+               var last_date = mproject.last_date
+               if last_date != null then
+                       var e = last_date.html_escape
+                       res.add "<li>most recent commit: {e}</li>\n"
+               end
+               var first_date = mproject.first_date
+               if first_date != null then
+                       var e = first_date.html_escape
+                       res.add "<li>oldest commit: {e}</li>\n"
+               end
+               var commits = commits[mproject]
+               if commits != 0 then
+                       res.add "<li>{commits} commits</li>\n"
+               end
+               res.add "</ul>\n"
+
+               res.add "<h3>Tags</h3>\n"
+               var tags = mproject.metadata("project.tags")
+               var ts2 = new Array[String]
+               var cat = null
+               if tags != null then
+                       var ts = tags.split(",")
+                       for t in ts do
+                               t = t.trim
+                               if t == "" then continue
+                               if cat == null then cat = t
+                               tag2proj[t].add mproject
+                               t = t.html_escape
+                               ts2.add "<a href=\"index.html#tag_{t}\">{t}</a>"
+                       end
+                       res.add_list(ts2, ", ", ", ")
+               end
+               if ts2.is_empty then
+                       var t = "none"
+                       cat = t
+                       tag2proj[t].add mproject
+                       res.add "<a href=\"index.html#tag_{t}\">{t}</a>"
+               end
+               if cat != null then cat2proj[cat].add mproject
+               score += ts2.length.score
+
+               var reqs = deps[mproject].greaters.to_a
+               reqs.remove(mproject)
+               alpha_comparator.sort(reqs)
+               res.add "<h3>Requirements</h3>\n"
+               if reqs.is_empty then
+                       res.add "none"
+               else
+                       var list = new Array[String]
+                       for r in reqs do
+                               var direct = deps.has_direct_edge(mproject, r)
+                               var s = "<a href=\"{r}.html\">"
+                               if direct then s += "<strong>"
+                               s += r.to_s
+                               if direct then s += "</strong>"
+                               s += "</a>"
+                               list.add s
+                       end
+                       res.add_list(list, ", ", " and ")
+               end
+
+               reqs = deps[mproject].smallers.to_a
+               reqs.remove(mproject)
+               alpha_comparator.sort(reqs)
+               res.add "<h3>Clients</h3>\n"
+               if reqs.is_empty then
+                       res.add "none"
+               else
+                       var list = new Array[String]
+                       for r in reqs do
+                               var direct = deps.has_direct_edge(r, mproject)
+                               var s = "<a href=\"{r}.html\">"
+                               if direct then s += "<strong>"
+                               s += r.to_s
+                               if direct then s += "</strong>"
+                               s += "</a>"
+                               list.add s
+                       end
+                       res.add_list(list, ", ", " and ")
+               end
+
+               score += deps[mproject].greaters.length.score
+               score += deps[mproject].direct_greaters.length.score
+               score += deps[mproject].smallers.length.score
+               score += deps[mproject].direct_smallers.length.score
+
+               var contributors = mproject.contributors
+               if not contributors.is_empty then
+                       res.add "<h3>Contributors</h3>\n<ul class=\"box\">"
+                       for c in contributors do
+                               add_contrib(c, mproject, res)
+                       end
+                       res.add "</ul>"
+               end
+               score += contributors.length.to_f
+
+               var mmodules = 0
+               var mclasses = 0
+               var mmethods = 0
+               var loc = 0
+               for g in mproject.mgroups do
+                       mmodules += g.module_paths.length
+                       for m in g.mmodules do
+                               var am = modelbuilder.mmodule2node(m)
+                               if am != null then
+                                       var file = am.location.file
+                                       if file != null then
+                                               loc += file.line_starts.length - 1
+                                       end
+                               end
+                               for cd in m.mclassdefs do
+                                       mclasses += 1
+                                       for pd in cd.mpropdefs do
+                                               if not pd isa MMethodDef then continue
+                                               mmethods += 1
+                                       end
+                               end
+                       end
+               end
+               self.mmodules[mproject] = mmodules
+               self.mclasses[mproject] = mclasses
+               self.mmethods[mproject] = mmethods
+               self.loc[mproject] = loc
+
+               #score += mmodules.score
+               score += mclasses.score
+               score += mmethods.score
+               score += loc.score
+
+               res.add """
+<h3>Stats</h3>
+<ul class="box">
+<li>{{{mmodules}}} modules</li>
+<li>{{{mclasses}}} classes</li>
+<li>{{{mmethods}}} methods</li>
+<li>{{{loc}}} lines of code</li>
+</ul>
+"""
+
+               res.add """
+</div>
+"""
+               self.score[mproject] = score.to_i
+
+               return res
+       end
+
+       # Return a short HTML sequence for a project
+       #
+       # Intended to use in lists.
+       fun li_project(p: MProject): String
+       do
+               var res = ""
+               var f = "{p.name}.html"
+               res += "<a href=\"{f}\">{p}</a>"
+               var d = p.mdoc_or_fallback
+               if d != null then res += " - {d.html_synopsis.write_to_string}"
+               return res
+       end
+
+       # List projects by group.
+       #
+       # For each key of the `map` a `<h3>` is generated.
+       # Each project is then listed.
+       #
+       # The list of keys is generated first to allow fast access to the correct `<h3>`.
+       # `id_prefix` is used to give an id to the `<h3>` element.
+       fun list_by(map: MultiHashMap[String, MProject], id_prefix: String): Template
+       do
+               var res = new Template
+               var keys = map.keys.to_a
+               alpha_comparator.sort(keys)
+               var list = [for x in keys do "<a href=\"#{id_prefix}{x.html_escape}\">{x.html_escape}</a>"]
+               res.add_list(list, ", ", " and ")
+
+               for k in keys do
+                       var projs = map[k].to_a
+                       alpha_comparator.sort(projs)
+                       var e = k.html_escape
+                       res.add "<h3 id=\"{id_prefix}{e}\">{e} ({projs.length})</h3>\n<ul>\n"
+                       for p in projs do
+                               res.add "<li>"
+                               res.add li_project(p)
+                               res.add "</li>"
+                       end
+                       res.add "</ul>"
+               end
+               return res
+       end
+
+       # List the 10 best projects from `cpt`
+       fun list_best(cpt: Counter[MProject]): Template
+       do
+               var res = new Template
+               res.add "<ul>"
+               var best = cpt.sort
+               for i in [1..10] do
+                       if i > best.length then break
+                       var p = best[best.length-i]
+                       res.add "<li>"
+                       res.add li_project(p)
+                       # res.add " ({cpt[p]})"
+                       res.add "</li>"
+               end
+               res.add "</ul>"
+               return res
+       end
+
+       # Collect more information on a project using the `git` tool.
+       fun git_info(mproject: MProject)
+       do
+               var ini = mproject.ini
+               if ini == null then return
+
+               # TODO use real git info
+               #var repo = ini.get_or_null("upstream.git")
+               #var branch = ini.get_or_null("upstream.git.branch")
+               #var directory = ini.get_or_null("upstream.git.directory")
+
+               var dirpath = mproject.root.filepath
+               if dirpath == null then return
+
+               # Collect commits info
+               var res = git_run("log", "--no-merges", "--follow", "--pretty=tformat:%ad;%aN <%aE>", "--", dirpath)
+               var contributors = new Counter[String]
+               var commits = res.split("\n")
+               if commits.not_empty and commits.last == "" then commits.pop
+               self.commits[mproject] = commits.length
+               for l in commits do
+                       var s = l.split_once_on(';')
+                       if s.length != 2 or s.last == "" then continue
+
+                       # Collect date of last and first commit
+                       if mproject.last_date == null then mproject.last_date = s.first
+                       mproject.first_date = s.first
+
+                       # Count contributors
+                       contributors.inc(s.last)
+               end
+               for c in contributors.sort.reverse_iterator do
+                       mproject.contributors.add c
+               end
+
+       end
+
+       # Produce a HTML table containig information on the projects
+       #
+       # `project_page` must have been called before so that information is computed.
+       fun table_projects(mprojects: Array[MProject]): Template
+       do
+               alpha_comparator.sort(mprojects)
+               var res = new Template
+               res.add "<table data-toggle=\"table\" data-sort-name=\"name\" data-sort-order=\"desc\" width=\"100%\">\n"
+               res.add "<thead><tr>\n"
+               res.add "<th data-field=\"name\" data-sortable=\"true\">name</th>\n"
+               res.add "<th data-field=\"maint\" data-sortable=\"true\">maint</th>\n"
+               res.add "<th data-field=\"contrib\" data-sortable=\"true\">contrib</th>\n"
+               res.add "<th data-field=\"reqs\" data-sortable=\"true\">reqs</th>\n"
+               res.add "<th data-field=\"dreqs\" data-sortable=\"true\">direct<br>reqs</th>\n"
+               res.add "<th data-field=\"cli\" data-sortable=\"true\">clients</th>\n"
+               res.add "<th data-field=\"dcli\" data-sortable=\"true\">direct<br>clients</th>\n"
+               res.add "<th data-field=\"mod\" data-sortable=\"true\">modules</th>\n"
+               res.add "<th data-field=\"cla\" data-sortable=\"true\">classes</th>\n"
+               res.add "<th data-field=\"met\" data-sortable=\"true\">methods</th>\n"
+               res.add "<th data-field=\"loc\" data-sortable=\"true\">lines</th>\n"
+               res.add "<th data-field=\"score\" data-sortable=\"true\">score</th>\n"
+               res.add "</tr></thead>"
+               for p in mprojects do
+                       res.add "<tr>"
+                       res.add "<td><a href=\"{p.name}.html\">{p.name}</a></td>"
+                       var maint = "?"
+                       if p.maintainers.not_empty then maint = p.maintainers.first
+                       res.add "<td>{maint}</td>"
+                       res.add "<td>{p.contributors.length}</td>"
+                       res.add "<td>{deps[p].greaters.length-1}</td>"
+                       res.add "<td>{deps[p].direct_greaters.length}</td>"
+                       res.add "<td>{deps[p].smallers.length-1}</td>"
+                       res.add "<td>{deps[p].direct_smallers.length}</td>"
+                       res.add "<td>{mmodules[p]}</td>"
+                       res.add "<td>{mclasses[p]}</td>"
+                       res.add "<td>{mmethods[p]}</td>"
+                       res.add "<td>{loc[p]}</td>"
+                       res.add "<td>{score[p]}</td>"
+                       res.add "</tr>\n"
+               end
+               res.add "</table>\n"
+               return res
+       end
+end
+
+# Execute a git command and return the result
+fun git_run(command: String...): String
+do
+       # print "git {command.join(" ")}"
+       var p = new ProcessReader("git", command...)
+       var res = p.read_all
+       p.close
+       p.wait
+       return res
+end
+
+var model = new Model
+var tc = new ToolContext
+
+tc.process_options(sys.args)
+tc.keep_going = true
+
+var modelbuilder = new ModelBuilder(model, tc)
+var catalog = new Catalog(modelbuilder)
+
+# Get files or groups
+for a in tc.option_context.rest do
+       modelbuilder.get_mgroup(a)
+       modelbuilder.identify_file(a)
+end
+
+# Scan projects and compute information
+for p in model.mprojects do
+       var g = p.root
+       assert g != null
+       modelbuilder.scan_group(g)
+
+       # Load the module to process importation information
+       modelbuilder.parse_group(g)
+
+       catalog.deps.add_node(p)
+       for gg in p.mgroups do for m in gg.mmodules do
+               for im in m.in_importation.direct_greaters do
+                       var ip = im.mproject
+                       if ip == null or ip == p then continue
+                       catalog.deps.add_edge(p, ip)
+               end
+       end
+
+       catalog.git_info(p)
+end
+
+# Run phases to modelize classes and properties (so we can count them)
+#modelbuilder.run_phases
+
+var out = "out"
+out.mkdir
+
+# Generate the css (hard coded)
+var css = """
+body {
+margin-top:                    15px;
+background-color:              #f8f8f8;
+}
+
+a {
+color:                         #0D8921;
+text-decoration:               none;
+}
+
+a:hover {
+color:                         #333;
+text-decoration:               none;
+}
+
+h1 {
+font-weight:                   bold;
+color:                          #0D8921;
+font-size:                     22px;
+}
+
+h2 {
+color:                          #6C6C6C;
+font-size:                     18px;
+border-bottom:                 solid 3px #CCC;
+}
+
+h3 {
+color:                          #6C6C6C;
+font-size:                     15px;
+border-bottom:                 solid 1px #CCC;
+}
+
+ul {
+list-style-type:               square;
+}
+
+dd {
+color:                         #6C6C6C;
+margin-top:                    1em;
+margin-bottom:                 1em;
+}
+
+pre {
+border:                                1px solid #CCC;
+font-family:                   Monospace;
+color:                         #2d5003;
+background-color:              rgb(250, 250, 250);
+}
+
+code {
+font-family:                   Monospace;
+color:                         #2d5003;
+}
+
+footer {
+margin-top:                    20px;
+}
+
+.container {
+margin:                                0 auto;
+padding:                       0 20px;
+}
+
+.content {
+float:                         left;
+margin-top:                    40px;
+width:                         65%;
+}
+
+.sidebar {
+float:                         right;
+margin-top:                    40px;
+width:                         30%
+}
+
+.sidebar h3 {
+color:                          #0D8921;
+font-size:                     18px;
+border-bottom:                 0px;
+}
+
+.box {
+margin:                                0;
+padding:                       0;
+}
+
+.box li {
+line-height:                   2.5;
+white-space:                   nowrap;
+overflow:                      hidden;
+text-overflow:                 ellipsis;
+padding-right:                 10px;
+border-bottom:                 1px solid rgba(0,0,0,0.2);
+}
+"""
+css.write_to_file(out/"style.css")
+
+# PAGES
+
+for p in model.mprojects do
+       # print p
+       var f = "{p.name}.html"
+       catalog.project_page(p).write_to_file(out/f)
+end
+
+# INDEX
+
+var index = new CatalogPage
+index.more_head.add "<title>Projects in Nit</title>"
+
+index.add """
+<div class="content">
+<h1>Projects in Nit</h1>
+"""
+
+index.add "<h2>Highlighted Projects</h2>\n"
+index.add catalog.list_best(catalog.score)
+
+index.add "<h2>Most Required</h2>\n"
+var reqs = new Counter[MProject]
+for p in model.mprojects do
+       reqs[p] = catalog.deps[p].smallers.length - 1
+end
+index.add catalog.list_best(reqs)
+
+index.add "<h2>By First Tag</h2>\n"
+index.add catalog.list_by(catalog.cat2proj, "cat_")
+
+index.add "<h2>By Any Tag</h2>\n"
+index.add catalog.list_by(catalog.tag2proj, "tag_")
+
+index.add """
+</div>
+<div class="sidebar">
+<h3>Stats</h3>
+<ul class="box">
+<li>{{{model.mprojects.length}}} projects</li>
+<li>{{{catalog.maint2proj.length}}} maintainers</li>
+<li>{{{catalog.contrib2proj.length}}} contributors</li>
+<li>{{{catalog.tag2proj.length}}} tags</li>
+<li>{{{catalog.mmodules.sum}}} modules</li>
+<li>{{{catalog.mclasses.sum}}} classes</li>
+<li>{{{catalog.mmethods.sum}}} methods</li>
+<li>{{{catalog.loc.sum}}} lines of code</li>
+</ul>
+</div>
+"""
+
+index.write_to_file(out/"index.html")
+
+# PEOPLE
+
+var page = new CatalogPage
+page.more_head.add "<title>People of Nit</title>"
+page.add """<div class="content">\n<h1>People of Nit</h1>\n"""
+page.add "<h2>By Maintainer</h2>\n"
+page.add catalog.list_by(catalog.maint2proj, "maint_")
+page.add "<h2>By Contributor</h2>\n"
+page.add catalog.list_by(catalog.contrib2proj, "contrib_")
+page.add "</div>\n"
+page.write_to_file(out/"people.html")
+
+# TABLE
+
+page = new CatalogPage
+page.more_head.add "<title>Projets of Nit</title>"
+page.add """<div class="content">\n<h1>People of Nit</h1>\n"""
+page.add "<h2>Table of Projets</h2>\n"
+page.add catalog.table_projects(model.mprojects)
+page.add "</div>\n"
+page.write_to_file(out/"table.html")
index 2f19e44..065ad8f 100644 (file)
@@ -1,7 +1,7 @@
 [project]
 name=nitc
 tags=devel,cli
-author=Jean Privat <jean@pryen.org>
+maintainer=Jean Privat <jean@pryen.org>
 license=Apache-2.0
 [upstream]
 browse=https://github.com/nitlang/nit/tree/master/src
index c1dad34..18bfeab 100644 (file)
@@ -1,2 +1,2 @@
-../lib/mnit_linux/linux_app.nit:29,16--31: Redef Error: a virtual type cannot be refined.
-../lib/mnit_linux/linux_app.nit:30,16--29: Redef Error: a virtual type cannot be refined.
+../lib/mnit/linux/linux_app.nit:29,16--31: Redef Error: a virtual type cannot be refined.
+../lib/mnit/linux/linux_app.nit:30,16--29: Redef Error: a virtual type cannot be refined.
diff --git a/tests/sav/nitcatalog.res b/tests/sav/nitcatalog.res
new file mode 100644 (file)
index 0000000..e50ad70
--- /dev/null
@@ -0,0 +1,2 @@
+Usage: [OPTION]... [ARG]...
+Use --help for help
index c1dad34..18bfeab 100644 (file)
@@ -1,2 +1,2 @@
-../lib/mnit_linux/linux_app.nit:29,16--31: Redef Error: a virtual type cannot be refined.
-../lib/mnit_linux/linux_app.nit:30,16--29: Redef Error: a virtual type cannot be refined.
+../lib/mnit/linux/linux_app.nit:29,16--31: Redef Error: a virtual type cannot be refined.
+../lib/mnit/linux/linux_app.nit:30,16--29: Redef Error: a virtual type cannot be refined.
index 9ce343f..86ed222 100644 (file)
@@ -1 +1 @@
-Runtime error: Assert failed (../lib/c.nit:45)
+Runtime error: Assert failed (../lib/c.nit:46)
index 79d181f..dbeee7b 100644 (file)
@@ -1,2 +1,2 @@
-Runtime error: Assert failed (../lib/c.nit:37)
+Runtime error: Assert failed (../lib/c.nit:38)
 0
index 79d181f..dbeee7b 100644 (file)
@@ -1,2 +1,2 @@
-Runtime error: Assert failed (../lib/c.nit:37)
+Runtime error: Assert failed (../lib/c.nit:38)
 0
index 2689f93..e5246df 100644 (file)
@@ -1,4 +1,4 @@
-Runtime error: Assert failed (../lib/c.nit:36)
+Runtime error: Assert failed (../lib/c.nit:37)
 0
 0
 1