cocoapods-release 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0f838058a73414378c875f78c28670f8c4a38e44
4
+ data.tar.gz: 48fd777a5f80ed12299c642d9846d9b1c5ce996e
5
+ SHA512:
6
+ metadata.gz: 3941af03276fd2a7c8a0f807708ed7dec97cbabf5b8f6e138258e01b7952befd7e0d0a1174c24fec7b6d17000f5482fc4aa01a3b33a2d6656a0da27e3878e135
7
+ data.tar.gz: 8d8b0441e97c89b2f9b011718d671e4894874e148346ddc132379c0bb2a3b09994565cbd56f1c4161d65267defc31eecef34930933d66ce1430b540b864e8589
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cocoapods-release.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Oliver Letterer
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.
data/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # Cocoapods release
2
+
3
+ CocoaPods release is a little helper that let's you release pods more easily.
4
+
5
+ ## Installation
6
+
7
+ $ gem install cocoapods-release
8
+
9
+ ## Usage
10
+
11
+ 1. Change the version in your `podspec` file.
12
+ 2. Run `pod release`.
13
+
14
+ `pod release`
15
+ * tags and pushes your current branch
16
+ * automatically finds the repository hosting your existing podspec (master or private, doesn't matter) and
17
+ * pushes to podspec for you.
18
+
19
+ ## Author
20
+
21
+ Oliver Letterer
22
+
23
+ - http://github.com/OliverLetterer
24
+ - http://twitter.com/oletterer
25
+ - oliver.letterer@gmail.com
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cocoapods-release"
8
+ spec.version = CocoapodRelease::VERSION
9
+ spec.authors = ["Oliver Letterer"]
10
+ spec.email = ["oliver.letterer@gmail.com"]
11
+ spec.summary = %q{Tags and releases pods for you.}
12
+ spec.description = %q{Release helper plugin for CocoaPods.}
13
+ spec.homepage = "https://github.com/Sparrow-Labs/cocoapods-release"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
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_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ end
@@ -0,0 +1 @@
1
+ require 'pod/command/release'
@@ -0,0 +1,93 @@
1
+ module Pod
2
+ class Command
3
+ class Release < Command
4
+ self.summary = 'Release podspecs in current directory'
5
+
6
+ def execute(command)
7
+ UI.puts "#{"==>".magenta} #{command}"
8
+ abort unless system(command)
9
+ end
10
+
11
+ self.arguments = [
12
+ CLAide::Argument.new('repository', false),
13
+ ]
14
+
15
+ def self.options
16
+ [
17
+ ['--allow-warnings', 'Allows push even if there are lint warnings'],
18
+ ].concat(super.reject { |option, _| option == '--silent' })
19
+ end
20
+
21
+ def initialize(argv)
22
+ warnings = argv.flag?('allow-warnings')
23
+ @allow_warnings = warnings ? "--allow-warnings" : ""
24
+ @only_errors = warnings ? "--only-errors" : ""
25
+
26
+ @repo = argv.shift_argument unless argv.arguments.empty?
27
+ super
28
+ end
29
+
30
+ def run
31
+ specs = Dir.entries(".").select { |s| s.end_with? ".podspec" }
32
+ abort "No podspec found" unless specs.count > 0
33
+
34
+ for spec in specs
35
+ name = spec.gsub(".podspec", "")
36
+ version = Specification.from_file(spec).version
37
+
38
+ sources = SourcesManager.all
39
+ sources = sources.select { |s| s.name == @repo } if @repo
40
+ pushed_sources = []
41
+
42
+ abort "Please run #{"pod install".green} to continue" if sources.count == 0
43
+ for source in sources
44
+ pushed_versions = source.versions(name)
45
+ next unless pushed_versions
46
+
47
+ pushed_sources << source
48
+ pushed_versions = pushed_versions.collect { |v| v.to_s }
49
+ abort "#{name} (#{version}) has already been pushed to #{source.name}".red if pushed_versions.include? version.to_s
50
+ end
51
+
52
+ repo_unspecified = pushed_sources.count == 0 && sources.count > 1
53
+ if repo_unspecified
54
+ puts "When pushing a new podspec, please specify a repository to push #{name} to:"
55
+ puts ""
56
+ for source in sources
57
+ puts " * pod release #{source.name}"
58
+ end
59
+ puts ""
60
+ abort
61
+ end
62
+
63
+ if pushed_sources.count > 1
64
+ puts "#{name} has already been pushed to #{pushed_sources.join(', ')}. Please specify a repository to push #{name} to:"
65
+ puts ""
66
+ for source in sources
67
+ puts " * pod release #{source.name}"
68
+ end
69
+ puts ""
70
+ abort
71
+ end
72
+
73
+ # verify lib
74
+ execute "pod lib lint #{spec} #{@only_errors}"
75
+
76
+ # TODO: create git tag for current version
77
+ unless system("git tag | grep #{version} > /dev/null")
78
+ execute "git add -A && git commit -m \"Releases #{version}.\""
79
+ execute "git tag #{version}"
80
+ execute "git push && git push --tags"
81
+ end
82
+
83
+ repo = pushed_sources.first.name
84
+ if repo == "master"
85
+ execute "pod trunk push #{spec} #{@allow_warnings}"
86
+ else
87
+ execute "pod repo push #{repo} #{spec} #{@allow_warnings}"
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
data/lib/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module CocoapodRelease
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-release
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Oliver Letterer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Release helper plugin for CocoaPods.
42
+ email:
43
+ - oliver.letterer@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - cocoapods-release.gemspec
54
+ - lib/cocoapods_plugin.rb
55
+ - lib/pod/command/release.rb
56
+ - lib/version.rb
57
+ homepage: https://github.com/Sparrow-Labs/cocoapods-release
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.2.2
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: Tags and releases pods for you.
81
+ test_files: []