calfilter 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ doc
2
+ pkg
3
+ .bundle
@@ -0,0 +1 @@
1
+ 1.9.3-p392
@@ -0,0 +1,6 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ notifications:
5
+ recipients:
6
+ - glv@vanderburg.org
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "http://rubygems.org"
2
+ gemspec
@@ -0,0 +1,30 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ calfilter (1.2.1)
5
+ icalendar
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ diff-lcs (1.1.2)
11
+ icalendar (1.1.6)
12
+ mocha (0.9.12)
13
+ rake (0.9.2)
14
+ rspec (2.6.0)
15
+ rspec-core (~> 2.6.0)
16
+ rspec-expectations (~> 2.6.0)
17
+ rspec-mocks (~> 2.6.0)
18
+ rspec-core (2.6.4)
19
+ rspec-expectations (2.6.0)
20
+ diff-lcs (~> 1.1.2)
21
+ rspec-mocks (2.6.0)
22
+
23
+ PLATFORMS
24
+ ruby
25
+
26
+ DEPENDENCIES
27
+ calfilter!
28
+ mocha
29
+ rake
30
+ rspec
@@ -1,3 +1,11 @@
1
+ === 1.2.1
2
+
3
+ * Works under Ruby 1.9
4
+
5
+ === 1.2.0
6
+
7
+ * Added source method to Calendar objects
8
+
1
9
  === 1.1.4 / 2008-05-05
2
10
 
3
11
  * Documentation!
File without changes
data/Rakefile CHANGED
@@ -1,24 +1,8 @@
1
- # -*- ruby -*-
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
2
3
 
3
- require 'rubygems'
4
- require 'hoe'
5
- require './lib/calfilter.rb'
4
+ require 'rspec/core/rake_task'
5
+ desc "Run all examples"
6
+ RSpec::Core::RakeTask.new(:spec)
6
7
 
7
- class Hoe
8
- def extra_deps
9
- @extra_deps.reject do |x|
10
- Array(x).first == 'hoe'
11
- end
12
- end
13
- end
14
-
15
- # Class structure isn't complex enough to make diagrams worthwhile.
16
- ENV['NODOT'] = "true"
17
-
18
- Hoe.new('calfilter', CalFilter::VERSION) do |p|
19
- p.rubyforge_name = 'thinkrelevance'
20
- p.developer('Glenn Vanderburg', 'glenn@thinkrelevance.com')
21
- p.extra_deps = %w{icalendar}
22
- end
23
-
24
- # vim: syntax=Ruby
8
+ task :default => :spec
@@ -0,0 +1,35 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "calfilter/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "calfilter"
7
+ s.version = CalFilter::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Glenn Vanderburg"]
10
+ s.email = ["glv@vanderburg.org"]
11
+ s.homepage = "http://github.com/glv/calfilter"
12
+ s.summary = %q{Filter icalendar files or streams}
13
+ s.description = %q{calfilter is a small library to assist in writing filtering
14
+ programs for icalendar files or streams.}
15
+
16
+ s.rubyforge_project = "calfilter"
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+ s.require_paths = ["lib"]
22
+
23
+ # s.required_ruby_version = '>= 1.9.2'
24
+
25
+ add_runtime_dependency = if s.respond_to?(:specification_version) && Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
+ :add_runtime_dependency
27
+ else
28
+ :add_dependency
29
+ end
30
+ s.send(add_runtime_dependency, 'icalendar')
31
+
32
+ s.add_development_dependency 'mocha'
33
+ s.add_development_dependency 'rake'
34
+ s.add_development_dependency 'rspec'
35
+ end
data/example.rb CHANGED
@@ -8,7 +8,7 @@ gem 'calfilter'
8
8
  require 'calfilter'
9
9
  require 'calfilter/cgi'
10
10
 
11
- filter_calendars(CalFilter::CGI.query_string}) do |cal|
11
+ filter_calendars(CalFilter::CGI.query_string) do |cal|
12
12
  cal.keep(:events) # drop todos, journals, etc.
