tracker-ical 0.0.1

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.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Niels Meersschaert
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,25 @@
1
+ = tracker-ical
2
+
3
+ Pivotal iterations and releases output as iCal feed
4
+
5
+ == Usage
6
+ TrackerIcal.token('myusername@email.com', 'secretpassword') # Automatically fetch API Token
7
+ TrackerIcal.token = 'jkfduisj97823974j2kl24899234' # Manually set API Token
8
+
9
+ TrackerIcal.create_calendar_for_project_id(project_id) #Pass the projectID of the Pivotal Project to generate iCal string for
10
+
11
+ TrackerIcal.create_ics_file_for_project_id(filepath,project_id) #Generates an ics file at the specified filepath for the Pivotal project with project_id
12
+
13
+ == Note on Patches/Pull Requests
14
+
15
+ * Fork the project.
16
+ * Make your feature addition or bug fix.
17
+ * Add tests for it. This is important so I don't break it in a
18
+ future version unintentionally.
19
+ * Commit, do not mess with rakefile, version, or history.
20
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
21
+ * Send me a pull request. Bonus points for topic branches.
22
+
23
+ == Copyright
24
+
25
+ Copyright (c) 2010 Niels Meersschaert. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,47 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "tracker-ical"
8
+ gem.summary = %Q{Pivotal Tracker meets iCal}
9
+ gem.description = %Q{Get your iterations and releases in iCalendar format}
10
+ gem.email = "niels@meerwerks.com"
11
+ gem.homepage = "http://github.com/nielsm/tracker-ical"
12
+ gem.authors = ["Niels Meersschaert"]
13
+ gem.add_development_dependency "rspec", ">= 1.2.9"
14
+ gem.add_dependency('icalendar', '>= 1.1.5')
15
+ gem.add_dependency('pivotal-tracker', '>=0.2.0')
16
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
+ end
18
+ Jeweler::GemcutterTasks.new
19
+ rescue LoadError
20
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
21
+ end
22
+
23
+ require 'spec/rake/spectask'
24
+ Spec::Rake::SpecTask.new(:spec) do |spec|
25
+ spec.libs << 'lib' << 'spec'
26
+ spec.spec_files = FileList['spec/**/*_spec.rb']
27
+ end
28
+
29
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
30
+ spec.libs << 'lib' << 'spec'
31
+ spec.pattern = 'spec/**/*_spec.rb'
32
+ spec.rcov = true
33
+ end
34
+
35
+ task :spec => :check_dependencies
36
+
37
+ task :default => :spec
38
+
39
+ require 'rake/rdoctask'
40
+ Rake::RDocTask.new do |rdoc|
41
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
42
+
43
+ rdoc.rdoc_dir = 'rdoc'
44
+ rdoc.title = "tracker-ical #{version}"
45
+ rdoc.rdoc_files.include('README*')
46
+ rdoc.rdoc_files.include('lib/**/*.rb')
47
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,61 @@
1
+ require 'icalendar'
2
+ require 'pivotal-tracker'
3
+
4
+ class TrackerIcal
5
+
6
+ def self.token=(token)
7
+ PivotalTracker::Client.token=token
8
+ end
9
+
10
+ def self.token(username,password)
11
+ PivotalTracker::Client.token(username,password)
12
+ end
13
+ #Returns an ics formatted string of all the milestones in the project
14
+ def self.create_calendar_for_project_id(project_id)
15
+ project = PivotalTracker::Project.find(project_id)
16
+ releases = project.stories.all(:story_type => 'release')
17
+ calendar = Icalendar::Calendar.new
18
+ iterations = project.iterations.all
19
+ iterations.each do |iter|
20
+ iteration_event(project,calendar,iter)
21
+ # Retrieve the due_on value for each milestone & stip the time component
22
+ #Retrieve the title of the milestone & set it to the summary
23
+ #Retrieve the goals of the milestone & set it to the description
24
+ end
25
+ releases.each do |release|
26
+ release_event(project,calendar,release)
27
+ end
28
+ calendar.publish
29
+ return calendar.to_ical
30
+ end
31
+
32
+ def self.create_ics_file_for_project_id(filepath,project_id)
33
+ file = File.new(filepath,"w+")
34
+ file.write(self.create_calendar_for_project_id(project_id))
35
+ file.close
36
+ end
37
+
38
+ private
39
+
40
+ def self.release_event(project,calendar,release)
41
+ puts("Release events not yet implemented")
42
+ end
43
+
44
+ def self.iteration_event(project,calendar,iter)
45
+ story_hash={}
46
+ iter.stories.each do |story|
47
+ story_hash[story.name] = story.current_state
48
+ end
49
+ desc = []
50
+ story_hash.keys.each do |key|
51
+ desc.push("#{key}: #{story_hash[key]}")
52
+ end
53
+ calendar.event do
54
+ dtstart Date.new(iter.start.year,iter.start.month,iter.start.day)
55
+ dtend Date.new(iter.finish.year,iter.finish.month,iter.finish.day)
56
+ summary "#{project.name}: Iteration #{iter.number}"
57
+ description desc.join("\n")
58
+ end
59
+ end
60
+
61
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,9 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'tracker-ical'
4
+ require 'spec'
5
+ require 'spec/autorun'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "TrackerIcal" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
@@ -0,0 +1,61 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{tracker-ical}
8
+ s.version = "0.0.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Niels Meersschaert"]
12
+ s.date = %q{2010-07-10}
13
+ s.description = %q{Get your iterations and releases in iCalendar format}
14
+ s.email = %q{niels@meerwerks.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/tracker-ical.rb",
27
+ "spec/spec.opts",
28
+ "spec/spec_helper.rb",
29
+ "spec/tracker-ical_spec.rb",
30
+ "tracker-ical.gemspec"
31
+ ]
32
+ s.homepage = %q{http://github.com/nielsm/tracker-ical}
33
+ s.rdoc_options = ["--charset=UTF-8"]
34
+ s.require_paths = ["lib"]
35
+ s.rubygems_version = %q{1.3.7}
36
+ s.summary = %q{Pivotal Tracker meets iCal}
37
+ s.test_files = [
38
+ "spec/spec_helper.rb",
39
+ "spec/tracker-ical_spec.rb"
40
+ ]
41
+
42
+ if s.respond_to? :specification_version then
43
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
44
+ s.specification_version = 3
45
+
46
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
48
+ s.add_runtime_dependency(%q<icalendar>, [">= 1.1.5"])
49
+ s.add_runtime_dependency(%q<pivotal-tracker>, [">= 0.2.0"])
50
+ else
51
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
52
+ s.add_dependency(%q<icalendar>, [">= 1.1.5"])
53
+ s.add_dependency(%q<pivotal-tracker>, [">= 0.2.0"])
54
+ end
55
+ else
56
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
57
+ s.add_dependency(%q<icalendar>, [">= 1.1.5"])
58
+ s.add_dependency(%q<pivotal-tracker>, [">= 0.2.0"])
59
+ end
60
+ end
61
+
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tracker-ical
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Niels Meersschaert
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-07-10 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rspec
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 13
30
+ segments:
31
+ - 1
32
+ - 2
33
+ - 9
34
+ version: 1.2.9
35
+ type: :development
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: icalendar
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 25
46
+ segments:
47
+ - 1
48
+ - 1
49
+ - 5
50
+ version: 1.1.5
51
+ type: :runtime
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: pivotal-tracker
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 23
62
+ segments:
63
+ - 0
64
+ - 2
65
+ - 0
66
+ version: 0.2.0
67
+ type: :runtime
68
+ version_requirements: *id003
69
+ description: Get your iterations and releases in iCalendar format
70
+ email: niels@meerwerks.com
71
+ executables: []
72
+
73
+ extensions: []
74
+
75
+ extra_rdoc_files:
76
+ - LICENSE
77
+ - README.rdoc
78
+ files:
79
+ - .document
80
+ - .gitignore
81
+ - LICENSE
82
+ - README.rdoc
83
+ - Rakefile
84
+ - VERSION
85
+ - lib/tracker-ical.rb
86
+ - spec/spec.opts
87
+ - spec/spec_helper.rb
88
+ - spec/tracker-ical_spec.rb
89
+ - tracker-ical.gemspec
90
+ has_rdoc: true
91
+ homepage: http://github.com/nielsm/tracker-ical
92
+ licenses: []
93
+
94
+ post_install_message:
95
+ rdoc_options:
96
+ - --charset=UTF-8
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ hash: 3
105
+ segments:
106
+ - 0
107
+ version: "0"
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ none: false
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ hash: 3
114
+ segments:
115
+ - 0
116
+ version: "0"
117
+ requirements: []
118
+
119
+ rubyforge_project:
120
+ rubygems_version: 1.3.7
121
+ signing_key:
122
+ specification_version: 3
123
+ summary: Pivotal Tracker meets iCal
124
+ test_files:
125
+ - spec/spec_helper.rb
126
+ - spec/tracker-ical_spec.rb