lotus_notes_calendar 0.0.1.pre → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTQ1M2M4ZDI0NGM4NDA5N2MyZGFjZDYxNjM4ODhlZjYyM2Q3NzBlYw==
5
+ data.tar.gz: !binary |-
6
+ YjNkZDVkNGVkZDgzMmQwODMwZTYwYzg1MTQyZGQwYjk2ODlhMTY5NQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NDE0MWZmMWVjNGE2NTg0Zjc4MWJhZDI3MTI2MDRlOTAxMDAyMjcxY2Q0MTJh
10
+ ZDVmMTcxMTExOGM2Mzk2YjFlNDg3NzNmYzMwNTJlZmIzMWIyZDA4YTAzMWQ5
11
+ OGY1ODYwNmFiNDZhMjRjNjBhMWRjYjdlYmQyZGFkNWFiN2MzY2Y=
12
+ data.tar.gz: !binary |-
13
+ YmY2YmNhMWQzN2M4Y2Q3NzBiZmM4ZTg4NmUxYjc2NGQ1ZDNiOWZiMGY2MGE3
14
+ ZDhkZjJiYjRlOWRmMGNhNWNlNDMzOTc4ODg0YzEyNjRjZGJiNjJhY2U0ZjY4
15
+ NWJhNDJjM2MxMWNkZmM5NmI2NTMyN2U5ZmY0NTlmYzQ0NzIxYmU=
@@ -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
@@ -0,0 +1,18 @@
1
+ AllCops:
2
+ Excludes:
3
+ - vendor/**
4
+
5
+ Encoding:
6
+ Enabled: false
7
+ Documentation:
8
+ Enabled: false
9
+ HashSyntax:
10
+ Enabled: false
11
+ LineLength:
12
+ Enabled: false
13
+ RedundantReturn:
14
+ Enabled: false
15
+ AndOr:
16
+ Enabled: false
17
+ MethodLength:
18
+ Max: 25
@@ -3,4 +3,8 @@ rvm:
3
3
  - 1.8.7
4
4
  - 1.9.2
5
5
  - 1.9.3
6
- - ree
6
+ - 2.0.0
7
+ - ree
8
+ script:
9
+ - bundle exec rubocop
10
+ - bundle exec rake test
data/Gemfile CHANGED
@@ -1,14 +1,2 @@
1
- source "http://rubygems.org"
2
- # Add dependencies required to use your gem here.
3
- # Example:
4
- # gem "activesupport", ">= 2.3.5"
5
- gem 'nokogiri'
6
-
7
- # Add dependencies to develop your gem here.
8
- # Include everything needed to run rake, tests, features, etc.
9
- group :development do
10
- gem "shoulda", ">= 0"
11
- gem "bundler", "~> 1.0.0"
12
- gem "jeweler", "~> 1.6.0"
13
- gem "rcov", ">= 0"
14
- end
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -1,4 +1,6 @@
1
- Copyright (c) 2011 David Radcliffe
1
+ Copyright (c) 2013 David Radcliffe
2
+
3
+ MIT License
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining
4
6
  a copy of this software and associated documentation files (the
@@ -0,0 +1,29 @@
1
+ # Lotus Notes Calendar
2
+
3
+ Library to fetch and parse events from a Lotus Notes calendar.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'lotus_notes_calendar'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install lotus_notes_calendar
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile CHANGED
@@ -1,29 +1,4 @@
1
- # encoding: utf-8
2
-
3
- require 'rubygems'
4
- require 'bundler'
5
- begin
6
- Bundler.setup(:default, :development)
7
- rescue Bundler::BundlerError => e
8
- $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
10
- exit e.status_code
11
- end
12
- require 'rake'
13
-
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
16
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
- gem.name = "lotus_notes_calendar"
18
- gem.homepage = "http://github.com/dwradcliffe/lotus_notes_calendar"
19
- gem.license = "MIT"
20
- gem.summary = %Q{Read and parse Lotus Notes calendars}
21
- gem.description = %Q{Given a Lotus Notes calendar url, parse events into ruby class. Includes basic query options.}
22
- gem.email = "david@etchdev.com"
23
- gem.authors = ["David Radcliffe"]
24
- # dependencies defined in Gemfile
25
- end
26
- Jeweler::RubygemsDotOrgTasks.new
1
+ require 'bundler/gem_tasks'
27
2
 
28
3
  require 'rake/testtask'
29
4
  Rake::TestTask.new(:test) do |test|
@@ -32,22 +7,4 @@ Rake::TestTask.new(:test) do |test|
32
7
  test.verbose = true
33
8
  end
34
9
 
35
- require 'rcov/rcovtask'
36
- Rcov::RcovTask.new do |test|
37
- test.libs << 'test'
38
- test.pattern = 'test/**/test_*.rb'
39
- test.verbose = true
40
- test.rcov_opts << '--exclude "gems/*"'
41
- end
42
-
43
10
  task :default => :test
44
-
45
- require 'rake/rdoctask'
46
- Rake::RDocTask.new do |rdoc|
47
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
48
-
49
- rdoc.rdoc_dir = 'rdoc'
50
- rdoc.title = "lotus_notes_calendar #{version}"
51
- rdoc.rdoc_files.include('README*')
52
- rdoc.rdoc_files.include('lib/**/*.rb')
53
- end
@@ -1,2 +1,6 @@
1
+ require 'lotus_notes_calendar/version'
1
2
  require 'lotus_notes_calendar/calendar'
2
3
  require 'lotus_notes_calendar/event'
4
+
5
+ module LotusNotesCalendar
6
+ end
@@ -4,65 +4,64 @@ require 'uri'
4
4
 
5
5
  module LotusNotesCalendar
6
6
  class Calendar
7
-
8
- attr_reader :name, :url
9
-
10
- def initialize(url, name = "")
11
- @name = name
7
+ attr_reader :url
8
+
9
+ def initialize(url)
12
10
  @url = url
13
11
  @results = {}
14
12
  end
15
-
13
+
16
14
  def find(id)
17
15
  url = "#{@url}/#{id}?OpenDocument"
18
- return @results[url] if @results.has_key?(url)
16
+ return @results[url] if @results.key?(url)
19
17
  doc = Nokogiri::HTML(open_url(url))
20
18
  event = Event.from_html(self, id, doc)
21
19
  @results[url] = event
22
- return event
20
+ event
23
21
  end
24
-
22
+
25
23
  def all
26
24
  where
27
25
  end
28
-
26
+
29
27
  def where(options = {})
30
28
  url = build_url(options)
31
- return @results[url] if @results.has_key?(url)
29
+ return @results[url] if @results.key?(url)
32
30
  doc = Nokogiri::XML(open_url(url))
33
31
  events = []
34
32
  doc.xpath('//viewentries/viewentry').each do |event_xml|
33
+ next if event_xml.has_attribute?('conflict') and event_xml['conflict'] == 'true'
35
34
  events << Event.from_xml(self, event_xml)
36
35
  end
37
36
  @results[url] = events
38
37
  return events
39
38
  end
40
-
41
- private
39
+
40
+ private
41
+
42
42
  def build_url(options = {})
43
43
  url = "#{@url}?ReadViewEntries&PreFormat"
44
44
  if options[:start] and options[:end]
45
- url += "&KeyType=time"
45
+ url += '&KeyType=time'
46
46
  url += "&StartKey=#{options[:start]}"
47
47
  url += "&UntilKey=#{options[:end]}"
48
+ url += '&Count=999'
48
49
  elsif options[:date]
49
50
  url += "&Date=#{options[:date]}"
50
51
  end
51
52
  url
52
53
  end
54
+
53
55
  def open_url(url)
