xcode-install 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc28280820fe62413795965ee4b361d46b7aaff7
4
- data.tar.gz: df8eab78dbaf502ac3006c2dc8d070a0562e4c70
3
+ metadata.gz: aab5d0135dc575609e7e51a5b80a6cda4e1961d8
4
+ data.tar.gz: 0c1a7f167a64e666de00a9470a11e842a39a5dcd
5
5
  SHA512:
6
- metadata.gz: f7aa0c1185455dc2edf0f2e63fd4b49262202e36a2941c74d8cc16eaf7b237ffddac48cbffd2331338efc310d558038ea0fb5c49ecfe22abd06d3998f45004cd
7
- data.tar.gz: 299a9e10235efe65b101330cbfae0f8c1016c89d9c2d7fdf6fba67812acf5e8be498517e1c960ba52b5953f6a2d6ddb198782e2454ec642c4b458653462714e2
6
+ metadata.gz: 25bd0f8b900bb58257a8403a0b47b3fb241133ab42db2ce86989339b6f6e009313cf428ecf1caf6cdf303a530a745f077fc09c696b3006617b225b760a8d51e6
7
+ data.tar.gz: e2bfb4e367ca6f194a4a6df05d738fca23a4f758aa1f5c11ad1e3728100469f056d05532abe29637fcfd0e3c5e3226aa2610808358717397af0a3f65b0b3c257
data/.rubocop.yml ADDED
@@ -0,0 +1,20 @@
1
+ Metrics/AbcSize:
2
+ Max: 18
3
+
4
+ Metrics/ClassLength:
5
+ Max: 130
6
+
7
+ Metrics/CyclomaticComplexity:
8
+ Max: 7
9
+
10
+ Metrics/LineLength:
11
+ Max: 215
12
+
13
+ Metrics/MethodLength:
14
+ Max: 20
15
+
16
+ Style/Documentation:
17
+ Enabled: false
18
+
19
+ Lint/Void:
20
+ Enabled: false
data/Gemfile CHANGED
@@ -6,6 +6,6 @@ group :development do
6
6
  gem 'bacon'
7
7
  gem 'mocha-on-bacon'
8
8
  gem 'mocha', '~> 0.11.4'
9
- gem 'prettybacon', :git => 'https://github.com/irrationalfab/PrettyBacon.git', :branch => 'master'
10
- gem 'coveralls', :require => false
9
+ gem 'prettybacon', git: 'https://github.com/irrationalfab/PrettyBacon.git', branch: 'master'
10
+ gem 'coveralls', require: false
11
11
  end
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
2
 
3
3
  def specs(dir)
4
4
  FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
@@ -9,4 +9,4 @@ task :spec do
9
9
  sh "bundle exec bacon #{specs('**')}"
10
10
  end
11
11
 
12
- task :default => :specs
12
+ task default: :specs
data/bin/xcode-install CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  if $PROGRAM_NAME == __FILE__
4
- ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
5
- require 'rubygems'
6
- require 'bundler/setup'
7
- $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
4
+ ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
5
+ require 'rubygems'
6
+ require 'bundler/setup'
7
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
8
8
  end
9
9
 
10
10
  require 'xcode/install'
11
11
 
12
- XcodeInstall::Command.run(ARGV)
12
+ XcodeInstall::Command.run(ARGV)
@@ -1,14 +1,14 @@
1
1
  module XcodeInstall
2
- class Command
3
- class Cleanup < Command
4
- self.command = 'cleanup'
5
- self.summary = 'Cleanup cached downloads.'
2
+ class Command
3
+ class Cleanup < Command
4
+ self.command = 'cleanup'
5
+ self.summary = 'Cleanup cached downloads.'
6
6
 
7
- def run
8
- installer = XcodeInstall::Installer.new
9
- return if installer.cache_dir.nil? || installer.cache_dir.to_s.length < 5
10
- FileUtils.rm_f(Dir.glob("#{installer.cache_dir}/*"))
11
- end
12
- end
13
- end
7
+ def run
8
+ installer = XcodeInstall::Installer.new
9
+ return if installer.cache_dir.nil? || installer.cache_dir.to_s.length < 5
10
+ FileUtils.rm_f(Dir.glob("#{installer.cache_dir}/*"))
11
+ end
12
+ end
13
+ end
14
14
  end
@@ -1,28 +1,28 @@
1
1
  require 'claide'
