reactive_support 0.2.1 → 0.2.2.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/{extensions → reactive_support/extensions}/array_extensions.rb +0 -0
- data/lib/{extensions → reactive_support/extensions}/hash_extensions.rb +0 -0
- data/lib/reactive_support/extensions/reactive_extensions.rb +3 -7
- data/spec/spec_helper.rb +1 -1
- data/version.rb +2 -2
- metadata +5 -6
- data/lib/extensions/reactive_extensions.rb +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cda2046ed4fab5bb39170777e080e493d78a485
|
4
|
+
data.tar.gz: 94e4af2f80ad955ca321022accb309a39fe6c4ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a3bbd48e6872d1c9d149c5b0018e8ec8ffdb944c4cd1441e5e5780abbc5f341cd37ac21998f595d7ff4ed2967881ccaa8cf62edc4e5b9dfe8143a9314bdcfe1
|
7
|
+
data.tar.gz: 18dd8e1383073d826b7bbe9c3462017b71e3dac20348fadf49e4c84dac6906af4bbab3f431f72537bad91c13df2be7467d78e1782010980f610dabe2bba08219
|
File without changes
|
File without changes
|
@@ -5,10 +5,11 @@ require 'reactive_support'
|
|
5
5
|
# them in your project, you will need to put this in your main project file:
|
6
6
|
# require 'reactive_support/extensions'
|
7
7
|
#
|
8
|
-
# ReactiveExtensions
|
9
|
-
#
|
8
|
+
# ReactiveExtensions includes ReactiveSupport, so you will need to remove any
|
9
|
+
# requires for ReactiveSupport as it will raise a SystemStackError.
|
10
10
|
|
11
11
|
module ReactiveExtensions
|
12
|
+
Dir['./**/*.rb'].each {|f| require f }
|
12
13
|
|
13
14
|
# The +#try_rescue+ method extends ReactiveSupport's +#try+ method so it
|
14
15
|
# rescues NoMethodErrors and TypeErrors as well as returning +nil+ when
|
@@ -36,11 +37,6 @@ module ReactiveExtensions
|
|
36
37
|
end
|
37
38
|
end
|
38
39
|
|
39
|
-
# Include ReactiveExtensions in Ruby's core Object class.
|
40
|
-
# See Ruby documentation for version
|
41
|
-
# 2.1.3[http://ruby-doc.org/core-2.1.3/Object.html],
|
42
|
-
# 2.0.0[http://ruby-doc.org/core-2.1.3/Object.html], or
|
43
|
-
# 1.9.3[http://ruby-doc.org/core-2.0.0/Object.html].
|
44
40
|
class Object
|
45
41
|
include ReactiveExtensions
|
46
42
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -10,7 +10,7 @@ SimpleCov.start if ENV["COVERAGE"]
|
|
10
10
|
Coveralls.wear!
|
11
11
|
|
12
12
|
# ReactiveExtensions requires ReactiveSupport, but not vice versa
|
13
|
-
require File.expand_path('../../lib/extensions/reactive_extensions', __FILE__)
|
13
|
+
require File.expand_path('../../lib/reactive_support/extensions/reactive_extensions', __FILE__)
|
14
14
|
|
15
15
|
RSpec.configure do |c|
|
16
16
|
c.order = 'random'
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reactive_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dana Scheider
|
@@ -75,9 +75,6 @@ extra_rdoc_files:
|
|
75
75
|
- README.md
|
76
76
|
- LICENSE
|
77
77
|
files:
|
78
|
-
- "./lib/extensions/array_extensions.rb"
|
79
|
-
- "./lib/extensions/hash_extensions.rb"
|
80
|
-
- "./lib/extensions/reactive_extensions.rb"
|
81
78
|
- "./lib/reactive_support.rb"
|
82
79
|
- "./lib/reactive_support/core_ext/array/access.rb"
|
83
80
|
- "./lib/reactive_support/core_ext/object/blank.rb"
|
@@ -87,6 +84,8 @@ files:
|
|
87
84
|
- "./lib/reactive_support/core_ext/object/inclusion.rb"
|
88
85
|
- "./lib/reactive_support/core_ext/object/instance_variables.rb"
|
89
86
|
- "./lib/reactive_support/core_ext/object/try.rb"
|
87
|
+
- "./lib/reactive_support/extensions/array_extensions.rb"
|
88
|
+
- "./lib/reactive_support/extensions/hash_extensions.rb"
|
90
89
|
- "./lib/reactive_support/extensions/reactive_extensions.rb"
|
91
90
|
- "./spec/array_spec.rb"
|
92
91
|
- "./spec/reactive_extensions_spec.rb"
|
@@ -118,9 +117,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
117
|
version: 1.9.3
|
119
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
119
|
requirements:
|
121
|
-
- - "
|
120
|
+
- - ">"
|
122
121
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
122
|
+
version: 1.3.1
|
124
123
|
requirements: []
|
125
124
|
rubyforge_project:
|
126
125
|
rubygems_version: 2.2.2
|
@@ -1,42 +0,0 @@
|
|
1
|
-
require 'reactive_support'
|
2
|
-
|
3
|
-
# The ReactiveExtensions module consists of methods I wish ActiveSupport provided.
|
4
|
-
# These methods do not adhere to the ActiveSupport API. If you wish to include
|
5
|
-
# them in your project, you will need to put this in your main project file:
|
6
|
-
# require 'reactive_support/extensions'
|
7
|
-
#
|
8
|
-
# ReactiveExtensions includes ReactiveSupport, so you will need to remove any
|
9
|
-
# requires for ReactiveSupport as it will raise a SystemStackError.
|
10
|
-
|
11
|
-
module ReactiveExtensions
|
12
|
-
Dir['./**/*.rb'].each {|f| require f }
|
13
|
-
|
14
|
-
# The +#try_rescue+ method extends ReactiveSupport's +#try+ method so it
|
15
|
-
# rescues NoMethodErrors and TypeErrors as well as returning +nil+ when
|
16
|
-
# called on a +nil+ value.
|
17
|
-
#
|
18
|
-
# Like the +#try+ method, +#try_rescue+ takes 1 or more arguments. The first
|
19
|
-
# argument is the method to be called on the calling object, passed as a
|
20
|
-
# symbol. The others are zero or more arguments that will be passed through to
|
21
|
-
# that method, and +&block+ is an optional block that will be similarly passed through.
|
22
|
-
#
|
23
|
-
# Example of usage identical to +#try+:
|
24
|
-
# nil.try(:map) {|a| a.to_s } # => nil
|
25
|
-
# nil.try_rescue(:map) {|a| a.to_s } # => nil
|
26
|
-
#
|
27
|
-
# Example of usage calling a method that is not defined on the calling object:
|
28
|
-
# 10.try(:to_h) # => TypeError
|
29
|
-
# 10.try_rescue(:to_h) # => nil
|
30
|
-
#
|
31
|
-
# Example of usage with invalid arguments:
|
32
|
-
# %w(foo, bar, baz).try(:join, [:hello, :world]) # => TypeError
|
33
|
-
# %w(foo, bar, baz).try_rescue(:join, [:hello, :world]) # => nil
|
34
|
-
|
35
|
-
def try_rescue(*args, &block)
|
36
|
-
self.try(*args, &block) rescue nil
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
class Object
|
41
|
-
include ReactiveExtensions
|
42
|
-
end
|