Skip to content

Commit ac54a19

Browse files
committed
Initial commit
0 parents  commit ac54a19

13 files changed

+198
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
pkg
3+
.idea/

Gemfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
source 'https://rubygems.org'
2+
3+
# Specify your gem's dependencies in cocoapods-prebuild-framework.gemspec
4+
gemspec
5+
6+
group :development do
7+
gem 'cocoapods'
8+
9+
gem 'mocha'
10+
gem 'bacon'
11+
gem 'mocha-on-bacon'
12+
gem 'prettybacon'
13+
end

LICENSE.txt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2018 GaoJi <[email protected]>
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# cocoapods-prebuild-framework
2+
3+
A description of cocoapods-prebuild-framework.
4+
5+
## Installation
6+
7+
$ gem install cocoapods-prebuild-framework
8+
9+
## Usage
10+
11+
$ pod spec framework POD_NAME

Rakefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'bundler/gem_tasks'
2+
3+
def specs(dir)
4+
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
5+
end
6+
7+
desc 'Runs all the specs'
8+
task :specs do
9+
sh "bundle exec bacon #{specs('**')}"
10+
end
11+
12+
task :default => :specs
13+

cocoapods-prebuild-framework.gemspec

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# coding: utf-8
2+
lib = File.expand_path('../lib', __FILE__)
3+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4+
require 'cocoapods-prebuild-framework/gem_version.rb'
5+
6+
Gem::Specification.new do |spec|
7+
spec.name = 'cocoapods-prebuild-framework'
8+
spec.version = CocoapodsPrebuildFramework::VERSION
9+
spec.authors = ['leavez']
10+
spec.email = ['[email protected]']
11+
spec.description = %q{A short description of cocoapods-prebuild-framework.}
12+
spec.summary = %q{A longer description of cocoapods-prebuild-framework.}
13+
spec.homepage = 'https://github.com/EXAMPLE/cocoapods-prebuild-framework'
14+
spec.license = 'MIT'
15+
16+
spec.files = `git ls-files`.split($/)
17+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19+
spec.require_paths = ['lib']
20+
21+
spec.add_dependency "cocoapods", ">= 1.4.0", "< 2.0"
22+
spec.add_development_dependency 'bundler', '~> 1.3'
23+
spec.add_development_dependency 'rake'
24+
end

lib/cocoapods-prebuild-framework.rb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'cocoapods-prebuild-framework/gem_version'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'cocoapods-prebuild-framework/command/framework'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
module Pod
2+
class Command
3+
# This is an example of a cocoapods plugin adding a top-level subcommand
4+
# to the 'pod' command.
5+
#
6+
# You can also create subcommands of existing or new commands. Say you
7+
# wanted to add a subcommand to `list` to show newly deprecated pods,
8+
# (e.g. `pod list deprecated`), there are a few things that would need
9+
# to change.
10+
#
11+
# - move this file to `lib/pod/command/list/deprecated.rb` and update
12+
# the class to exist in the the Pod::Command::List namespace
13+
# - change this class to extend from `List` instead of `Command`. This
14+
# tells the plugin system that it is a subcommand of `list`.
15+
# - edit `lib/cocoapods_plugins.rb` to require this file
16+
#
17+
# @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
18+
# in the `plugins.json` file, once your plugin is released.
19+
#
20+
class Framework < Command
21+
self.summary = 'Short description of cocoapods-prebuild-framework.'
22+
23+
self.description = <<-DESC
24+
Longer description of cocoapods-prebuild-framework.
25+
DESC
26+
27+
self.arguments = 'NAME'
28+
29+
def initialize(argv)
30+
@name = argv.shift_argument
31+
super
32+
end
33+
34+
def validate!
35+
super
36+
help! 'A Pod name is required.' unless @name
37+
end
38+
39+
def run
40+
UI.puts "Add your implementation for the cocoapods-prebuild-framework plugin in #{__FILE__}"
41+
end
42+
end
43+
end
44+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module CocoapodsPrebuildFramework
2+
VERSION = "0.0.1"
3+
end

lib/cocoapods_plugin.rb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'cocoapods-prebuild-framework/command'

spec/command/framework_spec.rb

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require File.expand_path('../../spec_helper', __FILE__)
2+
3+
module Pod
4+
describe Command::Framework do
5+
describe 'CLAide' do
6+
it 'registers it self' do
7+
Command.parse(%w{ framework }).should.be.instance_of Command::Framework
8+
end
9+
end
10+
end
11+
end
12+

spec/spec_helper.rb

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
require 'pathname'
2+
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
3+
$:.unshift((ROOT + 'lib').to_s)
4+
$:.unshift((ROOT + 'spec').to_s)
5+
6+
require 'bundler/setup'
7+
require 'bacon'
8+
require 'mocha-on-bacon'
9+
require 'pretty_bacon'
10+
require 'pathname'
11+
require 'cocoapods'
12+
13+
Mocha::Configuration.prevent(:stubbing_non_existent_method)
14+
15+
require 'cocoapods_plugin'
16+
17+
#-----------------------------------------------------------------------------#
18+
19+
module Pod
20+
21+
# Disable the wrapping so the output is deterministic in the tests.
22+
#
23+
UI.disable_wrap = true
24+
25+
# Redirects the messages to an internal store.
26+
#
27+
module UI
28+
@output = ''
29+
@warnings = ''
30+
31+
class << self
32+
attr_accessor :output
33+
attr_accessor :warnings
34+
35+
def puts(message = '')
36+
@output << "#{message}\n"
37+
end
38+
39+
def warn(message = '', actions = [])
40+
@warnings << "#{message}\n"
41+
end
42+
43+
def print(message)
44+
@output << message
45+
end
46+
end
47+
end
48+
end
49+
50+
#-----------------------------------------------------------------------------#

0 commit comments

Comments
 (0)