module GoNative::Plugins::IOS::Publish::Release

Constants

GONATIVE_SOURCE_NAME

Public Instance Methods

release_pod!() click to toggle source
# File lib/gonative/plugins/ios/publish/release.rb, line 12
def release_pod!
  Utils::UI.info 'Linting and releasing pod'
  assert_spec_exists!
  sources_manager.update(GONATIVE_SOURCE_NAME)
  assert_not_pushed!
  create_and_push_tag!
  push_to_pod_repo!
end

Private Instance Methods

assert_not_pushed!() click to toggle source
# File lib/gonative/plugins/ios/publish/release.rb, line 29
def assert_not_pushed!
  version = spec.version
  name = spec.name
  
  pushed_versions = source.versions(name).collect(&:to_s)
  
  raise Error, "#{name} (#{version}) has already been pushed to #{source.name}" if pushed_versions.include? version.to_s
end
assert_spec_exists!() click to toggle source
# File lib/gonative/plugins/ios/publish/release.rb, line 23
def assert_spec_exists!
  return if spec_name
  
  raise Error, "No podspec file exists"
end
create_and_push_tag!() click to toggle source
# File lib/gonative/plugins/ios/publish/release.rb, line 38
def create_and_push_tag!
  unless system("git tag | grep #{spec.version} > /dev/null")
    system "git add -A && git commit -m \"Releases #{spec.version}.\""
    system "git tag #{spec.version}"
    system "git push && git push --tags"
  end
end
push_to_pod_repo!() click to toggle source
# File lib/gonative/plugins/ios/publish/release.rb, line 46
def push_to_pod_repo!
  system "pod repo push #{GONATIVE_SOURCE_NAME} #{spec_name} --private"
end
source() click to toggle source
# File lib/gonative/plugins/ios/publish/release.rb, line 58
def source
  @source ||= sources_manager.source_with_name_or_url(GONATIVE_SOURCE_NAME)
end
sources_manager() click to toggle source
# File lib/gonative/plugins/ios/publish/release.rb, line 62
def sources_manager
  Pod::Config.instance.sources_manager
end
spec() click to toggle source
# File lib/gonative/plugins/ios/publish/release.rb, line 54
def spec
  @spec ||= Pod::Specification.from_file(spec_name)
end
spec_name() click to toggle source
# File lib/gonative/plugins/ios/publish/release.rb, line 50
def spec_name
  @spec_name ||= Dir.entries(".").select { |s| s.end_with? ".podspec" }.first
end