vpim 13.11.11 → 24.2.20

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
- SHA1:
3
- metadata.gz: 097fd14cb6df0e01acccdc8b8724ce42b3b0a6ff
4
- data.tar.gz: d6f031737c9c3c5fb4ba0676644f01c8db8966cb
2
+ SHA256:
3
+ metadata.gz: 2fb0cd0dc41928d4d5ed30930eae99edb6d10d8aa27e3a571995a6b96ced071c
4
+ data.tar.gz: ac1c8bd23664107fd69e2330e72ce23ff8e4591d2b73f5a7c0f6fb2a916b28b7
5
5
  SHA512:
6
- metadata.gz: cfb7b213e0094b6e9a3e2819b777325ff4e8454bebc8c981b8747e56119e311d58b10573b8bf4054c02a62982344eaa08b9b635d56833948e809fd776adc52b3
7
- data.tar.gz: 1ebc4da3ad5a487425ed74c76437371537d5df8e264953f3de0c4ae11cc8d344f5f881872f61c77770a0e3b469860660d77d34818a02aa2979c0afdca853ddc6
6
+ metadata.gz: deba874493893705140c3632a7f0b10f1406d7b0e5b4a0ac2bfa91c18a5adbd14e2843000027226f8b9144235ce7da20e7824ac254a8d3d3bf6f59ce405f7a42
7
+ data.tar.gz: d32542d5cc434c5ec6329d1698c58365e46656f449c38e6b2e27b2d3ee509fd5d61a27c5543ce6726fca40399f65d892f7a9178ddafedb778bf960c6d0b5eadf
data/bin/reminder CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  $-w = true
4
4
 
5
- require 'ubygems' rescue "ignored"
5
+ require 'rubygems' rescue "ignored"
6
6
 
7
7
  require 'getoptlong'
8
8
  require 'pp'
@@ -7,7 +7,7 @@
7
7
  details.
8
8
  =end
9
9
 
10
- require "enumerator"
10
+ require "vpim/enumerator"
11
11
 
12
12
  module Vpim
13
13
  # This is a way for an object to have multiple ways of being enumerated via
@@ -7,7 +7,7 @@
7
7
  details.
8
8
  =end
9
9
 
10
- require "enumerator"
10
+ require "vpim/enumerator"
11
11
 
12
12
  require 'vpim/rfc2425'
13
13
  require 'vpim/dirinfo'
@@ -101,7 +101,14 @@ module Vpim
101
101
  push Vevent::Maker.make( &block )
102
102
  end
103
103
 
104
- # TODO add_todo, add_journal
104
+ # TODO add_journal
105
+
106
+ # Add a task/todo to this calendar.
107
+ #
108
+ # Yields a todo maker, Icalendar::Vtodo::Maker.
109
+ def add_todo(&block) #:yield:todo
110
+ push Vtodo::Maker.make( &block )
111
+ end
105
112
 
106
113
  =begin
107
114
  TODO
@@ -7,7 +7,7 @@
7
7
  details.
8
8
  =end
9
9
 
10
- require "enumerator"
10
+ require "vpim/enumerator"
11
11
 
12
12
  module Vpim
13
13
  class Icalendar
data/lib/vpim/repo.rb CHANGED
@@ -7,7 +7,7 @@
7
7
  details.
8
8
  =end
9
9
 
10
- require 'enumerator'
10
+ require 'vpim/enumerator'
11
11
  require "net/http"
12
12
 
13
13
  require 'plist'
data/lib/vpim/vcard.rb CHANGED
@@ -153,7 +153,7 @@ module Vpim
153
153
  def Address.decode(card, field) #:nodoc:
154
154
  adr = new
155
155
 
156
- parts = Vpim.decode_text_list(field.value_raw, ';')
156
+ parts = Vpim.decode_text_list(field.value, ';')
157
157
 
158
158
  @@adr_parts.each_with_index do |part,i|
159
159
  adr.instance_variable_set(part, parts[i] || '')
data/lib/vpim/version.rb CHANGED
@@ -7,9 +7,9 @@
7
7
  =end
8
8
 
9
9
  module Vpim
10
- PRODID = '-//Octet Cloud//vPim 13.11.11//EN'
10
+ PRODID = '-//Octet Cloud//vPim 24.2.20//EN'
11
11
 
12
- VERSION = '13.11.11'
12
+ VERSION = '24.2.20'
13
13
 
14
14
  # Return the API version as a string.
15
15
  def Vpim.version
data/lib/vpim/vevent.rb CHANGED
@@ -164,7 +164,7 @@ module Vpim
164
164
  set_date_or_datetime 'DTEND', 'DATE-TIME', dtend
165
165
  end
166
166
 
167
- # Add a RRULE to this event. The rule can be provided as a pre-build
167
+ # Add a RRULE to this event. The rule can be provided as a pre-built
168
168
  # RRULE value, or the RRULE maker can be used.
169
169
  def add_rrule(rule = nil, &block) #:yield: Rrule::Maker
170
170
  # TODO - should be in Property::Reccurrence::Set
data/lib/vpim/view.rb CHANGED
@@ -7,7 +7,7 @@
7
7
  details.
8
8
  =end
9
9
 
10
- require "enumerator"
10
+ require "vpim/enumerator"
11
11
 
12
12
  module Vpim
13
13
  module View
data/lib/vpim/vtodo.rb CHANGED
@@ -97,6 +97,52 @@ module Vpim
97
97
  propinteger 'PERCENT-COMPLETE'
