rx 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -0
  3. data/Gemfile +1 -1
  4. data/examples/aggregate.rb +3 -3
  5. data/examples/amb.rb +4 -4
  6. data/examples/ambproto.rb +3 -3
  7. data/examples/and.rb +4 -4
  8. data/examples/as_observable.rb +2 -2
  9. data/examples/average.rb +3 -3
  10. data/examples/buffer_with_count.rb +3 -3
  11. data/examples/buffer_with_time.rb +3 -3
  12. data/examples/case.rb +5 -5
  13. data/examples/catch.rb +4 -4
  14. data/examples/catchproto.rb +5 -5
  15. data/examples/combine_latest.rb +4 -4
  16. data/examples/combine_latestproto.rb +3 -3
  17. data/examples/concat.rb +4 -4
  18. data/examples/concat_all.rb +3 -3
  19. data/examples/concat_map.rb +4 -4
  20. data/examples/concat_map_observer.rb +5 -5
  21. data/examples/concatproto.rb +3 -3
  22. data/examples/connect.rb +3 -3
  23. data/examples/contains.rb +3 -3
  24. data/examples/count.rb +3 -3
  25. data/examples/create.rb +4 -4
  26. data/examples/debounce.rb +3 -3
  27. data/examples/default_if_empty.rb +3 -3
  28. data/examples/defer.rb +3 -3
  29. data/examples/delay.rb +3 -3
  30. data/examples/delay_with_selector.rb +6 -6
  31. data/examples/dematerialize.rb +4 -4
  32. data/examples/disposable.rb +3 -3
  33. data/examples/distinct.rb +3 -3
  34. data/examples/distinct_until_changed.rb +3 -3
  35. data/examples/do.rb +4 -4
  36. data/examples/empty.rb +2 -2
  37. data/examples/for.rb +3 -3
  38. data/examples/fork_join.rb +6 -6
  39. data/examples/from.rb +7 -7
  40. data/examples/from_array.rb +2 -2
  41. data/examples/from_callback.rb +2 -2
  42. data/examples/generate.rb +2 -2
  43. data/examples/group_join.rb +5 -5
  44. data/examples/if.rb +6 -6
  45. data/examples/intervals.rb +2 -2
  46. data/examples/merge.rb +4 -4
  47. data/examples/merge_all.rb +3 -3
  48. data/examples/multicast.rb +4 -4
  49. data/examples/never.rb +2 -2
  50. data/examples/of.rb +2 -2
  51. data/examples/on_error_resume_next.rb +5 -5
  52. data/examples/pairs.rb +2 -2
  53. data/examples/publish.rb +5 -5
  54. data/examples/range.rb +2 -2
  55. data/examples/reduce.rb +2 -2
  56. data/examples/repeat.rb +2 -2
  57. data/examples/return.rb +2 -2
  58. data/examples/scan.rb +3 -3
  59. data/examples/start.rb +3 -3
  60. data/examples/throw.rb +3 -3
  61. data/examples/time_intervals.rb +2 -2
  62. data/examples/timer.rb +2 -2
  63. data/examples/timestamp.rb +2 -2
  64. data/examples/to_a.rb +2 -2
  65. data/examples/to_async.rb +2 -2
  66. data/examples/using.rb +3 -3
  67. data/examples/when.rb +4 -4
  68. data/examples/while.rb +3 -3
  69. data/examples/window_with_time.rb +3 -3
  70. data/examples/zip.rb +3 -3
  71. data/examples/zip_array.rb +3 -3
  72. data/lib/core_ext/enumerable.rb +3 -3
  73. data/lib/{rx_ruby.rb → rx.rb} +11 -11
  74. data/lib/{rx_ruby → rx}/concurrency/async_lock.rb +1 -1
  75. data/lib/{rx_ruby → rx}/concurrency/current_thread_scheduler.rb +6 -6
  76. data/lib/{rx_ruby → rx}/concurrency/default_scheduler.rb +8 -8
  77. data/lib/{rx_ruby → rx}/concurrency/historical_scheduler.rb +3 -3
  78. data/lib/{rx_ruby → rx}/concurrency/immediate_scheduler.rb +4 -4
  79. data/lib/{rx_ruby → rx}/concurrency/local_scheduler.rb +3 -3
  80. data/lib/{rx_ruby → rx}/concurrency/periodic_scheduler.rb +1 -1
  81. data/lib/{rx_ruby → rx}/concurrency/scheduled_item.rb +2 -2
  82. data/lib/{rx_ruby → rx}/concurrency/scheduler.rb +1 -1
  83. data/lib/{rx_ruby → rx}/concurrency/virtual_time_scheduler.rb +4 -4
  84. data/lib/{rx_ruby → rx}/core/async_lock_observer.rb +4 -4
  85. data/lib/{rx_ruby → rx}/core/auto_detach_observer.rb +4 -4
  86. data/lib/{rx_ruby → rx}/core/checked_observer.rb +2 -2
  87. data/lib/{rx_ruby → rx}/core/notification.rb +3 -3
  88. data/lib/{rx_ruby → rx}/core/observable.rb +6 -6
  89. data/lib/{rx_ruby → rx}/core/observe_on_observer.rb +2 -2
  90. data/lib/{rx_ruby → rx}/core/observer.rb +1 -1
  91. data/lib/{rx_ruby → rx}/core/scheduled_observer.rb +3 -3
  92. data/lib/{rx_ruby → rx}/core/synchronized_observer.rb +3 -3
  93. data/lib/{rx_ruby → rx}/core/time_interval.rb +1 -1
  94. data/lib/{rx_ruby → rx}/internal/priority_queue.rb +1 -1
  95. data/lib/{rx_ruby → rx}/internal/util.rb +1 -1
  96. data/lib/{rx_ruby → rx}/joins/active_plan.rb +1 -1
  97. data/lib/{rx_ruby → rx}/joins/join_observer.rb +1 -1
  98. data/lib/{rx_ruby → rx}/joins/pattern.rb +1 -1
  99. data/lib/{rx_ruby → rx}/joins/plan.rb +1 -1
  100. data/lib/{rx_ruby → rx}/linq/connectable_observable.rb +1 -1
  101. data/lib/{rx_ruby → rx}/linq/observable/_observable_timer_date_and_period.rb +1 -1
  102. data/lib/{rx_ruby → rx}/linq/observable/_observable_timer_time_span.rb +1 -1
  103. data/lib/{rx_ruby → rx}/linq/observable/_observable_timer_time_span_and_period.rb +1 -1
  104. data/lib/{rx_ruby → rx}/linq/observable/aggregate.rb +2 -2
  105. data/lib/{rx_ruby → rx}/linq/observable/and.rb +1 -1
  106. data/lib/{rx_ruby → rx}/linq/observable/case.rb +1 -1
  107. data/lib/{rx_ruby → rx}/linq/observable/concat_all.rb +1 -1
  108. data/lib/{rx_ruby → rx}/linq/observable/concat_map.rb +1 -1
  109. data/lib/{rx_ruby → rx}/linq/observable/concat_map_observer.rb +1 -1
  110. data/lib/{rx_ruby → rx}/linq/observable/contains.rb +1 -1
  111. data/lib/{rx_ruby → rx}/linq/observable/debounce.rb +1 -1
  112. data/lib/{rx_ruby → rx}/linq/observable/delay.rb +1 -1
  113. data/lib/{rx_ruby → rx}/linq/observable/delay_with_selector.rb +1 -1
  114. data/lib/{rx_ruby → rx}/linq/observable/do.rb +1 -1
  115. data/lib/{rx_ruby → rx}/linq/observable/for.rb +1 -1
  116. data/lib/{rx_ruby → rx}/linq/observable/fork_join.rb +1 -1
  117. data/lib/{rx_ruby → rx}/linq/observable/from.rb +1 -1
  118. data/lib/{rx_ruby → rx}/linq/observable/group_join.rb +1 -1
  119. data/lib/{rx_ruby → rx}/linq/observable/if.rb +1 -1
  120. data/lib/rx/linq/observable/interval.rb +5 -0
  121. data/lib/{rx_ruby → rx}/linq/observable/multicast.rb +1 -1
  122. data/lib/{rx_ruby → rx}/linq/observable/of.rb +1 -1
  123. data/lib/{rx_ruby → rx}/linq/observable/pairs.rb +1 -1
  124. data/lib/{rx_ruby → rx}/linq/observable/pluck.rb +1 -1
  125. data/lib/{rx_ruby → rx}/linq/observable/publish.rb +1 -1
  126. data/lib/{rx_ruby → rx}/linq/observable/start.rb +1 -1
  127. data/lib/{rx_ruby → rx}/linq/observable/time_interval.rb +1 -1
  128. data/lib/{rx_ruby → rx}/linq/observable/timer.rb +1 -1
  129. data/lib/{rx_ruby → rx}/linq/observable/timestamp.rb +1 -1
  130. data/lib/{rx_ruby → rx}/linq/observable/to_async.rb +1 -1
  131. data/lib/{rx_ruby → rx}/linq/observable/when.rb +1 -1
  132. data/lib/{rx_ruby → rx}/linq/observable/while.rb +1 -1
  133. data/lib/{rx_ruby → rx}/operators/aggregates.rb +31 -31
  134. data/lib/{rx_ruby → rx}/operators/creation.rb +6 -6
  135. data/lib/{rx_ruby → rx}/operators/multiple.rb +22 -23
  136. data/lib/{rx_ruby → rx}/operators/single.rb +14 -14
  137. data/lib/{rx_ruby → rx}/operators/standard_query_operators.rb +6 -6
  138. data/lib/{rx_ruby → rx}/operators/synchronization.rb +8 -8
  139. data/lib/{rx_ruby → rx}/operators/time.rb +12 -12
  140. data/lib/{rx_ruby → rx}/subjects/async_subject.rb +4 -4
  141. data/lib/{rx_ruby → rx}/subjects/behavior_subject.rb +3 -3
  142. data/lib/{rx_ruby → rx}/subjects/replay_subject.rb +5 -5
  143. data/lib/{rx_ruby → rx}/subjects/subject.rb +4 -4
  144. data/lib/{rx_ruby → rx}/subjects/subject_extensions.rb +3 -3
  145. data/lib/{rx_ruby → rx}/subscriptions/composite_subscription.rb +1 -1
  146. data/lib/{rx_ruby → rx}/subscriptions/ref_count_subscription.rb +2 -2
  147. data/lib/{rx_ruby → rx}/subscriptions/scheduled_subscription.rb +1 -1
  148. data/lib/{rx_ruby → rx}/subscriptions/serial_subscription.rb +1 -1
  149. data/lib/{rx_ruby → rx}/subscriptions/single_assignment_subscription.rb +1 -1
  150. data/lib/{rx_ruby → rx}/subscriptions/subscription.rb +1 -1
  151. data/lib/{rx_ruby → rx}/testing/cold_observable.rb +4 -4
  152. data/lib/{rx_ruby → rx}/testing/hot_observable.rb +4 -4
  153. data/lib/{rx_ruby → rx}/testing/mock_observer.rb +4 -4
  154. data/lib/{rx_ruby → rx}/testing/reactive_test.rb +3 -3
  155. data/lib/{rx_ruby → rx}/testing/recorded.rb +1 -1
  156. data/lib/{rx_ruby → rx}/testing/test_scheduler.rb +8 -8
  157. data/lib/{rx_ruby → rx}/testing/test_subscription.rb +1 -1
  158. data/lib/rx/version.rb +3 -0
  159. data/readme.md +19 -19
  160. data/{rx_ruby.gemspec → rx.gemspec} +2 -2
  161. data/test/{rx_ruby → rx}/concurrency/helpers/historical_virtual_scheduler_helper.rb +0 -0
  162. data/test/{rx_ruby → rx}/concurrency/helpers/immediate_local_scheduler_helper.rb +0 -0
  163. data/test/{rx_ruby → rx}/concurrency/test_async_lock.rb +1 -1
  164. data/test/{rx_ruby → rx}/concurrency/test_current_thread_scheduler.rb +3 -3
  165. data/test/{rx_ruby → rx}/concurrency/test_default_scheduler.rb +1 -1
  166. data/test/{rx_ruby → rx}/concurrency/test_historical_scheduler.rb +3 -3
  167. data/test/{rx_ruby → rx}/concurrency/test_immediate_scheduler.rb +2 -2
  168. data/test/{rx_ruby → rx}/concurrency/test_local_scheduler.rb +2 -2
  169. data/test/{rx_ruby → rx}/concurrency/test_periodic_scheduler.rb +1 -1
  170. data/test/{rx_ruby → rx}/concurrency/test_scheduled_item.rb +4 -4
  171. data/test/{rx_ruby → rx}/concurrency/test_scheduler.rb +2 -2
  172. data/test/{rx_ruby → rx}/concurrency/test_virtual_time_scheduler.rb +2 -2
  173. data/test/{rx_ruby → rx}/core/test_notification.rb +20 -20
  174. data/test/{rx_ruby → rx}/core/test_observable_creation.rb +220 -63
  175. data/test/{rx_ruby → rx}/core/test_observer.rb +39 -39
  176. data/test/{rx_ruby → rx}/internal/test_priority_queue.rb +6 -6
  177. data/test/{rx_ruby → rx}/subscriptions/test_composite_subscription.rb +20 -20
  178. data/test/{rx_ruby → rx}/subscriptions/test_serial_subscription.rb +9 -9
  179. data/test/{rx_ruby → rx}/subscriptions/test_singleassignment_subscription.rb +8 -8
  180. data/test/{rx_ruby → rx}/subscriptions/test_subscription.rb +3 -3
  181. data/test/test_helper.rb +1 -1
  182. metadata +129 -129
  183. data/lib/rx_ruby/linq/observable/interval.rb +0 -5
  184. data/lib/rx_ruby/version.rb +0 -3
