podspecpush 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: b9530bf344c87ce1a4f88c578b888e28847f5166
4
+ data.tar.gz: 28d81f981e81c4fe7bd511f0fdaf9e5d5bf12696
5
+ SHA512:
6
+ metadata.gz: a40023bda6d65da07f3062e4f3387a253d7f90633844b5d489515025e4e3923bfa285ef4c3fc070f62e6f563e82c046d219626af0ec9498d9238ccc23b5191f4
7
+ data.tar.gz: 78b81ef7bed25a3aaa43cdafdd169d354e33b14e523948593116cfaf655adde31996c9586a1e71465e2112fb0e12e9f6db34f5c8ec64205969dd86d42dba51fc
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .DS_Store
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in podspecpush.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Joe Carroll
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Podspecpush
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/podspecpush`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'podspecpush'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install podspecpush
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/podspecpush.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "podspecpush"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/podspecpush ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "podspecpush"
4
+
5
+ podpush = Podspecpush::PodPush.new
6
+ podpush.push
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,3 @@
1
+ module Podspecpush
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,85 @@
1
+ require "podspecpush/version"
2
+ require 'trollop'
3
+
4
+ module Podspecpush
5
+ class PodPush
6
+ def push
7
+ opts = Trollop::options do
8
+ opt :repo, "Repo name", :type => :string
9
+ opt :force, "Pod verify & push with warnings"
10
+ end
11
+ Trollop::die :repo, "Repo must be provided" if opts[:repo] == nil
12
+
13
+ force = opts[:force]
14
+ repoName = opts[:repo]
15
+
16
+ podspecName = `ls | grep .podspec`.strip
17
+
18
+ clean = `git status --porcelain`
19
+
20
+ if clean.length != 0
21
+ puts "Repo is not clean; will not push new version"
22
+ exit
23
+ end
24
+
25
+ version = `git describe --abbrev=0`.strip
26
+
27
+ newFile = ""
28
+
29
+ File.readlines(podspecName).each do |line|
30
+ idx = / s.version/ =~ line
31
+ if idx != nil && idx >= 0
32
+ startIdx = line.index("\'")
33
+ endIdx = line.index("\'", startIdx + 1)
34
+ currentVersion = line[startIdx + 1...endIdx]
35
+ if currentVersion == version
36
+ puts "Can't push same version silly!"
37
+ exit
38
+ end
39
+ line[startIdx +1 ...endIdx] = version
40
+ end
41
+
42
+ newFile += line
43
+ end
44
+
45
+ File.open(podspecName, 'w') { |file| file.write(newFile) }
46
+
47
+ lintCmd = "pod spec lint #{podspecName}" + (force == true ? ' --allow-warnings' : '')
48
+ lint = system(lintCmd)
49
+
50
+ if lint == false
51
+ puts "Linting failed, see errors. If its just a warning run with --force argument"
52
+ exit
53
+ end
54
+
55
+ pushCmd = "pod repo push #{repoName} #{podspecName}" + (force == true ? ' --allow-warnings' : '')
56
+ repoPush = system(pushCmd)
57
+
58
+ if repoPush == false
59
+ puts "Push failed, see errors."
60
+ exit
61
+ end
62
+
63
+ addExecute = system('git add .')
64
+
65
+ if addExecute == false
66
+ puts "Could not add files, consider finishing by hand and not the script"
67
+ exit
68
+ end
69
+
70
+ commitExecute = system('git commit -m "[Versioning] Updating podspec"')
71
+
72
+ if commitExecute == false
73
+ puts "Could not commit files, consider finishing by hand and not the script"
74
+ exit
75
+ end
76
+
77
+ pushToServer = system('git push origin master')
78
+
79
+ if pushToServer == false
80
+ puts "Could not push to server, consider finishing by hand and not the script"
81
+ exit
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'podspecpush/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "podspecpush"
8
+ spec.version = Podspecpush::VERSION
9
+ spec.authors = ["Joe Carroll"]
10
+ spec.email = ["jcarroll@mediafly.com"]
11
+
12
+ spec.summary = "Lint, publish and push podspec after tagging"
13
+ spec.description = "Once you tag a new version of your cocoapod run this to automatically run pod spec lint, pod push and finally update your local cocoapod spec file. All you must do is git tag!"
14
+ spec.homepage = "https://github.com/jcarroll-mediafly/podspecpush"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = "bin"
21
+ spec.executables = ["podspecpush"]
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_runtime_dependency 'trollop'
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.13"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: podspecpush
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Joe Carroll
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-12-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: trollop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.13'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.13'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Once you tag a new version of your cocoapod run this to automatically
56
+ run pod spec lint, pod push and finally update your local cocoapod spec file. All
57
+ you must do is git tag!
58
+ email:
59
+ - jcarroll@mediafly.com
60
+ executables:
61
+ - podspecpush
62
+ extensions: []
63
+ extra_rdoc_files: []
64
+ files:
65
+ - ".gitignore"
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - bin/console
71
+ - bin/podspecpush
72
+ - bin/setup
73
+ - lib/podspecpush.rb
74
+ - lib/podspecpush/version.rb
75
+ - podspecpush.gemspec
76
+ homepage: https://github.com/jcarroll-mediafly/podspecpush
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.4.8
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Lint, publish and push podspec after tagging
100
+ test_files: []