sloubi 1.3.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sloubi.rb +19 -9
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f12b478d4c557b5b6d41023e78097eca12ef890f
4
- data.tar.gz: b911a7bd425634ae9caa0d92c05b3281f327af2c
3
+ metadata.gz: f57d79b942ea0a57d2ff824436498931dbfdb303
4
+ data.tar.gz: 41b29a40ed945bfda6faabf065d265a23be6d559
5
5
  SHA512:
6
- metadata.gz: adb64e4b6f13b06117538d983e03c2c736fc642eec45ba6259191bd6d727f8080200f349d6b496f1dbb5d8bc4e3d4f5a2b7c8eb35e434dc3cec494eb44c571eb
7
- data.tar.gz: 3a032f7d81d62e54f3a310c7fb3dd9206ae5b9301fda0d0469073b5e556b2570950cb47188be9756102cfce324fdb90f96d5b7a1640363a8ba1d0192effa61b2
6
+ metadata.gz: 35acd0db3be6f048ac829560b5ea797becc009b21306ebe30d620d9374111b07b2283bac4124057f044f326f9846d948fdd38452a9d95be70adb5d097e5dc666
7
+ data.tar.gz: f8b5984a8ed8d678a99ca16df734a5d679a98511da841cc0ce8148ed6a031a1cc64461c5306909c6591b713784fe4162880b652f3d6ba1dc4509ab9d5c2311ab
data/lib/sloubi.rb CHANGED
@@ -6,15 +6,25 @@ module Sloubi
6
6
  def self.count n=42, ninit=1, v=false
7
7
  return 0 if !n.is_a?Integer or n < 1
8
8
  return 0 if ninit > n
9
- (ninit..n).each do |i|
10
- puts "Sloubi #{i}"
11
- if v == true
12
- if i <= 99999999999999
13
- `espeak "Sloubi #{i}" -a 200 -vfr`
14
- else
15
- `espeak "Je sais pas compter jusque là, moi !" -a 200 -vfr`
16
- return i
17
- end
9
+ if ninit == 0
10
+ n.times do
11
+ Sloubi.sing(rand(1..n), v)
12
+ end
13
+ else
14
+ (ninit..n).each do |i|
15
+ sing i
16
+ end
17
+ end
18
+ end
19
+
20
+ def self.sing i, v=false
21
+ puts "Sloubi #{i}"
22
+ if v == true
23
+ if i <= 99999999999999
24
+ `espeak "Sloubi #{i}" -a 200 -vfr`
25
+ else
26
+ `espeak "Je sais pas compter jusque là, moi !" -a 200 -vfr`
27
+ return false
18
28
  end
19
29
  end
20
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sloubi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - poulet_a
@@ -10,7 +10,7 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-02-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: "require 'sloubi'\n \t\t Sloubi::Sloubi.count(424242, 4242, false)"
13
+ description: require 'sloubi' ; Sloubi::Sloubi.count(424242, 4242, false)
14
14
  email:
15
15
  - poulet_a@epitech.eu
16
16
  - - lib/sloubi.rb
@@ -39,9 +39,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
39
39
  version: '0'
40
40
  requirements: []
41
41
  rubyforge_project:
42
- rubygems_version: 2.2.0.rc.1
42
+ rubygems_version: 2.2.2
43
43
  signing_key:
44
44
  specification_version: 4
45
- summary: A simple sloubi gem
45
+ summary: Add the random option when ninit == 0
46
46
  test_files: []
47
47
  has_rdoc: