simctl 1.4.0 → 1.4.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: 720fbd09efb48085401d8eabd6ee2a089117c94e
4
- data.tar.gz: 1d9c650feb22866a4759b498a782820483682641
3
+ metadata.gz: 3bdc998a600a6d6fd3061c51c856e1ae06b14ca8
4
+ data.tar.gz: 8547d49764806e85eaabd8fb005d1006967a0b52
5
5
  SHA512:
6
- metadata.gz: 40a6b4665e6d1a5877c0a0e6b583e05137c278c116c5ddacfbbb50e827b51d1307495de34812ee87b27b1089d9583e3e3c9cc5bf922681b334b4147327f70502
7
- data.tar.gz: 3a59cd1b61cb17b5698b7deb920ca7fdd7d3d80cfa58695eda4c9eb2bfb3890303211d0dfc17fa058198e0c0d9aa17bb144643759f36fdf759f6c9d9ad41ac52
6
+ metadata.gz: 7ae1446d24e47f8e76ff7bc0d7cbf333649c78353ca87a5413331246226f18adf4d569611f3478e8bd1481d8748f3db7ec5a38a0e009da27e03e357aa73725e8
7
+ data.tar.gz: 3f3a2c148cf03e84d00642745346b8a23239fc1c60a07af6087f42c87244b2ecdab93e902b3885ec98f6932b87dea8069da8d28fc96485cc247738dfcc351c64
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simctl (1.4.0)
4
+ simctl (1.4.1)
5
5
  CFPropertyList
6
6
 
7
7
  GEM
@@ -1,27 +1,16 @@
1
1
  require 'simctl/command'
2
2
  require 'simctl/device'
3
3
  require 'simctl/device_type'
4
- require 'simctl/helper'
5
4
  require 'simctl/list'
6
5
  require 'simctl/runtime'
7
6
 
8
7
  module SimCtl
9
8
  class << self
10
- include Helper
11
-
12
9
  def command
13
10
  return @command if defined?(@command)
14
11
  @command = SimCtl::Command.new
15
12
  end
16
13
 
17
- # Edit `Library/Preferences/com.apple.iphonesimulator.plist`
18
- #
19
- # @return [void]
20
- # @yield [Hash] The hash of the preferences plist. Modifications will be written to the file.
21
- def edit_iphonesimulator_plist(&block)
22
- edit_plist(File.join(ENV['HOME'], 'Library/Preferences/com.apple.iphonesimulator.plist'), &block)
23
- end
24
-
25
14
  private
26
15
 
27
16
  def respond_to_missing?(method_name, include_private=false)
@@ -1,9 +1,7 @@
1
- require 'simctl/helper'
1
+ require 'cfpropertylist'
2
2
 
3
3
  module SimCtl
4
4
  class DeviceSettings
5
- include SimCtl::Helper
6
-
7
5
  attr_reader :path
8
6
 
9
7
  def initialize(path)
@@ -31,6 +29,14 @@ module SimCtl
31
29
  end
32
30
  end
33
31
 
32
+ def edit_plist(path, &block)
33
+ plist = File.exists?(path) ? CFPropertyList::List.new(file: path) : CFPropertyList::List.new
34
+ content = CFPropertyList.native_types(plist.value) || {}
35
+ yield content
36
+ plist.value = CFPropertyList.guess(content)
37
+ plist.save(path, CFPropertyList::List::FORMAT_BINARY)
38
+ end
39
+
34
40
  # Sets the device language
35
41
  #
36
42
  # @return [void]
@@ -1,3 +1,3 @@
1
1
  module SimCtl
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Plunien
@@ -112,7 +112,6 @@ files:
112
112
  - lib/simctl/device_settings.rb
113
113
  - lib/simctl/device_type.rb
114
114
  - lib/simctl/executor.rb
115
- - lib/simctl/helper.rb
116
115
  - lib/simctl/list.rb
117
116
  - lib/simctl/object.rb
118
117
  - lib/simctl/runtime.rb
@@ -1,18 +0,0 @@
1
- require 'cfpropertylist'
2
-
3
- module SimCtl
4
- module Helper
5
- # Edit some plist
6
- #
7
- # @param [String] Path to the plist
8
- # @return [void]
9
- # @yield [Hash] The hash of the plist. Modifications will be written to the file.
10
- def edit_plist(path, &block)
11
- plist = File.exists?(path) ? CFPropertyList::List.new(file: path) : CFPropertyList::List.new
12
- content = CFPropertyList.native_types(plist.value) || {}
13
- yield content
14
- plist.value = CFPropertyList.guess(content)
15
- plist.save(path, CFPropertyList::List::FORMAT_BINARY)
16
- end
17
- end
18
- end