54
- begin
55
- Rails.logger.info url
56
- uri = URI.parse(url)
57
- http = Net::HTTP.new(uri.host, uri.port)
58
- http.use_ssl = uri.is_a? URI::HTTPS
59
- # http.ca_file = "/etc/ssl/certs/ca-certificate.crt"
60
- request = Net::HTTP::Get.new(uri.request_uri)
61
- http.request(request).body
62
- rescue Errno::ETIMEDOUT
63
- ""
64
- end
56
+ uri = URI.parse(url)
57
+ http = Net::HTTP.new(uri.host, uri.port)
58
+ http.use_ssl = uri.is_a? URI::HTTPS
59
+ # http.ca_file = "/etc/ssl/certs/ca-certificate.crt"
60
+ request = Net::HTTP::Get.new(uri.request_uri)
61
+ # puts uri.request_uri
62
+ http.request(request).body
63
+ rescue Errno::ETIMEDOUT
64
+ ''
65
65
  end
66
-
67
66
  end
68
- end
67
+ end
@@ -1,37 +1,37 @@
1
1
  module LotusNotesCalendar
2
2
  class Event
3
-
4
3
  attr_accessor :id, :at, :text, :calendar
5
-
6
-
4
+
5
+ def initialize(id = nil, at = nil, text = nil, url = nil)
6
+ @id = id
7
+ @at = at
8
+ @text = text
9
+ @calendar = Calendar.new(url)
10
+ end
11
+
7
12
  def self.from_xml(calendar, xml_node)
8
13
  # xml_node is 'viewentry' node
9
-
10
14
  e = Event.new
11
15
  e.id = xml_node['unid']
12
16
  e.calendar = calendar
13
17
  date_str = xml_node.xpath('entrydata[@name="$6"]/text')[0].content
14
18
  e.at = Date.strptime date_str, '%m/%d/%Y'
15
19
  e.text = xml_node.xpath('entrydata[@name="$7"]/text')[0].content
16
-
17
20
  return e
18
-
19
21
  end
20
-
22
+
21
23
  def self.from_html(calendar, id, html)
22
-
23
24
  e = Event.new
24
25
  e.id = id
25
26
  e.calendar = calendar
26
27
  next_attr = nil
27
-
28
+
28
29
  html.xpath('//html/body/form/table/tr/td/font').each do |el|
29
-
30
30
  if next_attr.nil?
31
31
  case el.content
32
- when "Date"
32
+ when 'Date'
33
33
  next_attr = :at
34
- when "Description"
34
+ when 'Description'
35
35
  next_attr = :text
36
36
  end
37
37
  else
@@ -43,17 +43,15 @@ module LotusNotesCalendar
43
43
  end
44
44
  next_attr = nil
45
45
  end
46
-
46
+
47
47
  end
48
48
 
49
49
  # e.id = xml_node['unid']
50
50
  # date_str = xml_node.xpath('entrydata[@name="$6"]/text')[0].content
51
51
  # e.at = Date.strptime date_str, '%m/%d/%Y'
52
52
  # e.text = xml_node.xpath('entrydata[@name="$7"]/text')[0].content
53
-
53
+
54
54
  return e
55
-
56
55
  end
57
-
58
56
  end
59
- end
57
+ end
@@ -0,0 +1,3 @@
1
+ module LotusNotesCalendar
2
+ VERSION = '0.0.2'
3
+ end
@@ -1,66 +1,30 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'lotus_notes_calendar/version'
5
5
 
6
- Gem::Specification.new do |s|
7
- s.name = %q{lotus_notes_calendar}
8
- s.version = "0.0.1.pre"
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "lotus_notes_calendar"
8
+ spec.version = LotusNotesCalendar::VERSION
9
+ spec.authors = ["David Radcliffe"]
10
+ spec.email = ["radcliffe.david@gmail.com"]
11
+ spec.description = %q{Given a Lutus Notes calendar url, parse events into ruby class. Includes basic query options.}
12
+ spec.summary = %q{Library to fetch and parse events from a Lotus Notes calendar.}
13
+ spec.homepage = "https://github.com/dwradcliffe/lotus_notes_calendar"
14
+ spec.license = "MIT"
9
15
 
