refinements 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 290c501dce37e794490845c8163a952495ce29a2
4
+ data.tar.gz: cef85374631c3fc1dd1b9ea88b382a4df84bff33
5
+ SHA512:
6
+ metadata.gz: 61a8c8c770fd7b87a702a01ef3b3c77e7bd07b62c5a44dfb3046cdb0b76a14e694e2ad0f89ea07570c992dcc1f59ab0044c5d654127c4e230475566cddca0392
7
+ data.tar.gz: f1d780e4b8f9d284c6ee386ef9a0f652104c30ef22649ef4757bac88fb25c60c008ce75062f2068412cefbe3978828fa9a6002b5bc85fba98e1186f091ad1ff1
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ W��m�SjؒIe�|���$����5�+��{�[��!I_�$60a�l��<j���������E�.�)����֕L܈�'V�i:}����_��5nd���XUD��(���J�w_K�Q�t^��
2
+ ��`��GqK୽<��
data/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2015 [Alchemists](https://www.alchemists.io).
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # Overview
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/refinements.png)](http://badge.fury.io/rb/refinements)
4
+ [![Code Climate GPA](https://codeclimate.com/github/bkuhlmann/refinements.png)](https://codeclimate.com/github/bkuhlmann/refinements)
5
+ [![Code Climate Coverage](https://codeclimate.com/github/bkuhlmann/refinements/coverage.png)](https://codeclimate.com/github/bkuhlmann/refinements)
6
+ [![Gemnasium Status](https://gemnasium.com/bkuhlmann/refinements.png)](https://gemnasium.com/bkuhlmann/refinements)
7
+ [![Travis CI Status](https://secure.travis-ci.org/bkuhlmann/refinements.png)](http://travis-ci.org/bkuhlmann/refinements)
8
+
9
+ Provides a collection of refinements to the standard Ruby objects.
10
+
11
+ # Features
12
+
13
+ - Adds the following Array refinements:
14
+ - Array#compress - Removes nil and empty values without modifying original values.
15
+ - Array#compress! - Removes nil and empty values and modifies original values.
16
+ - Adds the following BigDecimal refinements:
17
+ - BigDecimal#inspect - Allows one to inspect a big decimal with numeric representation.
18
+
19
+ # Requirements
20
+
21
+ 0. [MRI 2.x.x](http://www.ruby-lang.org).
22
+
23
+ # Setup
24
+
25
+ For a secure install, type the following from the command line (recommended):
26
+
27
+ gem cert --add <(curl -Ls http://www.my-website.com/gem-public.pem)
28
+ gem install refinements --trust-policy MediumSecurity
29
+
30
+ NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification while
31
+ allowing the installation of unsigned dependencies since they are beyond the scope of this gem.
32
+
33
+ For an insecure install, type the following (not recommended):
34
+
35
+ gem install refinements
36
+
37
+ # Usage
38
+
39
+ ## Array
40
+
41
+ using Refinements::ArrayExtensions
42
+
43
+ example = ["An", nil, "", "Example"]
44
+ example.compress # => ["An", "Example"]
45
+ example # => ["An", nil, "", "Example"]
46
+
47
+ example = ["An", nil, "", "Example"]
48
+ example.compress! # => ["An", "Example"]
49
+ example # => ["An", "Example"]
50
+
51
+ ## Big Decimal
52
+
53
+ using Refinements::BigDecimalExtensions
54
+
55
+ big = BigDecimal.new "5.0E-10"
56
+ big.inspect # => "#<BigDecimal:3fd3d458fe84 0.0000000005>"
57
+
58
+ # Tests
59
+
60
+ To test, run:
61
+
62
+ bundle exec rspec spec
63
+
64
+ # Versioning
65
+
66
+ Read [Semantic Versioning](http://semver.org) for details. Briefly, it means:
67
+
68
+ - Patch (x.y.Z) - Incremented for small, backwards compatible bug fixes.
69
+ - Minor (x.Y.z) - Incremented for new, backwards compatible public API enhancements and/or bug fixes.
70
+ - Major (X.y.z) - Incremented for any backwards incompatible public API changes.
71
+
72
+ # Code of Conduct
73
+
74
+ Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By participating in this project
75
+ you agree to abide by its terms.
76
+
77
+ # Contributions
78
+
79
+ Read [CONTRIBUTING](CONTRIBUTING.md) for details.
80
+
81
+ # License
82
+
83
+ Copyright (c) 2015 [Alchemists](https://www.alchemists.io).
84
+ Read the [LICENSE](LICENSE.md) for details.
85
+
86
+ # History
87
+
88
+ Read the [CHANGELOG](CHANGELOG.md) for details.
89
+ Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
90
+
91
+ # Credits
92
+
93
+ Developed by [Brooke Kuhlmann](https://www.alchemists.io) at [Alchemists](https://www.alchemists.io).
@@ -0,0 +1,13 @@
1
+ module Refinements
2
+ module ArrayExtensions
3
+ refine Array do
4
+ def compress
5
+ self.compact.reject(&:empty?)
6
+ end
7
+
8
+ def compress!
9
+ self.replace(compress)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ require "bigdecimal"
2
+
3
+ module Refinements
4
+ module BigDecimalExtensions
5
+ refine BigDecimal do
6
+ def inspect
7
+ format "#<BigDecimal:%x %s>", object_id, to_s("F")
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,19 @@
1
+ module Refinements
2
+ module Identity
3
+ def self.name
4
+ "refinements"
5
+ end
6
+
7
+ def self.label
8
+ "Refinements"
9
+ end
10
+
11
+ def self.version
12
+ "0.1.0"
13
+ end
14
+
15
+ def self.label_version
16
+ [label, version].join " "
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,3 @@
1
+ require "refinements/identity"
2
+ require "refinements/array_extensions"
3
+ require "refinements/big_decimal_extensions"
data.tar.gz.sig ADDED
@@ -0,0 +1,3 @@
1
+ ���>k�|
2
+ �  ����4�����ӝ�Ji��X#��'�� ����Q�h��B]��qA7�3��]!��<=mw<��5e��
3
+ %�(X�X��0�k6��Kq��T� �Z6H�Q��Q8��|p7F�/\���ȅEN7��}�z�{��8}|�>��
metadata ADDED
@@ -0,0 +1,242 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: refinements
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Brooke Kuhlmann
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMQ8wDQYDVQQDDAZicm9v
14
+ a2UxGjAYBgoJkiaJk/IsZAEZFgphbGNoZW1pc3RzMRIwEAYKCZImiZPyLGQBGRYC
15
+ aW8wHhcNMTUwNzA1MTQ1MzExWhcNMTYwNzA0MTQ1MzExWjBBMQ8wDQYDVQQDDAZi
16
+ cm9va2UxGjAYBgoJkiaJk/IsZAEZFgphbGNoZW1pc3RzMRIwEAYKCZImiZPyLGQB
17
+ GRYCaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzhOVcvLGBCceM
18
+ PppVpJLUKsnskWzc1VqBXmv30feKNw+MOxMQaDsIP421qwqGO/2JHY60Kuobssk+
19
+ 8/wqZkVFF/FFKxoQjuhlhc+VWLm8jWgXd4N1kwO2yytscQTzxc5qXarwA+36fqVH
20
+ RhBAHhjka+HdBI+6o3CXRHJoC47iav+QpR7u/wYl3gNq6MJO3MmTKqHegEDLjRN0
21
+ FJAr3bRAwq03ZtTuAVA2bdKLGThehe1RRRtJHJ/PHpmL2c203/GTXYtG6C8ILZIp
22
+ ZroTqQ8yglCJ+3hSOmodZqSAQ0Rj7GJgtuNH81qlSrHu5sTvoZjGmEqSIhvsSJ80
23
+ wKoPdZnFAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
24
+ BBSUnF478a5lB4xuOBiktJdMJv6JmDAfBgNVHREEGDAWgRRicm9va2VAYWxjaGVt
25
+ aXN0cy5pbzAfBgNVHRIEGDAWgRRicm9va2VAYWxjaGVtaXN0cy5pbzANBgkqhkiG
26
+ 9w0BAQUFAAOCAQEAT7KtBXWsq1KA7NOSMeFEDeSvhrgdLwCG/37pIu0rjvx9iAW4
27
+ gncxV0MccqIUtaF+lekjlXkIO+rXAVjvdha23KtpFTW90dYXp4NLPnPlSdyvYzJy
28
+ FIAaWGvujOT8xEu4umd45q5aepE8li4bR071i5Z7F0trKNVYYrxjQFmH5SSKYRT/
29
+ fXtICtAh1de3z3SOSK58IMPwjuoApYBxiqlmx0Uhla7mrzCE5+NmLPit3hLH6JFK
30
+ aSif+qBc6oHD7EQWPF5cZkzkIURuwNwPBngZGxIKaMAgRhjGFXzUMAaq++r59cS9
31
+ xTfQ4k6fglKEgpnLAXiKdo2c8Ym+X4rIKFfedQ==
32
+ -----END CERTIFICATE-----
33
+ date: 2015-07-20 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: rake
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ type: :development
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ - !ruby/object:Gem::Dependency
50
+ name: pry
51
+ requirement: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ - !ruby/object:Gem::Dependency
64
+ name: pry-byebug
65
+ requirement: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ - !ruby/object:Gem::Dependency
78
+ name: pry-stack_explorer
79
+ requirement: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ type: :development
85
+ prerelease: false
86
+ version_requirements: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ - !ruby/object:Gem::Dependency
92
+ name: pry-remote
93
+ requirement: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ type: :development
99
+ prerelease: false
100
+ version_requirements: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ - !ruby/object:Gem::Dependency
106
+ name: pry-rescue
107
+ requirement: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ type: :development
113
+ prerelease: false
114
+ version_requirements: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ - !ruby/object:Gem::Dependency
120
+ name: rspec
121
+ requirement: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ type: :development
127
+ prerelease: false
128
+ version_requirements: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ - !ruby/object:Gem::Dependency
134
+ name: rb-fsevent
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ type: :development
141
+ prerelease: false
142
+ version_requirements: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ - !ruby/object:Gem::Dependency
148
+ name: guard-rspec
149
+ requirement: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ - !ruby/object:Gem::Dependency
162
+ name: terminal-notifier
163
+ requirement: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ type: :development
169
+ prerelease: false
170
+ version_requirements: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ - !ruby/object:Gem::Dependency
176
+ name: terminal-notifier-guard
177
+ requirement: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ type: :development
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ - !ruby/object:Gem::Dependency
190
+ name: codeclimate-test-reporter
191
+ requirement: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - ">="
194
+ - !ruby/object:Gem::Version
195
+ version: '0'
196
+ type: :development
197
+ prerelease: false
198
+ version_requirements: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: '0'
203
+ description: Provides a collection of refinements to the standard Ruby objects.
204
+ email:
205
+ - brooke@alchemists.io
206
+ executables: []
207
+ extensions: []
208
+ extra_rdoc_files:
209
+ - README.md
210
+ - LICENSE.md
211
+ files:
212
+ - LICENSE.md
213
+ - README.md
214
+ - lib/refinements.rb
215
+ - lib/refinements/array_extensions.rb
216
+ - lib/refinements/big_decimal_extensions.rb
217
+ - lib/refinements/identity.rb
218
+ homepage: https://www.alchemists.io
219
+ licenses:
220
+ - MIT
221
+ metadata: {}
222
+ post_install_message:
223
+ rdoc_options: []
224
+ require_paths:
225
+ - lib
226
+ required_ruby_version: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - "~>"
229
+ - !ruby/object:Gem::Version
230
+ version: 2.2.2
231
+ required_rubygems_version: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: '0'
236
+ requirements: []
237
+ rubyforge_project:
238
+ rubygems_version: 2.4.8
239
+ signing_key:
240
+ specification_version: 4
241
+ summary: Provides a collection of refinements to the standard Ruby objects.
242
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,3 @@
1
+ n�ΠKY����M�����Sy)�ؕF8���,'�P��T8��@]cXљ7ms���
2
+ ��Ǻ�+XlLJH`�Y�����AbԈ�t�6*��g���$S�iY�n��S��ys���%���6����o�
3
+ o`��b�s~�� L�I��I3��&�}�A��.����mQ5Q�\