Class: Pod::Command::Bin
- Inherits:
-
Pod::Command
- Object
- Pod::Command
- Pod::Command::Bin
- Includes:
- CBin::SourcesHelper, CBin::SpecFilesHelper
- Defined in:
- lib/cocoapods-lhj-bin/command/bin.rb,
lib/cocoapods-lhj-bin/command/bin/dup.rb,
lib/cocoapods-lhj-bin/command/bin/lhj.rb,
lib/cocoapods-lhj-bin/command/bin/auto.rb,
lib/cocoapods-lhj-bin/command/bin/code.rb,
lib/cocoapods-lhj-bin/command/bin/init.rb,
lib/cocoapods-lhj-bin/command/bin/view.rb,
lib/cocoapods-lhj-bin/command/bin/yapi.rb,
lib/cocoapods-lhj-bin/command/bin/model.rb,
lib/cocoapods-lhj-bin/command/bin/trans.rb,
lib/cocoapods-lhj-bin/command/bin/import.rb,
lib/cocoapods-lhj-bin/command/bin/update.rb,
lib/cocoapods-lhj-bin/command/bin/archive.rb,
lib/cocoapods-lhj-bin/command/bin/install.rb,
lib/cocoapods-lhj-bin/command/bin/oss/del.rb,
lib/cocoapods-lhj-bin/command/bin/lib/lint.rb,
lib/cocoapods-lhj-bin/command/bin/oss/list.rb,
lib/cocoapods-lhj-bin/command/bin/spec/push.rb,
lib/cocoapods-lhj-bin/command/bin/initHotKey.rb,
lib/cocoapods-lhj-bin/command/bin/config/push.rb,
lib/cocoapods-lhj-bin/command/bin/local/fetch.rb,
lib/cocoapods-lhj-bin/command/bin/local/local.rb,
lib/cocoapods-lhj-bin/command/bin/repo/update.rb,
lib/cocoapods-lhj-bin/command/bin/spec/create.rb,
lib/cocoapods-lhj-bin/command/bin/local/filter.rb,
lib/cocoapods-lhj-bin/command/bin/local/upload.rb,
lib/cocoapods-lhj-bin/command/bin/reverse_import.rb,
lib/cocoapods-lhj-bin/command/bin/local/micro_service.rb
Overview
Create a PR to add your plugin to CocoaPods/cocoapods.org in the ‘plugins.json` file, once your plugin is released.
This is an example of a cocoapods plugin adding a top-level subcommand to the ‘pod’ command.
You can also create subcommands of existing or new commands. Say you wanted to add a subcommand to ‘list` to show newly deprecated pods, (e.g. `pod list deprecated`), there are a few things that would need to change.
-
move this file to ‘lib/pod/command/list/deprecated.rb` and update the class to exist in the the Pod::Command::List namespace
-
change this class to extend from ‘List` instead of `Command`. This tells the plugin system that it is a subcommand of `list`.
-
edit ‘lib/cocoapods_plugins.rb` to require this file
Direct Known Subclasses
Archive, Auto, Code, Dup, Fetch, Filter, Import, Init, Inithk, Install, Lhj, Lib, Local, Model, OSS, Repo, ReverseImport, Service, Spec, Trans, Update, View, Yapi
Defined Under Namespace
Classes: Archive, Auto, Code, Dup, Fetch, Filter, Import, Init, Inithk, Install, Lhj, Lib, Local, Model, OSS, Repo, ReverseImport, Service, Spec, Trans, Update, View, Yapi
Instance Method Summary collapse
-
#initialize(argv) ⇒ Bin
constructor
A new instance of Bin.
- #validate! ⇒ Object
Methods included from CBin::SpecFilesHelper
#binary_spec, #binary_spec_files, #binary_template_spec, #binary_template_spec_file, #binary_template_spec_files, #clear_binary_spec_file_if_needed, #code_spec, #code_spec_files, #create_binary_spec_file, #find_spec_file, #spec_files
Methods included from CBin::SourcesHelper
#binary_source, #code_source, #sources_manager, #sources_option, #valid_sources
Constructor Details
#initialize(argv) ⇒ Bin
Returns a new instance of Bin.
56 57 58 59 |
# File 'lib/cocoapods-lhj-bin/command/bin.rb', line 56 def initialize(argv) @help = argv.flag?('help') super end |
Instance Method Details
#validate! ⇒ Object
61 62 63 64 65 66 |
# File 'lib/cocoapods-lhj-bin/command/bin.rb', line 61 def validate! super # 这里由于 --help 是在 validate! 方法中提取的,会导致 --help 失效 # pod lib create 也有这个问题 if @help end |