vobject 0.1.0 → 1.0.2

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.
Files changed (46) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/macos.yml +38 -0
  3. data/.github/workflows/ubuntu.yml +56 -0
  4. data/.github/workflows/windows.yml +40 -0
  5. data/.hound.yml +3 -0
  6. data/.rubocop.tb.yml +650 -0
  7. data/.rubocop.yml +1077 -0
  8. data/Gemfile +1 -1
  9. data/LICENSE.txt +21 -17
  10. data/README.adoc +151 -0
  11. data/Rakefile +1 -1
  12. data/lib/c.rb +173 -0
  13. data/lib/error.rb +19 -0
  14. data/lib/vcalendar.rb +77 -0
  15. data/lib/vcard.rb +67 -0
  16. data/lib/vobject.rb +13 -170
  17. data/lib/vobject/component.rb +87 -36
  18. data/lib/vobject/parameter.rb +116 -0
  19. data/lib/vobject/parametervalue.rb +26 -0
  20. data/lib/vobject/property.rb +134 -55
  21. data/lib/vobject/propertyvalue.rb +46 -0
  22. data/lib/vobject/vcalendar/component.rb +106 -0
  23. data/lib/vobject/vcalendar/grammar.rb +595 -0
  24. data/lib/vobject/vcalendar/paramcheck.rb +259 -0
  25. data/lib/vobject/vcalendar/propertyparent.rb +98 -0
  26. data/lib/vobject/vcalendar/propertyvalue.rb +606 -0
  27. data/lib/vobject/vcalendar/typegrammars.rb +605 -0
  28. data/lib/vobject/vcard/v3_0/component.rb +40 -0
  29. data/lib/vobject/vcard/v3_0/grammar.rb +175 -0
  30. data/lib/vobject/vcard/v3_0/paramcheck.rb +110 -0
  31. data/lib/vobject/vcard/v3_0/parameter.rb +17 -0
  32. data/lib/vobject/vcard/v3_0/property.rb +18 -0
  33. data/lib/vobject/vcard/v3_0/propertyvalue.rb +401 -0
  34. data/lib/vobject/vcard/v3_0/typegrammars.rb +425 -0
  35. data/lib/vobject/vcard/v4_0/component.rb +40 -0
  36. data/lib/vobject/vcard/v4_0/grammar.rb +224 -0
  37. data/lib/vobject/vcard/v4_0/paramcheck.rb +269 -0
  38. data/lib/vobject/vcard/v4_0/parameter.rb +18 -0
  39. data/lib/vobject/vcard/v4_0/property.rb +63 -0
  40. data/lib/vobject/vcard/v4_0/propertyvalue.rb +404 -0
  41. data/lib/vobject/vcard/v4_0/typegrammars.rb +539 -0
  42. data/lib/vobject/version.rb +1 -1
  43. data/vobject.gemspec +19 -16
  44. metadata +81 -26
  45. data/.travis.yml +0 -5
  46. data/README.md +0 -94
@@ -1,3 +1,3 @@
1
1
  module Vobject
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.2".freeze
3
3
  end