@@ -1,12 +1,12 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
- require 'rx_ruby/concurrency/current_thread_scheduler'
4
- require 'rx_ruby/concurrency/immediate_scheduler'
5
- require 'rx_ruby/core/observer'
6
- require 'rx_ruby/subscriptions/composite_subscription'
7
- require 'rx_ruby/subscriptions/subscription'
3
+ require 'rx/concurrency/current_thread_scheduler'
4
+ require 'rx/concurrency/immediate_scheduler'
5
+ require 'rx/core/observer'
6
+ require 'rx/subscriptions/composite_subscription'
7
+ require 'rx/subscriptions/subscription'
8
8
 
9
- module RxRuby
9
+ module Rx
10
10
 
11
11
  module Observable
12
12
 
@@ -1,14 +1,14 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
3
  require 'monitor'
4
- require 'rx_ruby/subscriptions/single_assignment_subscription'
5
- require 'rx_ruby/subscriptions/serial_subscription'
6
- require 'rx_ruby/subscriptions/scheduled_subscription'
7
- require 'rx_ruby/core/observer'
8
- require 'rx_ruby/core/observable'
9
- require 'rx_ruby/core/observe_on_observer'
10
-
11
- module RxRuby
4
+ require 'rx/subscriptions/single_assignment_subscription'
5
+ require 'rx/subscriptions/serial_subscription'
6
+ require 'rx/subscriptions/scheduled_subscription'
7
+ require 'rx/core/observer'
8
+ require 'rx/core/observable'
9
+ require 'rx/core/observe_on_observer'
10
+
11
+ module Rx
12
12
  module Observable
13
13
 
14
14
  # Wraps the source sequence in order to run its subscription and unsubscribe logic on the specified scheduler.
@@ -1,18 +1,18 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
3
  require 'thread'
4
- require 'rx_ruby/concurrency/default_scheduler'
5
- require 'rx_ruby/subscriptions/subscription'
6
- require 'rx_ruby/subscriptions/composite_subscription'
7
- require 'rx_ruby/subscriptions/ref_count_subscription'
8
- require 'rx_ruby/subscriptions/serial_subscription'
9
- require 'rx_ruby/subscriptions/single_assignment_subscription'
10
- require 'rx_ruby/core/observer'
11
- require 'rx_ruby/core/observable'
12
- require 'rx_ruby/subjects/subject'
13
-
14
-
15
- module RxRuby
4
+ require 'rx/concurrency/default_scheduler'
5
+ require 'rx/subscriptions/subscription'
6
+ require 'rx/subscriptions/composite_subscription'
7
+ require 'rx/subscriptions/ref_count_subscription'
8
+ require 'rx/subscriptions/serial_subscription'
9
+ require 'rx/subscriptions/single_assignment_subscription'
10
+ require 'rx/core/observer'
11
+ require 'rx/core/observable'
12
+ require 'rx/subjects/subject'
13
+
14
+
15
+ module Rx
16
16
 
