lib/vindetta/cli.rb in vindetta-0.24.0 vs lib/vindetta/cli.rb in vindetta-0.25.0
- old
+ new
@@ -11,18 +11,21 @@
program_desc "Vehicle Identification Number (VIN) CLI"
version Vindetta::VERSION
desc "Validates a VIN"
-
+
command %i[validate v] do |c|
c.action do |_global, _options, args|
vin = args.first
exit_now!(I18n.t("required"), 1) if vin.nil?
- puts Vindetta::Validator.vin(vin)
+ standard = Vindetta::Standard::ISO3779
+ validator = Vindetta::Validator.new(standard)
+
+ puts validator.vin(vin)
end
end
desc "Decodes a VIN"
@@ -30,18 +33,24 @@
c.action do |_global, _options, args|
vin = args.first
exit_now!(I18n.t("required"), 1) if vin.nil?
- puts Vindetta::Decoder.vin(vin)
+ standard = Vindetta::Standard::ISO3779
+ decoder = Vindetta::Decoder.new(standard)
+
+ puts decoder.vin(vin)
end
end
desc "Generates a random VIN"
command %i[generate g] do |c|
c.action do |_global, _options, _args|
- puts Vindetta::Generator.vin
+ standard = Vindetta::Standard::ISO3779
+ generator = Vindetta::Generator.new(standard)
+
+ puts generator.vin
end
end
end
end