syncevolution 0.1.8 → 0.1.9

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: 79b4afacb612c7737cc91d323f7c8a1ad40dc16c
4
- data.tar.gz: 84125ee52b494adc6d520a8cc67bb90c8a384d0f
3
+ metadata.gz: 2a644fc5aa9036edcd885cbc2d04bb94f36f4a95
4
+ data.tar.gz: 0f32e59ac356e24f48e8175b262656a1a6992718
5
5
  SHA512:
6
- metadata.gz: b81f61a727fd69d7e829a82656cf60bfe0d956c73dcad10eb559384be147a1204c72b4f63b682d63ab845220ce75a40591d63eab3fe1fd8e4df61e3c1796fe78
7
- data.tar.gz: 097a68e137a1404ae0246d977b0b3ba52141149c851fef191dc12961351fc72ce875395b04c195333f9c01d2b90728997aa5bf4928ff55d7551b1b1fa534d3b5
6
+ metadata.gz: acd86598cdb20a5087a62ec017978d192f71bb5b64097dd8b54487c5a84d74ff0088ffff677a3791bf1289d48f411925cd09ae3a521fb5628bc4ca3f71167a97
7
+ data.tar.gz: 961e755678f7112d6bee2c98da05a60aa2b9ffb221c5e86d80ad77b20ed64697736ce902ea3ef7654d5a80f594042d9a52090b8cbc65b08ff73d50c3896b7df5
data/bin/se-config CHANGED
@@ -261,21 +261,29 @@ module SyncEvolution
261
261
  }
262
262
  end
263
263
 
264
+ def clear
265
+ @doc.xpath('//context').each{|context|
266
+ context.add_next_sibling("<context name=#{context['name'].inspect}><clear/></context>")
267
+ context.unlink
268
+ }
269
+ end
270
+
264
271
  def to_xml
265
272
  return @doc.to_xml
266
273
  end
267
274
 
268
275
  def backend_type(store)
269
- case store['backend']
276
+ case store['backend'].downcase
270
277
  when 'file'
271
278
  case store['databaseFormat']
272
279
  when 'text/vcard' then return :contacts
273
280
  when 'text/calendar' then return :events
274
281
  end
275
- when 'eas-events', 'ActiveSync Events' then return :events
276
- when 'eas-contacts', 'ActiveSync Address Book' then return :contacts
282
+ when 'caldav', 'eas-events', 'ActiveSync Events' then return :events
283
+ when 'carddav', 'eas-contacts', 'ActiveSync Address Book' then return :contacts
284
+ when 'addressbook' then return :contacts # TODO: what the hell is this?!
277
285
  end
278
- throw "Cannot determine backend type from #{store.inspect}"
286
+ throw "Cannot determine backend type from #{store['backend'].downcase.inspect} for #{id(store)} (#{store.inspect})"
279
287
  end
280
288
 
281
289
  def verify
@@ -333,14 +341,16 @@ OPTS = Trollop::options do
333
341
  opt :xml, "Output xml"
334
342
  opt :import, "Output xml", :type => :string
335
343
  opt :shell, "Output shell code"
344
+ opt :clear, "Clear entire config"
336
345
  opt :graphviz, "Output graphviz code"
337
346
  opt :indent, "Indent shell code"
338
347
  opt :verify, "Verify configuration"
339
348
  end
340
349
 
341
350
  SE = SyncEvolution::SyncEvolution.new('~')
342
- SE.verify
351
+ SE.clear if OPTS[:clear]
343
352
  SE.import(OPTS[:import]) if OPTS[:import]
353
+ SE.verify
344
354
  puts SE.to_xml if OPTS[:xml]
345
355
  puts SE.to_shell(OPTS[:indent]) if OPTS[:shell]
346
356
  puts SE.to_gv if OPTS[:graphviz]
@@ -1,3 +1,3 @@
1
1
  module SyncEvolution
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
data/tt ADDED
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0"?>
2
+ <syncevolution>
3
+ <context name="local">
4
+ <clear/>
5
+ </context>
6
+ <context name="google">
7
+ <clear/>
8
+ </context>
9
+ <context name="exchange">
10
+ <clear/>
11
+ </context>
12
+ </syncevolution>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syncevolution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emiliano Heyns
@@ -98,6 +98,7 @@ files:
98
98
  - publish.sh
99
99
  - syncevolution.gemspec
100
100
  - test/syncevolution.rb
101
+ - tt
101
102
  homepage: ''
102
103
  licenses:
103
104
  - MIT