17
17
  # Time based operations
18
18
  module Observable
@@ -1,11 +1,11 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
3
  require 'thread'
4
- require 'rx_ruby/core/observer'
5
- require 'rx_ruby/core/observable'
6
- require 'rx_ruby/subscriptions/subscription'
4
+ require 'rx/core/observer'
5
+ require 'rx/core/observable'
6
+ require 'rx/subscriptions/subscription'
7
7
 
8
- module RxRuby
8
+ module Rx
9
9
 
10
10
  # Represents the result of an asynchronous operation.
11
11
  # Each notification is broadcasted to all subscribed observers.
@@ -1,10 +1,10 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
3
  require 'thread'
4
- require 'rx_ruby/core/observer'
5
- require 'rx_ruby/core/observable'
4
+ require 'rx/core/observer'
5
+ require 'rx/core/observable'
6
6
 
7
- module RxRuby
7
+ module Rx
8
8
 
9
9
  # Represents a value that changes over time.
10
10
  # Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
@@ -1,12 +1,12 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
3
  require 'thread'
4
- require 'rx_ruby/concurrency/current_thread_scheduler'
5
- require 'rx_ruby/core/observer'
6
- require 'rx_ruby/core/observable'
7
- require 'rx_ruby/core/time_interval'
4
+ require 'rx/concurrency/current_thread_scheduler'
5
+ require 'rx/core/observer'
6
+ require 'rx/core/observable'
7
+ require 'rx/core/time_interval'
8
8
 
