xcvm 0.1.1 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6ee7da56fecc0450a027b696b7247e0633670ab
4
- data.tar.gz: da127e3f5c2f0f524e1257f451d62986093ae04e
3
+ metadata.gz: 33d79ec95081773fa742a6ba8a27418c37aa198d
4
+ data.tar.gz: 96a1057bf8e9a752281a975084a22d61be19bcf7
5
5
  SHA512:
6
- metadata.gz: 0debb64a46417ad31b5ec2271adc7d3d1b242b100aed0f11bdd7bc65af1aabd59fcca761e2d65279eeda637a8f2ce853426760751dac6d8d18d810813f8ae4d4
7
- data.tar.gz: ca15ebb0ba98fb14cc9a5d1bbd402923b863dcddcda7e80b8fe208bf1e212418763a84503a924190b6f7aa51c9289adb0d39f02ed9b56fc527e867d46c0c042c
6
+ metadata.gz: c3f08b94dad687d3dfdbda21a4c40bf73b0bc251a05ad5de9c6530bacc010fdb255b3656be02a9a63399120d82c667aa98091faaa9b439305f6f19a096bbd74a
7
+ data.tar.gz: 235a02d82c6bf8e70e624ccc1b1cdd2f08c62060e5d6f4a08779d46e84607c5bbdfe305a29844c7116c11407ebb945d8543fb757b4ea81ffef61ad83b93cf903
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ vendor
11
+ Info.plist
12
+ *.swp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ before_install: gem install bundler -v 1.11.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in xcvm.gemspec
4
+ gemspec
@@ -0,0 +1,36 @@
1
+ # Xcvm
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/xcvm`. 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 'xcvm'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install xcvm
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. Then, run `rake spec` to run the tests. 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/jaderfeijo/xcvm.
36
+
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "xcvm"
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
@@ -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
data/bin/xcvm CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'xcvm'
4
4
 
5
- Xcvm::VersionManager.run(ARGV[0], ARGV[1], ARGV[2], ARGV[3])
5
+ Xcvm::VersionManager::run(ARGV[0], ARGV[1], ARGV[2], ARGV[3])
@@ -4,27 +4,123 @@ require_relative 'xcvm/semantic_version.rb'
4
4
 
5
5
  module Xcvm
6
6
  class VersionManager
7
- def self.run(action, attribute, segment = nil, value = nil)
7
+ def self.run(action, attribute, value = nil, path = nil)
8
+ if path == nil then
9
+ path = 'Info.plist'
10
+ end
11
+
8
12
  if action == "print" then
9
- if attribute != nil then
10
- print(attribute)
11
- else
12
- raise "Invalid attribute '#{attribute}'"
13
- end
13
+ print attribute, path
14
14
  elsif action == "set" then
15
+ set attribute, value, path
15
16
  elsif action == "bump" then
17
+ increment attribute, path
16
18
  elsif action == "increment" then
19
+ increment attribute, path
17
20
  elsif action == "decrement" then
21
+ decrement attribute, path
22
+ elsif action == nil then
23
+ raise "Missing action"
24
+ else
25
+ raise "Invalid action '#{action}'"
26
+ end
27
+ end
28
+
29
+ def self.print(attribute, path)
30
+ project = Xcvm::Project.new(path)
31
+
32
+ if attribute == "version" then
33
+ puts project.version
34
+ elsif attribute == "build" then
35
+ puts project.build
36
+ elsif attribute == nil then
37
+ raise "Missing attribute"
18
38
  else
39
+ raise "Invalid attribute '#{attribute}'"
19
40
  end
20
41
  end
21
42
 
22
- def self.print(attribute)
23
- project = Xcvm::Project.new('Info.plist')
43
+ def self.set(attribute, value, path)
44
+ project = Xcvm::Project.new(path)
45
+
24
46
  if attribute == "version" then
47
+ project.version = Xcvm::SemanticVersion.new(value)
48
+ project.save
49
+ puts project.version
50
+ elsif attribute == "major" then
51
+ project.version.major = value.to_i
52
+ project.save
53
+ puts project.version
54
+ elsif attribute == "minor" then
55
+ project.version.minor = value.to_i
56
+ project.save
57
+ puts project.version
58
+ elsif attribute == "revision" then
59
+ project.revision = value.to_i
60
+ project.save
61
+ puts project.version
62
+ elsif
63
+ project.build = Xcvm::Build.new(value.to_i)
64
+ project.save
65
+ puts project.build
66
+ elsif attribute == nil then
67
+ raise "Missing attribute"
68
+ else
69
+ raise "Invalid attribute '#{attribute}'"
70
+ end
71
+ end
72
+
73
+ def self.increment(attribute, path)
74
+ project = Xcvm::Project.new(path)
75
+
76
+ if attribute == "major" then
77
+ project.version.increment! :major
78
+ project.save
79
+ puts project.version
80
+ elsif attribute == "minor" then
81
+ project.version.increment! :minor
82
+ project.save
83
+ puts project.version
84
+ elsif attribute == "revision" then
85
+ project.version.increment! :revision
86
+ project.save
87
+ puts project.version
88
+ elsif attribute == "build" then
89
+ project.build.increment!
90
+ project.save
91
+ puts project.build
92
+ elsif attribute == nil then
93
+ raise "Missing attribute"
94
+ else
95
+ raise "Invalid attribute '#{attribute}'"
96
+ end
97
+
98
+
99
+ end
100
+
101
+ def self.decrement(attribute, path)
102
+ project = Xcvm::Project.new(path)
103
+
104
+ if attribute == "major" then
105
+ project.version.decrement! :major
106
+ project.save
107
+ puts project.version
108
+ elsif attribute == "minor" then
109
+ project.version.decrement! :minor
110
+ project.save
111
+ puts project.version
112
+ elsif attribute == "revision" then
113
+ project.version.decrement! :revision
114
+ project.save
25
115
  puts project.version
26
116
  elsif attribute == "build" then
117
+ project.build.decrement!
118
+ project.save
27
119
  puts project.build
120
+ elsif attribute == nil then
121
+ raise "Missing attribute"
122
+ else
123
+ raise "Invalid attribute '#{attribute}'"
28
124
  end
29
125
  end
30
126
  end
@@ -18,12 +18,20 @@ module Xcvm
18
18
  return @version
19
19
  end
20
20
 
21
+ def version=(value)
22
+ @version = value
23
+ end
24
+
21
25
  def build
22
26
  if @build == nil then
23
27
  @build = Xcvm::Build.new(info['CFBundleVersion'].to_i)
24
28
  end
25
29
  return @build
26
30
  end
31
+
32
+ def build=(value)
33
+ @build = value
34
+ end
27
35
 
28
36
  def save
29
37
  info['CFBundleShortVersionString'] = version.to_s
@@ -1,3 +1,3 @@
1
1
  module Xcvm
2
- VERSION = "0.1.1"
2
+ VERSION = "1.0.0"
3
3
  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
+
5
+ require 'xcvm/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "xcvm"
9
+ spec.version = Xcvm::VERSION
10
+ spec.authors = ["jaderfeijo"]
11
+ spec.email = ["jader.feijo@gmail.com"]
12
+
13
+ spec.summary = "Xcode Project Version Manager"
14
+ spec.description = "A version manager for Xcode projects"
15
+ spec.homepage = "https://github.com/jaderfeijo/xcvm"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.executables = ["xcvm"]
19
+ spec.require_path = ["lib"]
20
+
21
+ spec.required_ruby_version = '~> 2.2'
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.11"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rspec", "~> 3.0"
26
+
27
+ spec.add_dependency "plist", "~> 3.2.0"
28
+ end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jaderfeijo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-14 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.11'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.11'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: plist
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 3.2.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 3.2.0
69
69
  description: A version manager for Xcode projects
@@ -74,32 +74,41 @@ executables:
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
+ - .gitignore
78
+ - .rspec
79
+ - .travis.yml
80
+ - Gemfile
81
+ - README.md
82
+ - Rakefile
83
+ - bin/console
84
+ - bin/setup
77
85
  - bin/xcvm
78
86
  - lib/xcvm.rb
79
87
  - lib/xcvm/build.rb
80
88
  - lib/xcvm/project.rb
81
89
  - lib/xcvm/semantic_version.rb
82
90
  - lib/xcvm/version.rb
91
+ - xcvm.gemspec
83
92
  homepage: https://github.com/jaderfeijo/xcvm
84
93
  licenses: []
85
94
  metadata: {}
86
95
  post_install_message:
87
96
  rdoc_options: []
88
97
  require_paths:
89
- - lib
98
+ - - lib
90
99
  required_ruby_version: !ruby/object:Gem::Requirement
91
100
  requirements:
92
- - - "~>"
101
+ - - ~>
93
102
  - !ruby/object:Gem::Version
94
103
  version: '2.2'
95
104
  required_rubygems_version: !ruby/object:Gem::Requirement
96
105
  requirements:
97
- - - ">="
106
+ - - '>='
98
107
  - !ruby/object:Gem::Version
99
108
  version: '0'
100
109
  requirements: []
101
110
  rubyforge_project:
102
- rubygems_version: 2.6.1
111
+ rubygems_version: 2.0.14.1
103
112
  signing_key:
104
113
  specification_version: 4
105
114
  summary: Xcode Project Version Manager