mirror of
https://github.com/joeblau/COSTouchVisualizer.git
synced 2024-09-11 12:36:58 +03:00
Initial commit
This commit is contained in:
commit
a4ceb609be
21
.gitignore
vendored
Normal file
21
.gitignore
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# OS X
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Xcode
|
||||||
|
build/
|
||||||
|
*.pbxuser
|
||||||
|
!default.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
!default.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
!default.mode2v3
|
||||||
|
*.perspectivev3
|
||||||
|
!default.perspectivev3
|
||||||
|
xcuserdata
|
||||||
|
*.xccheckout
|
||||||
|
profile
|
||||||
|
*.moved-aside
|
||||||
|
DerivedData
|
||||||
|
*.hmap
|
||||||
|
*.ipa
|
||||||
|
|
5
CHANGELOG.md
Normal file
5
CHANGELOG.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# TouchVisualizer CHANGELOG
|
||||||
|
|
||||||
|
## 0.1.0
|
||||||
|
|
||||||
|
Initial release.
|
0
Classes/ios/.gitkeep
Normal file
0
Classes/ios/.gitkeep
Normal file
0
Classes/osx/.gitkeep
Normal file
0
Classes/osx/.gitkeep
Normal file
7
Example/Podfile
Normal file
7
Example/Podfile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
pod "TouchVisualizer", :path => "../TouchVisualizer.podspec"
|
||||||
|
|
||||||
|
target "Demo" do
|
||||||
|
end
|
||||||
|
|
||||||
|
target "DemoTests" do
|
||||||
|
end
|
19
LICENSE
Normal file
19
LICENSE
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2014 Joe Blau <josephblau@gmail.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
26
README.md
Normal file
26
README.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# TouchVisualizer
|
||||||
|
|
||||||
|
[![Version](http://cocoapod-badges.herokuapp.com/v/TouchVisualizer/badge.png)](http://cocoadocs.org/docsets/TouchVisualizer)
|
||||||
|
[![Platform](http://cocoapod-badges.herokuapp.com/p/TouchVisualizer/badge.png)](http://cocoadocs.org/docsets/TouchVisualizer)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
To run the example project; clone the repo, and run `pod install` from the Example directory first.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
TouchVisualizer is available through [CocoaPods](http://cocoapods.org), to install
|
||||||
|
it simply add the following line to your Podfile:
|
||||||
|
|
||||||
|
pod "TouchVisualizer"
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
Joe Blau, josephblau@gmail.com
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
TouchVisualizer is available under the MIT license. See the LICENSE file for more info.
|
||||||
|
|
148
Rakefile
Normal file
148
Rakefile
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
desc "Runs the specs [EMPTY]"
|
||||||
|
task :spec do
|
||||||
|
# Provide your own implementation
|
||||||
|
end
|
||||||
|
|
||||||
|
task :version do
|
||||||
|
git_remotes = `git remote`.strip.split("\n")
|
||||||
|
|
||||||
|
if git_remotes.count > 0
|
||||||
|
puts "-- fetching version number from github"
|
||||||
|
sh 'git fetch'
|
||||||
|
|
||||||
|
remote_version = remote_spec_version
|
||||||
|
end
|
||||||
|
|
||||||
|
if remote_version.nil?
|
||||||
|
puts "There is no current released version. You're about to release a new Pod."
|
||||||
|
version = "0.0.1"
|
||||||
|
else
|
||||||
|
puts "The current released version of your pod is " + remote_spec_version.to_s()
|
||||||
|
version = suggested_version_number
|
||||||
|
end
|
||||||
|
|
||||||
|
puts "Enter the version you want to release (" + version + ") "
|
||||||
|
new_version_number = $stdin.gets.strip
|
||||||
|
if new_version_number == ""
|
||||||
|
new_version_number = version
|
||||||
|
end
|
||||||
|
|
||||||
|
replace_version_number(new_version_number)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Release a new version of the Pod"
|
||||||
|
task :release do
|
||||||
|
|
||||||
|
puts "* Running version"
|
||||||
|
sh "rake version"
|
||||||
|
|
||||||
|
unless ENV['SKIP_CHECKS']
|
||||||
|
if `git symbolic-ref HEAD 2>/dev/null`.strip.split('/').last != 'master'
|
||||||
|
$stderr.puts "[!] You need to be on the `master' branch in order to be able to do a release."
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if `git tag`.strip.split("\n").include?(spec_version)
|
||||||
|
$stderr.puts "[!] A tag for version `#{spec_version}' already exists. Change the version in the podspec"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
puts "You are about to release `#{spec_version}`, is that correct? [y/n]"
|
||||||
|
exit if $stdin.gets.strip.downcase != 'y'
|
||||||
|
end
|
||||||
|
|
||||||
|
puts "* Running specs"
|
||||||
|
sh "rake spec"
|
||||||
|
|
||||||
|
puts "* Linting the podspec"
|
||||||
|
sh "pod lib lint"
|
||||||
|
|
||||||
|
# Then release
|
||||||
|
sh "git commit #{podspec_path} CHANGELOG.md -m 'Release #{spec_version}'"
|
||||||
|
sh "git tag -a #{spec_version} -m 'Release #{spec_version}'"
|
||||||
|
sh "git push origin master"
|
||||||
|
sh "git push origin --tags"
|
||||||
|
sh "pod push master #{podspec_path}"
|
||||||
|
end
|
||||||
|
|
||||||
|
# @return [Pod::Version] The version as reported by the Podspec.
|
||||||
|
#
|
||||||
|
def spec_version
|
||||||
|
require 'cocoapods'
|
||||||
|
spec = Pod::Specification.from_file(podspec_path)
|
||||||
|
spec.version
|
||||||
|
end
|
||||||
|
|
||||||
|
# @return [Pod::Version] The version as reported by the Podspec from remote.
|
||||||
|
#
|
||||||
|
def remote_spec_version
|
||||||
|
require 'cocoapods-core'
|
||||||
|
|
||||||
|
if spec_file_exist_on_remote?
|
||||||
|
remote_spec = eval(`git show origin/master:#{podspec_path}`)
|
||||||
|
remote_spec.version
|
||||||
|
else
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# @return [Bool] If the remote repository has a copy of the podpesc file or not.
|
||||||
|
#
|
||||||
|
def spec_file_exist_on_remote?
|
||||||
|
test_condition = `if git rev-parse --verify --quiet origin/master:#{podspec_path} >/dev/null;
|
||||||
|
then
|
||||||
|
echo 'true'
|
||||||
|
else
|
||||||
|
echo 'false'
|
||||||
|
fi`
|
||||||
|
|
||||||
|
'true' == test_condition.strip
|
||||||
|
end
|
||||||
|
|
||||||
|
# @return [String] The relative path of the Podspec.
|
||||||
|
#
|
||||||
|
def podspec_path
|
||||||
|
podspecs = Dir.glob('*.podspec')
|
||||||
|
if podspecs.count == 1
|
||||||
|
podspecs.first
|
||||||
|
else
|
||||||
|
raise "Could not select a podspec"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# @return [String] The suggested version number based on the local and remote version numbers.
|
||||||
|
#
|
||||||
|
def suggested_version_number
|
||||||
|
if spec_version != remote_spec_version
|
||||||
|
spec_version.to_s()
|
||||||
|
else
|
||||||
|
next_version(spec_version).to_s()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# @param [Pod::Version] version
|
||||||
|
# the version for which you need the next version
|
||||||
|
#
|
||||||
|
# @note It is computed by bumping the last component of the versino string by 1.
|
||||||
|
#
|
||||||
|
# @return [Pod::Version] The version that comes next after the version supplied.
|
||||||
|
#
|
||||||
|
def next_version(version)
|
||||||
|
version_components = version.to_s().split(".");
|
||||||
|
last = (version_components.last.to_i() + 1).to_s
|
||||||
|
version_components[-1] = last
|
||||||
|
Pod::Version.new(version_components.join("."))
|
||||||
|
end
|
||||||
|
|
||||||
|
# @param [String] new_version_number
|
||||||
|
# the new version number
|
||||||
|
#
|
||||||
|
# @note This methods replaces the version number in the podspec file with a new version number.
|
||||||
|
#
|
||||||
|
# @return void
|
||||||
|
#
|
||||||
|
def replace_version_number(new_version_number)
|
||||||
|
text = File.read(podspec_path)
|
||||||
|
text.gsub!(/(s.version( )*= ")#{spec_version}(")/, "\\1#{new_version_number}\\3")
|
||||||
|
File.open(podspec_path, "w") { |file| file.puts text }
|
||||||
|
end
|
37
TouchVisualizer.podspec
Normal file
37
TouchVisualizer.podspec
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#
|
||||||
|
# Be sure to run `pod spec lint NAME.podspec' to ensure this is a
|
||||||
|
# valid spec and remove all comments before submitting the spec.
|
||||||
|
#
|
||||||
|
# To learn more about the attributes see http://guides.cocoapods.org/syntax/podspec.html
|
||||||
|
#
|
||||||
|
Pod::Spec.new do |s|
|
||||||
|
s.name = "TouchVisualizer"
|
||||||
|
s.version = "0.1.0"
|
||||||
|
s.summary = "A short description of TouchVisualizer."
|
||||||
|
s.description = <<-DESC
|
||||||
|
An optional longer description of TouchVisualizer
|
||||||
|
|
||||||
|
* Markdown format.
|
||||||
|
* Don't worry about the indent, we strip it!
|
||||||
|
DESC
|
||||||
|
s.homepage = "http://EXAMPLE/NAME"
|
||||||
|
s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
|
||||||
|
s.license = 'MIT'
|
||||||
|
s.author = { "Joe Blau" => "josephblau@gmail.com" }
|
||||||
|
s.source = { :git => "http://EXAMPLE/NAME.git", :tag => s.version.to_s }
|
||||||
|
s.social_media_url = 'https://twitter.com/NAME'
|
||||||
|
|
||||||
|
# s.platform = :ios, '5.0'
|
||||||
|
# s.ios.deployment_target = '5.0'
|
||||||
|
# s.osx.deployment_target = '10.7'
|
||||||
|
s.requires_arc = true
|
||||||
|
|
||||||
|
s.source_files = 'Classes'
|
||||||
|
s.resources = 'Resources'
|
||||||
|
|
||||||
|
s.ios.exclude_files = 'Classes/osx'
|
||||||
|
s.osx.exclude_files = 'Classes/ios'
|
||||||
|
# s.public_header_files = 'Classes/**/*.h'
|
||||||
|
# s.frameworks = 'SomeFramework', 'AnotherFramework'
|
||||||
|
# s.dependency 'JSONKit', '~> 1.4'
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user