disavow_tool 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: af38dc15d1fd21dcab9a427645eff07ce7119266ea529d9237b9594c941e953b
4
- data.tar.gz: ed632a61782d1e7748a8afc7b757c321a8c67cd8ecbe628954a2dc735badd041
3
+ metadata.gz: c7ec191f824e770810f284c9893491f27468279a136bbfc075f8319e51f84c7a
4
+ data.tar.gz: 63626b8f6505c63e13930da9fb16b25d543256230ad149475d8edbc229a4b459
5
5
  SHA512:
6
- metadata.gz: 96595e35e141f4a54c291708e55af3dbfa938180a659db4e5f3b4a7e0202fd5552f3aa8bac2143330dbb5e366a5c33f487efe19d4f622cc4b3de6adab3b5ee6d
7
- data.tar.gz: 2a3a9598ebacbd53201b754f2e03b1044ad02fc3095b2574dd80659f367f295f6d53f19a58b8c6bee8255ac091630518bd934f2373499fbd0e9262da0fb6e064
6
+ metadata.gz: 0e77f7322716892366f2c22c1af5c7d6a31a8d50e088322bca3b1620aedab22b66440eee819590baac8cdd2a32e5100735f96c7565ec7203b4751cad8622878b
7
+ data.tar.gz: 751b98ce7205bb45e3eb472c1e76d8262aedca76e2d18774faacd0985a8385ceaad7e3e447f7e8c558927a05cc0fc29dfdc7a1c22ffced73244589faf7027cfa
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- disavow_tool (0.1.0)
4
+ disavow_tool (0.1.1)
5
5
  activesupport
6
6
  colorize
7
7
 
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/ruby
2
2
  require 'colorize'
3
3
  require 'io/console'
4
+ require 'active_support/inflector'
5
+ require 'active_support/core_ext/object'
4
6
  require_relative 'disavow_tool/config'
5
7
  require_relative 'disavow_tool/version'
6
8
  require_relative 'disavow_tool/command_options.rb'
@@ -9,8 +11,8 @@ require_relative 'disavow_tool/white_list.rb'
9
11
  require_relative 'disavow_tool/imported_links.rb'
10
12
 
11
13
  module DisavowTool
12
-
13
14
  def self.run
15
+
14
16
  puts "Importing new links".blue if OPTIONS.verbose
15
17
  imported_links = ImportedLinks.new
16
18
 
@@ -18,7 +18,7 @@ module DisavowTool
18
18
  opts.banner = "Usage: disavow.rb [options] --disavow FILE --import file_1,file_2,file_3 [--whitelist file1,file2,file3]"
19
19
  opts.separator ""
20
20
  opts.separator "Requited options:"
21
- opts.on("-d","--disavow FILE", Array, "Disavow file as exported from Google Search Console") do |file|
21
+ opts.on("-d","--disavow FILE", "Disavow file as exported from Google Search Console") do |file|
22
22
  options.disavow_file = file
23
23
  end
24
24
  opts.on("-i","--import file_1,file_2", Array, "List of URLS to analyse. The file must have one URL per line") do |file|
@@ -27,7 +27,7 @@ module DisavowTool
27
27
 
28
28
  opts.separator ""
29
29
  opts.separator "Optional options:"
30
- opts.on("--whitelist file1,file2,file3", Array, "Enter any number of whitelisted files",
30
+ opts.on("-w", "--whitelist file1,file2,file3", Array, "Enter any number of whitelisted files",
31
31
  "whitelisted files must have one URL per line") do |file|
32
32
  options.whitelist = true
33
33
  options.whitelist_files = file
@@ -55,9 +55,20 @@ module DisavowTool
55
55
  end
56
56
 
57
57
  opt_parser.parse!(args)
58
+ check_arguments(options)
58
59
  options
59
60
  end
61
+
62
+ def check_arguments(options)
63
+ raise "You must to specify one disallow file" if options.disavow_file.blank?
64
+ raise "You must to specify one import file" if options.import_files.blank?
65
+ if options.whitelist
66
+ raise "You need to specify at least one white list file" if options.whitelist_files.blank?
67
+ end
68
+ end
69
+
60
70
  end
61
71
 
62
72
  OPTIONS = Commands.parse_inputs
73
+
63
74
  end
@@ -1,6 +1,5 @@
1
1
  require 'set'
2
- require 'active_support/inflector'
3
- require 'active_support/core_ext/object'
2
+
4
3
  module DisavowTool
5
4
  class List
6
5
 
@@ -1,3 +1,3 @@
1
1
  module DisavowTool
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: disavow_tool
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
  - Maesitos