nit.git
7 years agopipeline: Introduce `Iterator2`
Jean-Christophe Beaupré [Thu, 25 Aug 2016 20:59:34 +0000 (16:59 -0400)]
pipeline: Introduce `Iterator2`

Add a generalization of `PipeJoin`.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agoMerge: modelize_property: Remove a unnecessary pre-condition
Jean Privat [Tue, 23 Aug 2016 13:37:46 +0000 (09:37 -0400)]
Merge: modelize_property: Remove a unnecessary pre-condition

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2285
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: nitunit: import frontend
Jean Privat [Tue, 23 Aug 2016 13:37:44 +0000 (09:37 -0400)]
Merge: nitunit: import frontend

So the tests can use annotations and other things introduced in compiler phases.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2283
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agonitunit: import frontend
Alexandre Terrasa [Mon, 22 Aug 2016 18:20:57 +0000 (14:20 -0400)]
nitunit: import frontend

So the tests can use annotations and other things introduced in compiler phases.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: lib/github: fix load issue comments and issue pull request
Jean Privat [Sat, 20 Aug 2016 01:10:19 +0000 (21:10 -0400)]
Merge: lib/github: fix load issue comments and issue pull request

Fix the wrong url in issue comment.

Also set the `Issue::is_pull_request` value with custom deserialization.

Pull-Request: #2282
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: lib/popcorn: also log query string in console
Jean Privat [Sat, 20 Aug 2016 01:10:13 +0000 (21:10 -0400)]
Merge: lib/popcorn: also log query string in console

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2281
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: shibuqam: provide a basic auth web service to simplify the use of `shibuqam`
Jean Privat [Sat, 20 Aug 2016 01:10:08 +0000 (21:10 -0400)]
Merge: shibuqam: provide a basic auth web service to simplify the use of `shibuqam`

Configuring a shibboleth client is a PITA.
So why not configure it once with an simple auth service that allows servers to delegate their authentication to it?

This is the point of the new server `shibuqamoauth`.

Please review because I'm not a security expert and I do not want to get to much exploitable flaws.

Pull-Request: #2279
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>

7 years agoMerge: lib/mongo: improve queries
Jean Privat [Sat, 20 Aug 2016 01:10:03 +0000 (21:10 -0400)]
Merge: lib/mongo: improve queries

Add some features to Mongo queries

Pull-Request: #2275
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agolib/github: check if an Issue is linked to a PullRequest at deserialization time
Alexandre Terrasa [Fri, 19 Aug 2016 20:37:45 +0000 (16:37 -0400)]
lib/github: check if an Issue is linked to a PullRequest at deserialization time

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/github: fix issue comments loading
Alexandre Terrasa [Fri, 19 Aug 2016 20:37:21 +0000 (16:37 -0400)]
lib/github: fix issue comments loading

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoshibuqam: provide a basic auth web service to simplify the use of `shibuqam`
Jean Privat [Fri, 19 Aug 2016 20:20:19 +0000 (16:20 -0400)]
shibuqam: provide a basic auth web service to simplify the use of `shibuqam`

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agoshibuqam: make User serializable
Jean Privat [Fri, 19 Aug 2016 19:09:02 +0000 (15:09 -0400)]
shibuqam: make User serializable

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agopopcorn: redirect uses 303 by default
Jean Privat [Fri, 19 Aug 2016 13:58:16 +0000 (09:58 -0400)]
popcorn: redirect uses 303 by default

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agolib/popcorn: also log query string in console
Alexandre Terrasa [Fri, 19 Aug 2016 18:25:37 +0000 (14:25 -0400)]
lib/popcorn: also log query string in console

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/mongo: introduce MongoMatch logicial expressions
Alexandre Terrasa [Thu, 18 Aug 2016 01:49:46 +0000 (21:49 -0400)]
lib/mongo: introduce MongoMatch logicial expressions

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/mongo: introduce MongoMatch::regex
Alexandre Terrasa [Thu, 18 Aug 2016 01:48:07 +0000 (21:48 -0400)]
lib/mongo: introduce MongoMatch::regex

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/mongo: make MongoMatch::op public
Alexandre Terrasa [Thu, 18 Aug 2016 01:47:51 +0000 (21:47 -0400)]
lib/mongo: make MongoMatch::op public

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agomodelize_property: Remove a unnecessary pre-condition
Jean-Christophe Beaupré [Thu, 18 Aug 2016 16:08:03 +0000 (12:08 -0400)]
modelize_property: Remove a unnecessary pre-condition

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agoMerge: Nitweb clean
Jean Privat [Wed, 17 Aug 2016 21:50:29 +0000 (17:50 -0400)]
Merge: Nitweb clean