10
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{David Radcliffe}]
12
- s.date = %q{2012-01-17}
13
- s.description = %q{Given a Lotus Notes calendar url, parse events into ruby class. Includes basic query options.}
14
- s.email = %q{david@etchdev.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE.txt",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".rvmrc",
22
- ".travis.yml",
23
- "Gemfile",
24
- "Gemfile.lock",
25
- "LICENSE.txt",
26
- "README.rdoc",
27
- "Rakefile",
28
- "VERSION",
29
- "lib/lotus_notes_calendar.rb",
30
- "lib/lotus_notes_calendar/calendar.rb",
31
- "lib/lotus_notes_calendar/event.rb",
32
- "lotus_notes_calendar.gemspec",
33
- "test/helper.rb",
34
- "test/test_lotus_notes_calendar.rb"
35
- ]
36
- s.homepage = %q{http://github.com/dwradcliffe/lotus_notes_calendar}
37
- s.licenses = [%q{MIT}]
38
- s.require_paths = [%q{lib}]
39
- s.rubygems_version = %q{1.8.8}
40
- s.summary = %q{Read and parse Lotus Notes calendars}
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
41
20
 
42
- if s.respond_to? :specification_version then
43
- s.specification_version = 3
21
+ spec.add_dependency 'nokogiri', '~> 1.5.5'
44
22
 
45
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
- s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
47
- s.add_development_dependency(%q<shoulda>, [">= 0"])
48
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
49
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
50
- s.add_development_dependency(%q<rcov>, [">= 0"])
51
- else
52
- s.add_dependency(%q<nokogiri>, [">= 0"])
53
- s.add_dependency(%q<shoulda>, [">= 0"])
54
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
55
- s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
56
- s.add_dependency(%q<rcov>, [">= 0"])
57
- end
58
- else
59
- s.add_dependency(%q<nokogiri>, [">= 0"])
60
- s.add_dependency(%q<shoulda>, [">= 0"])
61
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
62
- s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
63
- s.add_dependency(%q<rcov>, [">= 0"])
64
- end
23
+ spec.add_development_dependency 'bundler', '~> 1.3'
24
+ spec.add_development_dependency 'rake'
25
+ spec.add_development_dependency 'shoulda', '~> 3.5.0'
26
+ spec.add_development_dependency 'simplecov', '~> 0.7.1'
27
+ spec.add_development_dependency 'turn', '~> 0.9.6'
28
+ spec.add_development_dependency 'minitest', '~> 3.4.0'
29
+ spec.add_development_dependency 'rubocop', '~> 0.15.0'
65
30
  end
66
-
@@ -1,14 +1,22 @@
1
1
  require 'rubygems'
2
2
  require 'bundler'
3
+
4
+ require 'simplecov'
5
+ SimpleCov.start do
6
+ add_filter '/vendor/bundle/'
7
+ add_filter '/test/'
8
+ end
9
+
3
10
  begin
4
11
  Bundler.setup(:default, :development)
5
12
  rescue Bundler::BundlerError => e
6
13
  $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
14
+ $stderr.puts 'Run `bundle install` to install missing gems'
8
15
  exit e.status_code
9
16
  end
10
17
  require 'test/unit'
11
18
  require 'shoulda'
19
+ require 'turn'
12
20
 
13
21
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
22
  $LOAD_PATH.unshift(File.dirname(__FILE__))
@@ -0,0 +1,32 @@
1
+ require 'helper'
2
+
3
+ class TestCalendar < Test::Unit::TestCase
4
+ should 'be able to get current events' do
5
+ calendar = LotusNotesCalendar::Calendar.new('https://harmony.mooresvilleschools.org/centraloffice.nsf/school+calendar')
6
+ results = calendar.all
7
+ assert results.count > 0
8
+ # assert_equal '7th Gr. First Football Practice - 9-11am', results[0].text
9
+ # assert_equal 'Monday, Aug 1', results[0].at.strftime('%A, %b %e')
10
+ end
11
+
12
+ should 'be able to get a single event' do
13
+ calendar = LotusNotesCalendar::Calendar.new('https://harmony.mooresvilleschools.org/madison.nsf/school+calendar')
14
+ result = calendar.find('5F217BE1172632A8852578D90050CFB8')
15
+ assert_equal '5F217BE1172632A8852578D90050CFB8', result.id
16
+ assert_equal 'Backe to School Night Grades 3 & 4 (6:00-7:30)', result.text
17
+ assert_equal Date.new(2011, 8, 11), result.at
18
+ assert_equal 'Thursday, Aug 11', result.at.strftime('%A, %b %e')
19
+ end
20
+
21
+ should 'be able to build url to get events by month' do
22
+ calendar = LotusNotesCalendar::Calendar.new('https://harmony.mooresvilleschools.org/madison.nsf/school+calendar')
23
+ options = { :start => '20120101', :end => '20120131' }
24
+ assert_equal 'https://harmony.mooresvilleschools.org/madison.nsf/school+calendar?ReadViewEntries&PreFormat&KeyType=time&StartKey=20120101&UntilKey=20120131&Count=999', calendar.send(:build_url, options)
25
+ end
26
+
27
+ should 'be able to get events by month' do
28
+ calendar = LotusNotesCalendar::Calendar.new('https://harmony.mooresvilleschools.org/madison.nsf/school+calendar')
29
+ results = calendar.where(:start => '20120101', :end => '20120131')
30
+ assert results.count > 0
31
+ end
32
+ end
@@ -0,0 +1,78 @@
1
+ require 'helper'
2
+
3
+ class TestEvent < Test::Unit::TestCase
4
+ should 'be able to parse event data from xml' do
5
+ raw_xml = <<END
6
+ <viewentry position="4140" unid="852571A7002389488525791200665961" noteid="24BC0E" siblings="4533">
7
+ <entrydata columnnumber="0" name="$6">
8
+ <text>12/26/2011 12:00:00 AM</text>
9
+ </entrydata>
10
+ <entrydata columnnumber="1" name="$7">
11
+ <text>Christmas Break</text>
12
+ </entrydata>
13
+ </viewentry>
14
+ END
15
+ xml_node = Nokogiri::XML(raw_xml).root
16
+ event = LotusNotesCalendar::Event.from_xml(LotusNotesCalendar::Calendar.new(''), xml_node)
17
+ assert_equal '852571A7002389488525791200665961', event.id
18
+ assert_equal Date.new(2011, 12, 26), event.at
19
+ assert_equal 'Christmas Break', event.text
20
+ end
21
+
22
+ should 'be able to parse event data from html' do
23
+ raw_html = <<END
24
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
25
+ <html>
26
+ <head>
27
+ <TITLE>Calendar Event</TITLE><style type = "text/css"> td {font-family: Arial; font-size: 9} td.menu {font-family: Arial} td.menu {font-size: 11; font-family: Arial; font-weight: normal} a {text-decoration: none; color: navy} a:hover {text-decoration: underline; color: blue} a.menu {text-decoration: none; color: navy} a.menu:hover {text-decoration: underline; color: blue; font-weight: bold} </style>
28
+ <script language="JavaScript" type="text/javascript">
29
+ <!--
30
+ document._domino_target = "_self";
31
+ function _doClick(v, o, t) {
32
+ var returnValue = false;
33
+ var url="/centraloffice.nsf/9eedb3f6499687e7852573f3006560bb/5c810f13e09ab8c785257912006662bc?OpenDocument&Date=2011-12-27&Click=" + v;
34
+ if (o.href != null) {
35
+ o.href = url;
36
+ returnValue = true;
37
+ } else {
38
+ if (t == null)
39
+ t = document._domino_target;
40
+ window.open(url, t);
41
+ }
42
+ return returnValue;
43
+ }
44
+ // -->
45
+ </script>
46
+ </head>
47
+ <body text="#000000" bgcolor="#FFFFFF">
48
+
49
+ <form action=""><A HREF="#" onClick="window.close();" onmouseover="status='Close'; return true;" onmouseout="status='';">
50
+ <font size = 2 face = Arial><b>Close</font></b></A><br>
51
+ <hr align = left height = 3 width = 640 color = #000080><br>
52
+ <table border="0" cellspacing="0" cellpadding="0">
53
+ <tr valign="top"><td width="480"><b><font size="4" color="#6260a1">Mooresville Consolidated School Corporation</font></b><br>
54
+ <b><font size="6" color="#000080">Calendar Event</font></b></td><td width="125"><img width="1" height="1" src="/icons/ecblank.gif" border="0" alt=""></td></tr>
55
+ </table>
56
+ <br>
57
+ <table border="0" cellspacing="0" cellpadding="0">
58
+ <tr valign="top"><td width="144"><font size="2">Date</font></td><td width="288"><font size="2">12/27/2011</font></td></tr>
59
+
60
+ <tr valign="top"><td width="144"><br></td><td width="288"><img width="1" height="1" src="/icons/ecblank.gif" border="0" alt=""></td></tr>
61
+
62
+ <tr valign="top"><td width="144"><font size="2">Description</font></td><td width="288"><font size="2">Christmas Break</font></td></tr>
63
+
64
+ <tr valign="top"><td width="144"><font size="2">Details</font><br>
65
+ </td><td width="288"><font size="2"></font></td></tr>
66
+ </table>
67
+ </form>
68
+ </body>
69
+ </html>
70
+ END
71
+
72
+ html_doc = Nokogiri::HTML(raw_html)
73
+ event = LotusNotesCalendar::Event.from_html(LotusNotesCalendar::Calendar.new(''), '5C810F13E09AB8C785257912006662BC', html_doc)
74
+ assert_equal '5C810F13E09AB8C785257912006662BC', event.id
75
+ assert_equal Date.new(2011, 12, 27), event.at
76
+ assert_equal 'Christmas Break', event.text
77
+ end
78
+ end
metadata CHANGED
@@ -1,121 +1,175 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lotus_notes_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre
5
- prerelease: 6
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - David Radcliffe
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-01-17 00:00:00.000000000Z
11
+ date: 2013-11-07 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: nokogiri
16
- requirement: &70357415994860 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: '0'
19
+ version: 1.5.5
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *70357415994860
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.5.5
25
27
  - !ruby/object:Gem::Dependency
26
- name: shoulda
27
- requirement: &70357415993820 !ruby/object:Gem::Requirement
28
- none: false
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
29
44
  requirements:
30
45
  - - ! '>='
31
46
  - !ruby/object:Gem::Version
32
47
  version: '0'
33
48
  type: :development
34
49
  prerelease: false
35
- version_requirements: *70357415993820
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
36
55
  - !ruby/object:Gem::Dependency
37
- name: bundler
38
- requirement: &70357415992680 !ruby/object:Gem::Requirement
39
- none: false
56
+ name: shoulda
57
+ requirement: !ruby/object:Gem::Requirement
40
58
  requirements:
41
59
  - - ~>
42
60
  - !ruby/object:Gem::Version
43
- version: 1.0.0
61
+ version: 3.5.0
44
62
  type: :development
45
63
  prerelease: false
46
- version_requirements: *70357415992680
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 3.5.0
47
69
  - !ruby/object:Gem::Dependency
48
- name: jeweler
49
- requirement: &70357415991580 !ruby/object:Gem::Requirement
50
- none: false
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
51
72
  requirements:
52
73
  - - ~>
53
74
  - !ruby/object:Gem::Version
54
- version: 1.6.0
75
+ version: 0.7.1
55
76
  type: :development
56
77
  prerelease: false
57
- version_requirements: *70357415991580
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 0.7.1
58
83
  - !ruby/object:Gem::Dependency
59
- name: rcov
60
- requirement: &70357415990700 !ruby/object:Gem::Requirement
61
- none: false
84
+ name: turn
85
+ requirement: !ruby/object:Gem::Requirement
62
86
  requirements:
63
- - - ! '>='
87
+ - - ~>
64
88
  - !ruby/object:Gem::Version
65
- version: '0'
89
+ version: 0.9.6
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: 0.9.6
97
+ - !ruby/object:Gem::Dependency
98
+ name: minitest
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: 3.4.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: 3.4.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 0.15.0
66
118
  type: :development
67
119
  prerelease: false
68
- version_requirements: *70357415990700
69
- description: Given a Lotus Notes calendar url, parse events into ruby class. Includes
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: 0.15.0
125
+ description: Given a Lutus Notes calendar url, parse events into ruby class. Includes
70
126
  basic query options.
71
- email: david@etchdev.com
127
+ email:
128
+ - radcliffe.david@gmail.com
72
129
  executables: []
73
130
  extensions: []
74
- extra_rdoc_files:
75
- - LICENSE.txt
76
- - README.rdoc
131
+ extra_rdoc_files: []
77
132
  files:
78
- - .document
79
- - .rvmrc
133
+ - .gitignore
134
+ - .rubocop.yml
80
135
  - .travis.yml
81
136
  - Gemfile
82
- - Gemfile.lock
83
137
  - LICENSE.txt
84
- - README.rdoc
138
+ - README.md
85
139
  - Rakefile
86
- - VERSION
87
140
  - lib/lotus_notes_calendar.rb
88
141
  - lib/lotus_notes_calendar/calendar.rb
89
142
  - lib/lotus_notes_calendar/event.rb
143
+ - lib/lotus_notes_calendar/version.rb
90
144
  - lotus_notes_calendar.gemspec
91
145
  - test/helper.rb
92
- - test/test_lotus_notes_calendar.rb
93
- homepage: http://github.com/dwradcliffe/lotus_notes_calendar
146
+ - test/test_calendar.rb
147
+ - test/test_event.rb
148
+ homepage: https://github.com/dwradcliffe/lotus_notes_calendar
94
149
  licenses:
95
150
  - MIT
151
+ metadata: {}
96
152
  post_install_message:
97
153
  rdoc_options: []
98
154
  require_paths:
99
155
  - lib
100
156
  required_ruby_version: !ruby/object:Gem::Requirement
101
- none: false
102
157
  requirements:
103
158
  - - ! '>='
104
159
  - !ruby/object:Gem::Version
105
160
  version: '0'
106
- segments:
107
- - 0
108
- hash: -301071999928766116
109
161
  required_rubygems_version: !ruby/object:Gem::Requirement
110
- none: false
111
162
  requirements:
112
- - - ! '>'
163
+ - - ! '>='
113
164
  - !ruby/object:Gem::Version
114
- version: 1.3.1
165
+ version: '0'
115
166
  requirements: []
116
167
  rubyforge_project:
117
- rubygems_version: 1.8.8
168
+ rubygems_version: 2.0.3
118
169
  signing_key:
119
- specification_version: 3
120
- summary: Read and parse Lotus Notes calendars
121
- test_files: []
170
+ specification_version: 4
171
+ summary: Library to fetch and parse events from a Lotus Notes calendar.
172
+ test_files:
173
+ - test/helper.rb
174
+ - test/test_calendar.rb
175
+ - test/test_event.rb
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm 1.9.2@lotus_notes_calendar --create
@@ -1,22 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- git (1.2.5)
5
- jeweler (1.6.4)
6
- bundler (~> 1.0)
7
- git (>= 1.2.5)
8
- rake
9
- nokogiri (1.5.0)
10
- rake (0.9.2)
11
- rcov (0.9.10)
12
- shoulda (2.11.3)
13
-
14
- PLATFORMS
15
- ruby
16
-
17
- DEPENDENCIES
18
- bundler (~> 1.0.0)
19
- jeweler (~> 1.6.0)
20
- nokogiri
21
- rcov
22
- shoulda
@@ -1,19 +0,0 @@
1
- = lotus_notes_calendar
2
-
3
- Description goes here.
4
-
5
- == Contributing to lotus_notes_calendar
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
- * Fork the project
10
- * Start a feature/bugfix branch
11
- * Commit and push until you are happy with your contribution
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2011 David Radcliffe. See LICENSE.txt for
18
- further details.
19
-
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.1.pre
@@ -1,13 +0,0 @@
1
- require 'helper'
2
-
3
- class TestLotusNotesCalendar < Test::Unit::TestCase
4
-
5
- should "get current events" do
6
- calendar = LotusNotesCalendar::Calendar.new("https://harmony.mcsc.k12.in.us/msstudent.nsf/school+calendar")
7
- results = calendar.where
8
- assert_equal 26, results.count
9
- assert_equal "7th Gr. First Football Practice - 9-11am", results[0].text
10
- assert_equal "Monday, Aug 1", results[0].at.strftime('%A, %b %e')
11
- end
12
-
13
- end