refinements 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 290c501dce37e794490845c8163a952495ce29a2
4
- data.tar.gz: cef85374631c3fc1dd1b9ea88b382a4df84bff33
3
+ metadata.gz: 187d41db156d487f8f558ff6479bdaf1b5529175
4
+ data.tar.gz: 3944401486fe06119d64a1412bb64a23c12653fb
5
5
  SHA512:
6
- metadata.gz: 61a8c8c770fd7b87a702a01ef3b3c77e7bd07b62c5a44dfb3046cdb0b76a14e694e2ad0f89ea07570c992dcc1f59ab0044c5d654127c4e230475566cddca0392
7
- data.tar.gz: f1d780e4b8f9d284c6ee386ef9a0f652104c30ef22649ef4757bac88fb25c60c008ce75062f2068412cefbe3978828fa9a6002b5bc85fba98e1186f091ad1ff1
6
+ metadata.gz: dedc8913cb29503b6589cede6211caef97708a977793c612374abb00b8d72ed1100cce3f7bd7be441dcd5ebaa7d02ef954c29f1ac6810aa34902ab9b14e30df8
7
+ data.tar.gz: 69caac9d19cb287026da1fbb992dfa6ae8b9d58efe07baa01ec263fe7f5f3ad1ee534da2508bb8a8f15da65e4e7ec7baf9bc2153b87794c2b57f14a29d1b124d
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1 @@
1
- W��mSjؒIe�|���$����5�+��{�[��!I_�$60a�l��<j���������E�.�)����֕L܈�'Vi:}����_��5nd���XUD��(���Jw_KQ�t^��
2
- ��`��GqK୽<��
1
+ ������ze���$(k�΢o�O6d�z�U�>���rƂ�q2��@�� ���?�W?��� �T/��HEI"�N�HD�Q)�s�������;�9R�,�U�[Y�҇n1dWMd��A!b��j�f�8:X��w�V���$�l|�I42��!u� ž��w���(L�W�*�\��d�Kυ�?��"Y0FK�8nf��t���EumJl����\�ﳖwr�dvX�~�>,[ږ�="�Nw��_�� �6 ��.eV0s�
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -1,20 +1,69 @@
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.
1
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
2
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3
+ # Table of Contents
4
+
5
+ - [Refinements](#refinements)
6
+ - [Table of Contents](#table-of-contents)
7
+ - [Features](#features)
8
+ - [Requirements](#requirements)
9
+ - [Setup](#setup)
10
+ - [Usage](#usage)
11
+ - [Requires](#requires)
12
+ - [Using](#using)
13
+ - [Examples](#examples)
14
+ - [Array](#array)
15
+ - [Big Decimal](#big-decimal)
16
+ - [Tests](#tests)
17
+ - [Versioning](#versioning)
18
+ - [Code of Conduct](#code-of-conduct)
19
+ - [Contributions](#contributions)
20
+ - [License](#license)
21
+ - [History](#history)
22
+ - [Credits](#credits)
23
+
24
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
25
+
26
+ # Refinements
27
+
28
+ [![Gem Version](https://badge.fury.io/rb/refinements.svg)](http://badge.fury.io/rb/refinements)
29
+ [![Code Climate GPA](https://codeclimate.com/github/bkuhlmann/refinements.svg)](https://codeclimate.com/github/bkuhlmann/refinements)
30
+ [![Code Climate Coverage](https://codeclimate.com/github/bkuhlmann/refinements/coverage.svg)](https://codeclimate.com/github/bkuhlmann/refinements)
31
+ [![Gemnasium Status](https://gemnasium.com/bkuhlmann/refinements.svg)](https://gemnasium.com/bkuhlmann/refinements)
32
+ [![Travis CI Status](https://secure.travis-ci.org/bkuhlmann/refinements.svg)](http://travis-ci.org/bkuhlmann/refinements)
33
+ [![Patreon](https://img.shields.io/badge/patreon-donate-brightgreen.svg)](https://www.patreon.com/bkuhlmann)
34
+
35
+ Provides a collection of refinements for core Ruby objects.
36
+
37
+ <!-- Tocer[start]: Auto-generated, don't remove. -->
38
+
39
+ # Table of Contents
40
+
41
+ - [Features](#features)
42
+ - [Requirements](#requirements)
43
+ - [Setup](#setup)
44
+ - [Usage](#usage)
45
+ - [Requires](#requires)
46
+ - [Using](#using)
47
+ - [Examples](#examples)
48
+ - [Array](#array)
49
+ - [Big Decimal](#big-decimal)
50
+ - [Tests](#tests)
51
+ - [Versioning](#versioning)
52
+ - [Code of Conduct](#code-of-conduct)
53
+ - [Contributions](#contributions)
54
+ - [License](#license)
55
+ - [History](#history)
56
+ - [Credits](#credits)
57
+
58
+ <!-- Tocer[finish]: Auto-generated, don't remove. -->
10
59
 
11
60
  # Features
12
61
 
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.
62
+ - Adds Array refinements:
63
+ - `Array#compress` - Removes nil and empty values without modifying original values.
64
+ - `Array#compress!` - Removes nil and empty values and modifies original values.
65
+ - Adds BigDecimal refinements:
66
+ - `BigDecimal#inspect` - Allows one to inspect a big decimal with numeric representation.
18
67
 
19
68
  # Requirements
20
69
 
@@ -34,11 +83,37 @@ For an insecure install, type the following (not recommended):
34
83
 
35
84
  gem install refinements
36
85
 
86
+ Add the following to your Gemfile file:
87
+
88
+ gem "refinements"
89
+
37
90
  # Usage
38
91
 
39
- ## Array
92
+ ## Requires
93
+
94
+ Due to this gem being a collection of Ruby refinements, none of the refinements are auto-loaded by default in order to
95
+ reduce code bloat for your app. Instead, require the specific requirement for the code that needs it. You'll want to
96
+ require one or all of the following:
97
+
98
+ require "refinements/array_extensions"
99
+ require "refinements/big_decimal_extensions"
40
100
 
41
- using Refinements::ArrayExtensions
101
+ ## Using
102
+
103
+ In addition to requiring the appropriate refinement file for the code that needs it, you'll also need to use the
104
+ refinement by using the `using` keyword within your object. You'll want to use one or all of the following:
105
+
106
+ class Example
107
+ using Refinements::ArrayExtensions
108
+ using Refinements::BigDecimalExtensions
109
+ end
110
+
111
+ ## Examples
112
+
113
+ With the appropriate refinements required and used within your objects, the following sections demonstrates how each
114
+ refinement enriches your objects with new capabilities.
115
+
116
+ ### Array
42
117
 
43
118
  example = ["An", nil, "", "Example"]
44
119
  example.compress # => ["An", "Example"]
@@ -48,9 +123,7 @@ For an insecure install, type the following (not recommended):
48
123
  example.compress! # => ["An", "Example"]
49
124
  example # => ["An", "Example"]
50
125
 
51
- ## Big Decimal
52
-
53
- using Refinements::BigDecimalExtensions
126
+ ### Big Decimal
54
127
 
55
128
  big = BigDecimal.new "5.0E-10"
56
129
  big.inspect # => "#<BigDecimal:3fd3d458fe84 0.0000000005>"
@@ -59,7 +132,7 @@ For an insecure install, type the following (not recommended):
59
132
 
60
133
  To test, run:
61
134
 
62
- bundle exec rspec spec
135
+ bundle exec rake
63
136
 
64
137
  # Versioning
65
138
 
data/lib/refinements.rb CHANGED
@@ -1,3 +1 @@
1
1
  require "refinements/identity"
2
- require "refinements/array_extensions"
3
- require "refinements/big_decimal_extensions"
@@ -1,12 +1,13 @@
1
1
  module Refinements
2
+ # Refinements for Arrays.
2
3
  module ArrayExtensions
3
4
  refine Array do
4
5
  def compress
5
- self.compact.reject(&:empty?)
6
+ compact.reject(&:empty?)
6
7
  end
7
8
 
8
9
  def compress!
9
- self.replace(compress)
10
+ replace(compress)
10
11
  end
11
12
  end
12
13
  end
@@ -1,6 +1,7 @@
1
1
  require "bigdecimal"
2
2
 
3
3
  module Refinements
4
+ # Refinements for Big Decimals.
4
5
  module BigDecimalExtensions
5
6
  refine BigDecimal do
6
7
  def inspect
@@ -1,4 +1,5 @@
1
1
  module Refinements
2
+ # Gem identity information.
2
3
  module Identity
3
4
  def self.name
4
5
  "refinements"
@@ -9,11 +10,11 @@ module Refinements
9
10
  end
10
11
 
11
12
  def self.version
12
- "0.1.0"
13
+ "1.0.0"
13
14
  end
14
15
 
15
16
  def self.label_version
16
- [label, version].join " "
17
+ "#{label} #{version}"
17
18
  end
18
19
  end
19
20
  end
@@ -0,0 +1,6 @@
1
+ begin
2
+ require "rspec/core/rake_task"
3
+ RSpec::Core::RakeTask.new(:spec)
4
+ rescue LoadError => error
5
+ puts error.message
6
+ end
@@ -0,0 +1,6 @@
1
+ begin
2
+ require "rubocop/rake_task"
3
+ RuboCop::RakeTask.new
4
+ rescue LoadError => error
5
+ puts error.message
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinements
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -30,7 +30,7 @@ cert_chain:
30
30
  aSif+qBc6oHD7EQWPF5cZkzkIURuwNwPBngZGxIKaMAgRhjGFXzUMAaq++r59cS9
31
31
  xTfQ4k6fglKEgpnLAXiKdo2c8Ym+X4rIKFfedQ==
32
32
  -----END CERTIFICATE-----
33
- date: 2015-07-20 00:00:00.000000000 Z
33
+ date: 2015-11-21 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rake
@@ -46,6 +46,20 @@ dependencies:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
+ - !ruby/object:Gem::Dependency
50
+ name: gemsmith
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'
49
63
  - !ruby/object:Gem::Dependency
50
64
  name: pry
51
65
  requirement: !ruby/object:Gem::Requirement
@@ -75,7 +89,7 @@ dependencies:
75
89
  - !ruby/object:Gem::Version
76
90
  version: '0'
77
91
  - !ruby/object:Gem::Dependency
78
- name: pry-stack_explorer
92
+ name: pry-remote
79
93
  requirement: !ruby/object:Gem::Requirement
80
94
  requirements:
81
95
  - - ">="
@@ -89,7 +103,7 @@ dependencies:
89
103
  - !ruby/object:Gem::Version
90
104
  version: '0'
91
105
  - !ruby/object:Gem::Dependency
92
- name: pry-remote
106
+ name: pry-state
93
107
  requirement: !ruby/object:Gem::Requirement
94
108
  requirements:
95
109
  - - ">="
@@ -116,6 +130,20 @@ dependencies:
116
130
  - - ">="
117
131
  - !ruby/object:Gem::Version
118
132
  version: '0'
133
+ - !ruby/object:Gem::Dependency
134
+ name: pry-stack_explorer
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'
119
147
  - !ruby/object:Gem::Dependency
120
148
  name: rspec
121
149
  requirement: !ruby/object:Gem::Requirement
@@ -186,6 +214,20 @@ dependencies:
186
214
  - - ">="
187
215
  - !ruby/object:Gem::Version
188
216
  version: '0'
217
+ - !ruby/object:Gem::Dependency
218
+ name: rubocop
219
+ requirement: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - ">="
222
+ - !ruby/object:Gem::Version
223
+ version: '0'
224
+ type: :development
225
+ prerelease: false
226
+ version_requirements: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
189
231
  - !ruby/object:Gem::Dependency
190
232
  name: codeclimate-test-reporter
191
233
  requirement: !ruby/object:Gem::Requirement
@@ -200,7 +242,7 @@ dependencies:
200
242
  - - ">="
201
243
  - !ruby/object:Gem::Version
202
244
  version: '0'
203
- description: Provides a collection of refinements to the standard Ruby objects.
245
+ description: Provides a collection of refinements for core Ruby objects.
204
246
  email:
205
247
  - brooke@alchemists.io
206
248
  executables: []
@@ -215,7 +257,9 @@ files:
215
257
  - lib/refinements/array_extensions.rb
216
258
  - lib/refinements/big_decimal_extensions.rb
217
259
  - lib/refinements/identity.rb
218
- homepage: https://www.alchemists.io
260
+ - lib/refinements/tasks/rspec.rake
261
+ - lib/refinements/tasks/rubocop.rake
262
+ homepage: https://github.com/bkuhlmann/refinements
219
263
  licenses:
220
264
  - MIT
221
265
  metadata: {}
@@ -225,9 +269,9 @@ require_paths:
225
269
  - lib
226
270
  required_ruby_version: !ruby/object:Gem::Requirement
227
271
  requirements:
228
- - - "~>"
272
+ - - ">="
229
273
  - !ruby/object:Gem::Version
230
- version: 2.2.2
274
+ version: '0'
231
275
  required_rubygems_version: !ruby/object:Gem::Requirement
232
276
  requirements:
233
277
  - - ">="
@@ -235,8 +279,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
279
  version: '0'
236
280
  requirements: []
237
281
  rubyforge_project:
238
- rubygems_version: 2.4.8
282
+ rubygems_version: 2.5.0
239
283
  signing_key:
240
284
  specification_version: 4
241
- summary: Provides a collection of refinements to the standard Ruby objects.
285
+ summary: Provides a collection of refinements for core Ruby objects.
242
286
  test_files: []
metadata.gz.sig CHANGED
Binary file