Cleans some misc part of Nitweb. Notable fact, replace the hover on cards by a dropdown menu with caret.

Can be seen here: http://nitweb.moz-code.org/doc/core::array

For now, the dropdown menu allows the user to swtich between signature and documentation. More contextual options in the future.

This looks quirk with the stars rating (left untouched in the new dropdown system) so still need the mouse over. Since the next PR rewrite this part, I will let this as it is.
We load the stars only when the dropdown is selected so we gain some perfs on the home page.

This PR is based on #2265

Pull-Request: #2268
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Simon Zeni <simonzeni@gmail.com>

7 years agoMerge: Nitcorn PUT
Jean Privat [Wed, 17 Aug 2016 21:49:30 +0000 (17:49 -0400)]
Merge: Nitcorn PUT

This PR does two things:

* The first, maybe controversial, but I removed the warning printed by nitcorn on bad post format. The reason is, I am posting a lot of raw json object to my APIs (like github and other APIs work) and I'm getting this warning a lot.

The right thing to do should be to check the format depending on the request type. But the code seem old, I'm not sure I want to rewrite it.

* Second thing: parsing body when receiving PUT requests.

Review: @xymus

Pull-Request: #2272
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agonitweb: move mongo to web_base
Alexandre Terrasa [Wed, 17 Aug 2016 21:34:03 +0000 (17:34 -0400)]
nitweb: move mongo to web_base

So other modules can import the mongo configuration

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: index use dropdown for general menus
Alexandre Terrasa [Thu, 4 Aug 2016 18:45:22 +0000 (14:45 -0400)]
nitweb: index use dropdown for general menus

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: load ratings only when asked
Alexandre Terrasa [Thu, 4 Aug 2016 18:43:37 +0000 (14:43 -0400)]
nitweb: load ratings only when asked

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: add dropdown menu to cards
Alexandre Terrasa [Tue, 2 Aug 2016 02:44:21 +0000 (22:44 -0400)]
nitweb: add dropdown menu to cards

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: factorize graph directive
Alexandre Terrasa [Tue, 2 Aug 2016 02:30:05 +0000 (22:30 -0400)]
nitweb: factorize graph directive

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: doc card use dropdown to switch between doc and grade
Alexandre Terrasa [Tue, 2 Aug 2016 01:56:43 +0000 (21:56 -0400)]
nitweb: doc card use dropdown to switch between doc and grade

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/css: remove hidden overflow
Alexandre Terrasa [Tue, 2 Aug 2016 00:42:27 +0000 (20:42 -0400)]
nitweb/css: remove hidden overflow

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: Popcorn clean
Jean Privat [Wed, 17 Aug 2016 11:22:33 +0000 (07:22 -0400)]
Merge: Popcorn clean

Just some cleaning in popcorn modules

Also introducing mongo options for pop_repos.

Pull-Request: #2266
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agolib/popcorn: pop_repo introduce Mongo in AppConfig and AppOptions
Alexandre Terrasa [Sun, 14 Aug 2016 22:29:09 +0000 (18:29 -0400)]
lib/popcorn: pop_repo introduce Mongo in AppConfig and AppOptions

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/popcorn: move session init to pop_auth
Alexandre Terrasa [Sun, 14 Aug 2016 22:19:43 +0000 (18:19 -0400)]
lib/popcorn: move session init to pop_auth

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/popcorn: rename `pop_middleware` into pop_logging
Alexandre Terrasa [Sun, 14 Aug 2016 22:18:52 +0000 (18:18 -0400)]
lib/popcorn: rename `pop_middleware` into pop_logging

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: lib/popcorn: introduce AuthHandler to check user session
Jean Privat [Tue, 16 Aug 2016 21:37:29 +0000 (17:37 -0400)]
Merge: lib/popcorn: introduce AuthHandler to check user session

### AuthHandler allows access to session user

 Inherit this handler to access to session user from your custom handler.

 For example, you need a profile handler that checks if the user is logged
 before returning it in json format.
 ~~~nit
 import popcorn::pop_auth

 class ProfileHandler
super AuthHandler

redef fun get(req, res) do
var user = check_session_user(req, res)
if user == null then return
res.json user.json
end
 end
 ~~~

 By using `check_session_user`, we delegate to the `AuthHandler` the responsability
 to set the HTTP 403 error.
 We then check is the user is not null before pursuing.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2271
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agolib/popcorn: introduce AuthHandler to check user session
Alexandre Terrasa [Tue, 16 Aug 2016 19:53:48 +0000 (15:53 -0400)]
lib/popcorn: introduce AuthHandler to check user session

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: remove wallet
Jean Privat [Tue, 16 Aug 2016 17:26:12 +0000 (13:26 -0400)]
Merge: remove wallet

Binary introduced by error in 840a7d2d6147a2a8ae219fa3e0f7b9dd3e5af4d5

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2270
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: Mongo: limit queries
Jean Privat [Tue, 16 Aug 2016 17:25:58 +0000 (13:25 -0400)]
Merge: Mongo: limit queries

Add some features used to paginate results:
* allow pop repos to query with a limit and skip
* makes Pipeline API cleaner with limit and skip
* allows user to count entities from a Repo

Pull-Request: #2269
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: lib/popcorn: add `remove_all` service to pop repos
Jean Privat [Tue, 16 Aug 2016 17:25:53 +0000 (13:25 -0400)]
Merge: lib/popcorn: add `remove_all` service to pop repos

No more to say here.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2267
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: lib/popcorn: introduce RepoObject in pop_repos
Jean Privat [Tue, 16 Aug 2016 17:25:49 +0000 (13:25 -0400)]
Merge: lib/popcorn: introduce RepoObject in pop_repos

### Base serializable entity that can go into a JsonRepository

 Provide boiler plate implementation of all object serializable to json.

`id` is used as a primary key for `find_by_id`.

 Subclassing RepoObject makes it easy to create a serializable class:
 ~~~nit
 import popcorn::pop_repos

 class Album
super RepoObject
serialize

var title: String
var price: Float
 end
 ~~~

 Do not forget the `serialize` annotation else the fields will not be serialized.

 It is also possible to redefine the `id` primary key to use your own:
 ~~~nit
 import popcorn::pop_repos

 class Order
super RepoObject
serialize

redef var id = "order-{get_time}"

# ...

 end
 ~~~

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2265
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agolib/nitcorn: parse body from POST and PUT requests
Alexandre Terrasa [Mon, 15 Aug 2016 23:58:09 +0000 (19:58 -0400)]
lib/nitcorn: parse body from POST and PUT requests

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/nitcorn: remove the POST format error
Alexandre Terrasa [Mon, 15 Aug 2016 23:57:48 +0000 (19:57 -0400)]
lib/nitcorn: remove the POST format error

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoremove wallet
Alexandre Terrasa [Mon, 15 Aug 2016 23:53:42 +0000 (19:53 -0400)]
remove wallet

Binary introduced by error in 840a7d2d6147a2a8ae219fa3e0f7b9dd3e5af4d5

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/popcorn: introduce count in pop_repos
Alexandre Terrasa [Mon, 15 Aug 2016 23:38:53 +0000 (19:38 -0400)]
lib/popcorn: introduce count in pop_repos

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/popcorn: add limit and skip to pop_repos
Alexandre Terrasa [Mon, 15 Aug 2016 23:38:42 +0000 (19:38 -0400)]
lib/popcorn: add limit and skip to pop_repos

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/mongo: make limit and skip parameters optional so the client code is cleaner
Alexandre Terrasa [Mon, 15 Aug 2016 23:37:45 +0000 (19:37 -0400)]
lib/mongo: make limit and skip parameters optional so the client code is cleaner

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/popcorn: introduce RepoObject in pop_repos
Alexandre Terrasa [Mon, 15 Aug 2016 23:14:04 +0000 (19:14 -0400)]
lib/popcorn: introduce RepoObject in pop_repos

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/popcorn: add `remove_all` service to pop repos
Alexandre Terrasa [Mon, 15 Aug 2016 19:41:45 +0000 (15:41 -0400)]
lib/popcorn: add `remove_all` service to pop repos

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: Native Windows bootstrap
Jean Privat [Mon, 15 Aug 2016 19:19:20 +0000 (15:19 -0400)]
Merge: Native Windows bootstrap

