linq 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +103 -39
- data/app/assests/javascripts/linq.jquery.js +28 -0
- data/app/assests/javascripts/linq.js +3 -0
- data/app/assests/javascripts/linq.lib.js +2997 -0
- data/app/assests/javascripts/linq.rx.js +69 -0
- data/lib/linq.rb +0 -1
- data/lib/linq/version.rb +1 -1
- data/linq.gemspec +2 -2
- metadata +10 -8
- data/CODE_OF_CONDUCT.md +0 -13
@@ -0,0 +1,69 @@
|
|
1
|
+
// extension for RxJS
|
2
|
+
|
3
|
+
(function (root) {
|
4
|
+
if (root.Enumerable == null) {
|
5
|
+
throw new Error("can't find Enumerable. linq.rx.js must load after linq.js");
|
6
|
+
}
|
7
|
+
if (root.Rx == null) {
|
8
|
+
throw new Error("can't find Rx. linq.rx.js must load after RxJS");
|
9
|
+
}
|
10
|
+
|
11
|
+
var Enumerable = root.Enumerable;
|
12
|
+
var Rx = root.Rx;
|
13
|
+
|
14
|
+
Enumerable.prototype.toObservable = function (scheduler) {
|
15
|
+
/// <summary>Converts an enumerable sequence to an observable sequence.</summary>
|
16
|
+
/// <param type="Scheduler" name="scheduler" optional="true">Rx.Scheduler. Default is CurrentThread.</param>
|
17
|
+
var source = this;
|
18
|
+
if (scheduler == null) scheduler = Rx.Scheduler.currentThread;
|
19
|
+
|
20
|
+
return Rx.Observable.createWithDisposable(function (observer) {
|
21
|
+
var disposable = new Rx.SingleAssignmentDisposable();
|
22
|
+
var enumerator = source.getEnumerator();
|
23
|
+
|
24
|
+
var calledOnCompleted;
|
25
|
+
var cancelable = scheduler.scheduleRecursive(function (self) {
|
26
|
+
var hasNext = false;
|
27
|
+
var current;
|
28
|
+
try {
|
29
|
+
if (disposable.isDisposed) return;
|
30
|
+
|
31
|
+
hasNext = enumerator.moveNext();
|
32
|
+
if (hasNext) current = enumerator.current();
|
33
|
+
else enumerator.dispose();
|
34
|
+
}
|
35
|
+
catch (e) {
|
36
|
+
try {
|
37
|
+
enumerator.dispose();
|
38
|
+
}
|
39
|
+
finally {
|
40
|
+
observer.onError(e);
|
41
|
+
}
|
42
|
+
return;
|
43
|
+
}
|
44
|
+
|
45
|
+
if (hasNext) {
|
46
|
+
observer.onNext(current);
|
47
|
+
self(); // loop
|
48
|
+
}
|
49
|
+
else {
|
50
|
+
observer.onCompleted();
|
51
|
+
}
|
52
|
+
});
|
53
|
+
|
54
|
+
disposable.disposable(cancelable);
|
55
|
+
|
56
|
+
return disposable;
|
57
|
+
});
|
58
|
+
};
|
59
|
+
|
60
|
+
Rx.Observable.prototype.toEnumerable = function () {
|
61
|
+
/// <summary>Converts an observable sequence to an enumerable sequence. Notice:cold observable only.</summary>
|
62
|
+
var obs = this;
|
63
|
+
return Enumerable.defer(function () {
|
64
|
+
var array = [];
|
65
|
+
obs.subscribe(function (x) { array.push(x) }).dispose();
|
66
|
+
return array;
|
67
|
+
});
|
68
|
+
};
|
69
|
+
})(this);
|
data/lib/linq.rb
CHANGED
data/lib/linq/version.rb
CHANGED
data/linq.gemspec
CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["marat@khusnetdinov.ru"]
|
11
11
|
|
12
12
|
spec.summary = %q{Language-Integrated Query (LINQ)}
|
13
|
-
spec.description = %q{
|
14
|
-
spec.homepage = ""
|
13
|
+
spec.description = %q{LINQ introduces standard, easily-learned patterns for querying and updating data, and the technology can be extended to support potentially any kind of data store.}
|
14
|
+
spec.homepage = "https://github.com/khusnetdinov/linq"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
17
|
spec.bindir = "exe"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marat Khusnetdinov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,10 +38,9 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
description:
|
42
|
-
|
43
|
-
|
44
|
-
can be extended to support potentially any kind of data store.
|
41
|
+
description: LINQ introduces standard, easily-learned patterns for querying and updating
|
42
|
+
data, and the technology can be extended to support potentially any kind of data
|
43
|
+
store.
|
45
44
|
email:
|
46
45
|
- marat@khusnetdinov.ru
|
47
46
|
executables: []
|
@@ -49,16 +48,19 @@ extensions: []
|
|
49
48
|
extra_rdoc_files: []
|
50
49
|
files:
|
51
50
|
- ".gitignore"
|
52
|
-
- CODE_OF_CONDUCT.md
|
53
51
|
- Gemfile
|
54
52
|
- README.md
|
55
53
|
- Rakefile
|
54
|
+
- app/assests/javascripts/linq.jquery.js
|
55
|
+
- app/assests/javascripts/linq.js
|
56
|
+
- app/assests/javascripts/linq.lib.js
|
57
|
+
- app/assests/javascripts/linq.rx.js
|
56
58
|
- bin/console
|
57
59
|
- bin/setup
|
58
60
|
- lib/linq.rb
|
59
61
|
- lib/linq/version.rb
|
60
62
|
- linq.gemspec
|
61
|
-
homepage:
|
63
|
+
homepage: https://github.com/khusnetdinov/linq
|
62
64
|
licenses: []
|
63
65
|
metadata: {}
|
64
66
|
post_install_message:
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# Contributor Code of Conduct
|
2
|
-
|
3
|
-
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
-
|
5
|
-
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
-
|
7
|
-
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
-
|
9
|
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
-
|
11
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
-
|
13
|
-
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|