Class: XCJobs::InfoPlist::Version
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- XCJobs::InfoPlist::Version
- Includes:
- Rake::DSL, XCJobs::InfoPlist
- Defined in:
- lib/xcjobs/info_plist.rb
Instance Method Summary collapse
- #define ⇒ Object
-
#initialize {|_self| ... } ⇒ Version
constructor
A new instance of Version.
- #path ⇒ Object
- #path=(path) ⇒ Object
Methods included from XCJobs::InfoPlist
#[], #[]=, #build_version, #build_version=, #bump_marketing_version_segment, #marketing_and_build_version, #marketing_version, #marketing_version=, #set
Constructor Details
#initialize {|_self| ... } ⇒ Version
Returns a new instance of Version.
58 59 60 61 |
# File 'lib/xcjobs/info_plist.rb', line 58 def initialize() yield self if block_given? define end |
Instance Method Details
#define ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/xcjobs/info_plist.rb', line 71 def define namespace :version do desc 'Print the current version' task :current do puts InfoPlist.marketing_and_build_version end desc 'Sets build version to last git commit hash' task :set_build_version do rev = %x[git rev-parse --short HEAD].strip puts "Setting build version to: #{rev}" InfoPlist.build_version = rev end desc 'Sets build version to number of commits' task :set_build_number do rev = %x[git rev-list --count HEAD].strip puts "Setting build version to: #{rev}" InfoPlist.build_version = rev end namespace :bump do desc 'Bump patch version (0.0.X)' task :patch do InfoPlist.bump_marketing_version_segment(2) end desc 'Bump minor version (0.X.0)' task :minor do InfoPlist.bump_marketing_version_segment(1) end desc 'Bump major version (X.0.0)' task :major do InfoPlist.bump_marketing_version_segment(0) end end end desc 'Print the current version' task :version => 'version:current' end |