@@ -1,29 +1,32 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+
3
+ lib = File.expand_path("../lib", __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'vobject/version'
5
+ require "vobject/version"
5
6
 
6
7
  Gem::Specification.new do |spec|
7
8
  spec.name = "vobject"
8
9
  spec.version = Vobject::VERSION
9
- spec.authors = ["Ribose Inc."]
10
- spec.email = ["open.source@ribose.com"]
10
+ spec.authors = ['Ribose Inc.']
11
+ spec.email = ['open.source@ribose.com']
11
12
 
12
- spec.summary = %q{Parser for vObjects: iCalendar (RFC 5545) and vCard (RFC 6350)}
13
- spec.description = %q{The main purpose of the gem is to parse vobject formatted text into a Ruby
14
- hash format. Currently there are two possiblities of vobjects, namely
15
- iCalendar (https://tools.ietf.org/html/rfc5545) and vCard
16
- (https://tools.ietf.org/html/rfc6350).}
17
- spec.homepage = "https://www.ribose.com"
18
- spec.license = "MIT"
13
+ spec.summary = "Parses iCalendar or vCard in Ruby."
14
+ spec.description = "Parse vObject formats: iCalendar (RFC 5545), vCard {3,4} (RFC 6350)."
15
+ spec.homepage = "https://github.com/riboseinc/ruby-vobject"
16
+ spec.license = "BSD-2-Clause"
19
17
 
20
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
+ f.match(%r{^(test|spec|features)/})
20
+ end
21
21
  spec.bindir = "exe"
22
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ # spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.add_development_dependency "bundler", "~> 1.15"
26
- spec.add_development_dependency "rake", "~> 10.0"
27
- spec.add_development_dependency "rspec", "~> 3.6"
25
+ spec.add_development_dependency "rake", "~> 12.0"
26
+ spec.add_development_dependency "rspec", "~> 3.0"
28
27
  spec.add_development_dependency "rspec-json_expectations"
28
+ spec.add_development_dependency "byebug"
29
+
30
+ spec.add_runtime_dependency "rsec", "~> 0.4"
31
+ spec.add_runtime_dependency "tzinfo"
29
32
  end
metadata CHANGED
@@ -1,59 +1,59 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vobject
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-03 00:00:00.000000000 Z
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.15'
19
+ version: '12.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.15'
26
+ version: '12.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '3.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: rspec-json_expectations
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '3.6'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '3.6'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec-json_expectations
56
+ name: byebug
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -66,35 +66,91 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: |-
70
- The main purpose of the gem is to parse vobject formatted text into a Ruby
71
- hash format. Currently there are two possiblities of vobjects, namely
72
- iCalendar (https://tools.ietf.org/html/rfc5545) and vCard
73
- (https://tools.ietf.org/html/rfc6350).
69
+ - !ruby/object:Gem::Dependency
70
+ name: rsec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.4'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.4'
83
+ - !ruby/object:Gem::Dependency
84
+ name: tzinfo
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: 'Parse vObject formats: iCalendar (RFC 5545), vCard {3,4} (RFC 6350).'
74
98
  email:
75
99
  - open.source@ribose.com
76
100
  executables: []
77
101
  extensions: []
78
102
  extra_rdoc_files: []
79
103
  files:
104
+ - ".github/workflows/macos.yml"
105
+ - ".github/workflows/ubuntu.yml"
106
+ - ".github/workflows/windows.yml"
80
107
  - ".gitignore"
108
+ - ".hound.yml"
81
109
  - ".rspec"
82
- - ".travis.yml"
110
+ - ".rubocop.tb.yml"
111
+ - ".rubocop.yml"
83
112
  - CODE_OF_CONDUCT.md
84
113
  - Gemfile
85
114
  - LICENSE.txt
86
- - README.md
115
+ - README.adoc
87
116
  - Rakefile
88
117
  - bin/console
89
118
  - bin/setup
119
+ - lib/c.rb
120
+ - lib/error.rb
121
+ - lib/vcalendar.rb
122
+ - lib/vcard.rb
90
123
  - lib/vobject.rb
91
124
  - lib/vobject/component.rb
125
+ - lib/vobject/parameter.rb
126
+ - lib/vobject/parametervalue.rb
92
127
  - lib/vobject/property.rb
128
+ - lib/vobject/propertyvalue.rb
129
+ - lib/vobject/vcalendar/component.rb
130
+ - lib/vobject/vcalendar/grammar.rb
131
+ - lib/vobject/vcalendar/paramcheck.rb
132
+ - lib/vobject/vcalendar/propertyparent.rb
133
+ - lib/vobject/vcalendar/propertyvalue.rb
134
+ - lib/vobject/vcalendar/typegrammars.rb
135
+ - lib/vobject/vcard/v3_0/component.rb
136
+ - lib/vobject/vcard/v3_0/grammar.rb
137
+ - lib/vobject/vcard/v3_0/paramcheck.rb
138
+ - lib/vobject/vcard/v3_0/parameter.rb
139
+ - lib/vobject/vcard/v3_0/property.rb
140
+ - lib/vobject/vcard/v3_0/propertyvalue.rb
141
+ - lib/vobject/vcard/v3_0/typegrammars.rb
142
+ - lib/vobject/vcard/v4_0/component.rb
143
+ - lib/vobject/vcard/v4_0/grammar.rb
144
+ - lib/vobject/vcard/v4_0/paramcheck.rb
145
+ - lib/vobject/vcard/v4_0/parameter.rb
146
+ - lib/vobject/vcard/v4_0/property.rb
147
+ - lib/vobject/vcard/v4_0/propertyvalue.rb
148
+ - lib/vobject/vcard/v4_0/typegrammars.rb
93
149
  - lib/vobject/version.rb
94
150
  - vobject.gemspec
95
- homepage: https://www.ribose.com
151
+ homepage: https://github.com/riboseinc/ruby-vobject
96
152
  licenses:
97
- - MIT
153
+ - BSD-2-Clause
98
154
  metadata: {}
99
155
  post_install_message:
100
156
  rdoc_options: []
@@ -111,9 +167,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
167
  - !ruby/object:Gem::Version
112
168
  version: '0'
113
169
  requirements: []
114
- rubyforge_project:
115
- rubygems_version: 2.5.2
170
+ rubygems_version: 3.0.3
116
171
  signing_key:
117
172
  specification_version: 4
118
- summary: 'Parser for vObjects: iCalendar (RFC 5545) and vCard (RFC 6350)'
173
+ summary: Parses iCalendar or vCard in Ruby.
119
174
  test_files: []
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.2.2
5
- before_install: gem install bundler -v 1.12.5
data/README.md DELETED
@@ -1,94 +0,0 @@
1
- # Vobject
2
-
3
- The main purpose of the gem is to parse vobject formatted text into a ruby
4
- hash format. Currently there are two possiblities of vobjects, namely
5
- iCalendar (https://tools.ietf.org/html/rfc5545) and vCard
6
- (https://tools.ietf.org/html/rfc6350). There are only a few differences
7
- between the iCalendar and vCard format. Only vCard supports grouping
8
- feature, and currently vCard does not have any sub-object supported.
9
-
10
- ## Installation
11
-
12
- Add this line to your application's Gemfile:
13
-
14
- ```ruby
15
- gem 'ruby-vobject'
16
- ```
17
-
18
- And then execute:
19
-
20
- $ bundle
21
-
22
- Or install it yourself as:
23
-
24
- $ gem install ruby-vobject
25
-
26
- ## Usage
27
-
28
- Vobject.parse("<ics/vcf file>")
29
-
30
- Example:
31
-
32
- A sample ics file (in spec/examples/example2.ics):
33
-
34
- ```
35
- BEGIN:VCALENDAR
36
- VERSION:2.0
37
- PRODID:-//ABC Corporation//NONSGML My Product//EN
38
- BEGIN:VTODO
39
- DTSTAMP:19980130T134500Z
40
- SEQUENCE:2
41
- UID:uid4@example.com
42
- ORGANIZER:mailto:unclesam@example.com
43
- ATTENDEE;PARTSTAT=ACCEPTED:mailto:jqpublic@example.com
44
- DUE:19980415T000000
45
- STATUS:NEEDS-ACTION
46
- SUMMARY:Submit Income Taxes
47
- BEGIN:VALARM
48
- ACTION:AUDIO
49
- TRIGGER:19980403T120000Z
50
- ATTACH;FMTTYPE=audio/basic:http://example.com/pub/audio-
51
- files/ssbanner.aud
52
- REPEAT:4
53
- DURATION:PT1H
54
- END:VALARM
55
- END:VTODO
56
- END:VCALENDAR
57
- ```
58
-
59
- Parse the ics file into Ruby hash format:
60
-
61
- ```ruby
62
- require 'vobject'
63
-
64
- ics = File.read "spec/examples/example2.ics"
65
- Vobject.parse(ics)
66
-
67
- => {:VCALENDAR=>[{:VERSION=>{:value=>"2.0"}}, {:PRODID=>{:value=>"-//ABC Corporation//NONSGML My Product//EN"}}, {:VTODO=>[{:DTSTAMP=>{:value=>"19980130T134500Z"}}, {:SEQUENCE=>{:value=>"2"}}, {:UID=>{:value=>"uid4@example.com"}}, {:ORGANIZER=>{:value=>"mailto:unclesam@example.com"}}, {:ATTENDEE=>{:params=>{:PARTSTAT=>"ACCEPTED"}, :value=>"mailto:jqpublic@example.com"}}, {:DUE=>{:value=>"19980415T000000"}}, {:STATUS=>{:value=>"NEEDS-ACTION"}}, {:SUMMARY=>{:value=>"Submit Income Taxes"}}, {:VALARM=>[{:ACTION=>{:value=>"AUDIO"}}, {:TRIGGER=>{:value=>"19980403T120000Z"}}, {:ATTACH=>{:params=>{:FMTTYPE=>"audio/basic"}, :value=>"http://example.com/pub/audio-files/ssbanner.aud"}}, {:REPEAT=>{:value=>"4"}}, {:DURATION=>{:value=>"PT1H"}}]}]}]}
68
- ```
69
-
70
- Running spec:
71
- bundle exec rspec
72
-
73
-
74
- ## Development
75
-
76
- Currently the parser is written by regular expression. However, it is
77
- hard to maintain. A better approach will be using some grammar parser
78
- library, such as treetop (https://rubygems.org/gems/treetop/versions/1.6.8).
79
-
80
- Some really simple specs have been written. Please make sure they still
81
- pass after migrating into the grammar parser approach. Also, some other
82
- specs such as some special characters as stated in RFC 5545 and 6350
83
- should be tested as well.
84
-
85
-
86
- ## Contributing
87
-
88
- Bug reports and pull requests are welcome on GitHub at https://github.com/riboseinc/ruby-vobject. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
89
-
90
-
91
- ## License
92
-
93
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
94
-