9
- module RxRuby
9
+ module Rx
10
10
 
11
11
  # Represents an object that is both an observable sequence as well as an observer.
12
12
  # Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
@@ -1,11 +1,11 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
3
  require 'thread'
4
- require 'rx_ruby/core/observer'
5
- require 'rx_ruby/core/observable'
6
- require 'rx_ruby/subscriptions/subscription'
4
+ require 'rx/core/observer'
5
+ require 'rx/core/observable'
6
+ require 'rx/subscriptions/subscription'
7
7
 
8
- module RxRuby
8
+ module Rx
9
9
 
10
10
  # Represents an object that is both an observable sequence as well as an observer.
11
11
  # Each notification is broadcasted to all subscribed observers.
@@ -1,9 +1,9 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
- require 'rx_ruby/core/observer'
4
- require 'rx_ruby/core/observable'
3
+ require 'rx/core/observer'
4
+ require 'rx/core/observable'
5
5
 
6
- module RxRuby
6
+ module Rx
7
7
 
8
8
  # Provides a set of static methods for creating subjects.
9
9
  class Subject
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'thread'
4
4
 
5
- module RxRuby
5
+ module Rx
6
6
 
7
7
  # Represents a group of subscription resources that are unsubscribed together.
8
8
  class CompositeSubscription
@@ -1,9 +1,9 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
3
  require 'thread'
4
- require 'rx_ruby/subscriptions/subscription'
4
+ require 'rx/subscriptions/subscription'
5
5
 
6
- module RxRuby
6
+ module Rx
7
7
 
8
8
  # Represents a subscription resource that only disposes its underlying subscription resource when all dependent subscription objects have been unsubscribed.
9
9
  class RefCountSubscription
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
- module RxRuby
3
+ module Rx
4
4
  # Represents a disposable resource whose disposal invocation will be scheduled on the specified scheduler
5
5
  class ScheduledDisposable
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'thread'
4
4
 
5
- module RxRuby
5
+ module Rx
6
6
 
7
7
  # Represents a subscription resource whose underlying subscription resource can be replaced by another subscription resource, causing automatic disposal of the previous underlying subscription resource.
8
8
  class SerialSubscription
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'thread'
4
4
 
5
- module RxRuby
5
+ module Rx
6
6
 
7
7
  # Represents a subscription resource which only allows a single assignment of its underlying subscription resource.
8
8
  # If an underlying subscription resource has already been set, future attempts to set the underlying subscription resource will throw an error
@@ -3,7 +3,7 @@
3
3
  require 'thread'
4
4
  require 'singleton'
5
5
 
6
- module RxRuby
6
+ module Rx
7
7
  module Subscription
8
8
  def dispose
9
9
  unsubscribe
@@ -1,10 +1,10 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
- require 'rx_ruby/subscriptions/subscription'
4
- require 'rx_ruby/subscriptions/composite_subscription'
5
- require 'rx_ruby/testing/test_subscription'
3
+ require 'rx/subscriptions/subscription'
4
+ require 'rx/subscriptions/composite_subscription'
5
+ require 'rx/testing/test_subscription'
6
6
 
7
- module RxRuby
7
+ module Rx
8
8
 
9
9
  class ColdObservable
10
10
 
@@ -1,10 +1,10 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
- require 'rx_ruby/core/observable'
4
- require 'rx_ruby/subscriptions/subscription'
5
- require 'rx_ruby/testing/test_subscription'
3
+ require 'rx/core/observable'
4
+ require 'rx/subscriptions/subscription'
5
+ require 'rx/testing/test_subscription'
6
6
 
7
- module RxRuby
7
+ module Rx
8
8
 
9
9
  class HotObservable
10
10
  include Observable
@@ -1,10 +1,10 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
- require 'rx_ruby/core/observer'
4
- require 'rx_ruby/core/notification'
5
- require 'rx_ruby/testing/recorded'
3
+ require 'rx/core/observer'
4
+ require 'rx/core/notification'
5
+ require 'rx/testing/recorded'
6
6
 
7
- module RxRuby
7
+ module Rx
8
8
 
9
9
  class MockObserver
10
10
  include Observer
@@ -1,9 +1,9 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
- require 'rx_ruby/core/notification'
4
- require 'rx_ruby/testing/recorded'
3
+ require 'rx/core/notification'
4
+ require 'rx/testing/recorded'
5
5
 
6
- module RxRuby
6
+ module Rx
7
7
 
8
8
  # Module to write unit tests for applications and libraries built using Reactive Extensions.
9
9
  module ReactiveTest
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
- module RxRuby
3
+ module Rx
4
4
 
5
5
  # Record of a value including the virtual time it was produced on.
