lib/cli.rb in inqlude-0.0.6 vs lib/cli.rb in inqlude-0.0.7
- old
+ new
@@ -70,18 +70,24 @@
end
desc "view", "Create view"
method_option :output_dir, :type => :string, :aliases => "-o",
:desc => "Output directory", :required => true
+ method_option :manifest_dir, :type => :string, :aliases => "-m",
+ :desc => "Manifest directory", :required => false
method_option :enable_disqus, :type => :boolean,
:desc => "Enable Disqus based comments on generate web pages. Works only on
actual domain."
method_option :disable_search, :type => :boolean,
:desc => "Disable Google based search."
def view
process_global_options options
-
+
+ if options[:manifest_dir]
+ @@settings.manifest_path = options[:manifest_dir]
+ end
+
view = View.new ManifestHandler.new @@settings
view.enable_disqus = options[:enable_disqus]
view.enable_search = !options[:disable_search]
view.create options[:output_dir]
end
@@ -101,29 +107,31 @@
handler.read_remote
count_ok = 0
count_error = 0
handler.libraries.each do |library|
library.manifests.each do |manifest|
- if v.verify manifest
+ result = v.verify manifest
+ result.print_result
+ if result.valid?
count_ok += 1
else
count_error += 1
end
end
end
puts "#{handler.manifests.count} manifests checked. #{count_ok} ok, " +
"#{count_error} with error."
end
- desc "create", "Create manifest"
+ desc "system_scan", "Scan system for installed Qt libraries and create manifests"
method_option :dry_run, :type => :boolean,
:desc => "Dry run. Don't write files."
method_option :recreate_source_cache, :type => :boolean,
:desc => "Recreate cache with meta data of installed RPMs"
method_option :recreate_qt_source_cache, :type => :boolean,
:desc => "Recreate cache with meta data of Qt library RPMs"
- def create
+ def system_scan
m = RpmManifestizer.new @@settings
m.dry_run = options[:dry_run]
if options[:recreate_source_cache]
m.create_source_cache
@@ -134,9 +142,17 @@
end
m.process_all_rpms
end
+ desc "create <manifest_name> <version> <release_date>", "Create new or updated manifest"
+ def create name, version, release_date
+ @@settings.manifest_path = "."
+ creator = Creator.new @@settings, name
+ creator.validate_directory
+ creator.create version, release_date
+ end
+
desc "get_involved", "Information about how to get involved"
def get_involved
Upstream.print_info
end