cliz 0.0.1 → 0.0.2

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/functions.rb +5 -8
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3703184d1cd9de97801b00a83b47f88f8128f08faeeda1af9f9e26df6d34cc94
4
- data.tar.gz: 8cd9a19cd0082b23d82ee881e887203d761eb1cbeb485433869d45b8f1df1213
3
+ metadata.gz: c0d4daf42c2bd286855ae30a21fc3de701ab42c05883fea64e36a4f292e6e5a8
4
+ data.tar.gz: 1311ed68a0e040bc8819c3f0aaddbaf6bb8b0d6bb7bd8f5287ee88e456687e6a
5
5
  SHA512:
6
- metadata.gz: b10004b4751bacccfce8ecd80209ce96d8e3e4da17e2f07db65e75533a13e2a96ecda27d8b4ddc5c8a80efd1bab0fe48c67bdbadba51039960011c2f2131a659
7
- data.tar.gz: 0f938d76de017cd9507701b293c88e9f2ce0154f5fc59bd30d8a89ca9890f693cb7ef23bb90b1595e30514f212391a12bacfa4ca864991f3602649a49daa69fc
6
+ metadata.gz: 94001761e04e7829553b0cc88d108af1cb689f4e122f186b30c0d46a0956d0611fad8f2449ca9185e219fd80388da6a9691bf820680fe9746f3def86440d5644
7
+ data.tar.gz: 0d01bc705f75a863854edcc486f37806b7409fb005d056d69d0b09a57e76b5950b076c953d2b81dae2398d066caf69247db35aeaccb3ba2e65ac41321669ec7e
data/lib/functions.rb CHANGED
@@ -6,14 +6,11 @@ require 'fileutils'
6
6
  def get_a_folder_path output_directory, short_suggestion = nil
7
7
  folder_path = nil
8
8
 
9
- unless short_suggestion
10
- random_string = generate_short_suggestion output_directory
11
- folder_path = get_a_folder_path output_directory, random_string
12
- else
13
- folder_path = File.join(output_directory, short_suggestion, '/')
14
- if File.directory?(folder_path)
15
- raise ("This short URL is already taken.")
16
- end
9
+ short_suggestion ||= generate_short_suggestion output_directory
10
+ folder_path = File.join(output_directory, short_suggestion, '/')
11
+
12
+ if File.directory?(folder_path)
13
+ raise ("This short URL is already taken.")
17
14
  end
18
15
 
19
16
  folder_path
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cliz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karthikeyan A K
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-02 00:00:00.000000000 Z
11
+ date: 2021-04-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Cliz - The static URL shortner
14
14
  email: mindaslab@protonmail.com