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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f971edce60a0eb897c51802fc1df7d23fb4f53ca
4
- data.tar.gz: 32fd85ab6bb177addb2664eb2ac576583667388c
3
+ metadata.gz: a9f027a9a6d8511307172310a8cf1054db146a87
4
+ data.tar.gz: e50e255ede9f6829322a8c3a022dc93c65a50d39
5
5
  SHA512:
6
- metadata.gz: a580a96ae672b59301ef1518437d4bd67da8771df6e0ed02690485658ccb1b3693e7e96c777760b1e3cf940b57ad580e9eeb7fdec2d5351bea004eaecff6cee5
7
- data.tar.gz: 37e0c16db0f2dbf232cc7cd5f45ef0db9a86117b99af3421c4228dc1ae73fcb645693a9c46162f4f4b4ace576304205e45192bd4d12aa240df6f4c6662063e11
6
+ metadata.gz: 6097c5cca6a7c996f3c92a65ada3861439e8c2b365c64e6bd946340028aebf6c402ed79b65d77a5738c0e8bcdabdbff8296bf1e6d6bfd256bdf898ba767b96ae
7
+ data.tar.gz: 91d8042d5528a7c4cc6feb73926efabf4bf818b029d17e636627cb766dc746afa237193210ef030c242525bcce451f6c8d5316b14dad5e3d21a34fb1c0281652
@@ -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
- Added functions from Ramda Js v0.1.0
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
@@ -2,11 +2,6 @@
2
2
 
3
3
  * Find out suitable documentation format
4
4
 
5
- ### release 0.2.2
6
-
7
- insert
8
- remove
9
-
10
5
  ### release 0.2.3
11
6
 
12
7
  times
@@ -44,6 +44,7 @@
44
44
  * if_else
45
45
  * inc
46
46
  * index_of - returns nil if index doesn't exist
47
+ * insert
47
48
  * intersection
48
49
  * invoker
49
50
  * is_empty
@@ -86,6 +87,7 @@
86
87
  * reduce
87
88
  * reduce_right
88
89
  * reject
90
+ * remove
89
91
  * repeat
90
92
  * reverse
91
93
  * slice
@@ -52,6 +52,7 @@ module Ramda
52
52
  :group_by,
53
53
  :head,
54
54
  :index_of,
55
+ :insert,
55
56
  :join,
56
57
  :last,
57
58
  :last_index_of,
@@ -67,6 +68,7 @@ module Ramda
67
68
  :reduce,
68
69
  :reduce_right,
69
70
  :reject,
71
+ :remove,
70
72
  :repeat,
71
73
  :reverse,
72
74
  :tail,
@@ -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]
@@ -1,3 +1,3 @@
1
1
  module Ramda
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.2'.freeze
3
3
  end
@@ -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'])
@@ -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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ramda-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Lazebny