13
13
 
14
14
  cal.filter_events do |evt|
@@ -4,7 +4,6 @@ $:.unshift(File.dirname(__FILE__))
4
4
  %w{datetime icalendar time}.each{|l| require "calfilter/#{l}_extensions"}
5
5
 
6
6
  module CalFilter
7
- VERSION = '1.2.0'
8
7
 
9
8
  # The output stream for filtered icalendar output.
10
9
  # If this is not nil, filter_calendars will automatically
@@ -25,8 +25,16 @@ module CalFilter
25
25
  CGI.new
26
26
  end
27
27
 
28
+ def cgi_constant_defined?
29
+ if RUBY_VERSION < "1.9"
30
+ CalFilter.const_defined?('CGI')
31
+ else
32
+ CalFilter.const_defined?('CGI', false)
33
+ end
34
+ end
35
+
28
36
  def set_cgi_constant
29
- CalFilter.const_set('CGI', create_cgi_instance) unless CalFilter.const_defined?('CGI')
37
+ CalFilter.const_set('CGI', create_cgi_instance) unless cgi_constant_defined?
30
38
  end
31
39
 
32
40
  def finish
@@ -0,0 +1,3 @@
1
+ module CalFilter
2
+ VERSION = "1.2.1"
3
+ end
@@ -1,8 +1,4 @@
1
- require 'rubygems'
2
- require 'test/spec'
3
- require 'mocha'
4
-
5
- require 'calfilter'
1
+ require File.dirname(__FILE__) + '/../spec_helper'
6
2
 
7
3
  def at_exit(&block)
8
4
  $at_exit_block = block
@@ -15,12 +11,12 @@ describe "calfilter cgi scripts" do
15
11
  end
16
12
 
17
13
  it "should initialize a CGIWrapper object" do
18
- assert_not_nil CalFilter::CGIWrapper
14
+ CalFilter::CGIWrapper.should_not be_nil
19
15
  end
20
16
 
21
17
  it "should set CalFilter's output stream" do
22
- assert_not_nil CalFilter::CGIWRAPPER.output_stream
23
- assert_equal CalFilter::CGIWRAPPER.output_stream, CalFilter.output_stream
18
+ CalFilter::CGIWRAPPER.output_stream.should_not be_nil
19
+ CalFilter.output_stream.should == CalFilter::CGIWRAPPER.output_stream
24
20
  end
25
21
 
26
22
  it "should finish the CGI on process exit" do
@@ -1,8 +1,4 @@
1
- require 'rubygems'
2
- require 'test/spec'
3
- require 'mocha'
4
-
5
- require 'calfilter'
1
+ require File.dirname(__FILE__) + '/../spec_helper'
6
2
 
7
3
  describe "filtering calendars" do
8
4
  it "should fetch urls and parse them" do
@@ -23,19 +19,19 @@ describe "filtering calendars" do
23
19
  end
24
20
 
25
21
  it "should pass things straight through" do
26
- expected_cals = [1, 2, 3]
22
+ expected_cals = %w{1 2 3}
27
23
  actual_cals = filter_calendars(expected_cals.dup)
28
- assert_equal expected_cals.size, actual_cals.size
24
+ actual_cals.size.should == expected_cals.size
29
25
  end
30
26
 
31
27
  it "should delete a calendar when told" do
32
- cals = filter_calendars([1, 2, 3]){|cal| cal.remove if cal.__delegate__ == 2}
33
- assert_equal [1, 3], cals
28
+ cals = filter_calendars(%w{1 2 3}){|cal| cal.remove if cal.__delegate__ == "2"}
29
+ cals.should == %w{1 3}
34
30
  end
35
31
 
36
32
  it "should keep a calendar when told" do
37
- cals = filter_calendars([1, 2, 3]){|cal| cal.keep if cal.__delegate__ == 2}
38
- assert_equal [2], cals
33
+ cals = filter_calendars(%w{1 2 3}){|cal| cal.keep if cal.__delegate__ == "2"}
34
+ cals.should == %w{2}
39
35
  end
