ical2hash 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -0
- data/README.md +155 -14
- data/Rakefile +4 -1
- data/ical2hash.gemspec +1 -1
- data/lib/ical2hash/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2699cbdb3088bd48e5c02d90a3186ae4f6067c9519a6c4c8313e8e15a5ec0ec0
|
4
|
+
data.tar.gz: b906e9c7c104bfabaf4fecc76e8d3173db798d168904e10bb66dfd7e443c0bcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 410cd021a99686af96fbb729ee4e549b425f075fe0dedf115926abbd15ce06f9ac4c23a58d5977a7fb6b74cb7d2014ac56df51575025115e7f4c7fc5159ff948
|
7
|
+
data.tar.gz: ed7faa4078c3a0edd34db44259aa2bddaa3868f5ea0c57a28dbec5199196c49f10601bbb952a4385dbc0f8516bb13eb1e2a2d1032d42382954e325a4c044f738
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,31 +1,172 @@
|
|
1
1
|
# Ical2hash
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ical2hash`. To experiment with that code, run `bin/console` for an interactive prompt.
|
3
|
+
Ical2hash is a Gem that can convert ics-format text into a ruby hash object.
|
4
|
+
Conversely, it also has the ability to convert from a hash object to ics format text.
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
9
|
-
|
8
|
+
```
|
9
|
+
$ gem install ical2hash
|
10
|
+
```
|
10
11
|
|
11
|
-
|
12
|
+
## Usage
|
12
13
|
|
13
|
-
|
14
|
+
```ruby
|
15
|
+
require 'ical2hash'
|
14
16
|
|
15
|
-
|
17
|
+
ics_txt = <<"ics"
|
18
|
+
BEGIN:VCALENDAR
|
19
|
+
VERSION:2.0
|
20
|
+
PRODID:-//OpenAI//GPT-3.5//EN
|
21
|
+
CALSCALE:GREGORIAN
|
22
|
+
METHOD:PUBLISH
|
23
|
+
X-WR-CALNAME:Test Calendar
|
16
24
|
|
17
|
-
|
25
|
+
BEGIN:VEVENT
|
26
|
+
DTSTART:20230522T090000
|
27
|
+
DTEND:20230522T110000
|
28
|
+
SUMMARY:Meeting
|
29
|
+
DESCRIPTION:This is an internal meeting to discuss the progress of the project.
|
30
|
+
LOCATION:Conference Room A
|
31
|
+
END:VEVENT
|
18
32
|
|
19
|
-
|
33
|
+
BEGIN:VEVENT
|
34
|
+
DTSTART:20230526T083000
|
35
|
+
DTEND:20230526T120000
|
36
|
+
SUMMARY:External Conference
|
37
|
+
DESCRIPTION:This is a conference with industry leaders. We will discuss market trends and competitive analysis.
|
38
|
+
LOCATION:Hotel Conference Room
|
39
|
+
END:VEVENT
|
40
|
+
|
41
|
+
END:VCALENDAR
|
42
|
+
ics
|
43
|
+
|
44
|
+
Ical2hash.convert(ics_txt)
|
45
|
+
|
46
|
+
# => {
|
47
|
+
# "VCALENDAR"=>[
|
48
|
+
# {
|
49
|
+
# "VERSION"=>"2.0",
|
50
|
+
# "PRODID"=>"-//OpenAI//GPT-3.5//EN",
|
51
|
+
# "CALSCALE"=>"GREGORIAN",
|
52
|
+
# "METHOD"=>"PUBLISH",
|
53
|
+
# "X-WR-CALNAME"=>"Test Calendar",
|
54
|
+
# "VEVENT"=>[
|
55
|
+
# {
|
56
|
+
# "DTSTART"=>"20230522T090000",
|
57
|
+
# "DTEND"=>"20230522T110000",
|
58
|
+
# "SUMMARY"=>"Meeting",
|
59
|
+
# "DESCRIPTION"=>"This is an internal meeting to discuss the progress of the project.",
|
60
|
+
# "LOCATION"=>"Conference Room A"
|
61
|
+
# },
|
62
|
+
# {
|
63
|
+
# "DTSTART"=>"20230526T083000",
|
64
|
+
# "DTEND"=>"20230526T120000",
|
65
|
+
# "SUMMARY"=>"External Conference",
|
66
|
+
# "DESCRIPTION"=>"This is a conference with industry leaders. We will discuss market trends and competitive analysis.",
|
67
|
+
# "LOCATION"=>"Hotel Conference Room"
|
68
|
+
# }
|
69
|
+
# ]
|
70
|
+
# }
|
71
|
+
# ]
|
72
|
+
# }
|
20
73
|
|
21
|
-
|
74
|
+
hash = {
|
75
|
+
"VCALENDAR"=>[
|
76
|
+
{
|
77
|
+
"VERSION"=>"2.0",
|
78
|
+
"PRODID"=>"-//OpenAI//GPT-3.5//EN",
|
79
|
+
"CALSCALE"=>"GREGORIAN",
|
80
|
+
"METHOD"=>"PUBLISH",
|
81
|
+
"X-WR-CALNAME"=>"Test Calendar",
|
82
|
+
"VEVENT"=>[
|
83
|
+
{
|
84
|
+
"DTSTART"=>"20230522T090000",
|
85
|
+
"DTEND"=>"20230522T110000",
|
86
|
+
"SUMMARY"=>"Meeting",
|
87
|
+
"DESCRIPTION"=>"This is an internal meeting to discuss the progress of the project.",
|
88
|
+
"LOCATION"=>"Conference Room A"
|
89
|
+
}
|
90
|
+
]
|
91
|
+
}
|
92
|
+
]
|
93
|
+
}
|
22
94
|
|
23
|
-
|
95
|
+
Ical2hash.revert(hash)
|
24
96
|
|
25
|
-
|
97
|
+
# => "BEGIN:VCALENDAR\r\n
|
98
|
+
# VERSION:2.0\r\n
|
99
|
+
# PRODID:-//OpenAI//GPT-3.5//EN\r\n
|
100
|
+
# CALSCALE:GREGORIAN\r\nMETHOD:PUBLISH\r\n
|
101
|
+
# X-WR-CALNAME:Test Calendar\r\n
|
102
|
+
# BEGIN:VEVENT\r\n
|
103
|
+
# DTSTART:20230522T090000\r\n
|
104
|
+
# DTEND:20230522T110000\r\n
|
105
|
+
# SUMMARY:Meeting\r\n
|
106
|
+
# DESCRIPTION:This is an internal meeting to discuss the progress of the project.\r\n
|
107
|
+
# LOCATION:Conference Room A\r\n
|
108
|
+
# END:VEVENT\r\n
|
109
|
+
# END:VCALENDAR\r\n"
|
26
110
|
|
27
|
-
|
111
|
+
|
112
|
+
ical_hash = {
|
113
|
+
"VCALENDAR"=>[
|
114
|
+
{
|
115
|
+
"VERSION"=>"2.0",
|
116
|
+
"PRODID"=>"-//OpenAI//GPT-3.5//EN",
|
117
|
+
"CALSCALE"=>"GREGORIAN",
|
118
|
+
"METHOD"=>"PUBLISH",
|
119
|
+
"X-WR-CALNAME"=>"Test Calendar",
|
120
|
+
"VEVENT"=>[
|
121
|
+
{
|
122
|
+
"DTSTART"=>"20230522T090000",
|
123
|
+
"DTEND"=>"20230522T110000",
|
124
|
+
"SUMMARY"=>"Meeting",
|
125
|
+
"DESCRIPTION"=>"This is an internal meeting to discuss the progress of the project.",
|
126
|
+
"LOCATION"=>"Conference Room A"
|
127
|
+
}
|
128
|
+
]
|
129
|
+
}
|
130
|
+
]
|
131
|
+
}
|
132
|
+
|
133
|
+
ical_hash["VCALENDAR"][0]["VEVENT"] << {
|
134
|
+
"DTSTART"=>"20230526T083000",
|
135
|
+
"DTEND"=>"20230526T120000",
|
136
|
+
"SUMMARY"=>"External Conference",
|
137
|
+
"DESCRIPTION"=>"This is a conference with industry leaders. We will discuss market trends and competitive analysis.",
|
138
|
+
"LOCATION"=>"Hotel Conference Room"
|
139
|
+
}
|
140
|
+
|
141
|
+
Ical2hash.revert(ical_hash)
|
142
|
+
|
143
|
+
#=> "BEGIN:VCALENDAR\r\n
|
144
|
+
# VERSION:2.0\r\n
|
145
|
+
# PRODID:-//OpenAI//GPT-3.5//EN\r\n
|
146
|
+
# CALSCALE:GREGORIAN\r\n
|
147
|
+
# METHOD:PUBLISH\r\n
|
148
|
+
# X-WR-CALNAME:Test Calendar\r\n
|
149
|
+
# BEGIN:VEVENT\r\n
|
150
|
+
# DTSTART:20230522T090000\r\n
|
151
|
+
# DTEND:20230522T110000\r\n
|
152
|
+
# SUMMARY:Meeting\r\n
|
153
|
+
# DESCRIPTION:This is an internal meeting to discuss the progress of the project.\r\n
|
154
|
+
# LOCATION:Conference Room A\r\n
|
155
|
+
# END:VEVENT\r\n
|
156
|
+
# BEGIN:VEVENT\r\n
|
157
|
+
# DTSTART:20230526T083000\r\n
|
158
|
+
# DTEND:20230526T120000\r\n
|
159
|
+
# SUMMARY:External Conference\r\n
|
160
|
+
# DESCRIPTION:This is a conference with industry leaders. We will discuss market trends and competitive analysis.\r\n
|
161
|
+
# LOCATION:Hotel Conference Room\r\n
|
162
|
+
# END:VEVENT\r\n
|
163
|
+
# END:VCALENDAR\r\n"
|
164
|
+
|
165
|
+
```
|
28
166
|
|
29
167
|
## Contributing
|
30
168
|
|
31
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
169
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/thehighhigh/ical2hash.
|
170
|
+
|
171
|
+
## License
|
172
|
+
The gem is available as open source under the terms of the MIT License.
|
data/Rakefile
CHANGED
data/ical2hash.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = 'It can convert ical txt to hash object and revert.'
|
12
12
|
spec.description = 'It can convert ical txt to hash object and revert.'
|
13
13
|
spec.homepage = 'https://github.com/thehighhigh/ical2hash'
|
14
|
-
spec.required_ruby_version = '>= 2.
|
14
|
+
spec.required_ruby_version = '>= 2.7.0'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
17
17
|
|
data/lib/ical2hash/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ical2hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thehighhigh
|
@@ -99,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements:
|
100
100
|
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 2.
|
102
|
+
version: 2.7.0
|
103
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
104
|
requirements:
|
105
105
|
- - ">="
|