6
6
  class Recorded < Struct.new(:time, :value)
@@ -1,13 +1,13 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
- require 'rx_ruby/concurrency/virtual_time_scheduler'
4
- require 'rx_ruby/subscriptions/subscription'
5
- require 'rx_ruby/testing/cold_observable'
6
- require 'rx_ruby/testing/hot_observable'
7
- require 'rx_ruby/testing/mock_observer'
8
- require 'rx_ruby/testing/reactive_test'
3
+ require 'rx/concurrency/virtual_time_scheduler'
4
+ require 'rx/subscriptions/subscription'
5
+ require 'rx/testing/cold_observable'
6
+ require 'rx/testing/hot_observable'
7
+ require 'rx/testing/mock_observer'
8
+ require 'rx/testing/reactive_test'
9
9
 
10
- module RxRuby
10
+ module Rx
11
11
 
12
12
  # Virtual time scheduler used for testing applications and libraries built using Reactive Extensions.
13
13
  class TestScheduler < VirtualTimeScheduler
@@ -44,7 +44,7 @@ module RxRuby
44
44
  def configure(options = {})
45
45
  options.each {|key,_|
46
46
  unless [:created, :subscribed, :disposed].include? key
47
- raise ArgumentError, "Should be spcified whether :created, :subscribed or :disposed, but the #{key.inspect}"
47
+ raise ArgumentError, "Should be specified whether :created, :subscribed or :disposed, but the #{key.inspect}"
48
48
  end
49
49
  }