40
36
 
41
37
  it "should delete parts of a calendar when told" do
@@ -55,26 +51,24 @@ describe "filtering calendars" do
55
51
  end
56
52
 
57
53
  it "should complain if we both keep and remove a calendar" do
58
- assert_raise(CalFilter::FilterError) do
59
- cals = filter_calendars([1]){|cal| cal.keep; cal.remove}
60
- end
54
+ expect{filter_calendars(%w{1}){|cal| cal.keep; cal.remove}}.to raise_error(CalFilter::FilterError)
61
55
  end
62
56
 
63
57
  it "should complain if we keep one calendar and remove another" do
64
- assert_raises(CalFilter::FilterError) do
65
- cals = filter_calendars([1, 2, 3]) do |cal|
58
+ expect {
59
+ cals = filter_calendars(%w{1 2 3}) do |cal|
66
60
  case cal.__delegate__
67
- when 1: cal.keep;
68
- when 2: cal.remove;
61
+ when "1" then cal.keep;
62
+ when "2" then cal.remove;
69
63
  end
70
64
  end
71
- end
65
+ }.to raise_error(CalFilter::FilterError)
72
66
  end
73
67
 
74
68
  it "should delegate unknown methods to the Calendar objects" do
75
69
  results = []
76
- cals = filter_calendars([0, 1]){|cal| results << cal.zero?}
77
- assert_equal [true, false], results
70
+ cals = filter_calendars(["a", "aa"]){|cal| results << (cal.size == 1)}
71
+ results.should == [true, false]
78
72
  end
79
73
 
80
74
  end
@@ -98,9 +92,10 @@ describe "filtering resources" do
98
92
  end
99
93
  end
100
94
 
101
- xit "should leave resources alone if no block specified" do
95
+ it "should leave resources alone if no block specified" do
96
+ events = @cal.events
102
97
  filter_calendars([@cal]) do |cal|
103
- cal.__delegate__.expects(:events).returns(@cal.events)
98
+ cal.__delegate__.expects(:events).returns(events)
104
99
  cal.filter_events
105
100
  end
106
101
  end
@@ -0,0 +1,19 @@
1
+ require 'rspec/core'
2
+ require 'mocha'
3
+
4
+ require 'calfilter'
5
+
6
+ Dir['./spec/support/**/*.rb'].map {|f| require f}
7
+
8
+ def in_editor?
9
+ ENV.has_key?('TM_MODE') || ENV.has_key?('EMACS') || ENV.has_key?('VIM')
10
+ end
11
+
12
+ RSpec.configure do |c|
13
+ c.color_enabled = !in_editor?
14
+ c.filter_run :focus => true
15
+ c.mock_with :mocha
16
+ c.run_all_when_everything_filtered = true
17
+ c.add_formatter :progress
18
+ #c.add_formatter :documentation, 'rspec.txt'
19
+ end
metadata CHANGED
@@ -1,76 +1,99 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: calfilter
3
- version: !ruby/object:Gem::Version
4
- version: 1.2.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.1
5
+ prerelease:
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - Glenn Vanderburg
8
9
  autorequire:
9
10
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDRDCCAiygAwIBAgIBADANBgkqhkiG9w0BAQUFADBIMQ4wDAY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BhDOVmPr4KHTTK4VwdxFtAKu2QK/NfAAl
30
- zrNa6ECLh1VS/pV78rYbAO1ZXsg3l7bY
31
- -----END CERTIFICATE-----
32
-
33
- date: 2008-08-06 00:00:00 -05:00
34
- default_executable:
35
- dependencies:
36
- - !ruby/object:Gem::Dependency
11
+ cert_chain: []
12
+ date: 2013-05-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
37
15
  name: icalendar
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
38
22
  type: :runtime
39
- version_requirement:
40
- version_requirements: !ruby/object:Gem::Requirement
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: "0"
45
- version:
46
- - !ruby/object:Gem::Dependency
47
- name: hoe
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: mocha
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
48
38
  type: :development
