cliz 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/cliz +6 -2
  3. data/lib/functions.rb +3 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 298c94e7dc3f9d453ed368ec0bcde14528f2306416c01367dd447a841de0bcd6
4
- data.tar.gz: 7d1f16b725d776e6a44af89d5aba4be0e8e5958513786780193facca791f7183
3
+ metadata.gz: de4a5cd7ac9ce9598f60e1674053920a3362d5cf93a9fc19c1b879845fb06567
4
+ data.tar.gz: 23e5e440771e05f9e15a8b8a508de4747fccf613dc1af6e459cce7c9bad85c5c
5
5
  SHA512:
6
- metadata.gz: 7b668249b3ae982ebd7a75803a00649c71dbf8876d08f59052b11863fe5f958681708a04fb0a4911853a00416082e89d18cba3ccfd529c3b9b93fc4dc3add18b
7
- data.tar.gz: e7f58dbb7b006c61e7c8549d2f040b45c80c0925419297b0833861d52eaecc81516ba3dbffcf98a41fd277e6989b678ab068bc6259dd9835d5a8a3db66a565eb
6
+ metadata.gz: 7e8d8bde06fc90d008c29ccfa234157a9d26d160557ecc6cef78cd201db533c5ec13cedfd1f4a3d05b2b5b33bef7b4dbe43cb4e9611b3025070f3594a0232892
7
+ data.tar.gz: 504e21a63bd2359ce50ef4e567fbb3b894c2d92aed4a1c37e2d40f105b4661ba11e698706891a96e564b6ef2cb799c6f0d5ac8cefb527083dab1eeeeab011f1d
data/bin/cliz CHANGED
@@ -8,15 +8,19 @@ require_relative '../lib/functions.rb'
8
8
 
9
9
  include Cliz
10
10
 
11
- FileUtils.mkdir_p 'reverse-index'
11
+
12
12
 
13
13
  config = YAML.load(File.read('config.yml'))
14
+ output_dir = config['output_dir']
15
+
16
+ FileUtils.mkdir_p File.join output_dir, 'reverse-index'
17
+
14
18
  url = ARGV[0]
15
19
  short_suggestion = ARGV[1]
16
20
 
17
21
  unless short_suggestion
18
22
  # check for reverse index
19
- reverse_index_file = File.join 'reverse-index', "#{Digest::SHA2.hexdigest url}"
23
+ reverse_index_file = File.join output_dir, 'reverse-index', "#{Digest::SHA2.hexdigest url}"
20
24
 
21
25
  if File.exist? reverse_index_file
22
26
  base_domain = config['base_domain']
data/lib/functions.rb CHANGED
@@ -93,9 +93,11 @@ module Cliz
93
93
  end
94
94
 
95
95
  def reverse_index config, short_url
96
+ output_dir = config['output_dir']
97
+
96
98
  long_url = long_url config, short_url
97
99
 
98
- reverse_index_file = File.join 'reverse-index', "#{Digest::SHA2.hexdigest long_url}"
100
+ reverse_index_file = File.join output_dir, 'reverse-index', "#{Digest::SHA2.hexdigest long_url}"
99
101
 
100
102
 
101
103
  File.open reverse_index_file, "a" do |f|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cliz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karthikeyan A K