ramda-ruby 0.2.2 → 0.2.3

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: a9f027a9a6d8511307172310a8cf1054db146a87
4
- data.tar.gz: e50e255ede9f6829322a8c3a022dc93c65a50d39
3
+ metadata.gz: 554c835670ffecb793b2f9219833f609fc7474cd
4
+ data.tar.gz: 58afbd319ba44b6fa58a0792ea817f342febbeba
5
5
  SHA512:
6
- metadata.gz: 6097c5cca6a7c996f3c92a65ada3861439e8c2b365c64e6bd946340028aebf6c402ed79b65d77a5738c0e8bcdabdbff8296bf1e6d6bfd256bdf898ba767b96ae
7
- data.tar.gz: 91d8042d5528a7c4cc6feb73926efabf4bf818b029d17e636627cb766dc746afa237193210ef030c242525bcce451f6c8d5316b14dad5e3d21a34fb1c0281652
6
+ metadata.gz: d2c06c63751263ce4e45b605f11a703c54c580c7da2d1761f2de822c933f39ff607b6ee941dd09ac8d77f18f4eb805d235952de9b0d57d3f206c72d29eb31404
7
+ data.tar.gz: 06b141ae4b5a1022cff6883797e33791993987bc8690981bc141ae2491c53c03572f52c2f796435e3005152c29b927d4634521809285da2da2d96675b2ae181f
@@ -1,6 +1,13 @@
1
1
  Not Released
2
2
  ---------------
3
3
 
4
+ Release 0.2.3
5
+ ---------------
6
+
7
+ Added:
8
+
9
+ * times
10
+
4
11
  Release 0.2.2
5
12
  ---------------
6
13
 
data/ROADMAP.md CHANGED
@@ -2,52 +2,47 @@
2
2
 
3
3
  * Find out suitable documentation format
4
4
 
5
- ### release 0.2.3
6
-
7
- times
8
-
9
5
  ### release 0.3.0
10
6
 
11
- ap
12
- chain
13
- empty
14
- from_pairs
15
- is
16
- length
17
- math_mod
18
- of
19
- unnest
20
- zip_obj
7
+ * ap
8
+ * chain
9
+ * empty
10
+ * from_pairs
11
+ * is
12
+ * length
13
+ * math_mod
14
+ * of
15
+ * unnest
16
+ * zip_obj
21
17
 
22
18
  ### release 0.4.0
23
19
 
24
- construct_n
25
- to_pairs
26
- to_pairs_in
20
+ * construct_n
21
+ * to_pairs
22
+ * to_pairs_in
27
23
 
28
24
  ### release 0.4.2
29
25
 
30
- converge
26
+ * converge
31
27
 
32
28
  ### release 0.5.0
33
29
 
34
- curry_n
30
+ * curry_n
35
31
 
36
32
  ### release 0.6.0
37
33
 
38
- __
39
- bind
40
- cond
41
- prop_or
42
- trim
34
+ * __
35
+ * bind
36
+ * cond
37
+ * prop_or
38
+ * trim
43
39
 
44
40
  ### release 0.7.0
45
41
 
46
- apply
47
- has
48
- has_in
49
- lift
50
- lift_n
51
- path_eq
52
- replace
53
-
42
+ * apply
43
+ * has
44
+ * has_in
45
+ * lift
46
+ * lift_n
47
+ * path_eq
48
+ * replace
@@ -100,6 +100,7 @@
100
100
  * take
101
101
  * take_while
102
102
  * tap
103
+ * times
103
104
  * to_lower
104
105
  * to_upper
105
106
  * unary
@@ -74,6 +74,7 @@ module Ramda
74
74
  :tail,
75
75
  :take,
76
76
  :take_while,
77
+ :times,
77
78
  :uniq,
78
79
  :uniq_with,
79
80
  :xprod,
@@ -416,6 +416,17 @@ module Ramda
416
416
  xs[0, xs.index { |x| !fn.call(x) } || xs.size]
417
417
  end
418
418
 
419
+ # Calls an input function n times, returning an array containing the results
420
+ # of those function calls.
421
+ # fn is passed one argument: The current value of n, which begins at 0
422
+ # and is gradually incremented to n - 1.
423
+ #
424
+ # (Number -> a) -> Number -> [a]
425
+ #
426
+ curried_method(:times) do |fn, n|
427
+ n.times.to_a.map(&fn)
428
+ end
429
+
419
430
  # Returns a new list containing only one copy of each element in the original list.
420
431
  #
421
432
  # [a] -> [a]
@@ -1,3 +1,3 @@
1
1
  module Ramda
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
@@ -453,6 +453,12 @@ describe Ramda::List do
453
453
  end
454
454
  end
455
455
 
456
+ context '#times' do
457
+ it 'from docs' do
458
+ expect(R.times(R.identity, 5)).to eq([0, 1, 2, 3, 4])
459
+ end
460
+ end
461
+
456
462
  context '#uniq' do
457
463
  it 'from docs' do
458
464
  expect(r.uniq([1, 1, 2, 1])).to eq([1, 2])
@@ -108,6 +108,7 @@ describe Ramda do
108
108
  r(:take)
109
109
  r(:take_while)
110
110
  r(:tap)
111
+ r(:times)
111
112
  r(:to_lower)
112
113
  r(:to_upper)
113
114
  r(:unary)
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.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Lazebny