rxjs-rails 2.2.19 → 2.2.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,133 +12,131 @@ require('./rx.testing');
12
12
 
13
13
  // Add specific Node functions
14
14
  var EventEmitter = require('events').EventEmitter,
15
- Observable = Rx.Observable;
15
+ Observable = Rx.Observable;
16
16
 
17
17
  Rx.Node = {
18
- /**
19
- * @deprecated Use Rx.Observable.fromCallback from rx.async.js instead.
20
- *
21
- * Converts a callback function to an observable sequence.
22
- *
23
- * @param {Function} func Function to convert to an asynchronous function.
24
- * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
25
- * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
26
- * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
27
- * @returns {Function} Asynchronous function.
28
- */
29
- fromCallback: function (func, scheduler, context, selector) {
30
- return Observable.fromCallback(func, scheduler, context, selector);
31
- },
18
+ /**
19
+ * @deprecated Use Rx.Observable.fromCallback from rx.async.js instead.
20
+ *
21
+ * Converts a callback function to an observable sequence.
22
+ *
23
+ * @param {Function} func Function to convert to an asynchronous function.
24
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
25
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
26
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
27
+ * @returns {Function} Asynchronous function.
28
+ */
29
+ fromCallback: function (func, scheduler, context, selector) {
30
+ return Observable.fromCallback(func, scheduler, context, selector);
31
+ },
32
32
 
33
- /**
34
- * @deprecated Use Rx.Observable.fromNodeCallback from rx.async.js instead.
35
- *
36
- * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
37
- *
38
- * @param {Function} func The function to call
39
- * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
40
- * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
41
- * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
42
- * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
43
- */
44
- fromNodeCallback: function (func, scheduler, context, selector) {
45
- return Observable.fromNodeCallback(func, scheduler, context, selector);
46
- },
33
+ /**
34
+ * @deprecated Use Rx.Observable.fromNodeCallback from rx.async.js instead.
35
+ *
36
+ * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
37
+ *
38
+ * @param {Function} func The function to call
39
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
40
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
41
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
42
+ * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
43
+ */
44
+ fromNodeCallback: function (func, scheduler, context, selector) {
45
+ return Observable.fromNodeCallback(func, scheduler, context, selector);
46
+ },
47
47
 
48
- /**
49
- * @deprecated Use Rx.Observable.fromNodeCallback from rx.async.js instead.
50
- *
51
- * Handles an event from the given EventEmitter as an observable sequence.
52
- *
53
- * @param {EventEmitter} eventEmitter The EventEmitter to subscribe to the given event.
54
- * @param {String} eventName The event name to subscribe
55
- * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
56
- * @returns {Observable} An observable sequence generated from the named event from the given EventEmitter. The data will be returned as an array of arguments to the handler.
57
- */
58
- fromEvent: function (eventEmitter, eventName, selector) {
59
- return Observable.fromEvent(eventEmitter, eventName, selector);
60
- },
48
+ /**
49
+ * @deprecated Use Rx.Observable.fromNodeCallback from rx.async.js instead.
50
+ *
51
+ * Handles an event from the given EventEmitter as an observable sequence.
52
+ *
53
+ * @param {EventEmitter} eventEmitter The EventEmitter to subscribe to the given event.
54
+ * @param {String} eventName The event name to subscribe
55
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
56
+ * @returns {Observable} An observable sequence generated from the named event from the given EventEmitter. The data will be returned as an array of arguments to the handler.
57
+ */
58
+ fromEvent: function (eventEmitter, eventName, selector) {
59
+ return Observable.fromEvent(eventEmitter, eventName, selector);
60
+ },
61
61
 
62
- /**
63
- * Converts the given observable sequence to an event emitter with the given event name.
64
- * The errors are handled on the 'error' event and completion on the 'end' event.
65
- * @param {Observable} observable The observable sequence to convert to an EventEmitter.
66
- * @param {String} eventName The event name to emit onNext calls.
67
- * @returns {EventEmitter} An EventEmitter which emits the given eventName for each onNext call in addition to 'error' and 'end' events.
68
- * You must call publish in order to invoke the subscription on the Observable sequuence.
69
- */
70
- toEventEmitter: function (observable, eventName) {
71
- var e = new EventEmitter();
62
+ /**
63
+ * Converts the given observable sequence to an event emitter with the given event name.
64
+ * The errors are handled on the 'error' event and completion on the 'end' event.
65
+ * @param {Observable} observable The observable sequence to convert to an EventEmitter.
66
+ * @param {String} eventName The event name to emit onNext calls.
67
+ * @returns {EventEmitter} An EventEmitter which emits the given eventName for each onNext call in addition to 'error' and 'end' events.
68
+ * You must call publish in order to invoke the subscription on the Observable sequuence.
69
+ */
70
+ toEventEmitter: function (observable, eventName) {
71
+ var e = new EventEmitter();
72
72
 
73
- // Used to publish the events from the observable
74
- e.publish = function () {
75
- e.subscription = observable.subscribe(
76
- function (x) {
77
- e.emit(eventName, x);
78
- },
79
- function (err) {
80
- e.emit('error', err);
81
- },
82
- function () {
83
- e.emit('end');
84
- });
85
- };
73
+ // Used to publish the events from the observable
74
+ e.publish = function () {
75
+ e.subscription = observable.subscribe(
76
+ function (x) {
77
+ e.emit(eventName, x);
78
+ },
79
+ function (err) {
80
+ e.emit('error', err);
81
+ },
82
+ function () {
83
+ e.emit('end');
84
+ });
85
+ };
86
86
 
87
- return e;
88
- },
87
+ return e;
88
+ },
89
89
 
90
- /**
91
- * Converts a flowing stream to an Observable sequence.
92
- * @param {Stream} stream A stream to convert to a observable sequence.
93
- * @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and 'end' events.
94
- */
95
- fromStream: function (stream) {
96
- return Observable.create(function (observer) {
97
- function dataHandler (data) {
98
- observer.onNext(data);
99
- }
90
+ /**
91
+ * Converts a flowing stream to an Observable sequence.
92
+ * @param {Stream} stream A stream to convert to a observable sequence.
93
+ * @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and 'end' events.
94
+ */
95
+ fromStream: function (stream) {
96
+ return Observable.create(function (observer) {
97
+ function dataHandler (data) {
98
+ observer.onNext(data);
99
+ }
100
100
 
101
- function errorHandler (err) {
102
- observer.onError(err);
103
- }
101
+ function errorHandler (err) {
102
+ observer.onError(err);
103
+ }
104
104
 
105
- function endHandler () {
106
- observer.onCompleted();
107
- }
105
+ function endHandler () {
106
+ observer.onCompleted();
107
+ }
108
108
 
109
- stream.addListener('data', dataHandler);
110
- stream.addListener('error', errorHandler);
111
- stream.addListener('end', endHandler);
112
-
113
- return function () {
114
- stream.removeListener('data', dataHandler);
115
- stream.removeListener('error', errorHandler);
116
- stream.removeListener('end', endHandler);
117
- };
118
- }).publish().refCount();
119
- },
109
+ stream.addListener('data', dataHandler);
110
+ stream.addListener('error', errorHandler);
111
+ stream.addListener('end', endHandler);
112
+
113
+ return function () {
114
+ stream.removeListener('data', dataHandler);
115
+ stream.removeListener('error', errorHandler);
116
+ stream.removeListener('end', endHandler);
117
+ };
118
+ }).publish().refCount();
119
+ },
120
120
 
121
- /**
122
- * Writes an observable sequence to a stream
123
- * @param {Observable} observable Observable sequence to write to a stream.
124
- * @param {Stream} stream The stream to write to.
125
- * @param {String} [encoding] The encoding of the item to write.
126
- * @returns {Disposable} The subscription handle.
127
- */
128
- writeToStream: function (observable, stream, encoding) {
129
- return observable.subscribe(
130
- function (x) {
131
- stream.write(String(x), encoding);
132
- },
133
- function (err) {
134
- stream.emit('error', err);
135
- }, function () {
136
- // Hack check because STDIO is not closable
137
- if (!stream._isStdio) {
138
- stream.end();
139
- }
140
- });
141
- }
121
+ /**
122
+ * Writes an observable sequence to a stream
123
+ * @param {Observable} observable Observable sequence to write to a stream.
124
+ * @param {Stream} stream The stream to write to.
125
+ * @param {String} [encoding] The encoding of the item to write.
126
+ * @returns {Disposable} The subscription handle.
127
+ */
128
+ writeToStream: function (observable, stream, encoding) {
129
+ return observable.subscribe(
130
+ function (x) {
131
+ stream.write(String(x), encoding);
132
+ },
133
+ function (err) {
134
+ stream.emit('error', err);
135
+ }, function () {
136
+ // Hack check because STDIO is not closable
137
+ !stream._isStdio && stream.end();
138
+ });
139
+ }
142
140
  };
143
141
 
144
142
  module.exports = Rx;
data/version.rb.m4 ADDED
@@ -0,0 +1,6 @@
1
+ module Rxjs
2
+ module Rails
3
+ VERSION = "version"
4
+ end
5
+ end
6
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rxjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.19
4
+ version: 2.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - jdeseno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-06 00:00:00.000000000 Z
11
+ date: 2014-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -80,6 +80,7 @@ files:
80
80
  - vendor/assets/javascripts/rx.time.min.js
81
81
  - vendor/assets/javascripts/rx.virtualtime.js
82
82
  - vendor/assets/javascripts/rx.virtualtime.min.js
83
+ - version.rb.m4
83
84
  homepage: http://rubygems.org/gems/rxjs-rails
84
85
  licenses:
85
86
  - MIT