This PR tweaks and hacks the core lib and the compiler to get a working bootstrap on Windows. After a regen of c_src, one could clone the repo and build c_src/nitc.exe using GCC on Windows with mingw or similar. There's a procedure using msys2 at <https://github.com/nitlang/nitlanguage/blob/master/pages/windows.mdwn>.

To achieve basic Windows compatibility, I applied the following algorithm:
1. For a missing C function, if there is an equivalent in `<windows.h>`, use an alternative static C implementation.
2. If it's a difference in a Nit only method, (like the path separator) add an alternative implementation selected at runtime.
3. If the difference spawns across more than one Nit method/class. Deactivate the code for Windows, replace by a no-op, and wait for a later fix hiding platform implementations behind an abstract API. Alternatively, we could use many `#ifdef` and keep the differences on the C side.

There are still a lot of issues:
* `c_src/nitc` can compile `hello_world` and `src/nitc.nit`. `hello_world` behaves as expected, but `src/nitc.nit` does not, there's some problems at parsing. (Maybe with the line endings.)
* The compiler hangs randomly. This may be related to different blocking behavior when reading files, or a local setup issue.
* I did not find a compatible GNU libregex, a solution is to use libboost regex. This could be declared in `lib/core/re.nit`, however would need to tweak some annotations and ensure that they work in nith. (`ldflags("-lmboost_regex-mt")@windows`)
* `poll` and `Process` related features must be replaced/implemented for Windows.
* There's a few warnings from the C compiler to check/silence.

Pull-Request: #2264
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: Nitcc custom lexer
Jean Privat [Mon, 15 Aug 2016 19:19:16 +0000 (15:19 -0400)]
Merge: Nitcc custom lexer

Proof of concept of how a nitcc lexer can be monkey-patched.

maybe not enough for @ppepos, but it's something.

Pull-Request: #2258
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: json::serialization: fallback to the static type when there is no metadata...
Jean Privat [Mon, 15 Aug 2016 19:16:59 +0000 (15:16 -0400)]
Merge: json::serialization: fallback to the static type when there is no metadata or heuristics

Move and improve some operations between two of the serialization phases, placing them after `modelize_property_phase` so they have access to the static type of serializable attributes.

The static type is then used by the JSON deserializer as a fallback if there is no metadata and no heuristic to find which Nit type to deserialize. This affects both the attributes of standard serializable classes and the items of `SimpleCollection`, when using the `JsonDeserializer` only. This means the we need much less `class_name_heuristic` for reading plain JSON.

The static types of generic attributes is also used as heuristic to support deserializing the given parameterized type. So as long as the static type is not an abstract class, does not need an anchor, is not a subclass hiding the parameter E (for JSON arrays)... it should work. This is actually most of the time, so avoid abstract generic static types like `Set` or `Sequence`. This also means less `class_name_heuristic` for any JSON and binary data.

All of it makes it easier to deal with the following input `json_string` without metadata:
~~~
var plain_json = """{
    "corners": [{"x": 0, "y": 0},
                {"x": 3, "y": 0},
                {"x": 2, "y": 2}],
    "name": "the same triangle"
}"""
~~~

which can be deserialized with the following Nit code:
~~~
module my_module is serialize

class Triangle
    var corners = new Array[Point] # Could as well be HashSet[Point]
    redef var to_s is serialize_as("name") # The static type comes from the model
end

class Point
    var x: Int
    var y: Int
end

var deser_engine = new JsonDeserializer(json_string)
var obj = new Triangle.deserialize_from(deser_engine) # The root object still needs a type
assert deser_engine.errors.is_empty # If false, don't trust `obj`

print obj
print obj.other_corners
~~~

Pull-Request: #2257
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agotests: update nitce savs
Alexis Laferrière [Mon, 15 Aug 2016 17:31:07 +0000 (13:31 -0400)]
tests: update nitce savs

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoMerge: lib/trees: introduce Trie
Jean Privat [Mon, 15 Aug 2016 17:18:24 +0000 (13:18 -0400)]
Merge: lib/trees: introduce Trie