2
- require "xcode/install/version"
2
+ require 'xcode/install/version'
3
3
 
4
4
  module XcodeInstall
5
- class PlainInformative < StandardError
6
- include CLAide::InformativeError
7
- end
5
+ class PlainInformative < StandardError
6
+ include CLAide::InformativeError
7
+ end
8
8
 
9
- class Informative < PlainInformative
10
- def message
11
- "[!] #{super}".red
12
- end
13
- end
9
+ class Informative < PlainInformative
10
+ def message
11
+ "[!] #{super}".red
12
+ end
13
+ end
14
14
 
15
- class Command < CLAide::Command
16
- require "xcode/install/cleanup"
17
- require "xcode/install/install"
18
- require "xcode/install/installed"
19
- require "xcode/install/list"
20
- require "xcode/install/uninstall"
21
- require "xcode/install/update"
15
+ class Command < CLAide::Command
16
+ require 'xcode/install/cleanup'
17
+ require 'xcode/install/install'
18
+ require 'xcode/install/installed'
19
+ require 'xcode/install/list'
20
+ require 'xcode/install/uninstall'
21
+ require 'xcode/install/update'
22
22
 
23
- self.abstract_command = true
24
- self.command = 'xcode-install'
25
- self.version = VERSION
26
- self.description = 'Xcode installation manager.'
27
- end
28
- end
23
+ self.abstract_command = true
24
+ self.command = 'xcode-install'
25
+ self.version = VERSION
26
+ self.description = 'Xcode installation manager.'
27
+ end
28
+ end
@@ -1,36 +1,36 @@
1
1
  module XcodeInstall
2
- class Command
3
- class Install < Command
4
- self.command = 'install'
5
- self.summary = 'Install a specific version of Xcode.'
2
+ class Command
3
+ class Install < Command
4
+ self.command = 'install'
5
+ self.summary = 'Install a specific version of Xcode.'
6
6
 
7
- self.arguments = [
8
- CLAide::Argument.new('VERSION', :true),
9
- ]
7
+ self.arguments = [
8
+ CLAide::Argument.new('VERSION', :true)
9
+ ]
10
10
 
11
- def self.options
12
- [['--no-switch', 'Don’t switch to this version after installation'],
13
- ['--no-clean', 'Don’t delete DMG after installation.']].concat(super)
14
- end
11
+ def self.options
12
+ [['--no-switch', 'Don’t switch to this version after installation'],
13
+ ['--no-clean', 'Don’t delete DMG after installation.']].concat(super)
14
+ end
15
15
 
16
- def initialize(argv)
17
- @installer = Installer.new
18
- @version = argv.shift_argument
19
- @should_clean = argv.flag?('clean', true)
20
- @should_switch = argv.flag?('switch', true)
21
- super
22
- end
16
+ def initialize(argv)
17
+ @installer = Installer.new
18
+ @version = argv.shift_argument
19
+ @should_clean = argv.flag?('clean', true)
20
+ @should_switch = argv.flag?('switch', true)
21
+ super
22
+ end
23
23
 
24
- def validate!
25
- return if @version.nil?
26
- raise Informative, "Version #{@version} already installed." if @installer.installed?(@version)
27
- raise Informative, "Version #{@version} doesn't exist." unless @installer.exist?(@version)
28
- end
24
+ def validate!
25
+ return if @version.nil?
26
+ fail Informative, "Version #{@version} already installed." if @installer.installed?(@version)
27
+ fail Informative, "Version #{@version} doesn't exist." unless @installer.exist?(@version)
28
+ end
29
29
 
30
- def run
31
- return if @version.nil?
32
- @installer.install_version(@version, @should_switch, @should_clean)
33
- end
34
- end
35
- end
30
+ def run
31
+ return if @version.nil?
32
+ @installer.install_version(@version, @should_switch, @should_clean)
33
+ end
34
+ end
35
+ end
36
36
  end
@@ -1,15 +1,15 @@
1
1
  module XcodeInstall
2
- class Command
3
- class Installed < Command
4
- self.command = 'installed'
5
- self.summary = 'List installed Xcodes.'
2
+ class Command
3
+ class Installed < Command
4
+ self.command = 'installed'
5
+ self.summary = 'List installed Xcodes.'
6
6
 
7
- def run
8
- installer = XcodeInstall::Installer.new
9
- installer.installed_versions.each do |xcode|
10
- puts "#{xcode.version}\t(#{xcode.path})"
11
- end
12
- end
13
- end
14
- end
7
+ def run
8
+ installer = XcodeInstall::Installer.new
9
+ installer.installed_versions.each do |xcode|
10
+ puts "#{xcode.version}\t(#{xcode.path})"
11
+ end
12
+ end
13
+ end
14
+ end
15
15
  end
@@ -1,27 +1,27 @@
1
1
  module XcodeInstall
2
- class Command
3
- class List < Command
4
- self.command = 'list'
5
- self.summary = 'List Xcodes available for download.'
2
+ class Command
3
+ class List < Command
4
+ self.command = 'list'
5
+ self.summary = 'List Xcodes available for download.'
6
6
 
7
- def self.options
8
- [['--all', 'Show all available versions.']].concat(super)
9
- end
7
+ def self.options
8
+ [['--all', 'Show all available versions.']].concat(super)
9
+ end
10
10
 
11
- def initialize(argv)
12
- @all = argv.flag?('all', false)
13
- super
14
- end
11
+ def initialize(argv)
12
+ @all = argv.flag?('all', false)
13
+ super
14
+ end
15
15
 
16
- def run
17
- installer = XcodeInstall::Installer.new
18
-
19
- if @all
20
- puts installer.list
21
- else
22
- puts installer.list_current
23
- end
24
- end
25
- end
26
- end
16
+ def run
17
+ installer = XcodeInstall::Installer.new
18
+
19
+ if @all
20
+ puts installer.list
21
+ else
22
+ puts installer.list_current
23
+ end
24
+ end
25
+ end
26
+ end
27
27
  end
@@ -1,33 +1,33 @@
1
1
  module XcodeInstall
2
- class Command
3
- class Uninstall < Command
4
- self.command = 'uninstall'
5
- self.summary = 'Uninstall a specific version of Xcode.'
2
+ class Command
3
+ class Uninstall < Command
4
+ self.command = 'uninstall'
5
+ self.summary = 'Uninstall a specific version of Xcode.'
6
6
 
7
- self.arguments = [
8
- CLAide::Argument.new('VERSION', :true),
9
- ]
7
+ self.arguments = [
8
+ CLAide::Argument.new('VERSION', :true)
9
+ ]
10
10
 
11
- def initialize(argv)
12
- @installer = Installer.new
13
- @version = argv.shift_argument
14
- end
11
+ def initialize(argv)
12
+ @installer = Installer.new
13
+ @version = argv.shift_argument
14
+ end
15
15
 
16
- def validate!
17
- raise Informative, "Version #{@version} is not installed." unless @installer.installed?(@version)
18
- end
16
+ def validate!
17
+ fail Informative, "Version #{@version} is not installed." unless @installer.installed?(@version)
18
+ end
19
19
 
20
- def run
21
- installed_path = @installer.installed_versions.select { |x| x.version == @version }.first
22
- return if installed_path.nil? || installed_path.path.nil?
20
+ def run
21
+ installed_path = @installer.installed_versions.find { |x| x.version == @version }
22
+ return if installed_path.nil? || installed_path.path.nil?
23
23
 
24
- `sudo rm -rf #{installed_path.path}`
24
+ `sudo rm -rf #{installed_path.path}`
25
25
 
26
- if @installer.symlinks_to == '/Applications/Xcode-6.3.app' #installed_path.path
27
- newest_version = @installer.installed_versions.last
28
- @installer.symlink(newest_version)
29
- end
30
- end
31
- end
32
- end
33
- end
26
+ if @installer.symlinks_to == installed_path.path
27
+ newest_version = @installer.installed_versions.last
28
+ @installer.symlink(newest_version)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,14 +1,14 @@
1
1
  module XcodeInstall
2
- class Command
3
- class Update < Command
4
- self.command = 'update'
5
- self.summary = 'Update cached list of available Xcodes.'
2
+ class Command
3
+ class Update < Command
4
+ self.command = 'update'
5
+ self.summary = 'Update cached list of available Xcodes.'
6
6
 
7
- def run
8
- installer = XcodeInstall::Installer.new
9
- installer.rm_list_cache
10
- installer.list
11
- end
12
- end
13
- end
7
+ def run
8
+ installer = XcodeInstall::Installer.new
9
+ installer.rm_list_cache
10
+ installer.list
11
+ end
12
+ end
13
+ end
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module XcodeInstall
2
- VERSION = "0.3.0"
2
+ VERSION = '0.3.1'
3
3
  end