Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a version constant and print it with --version.

  • Loading branch information...
commit 478c140466f4a686347064481de9e2fd3e6e812e 1 parent 21e4cd3
@alloy alloy authored
View
3  cocoapods.gemspec
@@ -1,8 +1,9 @@
# -*- encoding: utf-8 -*-
+require File.expand_path('../lib/cocoapods', __FILE__)
Gem::Specification.new do |s|
s.name = "cocoapods"
- s.version = "0.0.1"
+ s.version = Pod::VERSION
s.date = "2011-09-17"
s.license = "MIT"
s.summary = "A simple Objective-C library package manager."
View
2  lib/cocoapods.rb
@@ -1,4 +1,6 @@
module Pod
+ VERSION = '0.0.1'
+
class Informative < StandardError
end
View
5 lib/cocoapods/command.rb
@@ -40,7 +40,8 @@ def self.banner
def self.options
" --help Show help information\n" \
" --silent Print nothing\n" \
- " --verbose Print more information while working"
+ " --verbose Print more information while working\n" \
+ " --version Prints the version of CocoaPods"
end
def self.run(*argv)
@@ -58,6 +59,8 @@ def self.run(*argv)
def self.parse(*argv)
argv = ARGV.new(argv)
+ raise Informative, VERSION if argv.option('--version')
+
show_help = argv.option('--help')
Config.instance.silent = argv.option('--silent')
Config.instance.verbose = argv.option('--verbose')
Please sign in to comment.
Something went wrong with that request. Please try again.