ramda-ruby 0.2.0 → 0.2.2
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/CHANGELOG.md +104 -1
- data/ROADMAP.md +0 -5
- data/docs/FUNCTIONS.md +2 -0
- data/lib/ramda.rb +2 -0
- data/lib/ramda/list.rb +14 -0
- data/lib/ramda/version.rb +1 -1
- data/spec/ramda/list_spec.rb +12 -0
- data/spec/ramda_spec.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9f027a9a6d8511307172310a8cf1054db146a87
|
4
|
+
data.tar.gz: e50e255ede9f6829322a8c3a022dc93c65a50d39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6097c5cca6a7c996f3c92a65ada3861439e8c2b365c64e6bd946340028aebf6c402ed79b65d77a5738c0e8bcdabdbff8296bf1e6d6bfd256bdf898ba767b96ae
|
7
|
+
data.tar.gz: 91d8042d5528a7c4cc6feb73926efabf4bf818b029d17e636627cb766dc746afa237193210ef030c242525bcce451f6c8d5316b14dad5e3d21a34fb1c0281652
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
Not Released
|
2
2
|
---------------
|
3
3
|
|
4
|
+
Release 0.2.2
|
5
|
+
---------------
|
6
|
+
|
7
|
+
Added:
|
8
|
+
|
9
|
+
* insert
|
10
|
+
* remove
|
11
|
+
|
4
12
|
Release 0.2.0
|
5
13
|
---------------
|
6
14
|
|
@@ -42,4 +50,99 @@ Added:
|
|
42
50
|
Release 0.1.0
|
43
51
|
---------------
|
44
52
|
|
45
|
-
|
53
|
+
* add
|
54
|
+
* all
|
55
|
+
* all_pass
|
56
|
+
* always
|
57
|
+
* and
|
58
|
+
* any
|
59
|
+
* any_pass
|
60
|
+
* append
|
61
|
+
* assoc
|
62
|
+
* clone
|
63
|
+
* comparator
|
64
|
+
* compose
|
65
|
+
* concat
|
66
|
+
* construct
|
67
|
+
* contains
|
68
|
+
* converge
|
69
|
+
* count_by
|
70
|
+
* curry
|
71
|
+
* dec
|
72
|
+
* difference
|
73
|
+
* difference_with
|
74
|
+
* dissoc
|
75
|
+
* divide
|
76
|
+
* drop
|
77
|
+
* eq_by
|
78
|
+
* eq_props
|
79
|
+
* equals
|
80
|
+
* filter
|
81
|
+
* find
|
82
|
+
* flatten
|
83
|
+
* flip
|
84
|
+
* group_by
|
85
|
+
* gt
|
86
|
+
* gte
|
87
|
+
* head
|
88
|
+
* identity
|
89
|
+
* if_else
|
90
|
+
* inc
|
91
|
+
* index_of
|
92
|
+
* intersection
|
93
|
+
* invoker
|
94
|
+
* is_empty
|
95
|
+
* is_nil
|
96
|
+
* join
|
97
|
+
* keys
|
98
|
+
* last_index_of
|
99
|
+
* length
|
100
|
+
* lt
|
101
|
+
* lte
|
102
|
+
* map
|
103
|
+
* match
|
104
|
+
* max
|
105
|
+
* memoize
|
106
|
+
* merge
|
107
|
+
* min
|
108
|
+
* multiply
|
109
|
+
* n_ary
|
110
|
+
* not
|
111
|
+
* nth
|
112
|
+
* omit
|
113
|
+
* once
|
114
|
+
* or
|
115
|
+
* pick
|
116
|
+
* pick_all
|
117
|
+
* pipe
|
118
|
+
* pluck
|
119
|
+
* prepend
|
120
|
+
* product
|
121
|
+
* project
|
122
|
+
* prop
|
123
|
+
* prop_eq
|
124
|
+
* props
|
125
|
+
* range
|
126
|
+
* reduce
|
127
|
+
* reduce_right
|
128
|
+
* reject
|
129
|
+
* reverse
|
130
|
+
* sort
|
131
|
+
* sort_by
|
132
|
+
* split
|
133
|
+
* subtract
|
134
|
+
* sum
|
135
|
+
* tail
|
136
|
+
* take
|
137
|
+
* take_while
|
138
|
+
* tap
|
139
|
+
* to_lower
|
140
|
+
* to_upper
|
141
|
+
* union
|
142
|
+
* union_with
|
143
|
+
* uniq
|
144
|
+
* use_with
|
145
|
+
* values
|
146
|
+
* xprod
|
147
|
+
* zip
|
148
|
+
* zip_with
|
data/ROADMAP.md
CHANGED
data/docs/FUNCTIONS.md
CHANGED
data/lib/ramda.rb
CHANGED
data/lib/ramda/list.rb
CHANGED
@@ -183,6 +183,16 @@ module Ramda
|
|
183
183
|
xs.index(x)
|
184
184
|
end
|
185
185
|
|
186
|
+
# Inserts the supplied element into the list, at the specified index.
|
187
|
+
# Note that this is not destructive: it returns a copy of the list with
|
188
|
+
# the changes. No lists have been harmed in the application of this function.
|
189
|
+
#
|
190
|
+
# Number -> a -> [a] -> [a]
|
191
|
+
#
|
192
|
+
curried_method(:insert) do |idx, x, xs|
|
193
|
+
xs.dup.insert(idx, x)
|
194
|
+
end
|
195
|
+
|
186
196
|
# Returns a string made by inserting the separator between each element and
|
187
197
|
# concatenating all the elements into a single string.
|
188
198
|
#
|
@@ -343,6 +353,10 @@ module Ramda
|
|
343
353
|
end
|
344
354
|
end
|
345
355
|
|
356
|
+
curried_method(:remove) do |from, n, xs|
|
357
|
+
xs[0...from] + xs[from + n..-1]
|
358
|
+
end
|
359
|
+
|
346
360
|
# Returns a fixed list of size n containing a specified identical value.
|
347
361
|
#
|
348
362
|
# a -> n -> [a]
|
data/lib/ramda/version.rb
CHANGED
data/spec/ramda/list_spec.rb
CHANGED
@@ -210,6 +210,12 @@ describe Ramda::List do
|
|
210
210
|
end
|
211
211
|
end
|
212
212
|
|
213
|
+
context '#insert' do
|
214
|
+
it 'from docs' do
|
215
|
+
expect(r.insert(2, 'x', [1, 2, 3, 4])).to eq([1, 2, 'x', 3, 4])
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
213
219
|
context '#join' do
|
214
220
|
it 'from docs' do
|
215
221
|
expect(r.join('|', [1, 2, 3])).to eq('1|2|3')
|
@@ -354,6 +360,12 @@ describe Ramda::List do
|
|
354
360
|
end
|
355
361
|
end
|
356
362
|
|
363
|
+
context '#remove' do
|
364
|
+
it 'from docs' do
|
365
|
+
expect(r.remove(2, 3, [1, 2, 3, 4, 5, 6, 7, 8])).to eq([1, 2, 6, 7, 8])
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
357
369
|
context '#repeat' do
|
358
370
|
it 'from docs' do
|
359
371
|
expect(r.repeat('hi', 5)).to eq(['hi', 'hi', 'hi', 'hi', 'hi'])
|
data/spec/ramda_spec.rb
CHANGED
@@ -51,6 +51,7 @@ describe Ramda do
|
|
51
51
|
r(:if_else)
|
52
52
|
r(:inc)
|
53
53
|
r(:index_of)
|
54
|
+
r(:insert)
|
54
55
|
r(:intersection)
|
55
56
|
r(:invoker)
|
56
57
|
r(:is_empty)
|
@@ -94,6 +95,7 @@ describe Ramda do
|
|
94
95
|
r(:reduce)
|
95
96
|
r(:reduce_right)
|
96
97
|
r(:reject)
|
98
|
+
r(:remove)
|
97
99
|
r(:repeat)
|
98
100
|
r(:reverse)
|
99
101
|
r(:slice)
|