diff --git a/lib/docs.rb b/lib/docs.rb index 33d54bbc..a83ed1c6 100644 --- a/lib/docs.rb +++ b/lib/docs.rb @@ -56,7 +56,7 @@ module Docs doc = const_get(const) if version.present? - doc = doc.versions.find { |klass| klass.version == version } + doc = doc.versions.find { |klass| klass.version == version || klass.version_slug == version } raise DocNotFound.new(%(could not find version "#{version}" for doc "#{name}"), name) unless doc else doc = doc.versions.first diff --git a/lib/tasks/docs.thor b/lib/tasks/docs.thor index f8c7af20..e727224e 100644 --- a/lib/tasks/docs.thor +++ b/lib/tasks/docs.thor @@ -141,7 +141,9 @@ class DocsCLI < Thor desc 'upload', '[private]' option :dryrun, type: :boolean + option :packaged, type: :boolean def upload(*names) + names = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') } if options[:packaged] docs = find_docs(names) assert_docs(docs) docs.each do |doc| @@ -156,7 +158,7 @@ class DocsCLI < Thor def find_docs(names) names.map do |name| - name, version = name.split('@') + name, version = name.split(/@|~/) Docs.find(name, version) end end