Class: OrmDev::Command::Publish
- Inherits:
-
OrmDev::Command
- Object
- CLAide::Command
- OrmDev::Command
- OrmDev::Command::Publish
- Defined in:
- lib/ormdev/command/publish.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Publish
constructor
A new instance of Publish.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Publish
Returns a new instance of Publish.
23 24 25 26 27 |
# File 'lib/ormdev/command/publish.rb', line 23 def initialize(argv) @podspec_file = argv.shift_argument @podspec_files = Pathname.pwd.children.select { |pn| pn.extname == '.podspec' } super end |
Class Method Details
.options ⇒ Object
18 19 20 21 |
# File 'lib/ormdev/command/publish.rb', line 18 def self. [ ].concat(super) end |
Instance Method Details
#run ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/ormdev/command/publish.rb', line 42 def run super OrmDev::LogUtil.info '[插件发布] '.green installer = OrmDev::RunHelper.new(@podspec_path) installer.setup() OrmDev::LogUtil.info "Success!!! Please run command:\n orm ipa \#{platform}" end |
#validate! ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ormdev/command/publish.rb', line 29 def validate! super # raise Pod::Informative, "No `Cimfile' found in the project directory." unless @cipfile_path.exist? if @podspec_file help! "podspec file at #{@podspec_file} does not exist" unless File.exist? @podspec_file @podspec_path = @podspec_file else raise Pod::Informative, 'No podspec file found, please specify one' unless @podspec_files.length > 0 raise Pod::Informative, 'Multiple podspec file found, please specify one' unless @podspec_files.length == 1 @podspec_path = @podspec_files.first end end |