xf 0.0.1
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 +7 -0
- data/LICENSE.md +20 -0
- data/README.md +90 -0
- data/lib/xf.rb +8 -0
- data/lib/xf/identity.rb +22 -0
- data/lib/xf/public_api.rb +21 -0
- metadata +208 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9df7279d149753a1c1a73ad78abf38d217ad745adcf914a3c561fb776b1f116a
|
4
|
+
data.tar.gz: 709dad6362cf6792ae3d7051f563940161a6dfd666074f156760712f53c8eec2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 74261ad1e8b45bae2bfa7a65e349619270f0e57920c3517c02387dfa849dca81a4f5249aef1baf0b365335b03d3c93cceb227fdc59cf8a5afecea6a30ef202bd
|
7
|
+
data.tar.gz: d8b33f75ecf8b681593058e9d19f6f453b35bb0723169f3fabf2848b7b953276de459b0eaeeee50d0dad19c94b8bbfbcc3aafb3cb1779ed062e2fc00e0b3179c
|
data/LICENSE.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2018 []().
|
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,90 @@
|
|
1
|
+
# Xf
|
2
|
+
|
3
|
+
[](http://badge.fury.io/rb/xf)
|
4
|
+
<!-- Replace <id> with Code Climate repository ID. Remove this comment afterwards. -->
|
5
|
+
[](https://codeclimate.com/github//xf/maintainability)
|
6
|
+
[](https://codeclimate.com/github//xf/test_coverage)
|
7
|
+
|
8
|
+
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
9
|
+
|
10
|
+
## Table of Contents
|
11
|
+
|
12
|
+
- [Features](#features)
|
13
|
+
- [Screencasts](#screencasts)
|
14
|
+
- [Requirements](#requirements)
|
15
|
+
- [Setup](#setup)
|
16
|
+
- [Usage](#usage)
|
17
|
+
- [Tests](#tests)
|
18
|
+
- [Versioning](#versioning)
|
19
|
+
- [Code of Conduct](#code-of-conduct)
|
20
|
+
- [Contributions](#contributions)
|
21
|
+
- [License](#license)
|
22
|
+
- [History](#history)
|
23
|
+
- [Credits](#credits)
|
24
|
+
|
25
|
+
<!-- Tocer[finish]: Auto-generated, don't remove. -->
|
26
|
+
|
27
|
+
## Features
|
28
|
+
|
29
|
+
For the moment, compose:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
%w(1 2 3 4).map(&Xf.compose(:to_i, :succ))
|
33
|
+
```
|
34
|
+
|
35
|
+
If it looks like a Proc, or can be convinced to become one, it will work there.
|
36
|
+
|
37
|
+
## Screencasts
|
38
|
+
|
39
|
+
## Requirements
|
40
|
+
|
41
|
+
0. [Ruby 2.5.1](https://www.ruby-lang.org)
|
42
|
+
|
43
|
+
## Setup
|
44
|
+
|
45
|
+
To install, run:
|
46
|
+
|
47
|
+
gem install xf
|
48
|
+
|
49
|
+
Add the following to your Gemfile:
|
50
|
+
|
51
|
+
gem "xf"
|
52
|
+
|
53
|
+
## Usage
|
54
|
+
|
55
|
+
## Tests
|
56
|
+
|
57
|
+
To test, run:
|
58
|
+
|
59
|
+
bundle exec rake
|
60
|
+
|
61
|
+
## Versioning
|
62
|
+
|
63
|
+
Read [Semantic Versioning](http://semver.org) for details. Briefly, it means:
|
64
|
+
|
65
|
+
- Major (X.y.z) - Incremented for any backwards incompatible public API changes.
|
66
|
+
- Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
|
67
|
+
- Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
|
68
|
+
|
69
|
+
## Code of Conduct
|
70
|
+
|
71
|
+
Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By
|
72
|
+
participating in this project you agree to abide by its terms.
|
73
|
+
|
74
|
+
## Contributions
|
75
|
+
|
76
|
+
Read [CONTRIBUTING](CONTRIBUTING.md) for details.
|
77
|
+
|
78
|
+
## License
|
79
|
+
|
80
|
+
Copyright 2018 [Brandon Weaver]().
|
81
|
+
Read [LICENSE](LICENSE.md) for details.
|
82
|
+
|
83
|
+
## History
|
84
|
+
|
85
|
+
Read [CHANGES](CHANGES.md) for details.
|
86
|
+
Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
|
87
|
+
|
88
|
+
## Credits
|
89
|
+
|
90
|
+
Developed by [Brandon Weaver]()
|
data/lib/xf.rb
ADDED
data/lib/xf/identity.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Xf
|
4
|
+
# Gem identity information.
|
5
|
+
module Identity
|
6
|
+
def self.name
|
7
|
+
"xf"
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.label
|
11
|
+
"Xf"
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.version
|
15
|
+
"0.0.1"
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.version_label
|
19
|
+
"#{label} #{version}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Xf
|
4
|
+
module PublicApi
|
5
|
+
# Composes a list of functions, or items that respond to `to_proc`, into
|
6
|
+
# a function chain that can be called against a target.
|
7
|
+
#
|
8
|
+
# @param *fns [#to_proc] List of objects coercible into Procs
|
9
|
+
#
|
10
|
+
# @return [Proc[Any] -> Any]
|
11
|
+
def compose(*fns)
|
12
|
+
chain = fns.map(&:to_proc)
|
13
|
+
|
14
|
+
Proc.new { |target|
|
15
|
+
chain.reduce(target) { |t, fn| fn.call(t) }
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
alias_method :c, :compose
|
20
|
+
end
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xf
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Brandon Weaver
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-04-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler-audit
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: codeclimate-test-reporter
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: gemsmith
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '12.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '12.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: git-cop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.2'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: guard-rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '4.7'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '4.7'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.10'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.10'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry-byebug
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.5'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.5'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '12.3'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '12.3'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: reek
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '4.8'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '4.8'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '3.7'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '3.7'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubocop
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.54'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.54'
|
167
|
+
description:
|
168
|
+
email:
|
169
|
+
- keystonelemur@gmail.com
|
170
|
+
executables: []
|
171
|
+
extensions: []
|
172
|
+
extra_rdoc_files:
|
173
|
+
- README.md
|
174
|
+
- LICENSE.md
|
175
|
+
files:
|
176
|
+
- LICENSE.md
|
177
|
+
- README.md
|
178
|
+
- lib/xf.rb
|
179
|
+
- lib/xf/identity.rb
|
180
|
+
- lib/xf/public_api.rb
|
181
|
+
homepage: https://www.github.com/baweaver/xf
|
182
|
+
licenses:
|
183
|
+
- MIT
|
184
|
+
metadata:
|
185
|
+
source_code_uri: https://www.github.com/baweaver/xf/xf
|
186
|
+
changelog_uri: https://www.github.com/baweaver/xf/blob/master/CHANGES.md
|
187
|
+
bug_tracker_uri: https://www.github.com/baweaver/xf/issues
|
188
|
+
post_install_message:
|
189
|
+
rdoc_options: []
|
190
|
+
require_paths:
|
191
|
+
- lib
|
192
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
193
|
+
requirements:
|
194
|
+
- - "~>"
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: '2.5'
|
197
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
requirements: []
|
203
|
+
rubyforge_project:
|
204
|
+
rubygems_version: 2.7.6
|
205
|
+
signing_key:
|
206
|
+
specification_version: 4
|
207
|
+
summary: Xf - Transform functions for Enumerable collections
|
208
|
+
test_files: []
|