uat_director 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
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 Ben Askins
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,42 @@
1
+ = uat_director
2
+
3
+ Adds a toolbar to your rails app that directs your clients to test stories that have been marked as 'delivered' in Pivotal Tracker.
4
+
5
+ == Installing
6
+
7
+ Add uat_director to your Gemfile:
8
+
9
+ gem 'uat_director'
10
+
11
+ Create an initializer to configure your pivotal tracker api token and project id:
12
+
13
+ UatDirector.configure do |config|
14
+ config.pivotal_tracker_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
15
+ config.pivotal_tracker_project = 123456
16
+ end
17
+
18
+ Add the UatDirector::RackApp to your middleware stack:
19
+
20
+ require 'uat_director'
21
+ config.middleware.use(UatDirector::RackApp)
22
+
23
+ Use the following helper somewhere in your application layout (we recommend at the end of the body):
24
+
25
+ = uat_director
26
+
27
+ The helper will insert a smidgeon of javascript (jquery is assumed to be available) that will add a tiny toolbar to your view.
28
+ Reload a page from your app and give it a whirl.
29
+
30
+ == Note on Patches/Pull Requests
31
+
32
+ * Fork the project.
33
+ * Make your feature addition or bug fix.
34
+ * Add tests for it. This is important so I don't break it in a
35
+ future version unintentionally.
36
+ * Commit, do not mess with rakefile, version, or history.
37
+ (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)
38
+ * Send me a pull request. Bonus points for topic branches.
39
+
40
+ == Copyright
41
+
42
+ Copyright (c) 2010 Ben Askins. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "uat_director"
8
+ gem.summary = %Q{Direct your clients to test delivered features}
9
+ gem.description = %Q{Adds a toolbar to your rails app that directs your clients to test stories that have been marked as 'delivered' in Pivotal Tracker }
10
+ gem.email = "ben.askins@gmail.com"
11
+ gem.homepage = "http://github.com/benaskins/uat_director"
12
+ gem.authors = ["Ben Askins"]
13
+ # gem is a Gem::Specificatiohttp://www.rubygems.org/read/chapter/20 n... see http://www.rubygems.org/read/chapter/20 for additional settings
14
+ gem.add_dependency("pivotal-tracker", ">= 0.1.3")
15
+ gem.add_dependency("haml", ">= 3.0.9")
16
+ gem.add_dependency("rack", ">= 1.1.0")
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
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,8 @@
1
+ module UatDirector
2
+
3
+ class Configuration
4
+ attr_accessor :pivotal_tracker_token
5
+ attr_accessor :pivotal_tracker_project
6
+ end
7
+
8
+ end
@@ -0,0 +1,37 @@
1
+ module UatDirector
2
+ module Helpers
3
+ def uat_director
4
+ <<TDSCRIPT
5
+ <script type="text/javascript">
6
+ $("body").prepend("#{toolbar_html}");
7
+ $("#uat-bar").css({width: "100%", background: "#000", "text-align": "right"});
8
+ $("#uat-bar a.go").css({color: "#fff"});
9
+ $("#uat-bar .pop-over").css({position: "absolute", right: "0px", clear: "none", "z-index": "99999999", background: "#fff", "text-align": "left"});
10
+ $("#uat-bar .hide").css({display: "none"});
11
+ $(function() {
12
+ $("#uat-bar a.go").click(function() {
13
+ $.ajax({
14
+ url: '/uat_director',
15
+ success: function(response) {
16
+ $(".pop-over").append(response);
17
+ $(".pop-over").slideDown();
18
+ }
19
+ });
20
+ });
21
+
22
+ $("#uat-bar a.close").click(function() {
23
+ $(".pop-over").slideUp(function() {
24
+ $(".pop-over ol").remove();
25
+ });
26
+ });
27
+ });
28
+ </script>
29
+ TDSCRIPT
30
+ end
31
+
32
+ def toolbar_html
33
+ "<div id='uat-bar'><a class='go' href='#'>Show me what to test</a><div class='pop-over hide'><a class='close' href='#'>close</a></div></div>"
34
+ end
35
+ end
36
+ end
37
+
@@ -0,0 +1,42 @@
1
+ require 'pathname'
2
+ require 'haml'
3
+ require 'pivotal-tracker'
4
+
5
+ module UatDirector
6
+ class RackApp
7
+ PT = PivotalTracker
8
+
9
+ def initialize(app)
10
+ @app = app
11
+ PT::Client.token = config.pivotal_tracker_token
12
+ end
13
+
14
+ def call(env)
15
+ if env["PATH_INFO"] =~ /^\/uat_director/
16
+ index
17
+ else
18
+ @app.call(env)
19
+ end
20
+ end
21
+
22
+ def index
23
+ @project = PT::Project.find(config.pivotal_tracker_project)
24
+ @stories = @project.stories.all(:current_state => "delivered")
25
+ haml "index"
26
+ end
27
+
28
+ def haml(file_name, options={})
29
+ template = (template_root + "#{file_name}.haml").read
30
+ [200, {"Content-Type" => "text/html"}, [Haml::Engine.new(template).render(self)]]
31
+ end
32
+
33
+ def template_root
34
+ Pathname.new(__FILE__).parent + "templates"
35
+ end
36
+
37
+ def config
38
+ UatDirector.configuration
39
+ end
40
+ end
41
+ end
42
+
@@ -0,0 +1,3 @@
1
+ %ol
2
+ - @stories.each do |story|
3
+ %li= story.name
@@ -0,0 +1,16 @@
1
+ require 'uat_director/configuration'
2
+ require 'uat_director/rack_app'
3
+ require 'uat_director/helpers'
4
+
5
+ ActionView::Base.send :include, UatDirector::Helpers
6
+
7
+ module UatDirector
8
+ class << self
9
+ attr_accessor :configuration
10
+
11
+ def configure
12
+ self.configuration ||= Configuration.new
13
+ yield(configuration)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,58 @@
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{uat_director}
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 = ["Ben Askins"]
12
+ s.date = %q{2010-06-07}
13
+ s.description = %q{Adds a toolbar to your rails app that directs your clients to test stories that have been marked as 'delivered' in Pivotal Tracker }
14
+ s.email = %q{ben.askins@gmail.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/uat_director.rb",
27
+ "lib/uat_director/configuration.rb",
28
+ "lib/uat_director/helpers.rb",
29
+ "lib/uat_director/rack_app.rb",
30
+ "lib/uat_director/templates/index.haml",
31
+ "uat_director.gemspec"
32
+ ]
33
+ s.homepage = %q{http://github.com/benaskins/uat_director}
34
+ s.rdoc_options = ["--charset=UTF-8"]
35
+ s.require_paths = ["lib"]
36
+ s.rubygems_version = %q{1.3.7}
37
+ s.summary = %q{Direct your clients to test delivered features}
38
+
39
+ if s.respond_to? :specification_version then
40
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
41
+ s.specification_version = 3
42
+
43
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
44
+ s.add_runtime_dependency(%q<pivotal-tracker>, [">= 0.1.3"])
45
+ s.add_runtime_dependency(%q<haml>, [">= 3.0.9"])
46
+ s.add_runtime_dependency(%q<rack>, [">= 1.1.0"])
47
+ else
48
+ s.add_dependency(%q<pivotal-tracker>, [">= 0.1.3"])
49
+ s.add_dependency(%q<haml>, [">= 3.0.9"])
50
+ s.add_dependency(%q<rack>, [">= 1.1.0"])
51
+ end
52
+ else
53
+ s.add_dependency(%q<pivotal-tracker>, [">= 0.1.3"])
54
+ s.add_dependency(%q<haml>, [">= 3.0.9"])
55
+ s.add_dependency(%q<rack>, [">= 1.1.0"])
56
+ end
57
+ end
58
+
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: uat_director
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
+ - Ben Askins
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-06-07 00:00:00 +10:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: pivotal-tracker
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 29
30
+ segments:
31
+ - 0
32
+ - 1
33
+ - 3
34
+ version: 0.1.3
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: haml
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 21
46
+ segments:
47
+ - 3
48
+ - 0
49
+ - 9
50
+ version: 3.0.9
51
+ type: :runtime
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: rack
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 19
62
+ segments:
63
+ - 1
64
+ - 1
65
+ - 0
66
+ version: 1.1.0
67
+ type: :runtime
68
+ version_requirements: *id003
69
+ description: "Adds a toolbar to your rails app that directs your clients to test stories that have been marked as 'delivered' in Pivotal Tracker "
70
+ email: ben.askins@gmail.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/uat_director.rb
86
+ - lib/uat_director/configuration.rb
87
+ - lib/uat_director/helpers.rb
88
+ - lib/uat_director/rack_app.rb
89
+ - lib/uat_director/templates/index.haml
90
+ - uat_director.gemspec
91
+ has_rdoc: true
92
+ homepage: http://github.com/benaskins/uat_director
93
+ licenses: []
94
+
95
+ post_install_message:
96
+ rdoc_options:
97
+ - --charset=UTF-8
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ hash: 3
106
+ segments:
107
+ - 0
108
+ version: "0"
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ hash: 3
115
+ segments:
116
+ - 0
117
+ version: "0"
118
+ requirements: []
119
+
120
+ rubyforge_project:
121
+ rubygems_version: 1.3.7
122
+ signing_key:
123
+ specification_version: 3
124
+ summary: Direct your clients to test delivered features
125
+ test_files: []
126
+