49
- version_requirement:
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: 1.7.0
55
- version:
56
- description: "calfilter is a small library to assist in writing filtering programs for icalendar files or streams. It can be used for various purposes, including: * removing items from icalendar feeds that are not interesting to you * removing private information from your own calendar before publishing it to others * reformatting a provided calendar to highlight particular information A calfilter script does most of its work using the filter_calendars[link:files/lib/calfilter_rb.html] method."
57
- email:
58
- - glenn@thinkrelevance.com
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description: ! "calfilter is a small library to assist in writing filtering\n programs
79
+ for icalendar files or streams."
80
+ email:
81
+ - glv@vanderburg.org
59
82
  executables: []
60
-
61
83
  extensions: []
62
-
63
- extra_rdoc_files:
64
- - History.txt
65
- - Manifest.txt
66
- - README.txt
67
- - ToDo.txt
68
- files:
84
+ extra_rdoc_files: []
85
+ files:
86
+ - .gitignore
87
+ - .ruby-version
88
+ - .travis.yml
89
+ - Gemfile
90
+ - Gemfile.lock
69
91
  - History.txt
70
92
  - Manifest.txt
71
- - README.txt
93
+ - README.rdoc
72
94
  - Rakefile
73
95
  - ToDo.txt
96
+ - calfilter.gemspec
74
97
  - example.rb
75
98
  - lib/calfilter.rb
76
99
  - lib/calfilter/cgi.rb
@@ -78,35 +101,41 @@ files:
78
101
  - lib/calfilter/icalendar_extensions.rb
79
102
  - lib/calfilter/time_extensions.rb
80
103
  - lib/calfilter/tripit.rb
81
- - test/test_calfilter.rb
82
- - test/test_calfilter_cgi.rb
83
- has_rdoc: true
84
- homepage: http://opensource.thinkrelevance.com/wiki/calfilter
104
+ - lib/calfilter/version.rb
105
+ - spec/calfilter/calfilter_cgi_spec.rb
106
+ - spec/calfilter/calfilter_spec.rb
107
+ - spec/spec_helper.rb
108
+ homepage: http://github.com/glv/calfilter
109
+ licenses: []
85
110
  post_install_message:
86
- rdoc_options:
87
- - --main
88
- - README.txt
89
- require_paths:
111
+ rdoc_options: []
112
+ require_paths:
90
113
  - lib
91
- required_ruby_version: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: "0"
96
- version:
97
- required_rubygems_version: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: "0"
102
- version:
114
+ required_ruby_version: !ruby/object:Gem::Requirement
115
+ none: false
116
+ requirements:
117
+ - - ! '>='
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ segments:
121
+ - 0
122
+ hash: 3909444746793208583
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ! '>='
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ segments:
130
+ - 0
131
+ hash: 3909444746793208583
103
132
  requirements: []
104
-
105
- rubyforge_project: thinkrelevance
106
- rubygems_version: 1.2.0
133
+ rubyforge_project: calfilter
134
+ rubygems_version: 1.8.23
107
135
  signing_key:
108
- specification_version: 2
109
- summary: calfilter is a small library to assist in writing filtering programs for icalendar files or streams
110
- test_files:
111
- - test/test_calfilter.rb
112
- - test/test_calfilter_cgi.rb
136
+ specification_version: 3
137
+ summary: Filter icalendar files or streams
138
+ test_files:
139
+ - spec/calfilter/calfilter_cgi_spec.rb
140
+ - spec/calfilter/calfilter_spec.rb
141
+ - spec/spec_helper.rb
data.tar.gz.sig DELETED
@@ -1,4 +0,0 @@
1
- 5�\��;92K0
2
- q��p ��񞟦Y�+t�YL�!�w�yf���徳�fŸX��*�$$��q�B�f��%t��8�!�x�'��e��31�[���f��1�q�[�zC-(\���
3
- �:
4
- �>#Oe
metadata.gz.sig DELETED
Binary file