50
50
  o = {
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
- module RxRuby
3
+ module Rx
4
4
 
5
5
  # Records information about subscriptions to and unsubscriptions from observable sequences.
6
6
  class TestSubscription < Struct.new(:subscribe, :unsubscribe)
@@ -0,0 +1,3 @@
1
+ module Rx
2
+ VERSION = '0.0.3'
3
+ end
data/readme.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![Build Status](https://travis-ci.org/ReactiveX/RxRuby.svg?branch=master)](https://travis-ci.org/ReactiveX/RxRuby)
2
- [![GitHub version](http://img.shields.io/github/tag/ReactiveX/RxRuby.svg)](https://github.com/ReactiveX/RxRuby)
3
- [![Downloads](http://img.shields.io/gem/dt/rx.svg)](https://npmjs.org/package/rx)
2
+ [![GitHub version](https://img.shields.io/github/tag/ReactiveX/RxRuby.svg)](https://github.com/ReactiveX/RxRuby)
3
+ [![Downloads](https://img.shields.io/gem/dt/rx.svg)](https://www.npmjs.com/package/rx)
4
4
  [![Code Climate](https://codeclimate.com/github/ReactiveX/RxRuby/badges/gpa.svg)](https://codeclimate.com/github/ReactiveX/RxRuby)
5
5
 
6
6
  **[The Need to go Reactive](#the-need-to-go-reactive)** |
@@ -14,19 +14,19 @@
14
14
 
15
15
  ## The Need to go Reactive ##
16
16
 
17
- Reactive Programming is a hot topic as of late, especially with such things as the [Reactive Manifesto](http://www.reactivemanifesto.org/). Applications needs have changed over time with simple polling for data, to a full reactive system where data is pushed at you. Each time, we're adding more complexity, more data, and asynchronous behavior to our applications. How do we manage it all? How do we scale it? By moving towards "Reactive Architectures" which are event-driven, resilient and responsive. With the Reactive Extensions, you have all the tools you need to help build these systems.
17
+ Reactive Programming is a hot topic as of late, especially with such things as the [Reactive Manifesto](http://www.reactivemanifesto.org/). Applications' needs have changed over time, from simple polling for data to a full reactive system where data is pushed at you. Each time, we're adding more complexity, data, and asynchronous behavior to our applications. How do we manage it all? How do we scale it? By moving towards "Reactive Architectures" which are event-driven, resilient, and responsive. With the Reactive Extensions, you have all the tools you need to help build these systems.
18
18
 
19
19
  ## About the Reactive Extensions ##
20
20
 
21
- The Reactive Extensions for Ruby (RxRuby) is a set of libraries for composing asynchronous and event-based programs using observable sequences and fluent query operators that many of you already know by with the in Ruby. Using RxRuby, developers represent asynchronous data streams with Observables, query asynchronous data streams using our many operators, and parameterize the concurrency in the asynchronous data streams using Schedulers. Simply put, RxRuby = Observables + Operators + Schedulers.
21
+ The Reactive Extensions for Ruby (RxRuby) is a set of libraries for composing asynchronous and event-based programs using observable sequences and fluent query operators that many of you already know in Ruby. Using RxRuby, developers represent asynchronous data streams with Observables, query asynchronous data streams using our many operators, and parameterize the concurrency in the asynchronous data streams using Schedulers. Simply put, RxRuby = Observables + Operators + Schedulers.
22
22
 
23
- When you're authoring applications with Ruby, there may be times when you want to deal with asynchronous programming and event-based programming, and synchronization is difficult and error prone.
23
+ When you're authoring applications with Ruby, there may be times when you want to deal with asynchronous and event-based programming, and synchronization is difficult and error prone.
24
24
 
25
- Using RxRuby, you can represent multiple asynchronous data streams (that come from diverse sources, e.g., stock quote, tweets, computer events, web service requests, etc.), and subscribe to the event stream using the Observer module. The Observable notifies the subscribed Observer instance whenever an event occurs.
25
+ Using RxRuby, you can represent multiple asynchronous data streams (that come from diverse sources, e.g., stock quotes, tweets, computer events, web service requests, etc.), and subscribe to the event stream using the Observer module. The Observable notifies the subscribed Observer instance whenever an event occurs.
26
26
 
27
- Because observable sequences are data streams, you can query them using standard query operators implemented by the Observable module. Thus you can filter, project, reduce, compose and perform time-based operations on multiple events easily by using these our many operators. In addition, there are a number of other reactive stream specific operators that allow powerful queries to be written. Cancellation, exceptions, and synchronization are also handled gracefully by using the methods on the Observable module.
27
+ Because observable sequences are data streams, you can query them using standard query operators implemented by the Observable module. Thus you can filter, project, reduce, compose, and perform time-based operations on multiple events easily by using these operators. In addition, there are a number of other reactive stream-specific operators that allow powerful queries to be written. Cancellation, exceptions, and synchronization are also handled gracefully by using the methods on the Observable module.
28
28
 
29
- But the best news of all is that you already know how to program like this. Take for example the following Ruby code, where we get some stock data and then manipulate and then iterate the results.
29
+ But the best news of all is that you already know how to program like this. Take for example the following Ruby code, where we get some stock data, manipulate it, and then iterate over the results.
30
30
 
31
31
  ```ruby
32
32
  # Get evens and square each
@@ -36,7 +36,7 @@ someSource
36
36
  .each {|x| puts x.to_s }
37
37
  ```
38
38
 
39
- Using RxRuby, you can accomplish the same kind of thing with a push based collection with little to no change to your code at all, changing `each` to `subscribe`.
39
+ Using RxRuby, you can accomplish the same kind of thing with a push-based collection by changing `each` to `subscribe`.
40
40
 
41
41
  ```ruby
42
42
  someSource
@@ -47,7 +47,7 @@ someSource
47
47
 
48
48
  ## Why RxRuby? ##
49
49
 
50
- The overall goal of [RxRuby](https://github.com/ReactiveX/RxRuby) is to have a push based version of the [Enumerable module](http://www.ruby-doc.org/core-2.1.0/Enumerable.html) with an added notion of time. Right now, the [Observable module](http://ruby-doc.org/stdlib-1.9.3/libdoc/observer/rdoc/Observable.html) is not quite what we want because it does not allow for composition. That is no more than a simple implementation of the Subject/Observer pattern from the Gang of Four book, such as the following.
50
+ The overall goal of [RxRuby](https://github.com/ReactiveX/RxRuby) is to have a push-based version of the [Enumerable module](http://ruby-doc.org/core-2.1.0/Enumerable.html) with an added notion of time. Right now, the [Observable module](http://ruby-doc.org/stdlib-1.9.3/libdoc/observer/rdoc/Observable.html) is not quite what we want because it does not allow for composition. That is no more than a simple implementation of the Subject/Observer pattern from the Gang of Four book, such as the following.
51
51
 
52
52
  ```ruby
53
53
  require 'observer'
@@ -87,13 +87,13 @@ observer = ArrayObserver.new(observable)
87
87
  # 2
88
88
  ```
89
89
 
90
- But, how do you enable better composition so that you can compose together Observable instances? In this current model, this can't happen. That's why we need the Reactive Extensions for Ruby. Not only that, but we can at any point in the computation, change the concurrency model to be immediate, on a new thread, or on another machine.
90
+ But how do you enable better composition so that you can compose together Observable instances? In this current model, this can't happen. That's why we need the Reactive Extensions for Ruby. Not only that, we can, at any point in the computation, change the concurrency model to be immediate, on a new thread, or on another machine.
91
91
 
92
- There are many implementations of the Reactive Extensions such as [RxJS](https://github.com/Reactive-Extensions/RxJS), [Rx.NET](https://github.com/reactive-extensions/rx.net), [Java/JVM/Clojure/Scala/JRuby/Groovy](https://github.com/Netflix/RxJava) and [ObjC/ReactiveCocoa](https://github.com/ReactiveCocoa/ReactiveCocoa). Our goal is to have one operate like the JRuby one, but be available to all users of Ruby regardless of VM.
92
+ There are many implementations of the Reactive Extensions such as [RxJS](https://github.com/Reactive-Extensions/RxJS), [Rx.NET](https://github.com/reactive-extensions/rx.net), [Java/JVM/Clojure/Scala/JRuby/Groovy](https://github.com/ReactiveX/RxJava) and [ObjC/ReactiveCocoa](https://github.com/ReactiveCocoa/ReactiveCocoa). Our goal is to have one operate like the JRuby one, but be available to all users of Ruby, regardless of VM.
93
93
 
94
- We'd like it to be much like our JavaScript version, [RxJS](https://github.com/Reactive-Extensions/RxJS) but be able to handle multi-threading, parallelism, and in addition, go across the network.
94
+ We'd like it to be like our JavaScript version, [RxJS](https://github.com/Reactive-Extensions/RxJS) but be able to handle multi-threading, parallelism, and in addition, go across the network.
95
95
 
96
- Instead, our goal is to make the Observable module look exactly like the Enumerable module in that you can write any query method over it to produce a value, but have it push based. This could become yet another competitor to [EventMachine](http://rubyeventmachine.com/) in which we have rich composition over events, whether locally or across the network.
96
+ Instead, our goal is to make the Observable module look exactly like the Enumerable module, in that you can write any query method over it to produce a value, but have it push-based. This could become yet another competitor to [EventMachine](http://rubyeventmachine.com/), in which we have rich composition over events, whether locally or across the network.
97
97
 
98
98
  So, take an example, zipping two Arrays.
99
99
 
@@ -109,10 +109,10 @@ a.zip([1, 2], [8]) #=> [[4, 1, 8], [5, 2, nil], [6, nil, nil]]
109
109
  Now, we could do something similar in [RxRuby](https://github.com/ReactiveX/RxRuby) with two observable sequences:
110
110
 
111
111
  ```ruby
112
- require 'rx_ruby'
112
+ require 'rx'
113
113
 
114
- a = RxRuby::Observable.from_array [ 4, 5, 6 ]
115
- b = RxRuby::Observable.from_array [ 7, 8, 9 ]
114
+ a = Rx::Observable.from_array [ 4, 5, 6 ]
115
+ b = Rx::Observable.from_array [ 7, 8, 9 ]
116
116
 
117
117
  sub = a.zip(b).subscribe {|arr| puts arr.to_s }
118
118
  # => "[4, 7]"
@@ -123,9 +123,9 @@ sub = a.zip(b).subscribe {|arr| puts arr.to_s }
123
123
  sub.unsubscribe
124
124
  ```
125
125
 
126
- The difference here is that `zip` returns an `RxRuby::Observable` instead of an `Enumerable`. And once you call `subscribe` it's much like `each` but takes an observer, or perhaps just some blocks, lambdas, etc. The subscription handed back contains the cancellation logic. For example, if you are listening to events and you no longer want to listen, then you can call `unsubscribe` on the `sub` variable above.
126
+ The difference here is that `zip` returns an `Rx::Observable` instead of an `Enumerable`. And once you call `subscribe` it's much like `each` but takes an observer, or perhaps just some blocks, lambdas, etc. The subscription handed back contains the cancellation logic. For example, if you are listening to events and you no longer want to listen, you can call `unsubscribe` on the `sub` variable above.
127
127
 
128
- What's the end goal? The first part is where we want to support the main `Enumerable` module methods in the `Observable` module and have them react the same way, but push instead of pull based. Then from there, we can explore such things as multi-threading, and calls across the network.
128
+ What's the end goal? The first part is that we want to support the main `Enumerable` module methods in the `Observable` module and have them react the same way, but push instead of pull-based. From there, we can explore such things as multi-threading, and calls across the network.
129
129
 
130
130
  If you want to find out more, please check out the JavaScript version, [RxJS](https://github.com/Reactive-Extensions/RxJS), which has more details on the overall goals.
131
131
 
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'rx_ruby/version'
4
+ require 'rx/version'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
  gem.authors = ["Microsoft Open Technologies, Inc."]
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = "rx"
15
15
  gem.require_paths = ["lib"]
16
- gem.version = RxRuby::VERSION
16
+ gem.version = Rx::VERSION
17
17
  gem.license = 'Apache License, v2.0'
18
18
 
19
19
  gem.add_development_dependency 'rake'