98
98
  end
99
99
 
100
+ # Make a new Vtodo, or make changes to an existing Vtodo.
101
+ class Maker
102
+ include Vpim::Icalendar::Set::Util #:nodoc:
103
+ include Vpim::Icalendar::Set::Common
104
+ include Vpim::Icalendar::Set::Location
105
+
106
+ # The todo that changes are being made to.
107
+ attr_reader :todo
108
+
109
+ def initialize(todo) #:nodoc:
110
+ @todo = todo
111
+ @comp = todo
112
+ end
113
+
114
+ # Make changes to +todo+. If +todo+ is not specified, creates a new
115
+ # todo. Yields a Vtodo::Maker, and returns +todo+.
116
+ def self.make(todo = Vpim::Icalendar::Vtodo.create) #:yield:maker
117
+ m = self.new(todo)
118
+ yield m
119
+ m.todo
120
+ end
121
+
122
+ # Set transparency to "OPAQUE" or "TRANSPARENT", see Vpim::Vtodo#transparency.
123
+ def transparency(token)
124
+ set_token 'TRANSP', ["OPAQUE", "TRANSPARENT"], "OPAQUE", token
125
+ end
126
+
127
+ # Add a RRULE to this todo. The rule can be provided as a pre-built
128
+ # RRULE value, or the RRULE maker can be used.
129
+ def add_rrule(rule = nil, &block) #:yield: Rrule::Maker
130
+ # TODO - should be in Property::Reccurrence::Set
131
+ unless rule
132
+ rule = Rrule::Maker.new(&block).encode
133
+ end
134
+ @comp.properties.push(Vpim::DirectoryInfo::Field.create("RRULE", rule))
135
+ self
136
+ end
137
+
138
+ # Set the RRULE for this todo. See #add_rrule
139
+ def set_rrule(rule = nil, &block) #:yield: Rrule::Maker
140
+ rm_all("RRULE")
141
+ add_rrule(rule, &block)
142
+ end
143
+
144
+ end
145
+
100
146
  end
101
147
 
102
148
  end
data/samples/reminder.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  $-w = true
4
4
 
5
- require 'ubygems' rescue "ignored"
5
+ require 'rubygems' rescue "ignored"
6
6
 
7
7
  require 'getoptlong'
8
8
  require 'pp'
data/test/test_ical.rb CHANGED
@@ -443,5 +443,16 @@ __
443
443
  assert_match(/RRULE:FREQ=DAILY/, vc.to_s)
444
444
  end
445
445
 
446
+ def test_todo_maker_w_rrule
447
+ vc = Icalendar.create2 do |vc|
448
+ vc.add_todo do |m|
449
+ m.add_rrule("freq=monthly")
450
+ m.set_rrule do |_| _.frequency = "daily" end
451
+ end
452
+ end
453
+ assert_no_match(/RRULE:FREQ=MONTHLY/, vc.to_s)
454
+ assert_match(/RRULE:FREQ=DAILY/, vc.to_s)
455
+ end
456
+
446
457
  end
447
458
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vpim
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.11.11
4
+ version: 24.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-11 00:00:00.000000000 Z
11
+ date: 2024-02-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  This is a pure-ruby library for decoding and encoding vCard and iCalendar data
@@ -24,6 +24,12 @@ extra_rdoc_files:
24
24
  - COPYING
25
25
  - samples/README.mutt
26
26
  files:
27
+ - CHANGES
28
+ - COPYING
29
+ - README.rdoc
30
+ - bin/reminder
31
+ - bin/rrule
32
+ - lib/vpim.rb
27
33
  - lib/vpim/address.rb
28
34
  - lib/vpim/agent/atomize.rb
29
35
  - lib/vpim/agent/base.rb
@@ -55,9 +61,6 @@ files:
55
61
  - lib/vpim/vjournal.rb
56
62
  - lib/vpim/vpim.rb
57
63
  - lib/vpim/vtodo.rb
58
- - lib/vpim.rb
59
- - bin/reminder
60
- - bin/rrule
61
64
  - samples/README.mutt
62
65
  - samples/ab-query.rb
63
66
  - samples/agent.ru
@@ -87,9 +90,6 @@ files:
87
90
  - test/test_repo.rb
88
91
  - test/test_rrule.rb
89
92
  - test/test_vcard.rb
90
- - COPYING
91
- - README.rdoc
92
- - CHANGES
93
93
  homepage: http://vpim.rubyforge.org
94
94
  licenses: []
95
95
  metadata: {}
@@ -99,27 +99,26 @@ require_paths:
99
99
  - lib
100
100
  required_ruby_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - '>='
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - '>='
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubyforge_project: vpim
112
- rubygems_version: 2.0.3
111
+ rubygems_version: 3.0.3
113
112
  signing_key:
114
113
  specification_version: 4
115
114
  summary: iCalendar and vCard support for ruby
116
115
  test_files:
117
- - test/test_all.rb
118
116
  - test/test_date.rb
119
117
  - test/test_dur.rb
120
118
  - test/test_field.rb
121
- - test/test_ical.rb
122
- - test/test_misc.rb
123
119
  - test/test_repo.rb
124
- - test/test_rrule.rb
125
120
  - test/test_vcard.rb
121
+ - test/test_misc.rb
122
+ - test/test_all.rb
123
+ - test/test_ical.rb
124
+ - test/test_rrule.rb