reactive_support 0.1.2 → 0.1.3.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +11 -5
- data/README.md +26 -10
- data/lib/reactive_support/core_ext/object/deep_dup.rb +5 -0
- data/lib/reactive_support/core_ext/object/try.rb +6 -4
- data/lib/reactive_support/extensions/reactive_extensions.rb +5 -0
- data/lib/reactive_support.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- data/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a76239ce7cf53dfab3088b007b993b0ce1399108
|
4
|
+
data.tar.gz: fb8cc9c38444f37f4a7d4245b54cc601209cb5da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b9f2de0069d5738c79b100f5d025ea409940eada943a366f5bc1d7c953eb2d248e0f77992f2802d0d07e53852ad18733d61dc8b49b5beef8efa0631ebef20ce
|
7
|
+
data.tar.gz: 04049f2dae7f2b84cb7e3d05cfe6a2f610c1ef2a64c85dab033bf6399fa19d1dbf92bc587640baa1abb2da5a39ad1c746114466e1e4f67a42c4ef4b0e2c999f1
|
data/CONTRIBUTING.md
CHANGED
@@ -18,8 +18,7 @@ DO...
|
|
18
18
|
* Include robust, passing RSpec examples with your PR
|
19
19
|
* Include extensive [RDoc](https://github.com/rdoc/rdoc) comments
|
20
20
|
* Keep your code DRY and concise - be mindful of best practices
|
21
|
-
* Familiarize yourself with the metrics
|
22
|
-
* Familiarize yourself with the vision and values of this project
|
21
|
+
* Familiarize yourself with the metrics, vision, and values of this project
|
23
22
|
* Run the full test suite before making your PR
|
24
23
|
* File an issue report or message me if you have any questions
|
25
24
|
(I don't bite!)
|
@@ -29,10 +28,11 @@ DON'T...
|
|
29
28
|
* Break backward compatibility
|
30
29
|
* Modify existing functionality (unless required to fix a bug)
|
31
30
|
* Add dependencies
|
32
|
-
* Add functionality that is not present in ActiveSupport
|
31
|
+
* Add functionality that is not present in ActiveSupport (except to the
|
32
|
+
ReactiveExtensions module)
|
33
33
|
* Submit a PR with breaking changes or no passing tests
|
34
34
|
* Submit changes that only work with particular tools, gemsets,
|
35
|
-
environments, or Ruby versions
|
35
|
+
environments, or with only a subset of supported Ruby versions.
|
36
36
|
|
37
37
|
Thank you for your contributions!
|
38
38
|
|
@@ -159,4 +159,10 @@ Lots of things can be reduced to a single line, especially blocks and conditiona
|
|
159
159
|
end
|
160
160
|
|
161
161
|
# Needs to be written like this:
|
162
|
-
return foo.message rescue "It didn't work!"
|
162
|
+
return foo.message rescue "It didn't work!"
|
163
|
+
|
164
|
+
#### Contributing to ReactiveExtensions
|
165
|
+
The ReactiveExtensions module is for useful methods that are not included in
|
166
|
+
ActiveSupport, but are congruent with its spirit. I'll accept additions to
|
167
|
+
ReactiveExtensions as long as they will be useful to a broad audience and
|
168
|
+
adhere to best practices and style/testing/documentation guidelines.
|
data/README.md
CHANGED
@@ -1,16 +1,27 @@
|
|
1
|
-
## ReactiveSupport
|
1
|
+
## ReactiveSupport
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/reactive_support.svg)](http://badge.fury.io/rb/reactive_support) [![Build Status](https://travis-ci.org/danascheider/reactive_support.svg?branch=master)](https://travis-ci.org/danascheider/reactive_support) [![Coverage Status](https://img.shields.io/coveralls/danascheider/reactive_support.svg)](https://coveralls.io/r/danascheider/reactive_support) [![Code Climate](https://codeclimate.com/github/danascheider/reactive_support/badges/gpa.svg)](https://codeclimate.com/github/danascheider/reactive_support) [![Inline docs](http://inch-ci.org/github/danascheider/reactive_support.svg?branch=master)](http://inch-ci.org/github/danascheider/reactive_support)
|
3
|
+
|
2
4
|
The ReactiveSupport gem provides a re-implementation of certain [ActiveSupport](https://github.com/rails/activesupport)
|
3
5
|
methods, allowing them to be used outside of the Rails ecosystem. This gem can
|
4
6
|
be used in any kind of project and is not dependent on any frameworks, gemsets, etc.
|
5
7
|
To add ReactiveSupport to your project, add this to your Gemfile and run `bundle install`:
|
6
|
-
<pre><code>gem '
|
8
|
+
<pre><code>gem 'reactive_support', '~> 0.1.3'</code></pre>
|
7
9
|
To install locally:
|
8
|
-
<pre><code>sudo gem install
|
10
|
+
<pre><code>sudo gem install reactive_support</code></pre>
|
9
11
|
Or if you're using RVM:
|
10
|
-
<pre><code>gem install
|
12
|
+
<pre><code>gem install reactive_support</code></pre>
|
11
13
|
Then, in your main project file, include:
|
12
14
|
<pre><code>require 'reactive_support'</code></pre>
|
13
15
|
|
16
|
+
You can also point your Gemfile to this repo:
|
17
|
+
<pre><code>gem 'reactive_support', '~> 0.1.3', git: 'https://github.com/danascheider/reactive_support.git</code></pre>
|
18
|
+
|
19
|
+
If you would like to install an earlier version, you can specify that version's branch
|
20
|
+
using the standard branch naming scheme:
|
21
|
+
<pre><code>gem 'reactive_support', '~> 0.1.2', git: 'https://github.com/danascheider/reactive_support.git, branch: 'version-0.1.2'</code></pre>
|
22
|
+
|
23
|
+
Please note that version 0.1.2 is the earliest available version of ReactiveSupport.
|
24
|
+
|
14
25
|
### Usage
|
15
26
|
In its current version, ReactiveSupport adds methods to Ruby's `Object` class, so
|
16
27
|
once required, its methods can be used on any object within your project, including
|
@@ -20,7 +31,13 @@ Currently, ReactiveSupport's methods are a strict subset of ActiveSupport's. (Th
|
|
20
31
|
change in future versions, or most saliently, if ActiveSupport's API changes.)
|
21
32
|
That means that, while not all ActiveSupport methods are available, those that are can,
|
22
33
|
as of September 2014, be found in ActiveSupport's API documentation with no functional
|
23
|
-
differences. (This is true of ReactiveSupport 0.1.
|
34
|
+
differences. (This is true of ReactiveSupport 0.1.x and ActiveSupport 4.1.6.)
|
35
|
+
|
36
|
+
ReactiveSupport includes an extension module, ReactiveExtensions, that additional
|
37
|
+
methods in the spirit of, but not included in, ActiveSupport. This module needs to
|
38
|
+
be included separately; the default configuration is that only ActiveSupport methods
|
39
|
+
are added to your project. You can include ReactiveExtensions with a simple `require`:
|
40
|
+
<pre><code>require 'reactive_support/extensions/reactive_extensions'</pre></code>
|
24
41
|
|
25
42
|
### FAQ
|
26
43
|
##### Why not just use ActiveSupport?
|
@@ -56,12 +73,10 @@ contributions should not be taken to mean it has fallen off my radar.
|
|
56
73
|
|
57
74
|
##### Can I use ReactiveSupport in a Sinatra project/Puppet module/system utility/etc.?
|
58
75
|
Yes. ReactiveSupport is agnostic to the characteristics of your app, and there is no
|
59
|
-
reason it cannot be used in any app where you feel it
|
76
|
+
reason it cannot be used in any app where you feel it will be useful.
|
60
77
|
|
61
78
|
##### What versions of Ruby are supported?
|
62
|
-
ReactiveSupport version 0.1
|
63
|
-
of JRuby as well (currently 1.7.16), but tests are currently failing and frankly,
|
64
|
-
I don't know JRuby well enough to fix them. Additional Rubies
|
79
|
+
ReactiveSupport version 0.1 supports Ruby versions >= 1.9.3. Additional Rubies
|
65
80
|
may be supported in the future. Adding such support would be a welcome contribution
|
66
81
|
to the project.
|
67
82
|
|
@@ -89,4 +104,5 @@ full CONTRIBUTING.md file to ensure your pull request will be accepted as is:
|
|
89
104
|
ActiveRecord give information about each of ReactiveSupport's methods.
|
90
105
|
* Those interested in contributing to ReactiveSupport are encouraged read up on
|
91
106
|
[Travis CI](http://travis-ci.org), [Coveralls](http://coveralls.io),
|
92
|
-
[CodeClimate](http://codeclimate.com), and [Inch CI](http://inch-ci.org).
|
107
|
+
[CodeClimate](http://codeclimate.com), and [Inch CI](http://inch-ci.org).
|
108
|
+
* Check out ReactiveSupport at [Rubygems.org](http://rubygems.org/gems/reactive_support)!
|
@@ -1,3 +1,8 @@
|
|
1
|
+
# Ruby's core Object class. See documentation for version
|
2
|
+
# 2.1.3[http://ruby-doc.org/core-2.1.3/Object.html],
|
3
|
+
# 2.0.0[http://ruby-doc.org/core-2.1.3/Object.html], or
|
4
|
+
# 1.9.3[http://ruby-doc.org/core-2.0.0/Object.html].
|
5
|
+
|
1
6
|
class Object
|
2
7
|
|
3
8
|
# The +#deep_dup+ method returns a duplicate of a duplicable object. If the
|
@@ -1,8 +1,10 @@
|
|
1
1
|
class Object
|
2
|
-
# The +#try+ method calls
|
3
|
-
# on the object calling it.
|
4
|
-
# method
|
5
|
-
#
|
2
|
+
# The +#try+ method calls a given (with given +*args+ and +&block+)
|
3
|
+
# on the object calling it. If the receiving object is +nil+, then the +#try+
|
4
|
+
# method returns +nil+; otherwise, +#try+ returns the output of the method
|
5
|
+
# passed to it, or any error raised when the method is called.
|
6
|
+
# It accepts an arbitrary number of arguments and an optional block,
|
7
|
+
# enabling it to be used with any method.
|
6
8
|
#
|
7
9
|
# The first argument is the name of the method to be called, given as a symbol.
|
8
10
|
# The rest are the arguments (if any) that should be passed into that
|
@@ -36,6 +36,11 @@ module ReactiveExtensions
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
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].
|
39
44
|
class Object
|
40
45
|
include ReactiveExtensions
|
41
46
|
end
|
data/lib/reactive_support.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Dir['./lib/reactive_support/core_ext
|
1
|
+
Dir['./lib/reactive_support/core_ext/**/*.rb'].each {|f| require f }
|
2
2
|
|
3
3
|
# The ReactiveSupport module implements methods from ActiveSupport. It can be
|
4
4
|
# included in Ruby's +Object+ class by adding +require 'reactive_support'+ to
|
data/spec/spec_helper.rb
CHANGED
@@ -10,7 +10,6 @@ SimpleCov.start if ENV["COVERAGE"]
|
|
10
10
|
Coveralls.wear!
|
11
11
|
|
12
12
|
require_relative '../lib/reactive_support'
|
13
|
-
require_relative '../lib/reactive_support/core_ext/array/access'
|
14
13
|
require_relative '../lib/reactive_support/extensions/reactive_extensions'
|
15
14
|
|
16
15
|
RSpec.configure do |c|
|
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.1.
|
4
|
+
version: 0.1.3.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dana Scheider
|
@@ -116,9 +116,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: 1.9.3
|
117
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
118
|
requirements:
|
119
|
-
- - "
|
119
|
+
- - ">"
|
120
120
|
- !ruby/object:Gem::Version
|
121
|
-
version:
|
121
|
+
version: 1.3.1
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
124
|
rubygems_version: 2.2.2
|