### A trie (or prefix tree) is a datastructure used to perform prefix searches.

The trie uses an arborescent datastructure to perform searches on a prefix.
With this version of the trie, you can link data to nodes so the trie can
be used as a kind of Map by prefix.

~~~nit
# Associate some integers to Map keys
var trie = new Trie[Int]
trie["foo"] = 1
trie["fooo"] = 2
trie["foooo"] = 3
trie["bar"] = 4
trie["baz"] = 5

# Get stored values by key
print trie.has_key("foo")
print trie["foo"] == 1

# Get stored values by prefix
assert trie.has_prefix("fo")
assert not trie.has_prefix("z")
assert trie.find_by_prefix("foo") == [1, 2, 3]
assert trie.find_by_prefix("bar") == [4]
assert trie.find_by_prefix("z").is_empty
~~~

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2261
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: Make HttpRequest and Response serializable
Jean Privat [Mon, 15 Aug 2016 17:18:22 +0000 (13:18 -0400)]
Merge: Make HttpRequest and Response serializable

This PR makes HTTP requests and responses serializable.

I had a hard time with deserialization because of the `host` attribute that is never initialized, I removed it. Let's see what is crashing.

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

7 years agoMerge: Nitweb sessions
Jean Privat [Mon, 15 Aug 2016 17:18:02 +0000 (13:18 -0400)]
Merge: Nitweb sessions

Nitweb users can open sessions with Github Auth.

For now, instances are useless and the User profile page displays only `nothing to display yet`.

Demo is here: http://nitweb.moz-code.org/

Pull-Request: #2259
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: nitls: improve the man by giving better examples
Jean Privat [Mon, 15 Aug 2016 17:17:59 +0000 (13:17 -0400)]
Merge: nitls: improve the man by giving better examples

Pull-Request: #2256
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoMerge: lib/mongo: introduce mongo queries
Jean Privat [Mon, 15 Aug 2016 17:17:54 +0000 (13:17 -0400)]
Merge: lib/mongo: introduce mongo queries

A small abstraction of JsonObject dedicated to repo queries.

Just because I'm fed up with writing my JsonObjects by hand...

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2251
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: lib/github: use serialization
Jean Privat [Mon, 15 Aug 2016 17:17:49 +0000 (13:17 -0400)]
Merge: lib/github: use serialization

Just to see what I broke...

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

7 years agotests: update nituml tests
Alexis Laferrière [Mon, 15 Aug 2016 15:54:33 +0000 (11:54 -0400)]
tests: update nituml tests

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agolib/trees: introduce Trie
Alexandre Terrasa [Mon, 15 Aug 2016 15:11:46 +0000 (11:11 -0400)]
lib/trees: introduce Trie

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitc: don't use /dev/null on windows
Alexis Laferrière [Sun, 14 Aug 2016 14:07:38 +0000 (10:07 -0400)]
nitc: don't use /dev/null on windows

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agonitc: gen precompiler ifs to avoid features incompatible to windows
Alexis Laferrière [Sun, 14 Aug 2016 04:05:51 +0000 (00:05 -0400)]
nitc: gen precompiler ifs to avoid features incompatible to windows

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocore::file & exec & enviro: deactivate incompatible implementations on windows
Alexis Laferrière [Sun, 14 Aug 2016 19:05:05 +0000 (15:05 -0400)]
core::file & exec & enviro: deactivate incompatible implementations on windows

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocore::file: change basename implementation by OS
Alexis Laferrière [Sun, 14 Aug 2016 05:29:00 +0000 (01:29 -0400)]
core::file: change basename implementation by OS

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocore: tweak misc services for windows
Alexis Laferrière [Sun, 14 Aug 2016 19:06:05 +0000 (15:06 -0400)]
core: tweak misc services for windows

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agonitweb: add user menu
Alexandre Terrasa [Sun, 14 Aug 2016 17:35:06 +0000 (13:35 -0400)]
nitweb: add user menu

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: add user controller
Alexandre Terrasa [Tue, 2 Aug 2016 17:43:05 +0000 (13:43 -0400)]
nitweb/angular: add user controller

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/nitcorn: remove uninitialized attribute `host`
Alexandre Terrasa [Mon, 15 Aug 2016 04:25:30 +0000 (00:25 -0400)]
lib/nitcorn: remove uninitialized attribute `host`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/nitcorn: make HttpRequest and HttpResponse serializable
Alexandre Terrasa [Mon, 15 Aug 2016 04:25:08 +0000 (00:25 -0400)]
lib/nitcorn: make HttpRequest and HttpResponse serializable

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agocontrib/nitrpg: nitrpg use github serialization
Alexandre Terrasa [Mon, 15 Aug 2016 04:22:58 +0000 (00:22 -0400)]
contrib/nitrpg: nitrpg use github serialization

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/popcorn: pop_auth use github serialization
Alexandre Terrasa [Sun, 14 Aug 2016 21:16:08 +0000 (17:16 -0400)]
lib/popcorn: pop_auth use github serialization

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/github: use serialization
Alexandre Terrasa [Sun, 14 Aug 2016 21:15:48 +0000 (17:15 -0400)]
lib/github: use serialization

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agocore::file: alternative C implementations for windows
Alexis Laferrière [Sun, 14 Aug 2016 04:06:34 +0000 (00:06 -0400)]
core::file: alternative C implementations for windows

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocore: intro `is_windows`
Alexis Laferrière [Sun, 14 Aug 2016 14:10:56 +0000 (10:10 -0400)]
core: intro `is_windows`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agonitweb: add API user login/logout end points
Alexandre Terrasa [Sun, 14 Aug 2016 18:39:24 +0000 (14:39 -0400)]
nitweb: add API user login/logout end points

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: init session
Alexandre Terrasa [Tue, 2 Aug 2016 03:26:45 +0000 (23:26 -0400)]
nitweb: init session

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/mongo: introduce mongo queries
Alexandre Terrasa [Sun, 14 Aug 2016 17:10:55 +0000 (13:10 -0400)]
lib/mongo: introduce mongo queries

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitcc: add an example of a monkey-patching of a Lexer to add behavior.
Jean Privat [Fri, 12 Aug 2016 21:53:43 +0000 (17:53 -0400)]
nitcc: add an example of a monkey-patching of a Lexer to add behavior.

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agobenitlux: drop a few explicity deserialization support for generics
Alexis Laferrière [Fri, 12 Aug 2016 13:07:29 +0000 (09:07 -0400)]
benitlux: drop a few explicity deserialization support for generics

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agofrontend/serialization: a bit more details to the doc
Alexis Laferrière [Fri, 12 Aug 2016 12:40:18 +0000 (08:40 -0400)]
frontend/serialization: a bit more details to the doc

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoserialization: update README limitations section
Alexis Laferrière [Thu, 11 Aug 2016 18:06:05 +0000 (14:06 -0400)]
serialization: update README limitations section

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agojson::serialization: update "Read JSON" section
Alexis Laferrière [Thu, 11 Aug 2016 18:06:31 +0000 (14:06 -0400)]
json::serialization: update "Read JSON" section

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agojson::serialization: infer the static type of the items of an array
Alexis Laferrière [Fri, 12 Aug 2016 03:35:04 +0000 (23:35 -0400)]
json::serialization: infer the static type of the items of an array

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agofrontent/serialization: use static types to deserialize parameterized attributes
Alexis Laferrière [Fri, 12 Aug 2016 03:34:16 +0000 (23:34 -0400)]
frontent/serialization: use static types to deserialize parameterized attributes

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agojson::serialization: use static type to deserialize arrays without metadata
Alexis Laferrière [Thu, 11 Aug 2016 19:51:44 +0000 (15:51 -0400)]
json::serialization: use static type to deserialize arrays without metadata

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agofrontend/serialization: pass the static type to the deserialization engine
Alexis Laferrière [Thu, 11 Aug 2016 15:53:04 +0000 (11:53 -0400)]
frontend/serialization: pass the static type to the deserialization engine

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agojson::serialization: fallback to the static type at deserialization
Alexis Laferrière [Thu, 11 Aug 2016 15:52:02 +0000 (11:52 -0400)]
json::serialization: fallback to the static type at deserialization

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoserialization: `deserialize_attribute` takes an optional static type name
Alexis Laferrière [Thu, 11 Aug 2016 15:48:49 +0000 (11:48 -0400)]
serialization: `deserialize_attribute` takes an optional static type name

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agofrontend/serialization: use types from model at deserialization
Alexis Laferrière [Thu, 11 Aug 2016 15:40:56 +0000 (11:40 -0400)]
frontend/serialization: use types from model at deserialization

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agofrontent/serialization: fix warnings
Alexis Laferrière [Thu, 11 Aug 2016 15:40:28 +0000 (11:40 -0400)]
frontent/serialization: fix warnings

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agonitls: improve the man by giving better examples
Jean Privat [Fri, 12 Aug 2016 00:40:52 +0000 (20:40 -0400)]
nitls: improve the man by giving better examples

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agoMerge: calculator: nicer Android adaptation with API 21 + variant
Jean Privat [Thu, 11 Aug 2016 22:18:24 +0000 (18:18 -0400)]
Merge: calculator: nicer Android adaptation with API 21 + variant

Improve the look of the Android variant for the calculator using style resources from the AOSP calculator. Also intro another variant for Android API 21+ which changes the font and deactivates the virtual keyboard.

This should also fix the calculator missing from our f-droid repository. However, I don't know yet how f-droid handles more than one APK per package...

For an idea of the result, you can take a look at the 6 different resulting calculators alongside the latest AOSP calculator: http://xymus.net/pub/calcs.pdf

Pull-Request: #2255
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>

7 years agoMerge: contrib: add shibuqam to extract information from a shibboleth authentication
Jean Privat [Thu, 11 Aug 2016 19:43:26 +0000 (15:43 -0400)]
Merge: contrib: add shibuqam to extract information from a shibboleth authentication

Pull-Request: #2254
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: lib/core: add `Path::/`
Jean Privat [Thu, 11 Aug 2016 19:43:22 +0000 (15:43 -0400)]
Merge: lib/core: add `Path::/`

Pull-Request: #2253
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: json::serialization: intro `attributes_path` as support to `class_name_heuristic`
Jean Privat [Thu, 11 Aug 2016 19:43:20 +0000 (15:43 -0400)]
Merge: json::serialization: intro `attributes_path` as support to `class_name_heuristic`

Intro a list of the attribute names to the currently deserialized object which can be used to infer the Nit type of a JSON object to deserialize. It is not the most reliable information, some objects won't have an associated attribute like the root deserialized object and collection items.

Should help for #2246.

As a bonus, this PR improves the doc to `Deserializer` mainly to mention `errors` from `deserialize`.

Pull-Request: #2252
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agocontrib: add shibuqam to extract information from a shibboleth authentication
Jean Privat [Thu, 11 Aug 2016 19:42:04 +0000 (15:42 -0400)]
contrib: add shibuqam to extract information from a shibboleth authentication

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agocalculator: rename android_calculator to android14
Alexis Laferrière [Wed, 10 Aug 2016 13:19:06 +0000 (09:19 -0400)]
calculator: rename android_calculator to android14

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocalculator: add variant for Android 21 +
Alexis Laferrière [Tue, 9 Aug 2016 14:22:33 +0000 (10:22 -0400)]
calculator: add variant for Android 21 +

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocalculator: prettier Android variant
Alexis Laferrière [Thu, 21 Jul 2016 21:44:14 +0000 (17:44 -0400)]
calculator: prettier Android variant

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocalculator: add scientific variant fdroid metadata
Alexis Laferrière [Tue, 9 Aug 2016 14:18:33 +0000 (10:18 -0400)]
calculator: add scientific variant fdroid metadata

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agolib/core: add `Path::/`
Jean Privat [Thu, 11 Aug 2016 17:42:56 +0000 (13:42 -0400)]
lib/core: add `Path::/`

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agoserialization: better doc for `Deserializer`
Alexis Laferrière [Thu, 11 Aug 2016 12:45:20 +0000 (08:45 -0400)]
serialization: better doc for `Deserializer`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agojson::serialization: intro `attributes_path` as support to `class_name_heuristic`
Alexis Laferrière [Thu, 11 Aug 2016 11:38:16 +0000 (07:38 -0400)]
json::serialization: intro `attributes_path` as support to `class_name_heuristic`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>