selene 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in selene.gemspec
4
+ gemspec
5
+ gem 'rspec'
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Cory Kaufman-Schofield
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # Selene
2
+
3
+ Selene is a simple iCalendar parser. It takes a string and outputs a ruby hash.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'selene'
10
+
11
+ And then execute:
12
+
13
+ $ bundle install
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install selene
18
+
19
+ ## Usage
20
+
21
+ ```ruby
22
+ ical = Selene.parse(File.read('calendar.ics'))
23
+
24
+ ## Contributing
25
+
26
+ 1. Fork it
27
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
28
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
29
+ 4. Push to the branch (`git push origin my-new-feature`)
30
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/lib/selene.rb ADDED
@@ -0,0 +1,15 @@
1
+ require "selene/version"
2
+
3
+ class Selene
4
+
5
+ FEED = {
6
+ :calendars => []
7
+ }
8
+
9
+ def self.parse(string)
10
+ { :calendars => [] }.tap do |feed|
11
+
12
+ end
13
+ end
14
+
15
+ end
@@ -0,0 +1,3 @@
1
+ module Selene
2
+ VERSION = "0.0.1"
3
+ end
data/selene.gemspec ADDED
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'selene/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "selene"
8
+ gem.version = Selene::VERSION
9
+ gem.authors = ["Cory Kaufman-Schofield"]
10
+ gem.email = ["cory@corykaufman.com"]
11
+ gem.description = %q{Selene is a simple iCalendar parser}
12
+ gem.summary = %q{Selene is a simple iCalendar parser}
13
+ gem.homepage = ""
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+ end
@@ -0,0 +1,76 @@
1
+ BEGIN:VCALENDAR
2
+ VERSION:2.0
3
+ PRODID:-//Meetup//RemoteApi//EN
4
+ CALSCALE:GREGORIAN
5
+ METHOD:PUBLISH
6
+ X-ORIGINAL-URL:http://www.meetup.com/Mobile-Monday-Detroit/events/ical/Mo
7
+ bile+Monday+Detroit/
8
+ X-WR-CALNAME:Events - Mobile Monday Detroit
9
+ BEGIN:VTIMEZONE
10
+ TZID:America/New_York
11
+ TZURL:http://tzurl.org/zoneinfo-outlook/America/New_York
12
+ X-LIC-LOCATION:America/New_York
13
+ BEGIN:DAYLIGHT
14
+ TZOFFSETFROM:-0500
15
+ TZOFFSETTO:-0400
16
+ TZNAME:EDT
17
+ DTSTART:19700308T020000
18
+ RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
19
+ END:DAYLIGHT
20
+ BEGIN:STANDARD
21
+ TZOFFSETFROM:-0400
22
+ TZOFFSETTO:-0500
23
+ TZNAME:EST
24
+ DTSTART:19701101T020000
25
+ RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
26
+ END:STANDARD
27
+ END:VTIMEZONE
28
+ BEGIN:VEVENT
29
+ DTSTAMP:20121222T185423Z
30
+ DTSTART;TZID=America/New_York:20130114T173000
31
+ DTEND;TZID=America/New_York:20130114T203000
32
+ STATUS:CONFIRMED
33
+ SUMMARY:MoMoDetroit - taking a break in January
34
+ DESCRIPTION:Mobile Monday Detroit\nMonday\, January 14 at 5:30 PM\n\nMobi
35
+ le Monday Detroit will not be meeting in January 2013. We'll be taking a
36
+ month off during which time our organizing committee will be working on
37
+ p...\n\nDetails: http://www.meetup.com/Mobile-Monday-Detroit/events/939
38
+ 23552/
39
+ CLASS:PUBLIC
40
+ CREATED:20121203T215142Z
41
+ GEO:42.33;-83.05
42
+ URL:http://www.meetup.com/Mobile-Monday-Detroit/events/93923552/
43
+ LAST-MODIFIED:20121203T215142Z
44
+ UID:event_93923552@meetup.com
45
+ END:VEVENT
46
+ BEGIN:VEVENT
47
+ DTSTAMP:20121222T185423Z
48
+ DTSTART;TZID=America/New_York:20130211T173000
49
+ DTEND;TZID=America/New_York:20130211T200000
50
+ STATUS:CONFIRMED
51
+ SUMMARY:To be announced
52
+ DESCRIPTION:Mobile Monday Detroit\nMonday\, February 11 at 5:30 PM\n\nDet
53
+ ails: http://www.meetup.com/Mobile-Monday-Detroit/events/93923892/
54
+ CLASS:PUBLIC
55
+ CREATED:20121203T215431Z
56
+ GEO:42.33;-83.05
57
+ URL:http://www.meetup.com/Mobile-Monday-Detroit/events/93923892/
58
+ LAST-MODIFIED:20121203T215431Z
59
+ UID:event_93923892@meetup.com
60
+ END:VEVENT
61
+ BEGIN:VEVENT
62
+ DTSTAMP:20121222T185423Z
63
+ DTSTART;TZID=America/New_York:20130311T173000
64
+ DTEND;TZID=America/New_York:20130311T200000
65
+ STATUS:CONFIRMED
66
+ SUMMARY:To be announced
67
+ DESCRIPTION:Mobile Monday Detroit\nMonday\, March 11 at 5:30 PM\n\nDetail
68
+ s: http://www.meetup.com/Mobile-Monday-Detroit/events/93924042/
69
+ CLASS:PUBLIC
70
+ CREATED:20121203T215538Z
71
+ GEO:42.33;-83.05
72
+ URL:http://www.meetup.com/Mobile-Monday-Detroit/events/93924042/
73
+ LAST-MODIFIED:20121203T215538Z
74
+ UID:event_93924042@meetup.com
75
+ END:VEVENT
76
+ END:VCALENDAR
data/spec/selene.rb ADDED
@@ -0,0 +1,14 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
2
+
3
+ describe Selene do
4
+
5
+ describe "when parsing" do
6
+ let(:actual) { File.read('fixtures/mobile-monday.ics') }
7
+ let(:expected) { File.read('fixtures/mobile-monday.json') }
8
+
9
+ it "parses calendar" do
10
+ Selene.parse(actual).should == JSON.parse(expected)
11
+ end
12
+ end
13
+
14
+ end
@@ -0,0 +1,6 @@
1
+ RSpec.configure do |config|
2
+ config.treat_symbols_as_metadata_keys_with_true_values = true
3
+ config.run_all_when_everything_filtered = true
4
+ config.filter_run :focus
5
+ config.order = 'random'
6
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: selene
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Cory Kaufman-Schofield
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-22 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Selene is a simple iCalendar parser
15
+ email:
16
+ - cory@corykaufman.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - .rspec
23
+ - Gemfile
24
+ - LICENSE.txt
25
+ - README.md
26
+ - Rakefile
27
+ - lib/selene.rb
28
+ - lib/selene/version.rb
29
+ - selene.gemspec
30
+ - spec/fixtures/mobile-monday.ics
31
+ - spec/selene.rb
32
+ - spec/spec_helper.rb
33
+ homepage: ''
34
+ licenses: []
35
+ post_install_message:
36
+ rdoc_options: []
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
46
+ none: false
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ requirements: []
52
+ rubyforge_project:
53
+ rubygems_version: 1.8.24
54
+ signing_key:
55
+ specification_version: 3
56
+ summary: Selene is a simple iCalendar parser
57
+ test_files:
58
+ - spec/fixtures/mobile-monday.ics
59
+ - spec/selene.rb
60
+ - spec/spec_helper.rb