Class: Pod::Command::Fmwk::Create
- Inherits:
-
Pod::Command::Fmwk
- Object
- Pod::Command
- Pod::Command::Fmwk
- Pod::Command::Fmwk::Create
- Defined in:
- lib/pod/command/fmwk/create.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Create
constructor
A new instance of Create.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Create
Returns a new instance of Create.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/pod/command/fmwk/create.rb', line 48 def initialize(argv) # @quick = argv.flag?('quick') # @allow_warnings = argv.flag?('allow-warnings') # @clean = argv.flag?('clean', true) # @fail_fast = argv.flag?('fail-fast', false) # @subspecs = argv.flag?('subspecs', true) # @only_subspec = argv.option('subspec') # @use_frameworks = !argv.flag?('use-libraries') # @source_urls = argv.option('sources', 'https://github.com/CocoaPods/Specs.git').split(',') # @private = argv.flag?('private', false) # @swift_version = argv.option('swift-version', nil) # @skip_import_validation = argv.flag?('skip-import-validation', false) # @skip_tests = argv.flag?('skip-tests', false) @framework_names = argv.arguments! super end |
Class Method Details
.options ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/pod/command/fmwk/create.rb', line 28 def self. [ # ['--quick', 'Lint skips checks that would require to download and build the spec'], # ['--allow-warnings', 'Lint validates even if warnings are present'], # ['--subspec=NAME', 'Lint validates only the given subspec'], # ['--no-subspecs', 'Lint skips validation of subspecs'], # ['--no-clean', 'Lint leaves the build directory intact for inspection'], # ['--fail-fast', 'Lint stops on the first failing platform or subspec'], # ['--use-libraries', 'Lint uses static libraries to install the spec'], # ['--sources=https://github.com/artsy/Specs,master', 'The sources from which to pull dependent pods ' \ # '(defaults to https://github.com/CocoaPods/Specs.git). ' \ # 'Multiple sources must be comma-delimited.'], # ['--private', 'Lint skips checks that apply only to public specs'], # ['--swift-version=VERSION', 'The SWIFT_VERSION that should be used to lint the spec. ' \ # 'This takes precedence over a .swift-version file.'], # ['--skip-import-validation', 'Lint skips validating that the pod can be imported'], # ['--skip-tests', 'Lint skips building and running tests during validation'], ].concat(super) end |
Instance Method Details
#run ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/pod/command/fmwk/create.rb', line 69 def run UI.puts framework_names.each do |podspec| puts "开始创建 framework 工程 #{podspec}" puts "创建目录..." `mkdir -p \`pwd\`/#{podspec}/#{podspec}` puts "下载模板..." `curl http://gitlab.douyuios.com/huangluyang/my-shells/raw/master/framework_template.podspec -o #{podspec}/#{podspec}.podspec` `curl http://gitlab.douyuios.com/huangluyang/my-shells/raw/master/LICENSE_template -o #{podspec}/#{podspec}/LICENSE` puts "填充模板..." `sed -i '' "s/<#lib name#>/#{podspec}/g" #{podspec}/#{podspec}.podspec` puts "创建 framework 工程 #{podspec} 成功!" puts "" end end |
#validate! ⇒ Object
65 66 67 |
# File 'lib/pod/command/fmwk/create.rb', line 65 def validate! super end |