PackingPeanut 1.1.0 → 1.2.0

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: 12ff5130d11697ea17d75fb51296fc420846c8b7
4
- data.tar.gz: 87951bc7c2fb7f9182531bba0594ecaff8173ad1
3
+ metadata.gz: c94e10d22d54e95b23ebddea1a122ae414a44ecd
4
+ data.tar.gz: 17489485784da059bbb569b9139475cfbef1d57c
5
5
  SHA512:
6
- metadata.gz: 94326ee0e5896786cfeb0b73b9ab7426b47ee73a36391d1c435e543db1fb289b13e1787c4a17a743dec1f5368d55e5b3a83b2a5b8a451c1cea0f831a240b5cd2
7
- data.tar.gz: 7e8fdc3f22364045d489abedcbfea00a5d0a13c38000a10260d3db441da6382bed2097e071607bfc300e2e881b3de86c8a6e2e8ac88f9965980737d2f0d1181c
6
+ metadata.gz: 408339bba5c5d229c136a61c72d151c47a2e2bb65584a5c83cd15383cd7fbc498940407ccf893a8a3e721edaa1e474af5913adc67b6c43fea12e5c9cc922f266
7
+ data.tar.gz: 3600ca83f68146068230a70d1d71394921e752ec490af3fcebd590a2efa72222bdda3fc97878931a91238a9e25e864cc49ead18791098103229c8f8801c28582
@@ -81,6 +81,21 @@ module PackingPeanut
81
81
  merged_hashes
82
82
  end
83
83
 
84
+ def delete(key)
85
+ settings = get_settings
86
+ string_key = key.to_s
87
+ editor = settings.edit
88
+ editor.remove(string_key)
89
+ editor.commit
90
+ end
91
+
92
+ def delete_all!
93
+ settings = get_settings
94
+ editor = settings.edit
95
+ editor.clear()
96
+ editor.commit
97
+ end
98
+
84
99
  def get_settings
85
100
  raise "[PackingPeanut] Fatal Error - You must set the context before accessing persistent data." unless @context
86
101
  current_context.getSharedPreferences(storage_file, preference_mode)
@@ -43,6 +43,13 @@ module PackingPeanut
43
43
  value
44
44
  end
45
45
 
46
+ def delete_all!
47
+ all.keys.each do |k|
48
+ storage.removeObjectForKey(storage_key(k))
49
+ end
50
+ storage.synchronize
51
+ end
52
+
46
53
  def storage
47
54
  NSUserDefaults.standardUserDefaults
48
55
  end
@@ -5,7 +5,7 @@ end
5
5
 
6
6
  # WHAT ARE WE?
7
7
  platform = Motion::Project::App.respond_to?(:template) ? Motion::Project::App.template : :ios
8
- if platform.to_s.start_with?('ios')
8
+ if platform.to_s.start_with?('ios') or platform.to_s.start_with?('osx')
9
9
  platform_name = 'ios'
10
10
  elsif platform.to_s.start_with?('android')
11
11
  platform_name = 'android'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: PackingPeanut
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gant
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-26 00:00:00.000000000 Z
11
+ date: 2015-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake