israkel 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/israkel.gemspec +1 -1
  3. data/lib/israkel/tasks.rb +8 -28
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
data/israkel.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "israkel"
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Johannes Plunien"]
data/lib/israkel/tasks.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'fileutils'
2
- require 'highline/import'
3
2
  require 'json'
4
3
  require 'rake'
5
4
  require 'rake/tasklib'
@@ -8,10 +7,11 @@ module ISRakel
8
7
  class Tasks < ::Rake::TaskLib
9
8
  include ::Rake::DSL if defined?(::Rake::DSL)
10
9
 
11
- attr_accessor :name
10
+ attr_accessor :name, :sdk_version
12
11
 
13
12
  def initialize(name = :simulator)
14
13
  @name = name
14
+ @sdk_version = ENV['IOS_SDK_VERSION'] || '6.0'
15
15
 
16
16
  yield self if block_given?
17
17
 
@@ -25,15 +25,11 @@ module ISRakel
25
25
  end
26
26
 
27
27
  def edit_global_preferences(&block)
28
- sdk_version_choice do |version|
29
- edit_file( File.join(simulator_preferences_path(version), '.GlobalPreferences.plist'), &block )
30
- end
28
+ edit_file( File.join(simulator_preferences_path, '.GlobalPreferences.plist'), &block )
31
29
  end
32
30
 
33
31
  def edit_preferences(&block)
34
- sdk_version_choice do |version|
35
- edit_file( File.join(simulator_preferences_path(version), 'com.apple.Preferences.plist'), &block )
36
- end
32
+ edit_file( File.join(simulator_preferences_path, 'com.apple.Preferences.plist'), &block )
37
33
  end
38
34
 
39
35
  private
@@ -47,9 +43,7 @@ module ISRakel
47
43
  def define_reset_task
48
44
  desc "Reset content and settings of the iPhone Simulator"
49
45
  task "#{name}:reset" do
50
- sdk_version_choice do |version|
51
- rm_rf File.join(simulator_support_path(version), '*')
52
- end
46
+ rm_rf simulator_support_path
53
47
  end
54
48
  end
55
49
 
@@ -93,29 +87,15 @@ module ISRakel
93
87
  JSON.parse( IO.popen(['plutil', '-convert', 'json', '-o', '-', path]) {|f| f.read} )
94
88
  end
95
89
 
96
- def sdk_version_choice
97
- if ENV['IOS_SDK_VERSION']
98
- yield ENV['IOS_SDK_VERSION']
99
- return
100
- end
101
- versions = Dir[File.join(ENV['HOME'], 'Library', 'Application Support', 'iPhone Simulator', '*')].map {|dir| File.basename(dir)}
102
- choose do |menu|
103
- menu.prompt = "Please select an SDK version"
104
- menu.choices(*versions) do |version|
105
- yield version
106
- end
107
- end
108
- end
109
-
110
90
  def simulator_path
111
91
  @simulator_path ||= File.join(xcode_path, 'Platforms', 'iPhoneSimulator.platform', 'Developer', 'Applications', 'iPhone Simulator.app')
112
92
  end
113
93
 
114
- def simulator_preferences_path(sdk_version)
115
- File.join(simulator_support_path(sdk_version), 'Library', 'Preferences')
94
+ def simulator_preferences_path
95
+ File.join(simulator_support_path, 'Library', 'Preferences')
116
96
  end
117
97
 
118
- def simulator_support_path(sdk_version)
98
+ def simulator_support_path
119
99
  @simulator_support_path ||= File.join(ENV['HOME'], 'Library', 'Application Support', 'iPhone Simulator', sdk_version)
120
100
  end
121
101
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: israkel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -106,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  segments:
108
108
  - 0
109
- hash: -3467155980208582955
109
+ hash: -3949644857566582738
110
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  none: false
112
112
  requirements: