Class: Pod::Command::Bin
- Inherits:
-
Pod::Command
- Object
- Pod::Command
- Pod::Command::Bin
- Includes:
- CBin::SourcesHelper, CBin::SpecFilesHelper
- Defined in:
- lib/cocoapods-imy-bin/command/bin.rb,
lib/cocoapods-imy-bin/command/bin/dup.rb,
lib/cocoapods-imy-bin/command/bin/imy.rb,
lib/cocoapods-imy-bin/command/bin/auto.rb,
lib/cocoapods-imy-bin/command/bin/code.rb,
lib/cocoapods-imy-bin/command/bin/init.rb,
lib/cocoapods-imy-bin/command/bin/update.rb,
lib/cocoapods-imy-bin/command/bin/archive.rb,
lib/cocoapods-imy-bin/command/bin/install.rb,
lib/cocoapods-imy-bin/command/bin/lib/lint.rb,
lib/cocoapods-imy-bin/command/bin/spec/push.rb,
lib/cocoapods-imy-bin/command/bin/initHotKey.rb,
lib/cocoapods-imy-bin/command/bin/repo/update.rb,
lib/cocoapods-imy-bin/command/bin/spec/create.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, Imy, Init, Inithk, Install, Lib, Repo, Spec, Update
Defined Under Namespace
Classes: Archive, Auto, Code, Dup, Imy, Init, Inithk, Install, Lib, Repo, Spec, Update
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.
46 47 48 49 50 51 |
# File 'lib/cocoapods-imy-bin/command/bin.rb', line 46 def initialize(argv) require 'cocoapods-imy-bin/native' @help = argv.flag?('help') super end |
Instance Method Details
#validate! ⇒ Object
53 54 55 56 57 58 |
# File 'lib/cocoapods-imy-bin/command/bin.rb', line 53 def validate! super # 这里由于 --help 是在 validate! 方法中提取的,会导致 --help 失效 # pod lib create 也有这个问题 if @help end |