uat_director 0.0.1 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.rdoc +3 -3
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/uat_director/helpers.rb +1 -30
- data/lib/uat_director/javascript/uat_director.js +42 -0
- data/lib/uat_director/rack_app.rb +20 -4
- data/lib/uat_director/stylesheets/uat_director.css +76 -0
- data/lib/uat_director/templates/index.haml +4 -1
- metadata +12 -11
- data/uat_director.gemspec +0 -58
data/.gitignore
CHANGED
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= uat_director
|
1
|
+
= uat_director
|
2
2
|
|
3
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
4
|
|
@@ -15,7 +15,7 @@ Create an initializer to configure your pivotal tracker api token and project id
|
|
15
15
|
config.pivotal_tracker_project = 123456
|
16
16
|
end
|
17
17
|
|
18
|
-
Add the UatDirector::RackApp to your middleware stack:
|
18
|
+
Add the UatDirector::RackApp to your middleware stack (in your environment.rb file):
|
19
19
|
|
20
20
|
require 'uat_director'
|
21
21
|
config.middleware.use(UatDirector::RackApp)
|
@@ -28,7 +28,7 @@ The helper will insert a smidgeon of javascript (jquery is assumed to be availab
|
|
28
28
|
Reload a page from your app and give it a whirl.
|
29
29
|
|
30
30
|
== Note on Patches/Pull Requests
|
31
|
-
|
31
|
+
|
32
32
|
* Fork the project.
|
33
33
|
* Make your feature addition or bug fix.
|
34
34
|
* Add tests for it. This is important so I don't break it in a
|
data/Rakefile
CHANGED
@@ -12,8 +12,8 @@ begin
|
|
12
12
|
gem.authors = ["Ben Askins"]
|
13
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
14
|
gem.add_dependency("pivotal-tracker", ">= 0.1.3")
|
15
|
-
gem.add_dependency("haml", ">= 3.0.
|
16
|
-
gem.add_dependency("rack", ">= 1.
|
15
|
+
gem.add_dependency("haml", ">= 3.0.0")
|
16
|
+
gem.add_dependency("rack", ">= 1.0.0")
|
17
17
|
end
|
18
18
|
Jeweler::GemcutterTasks.new
|
19
19
|
rescue LoadError
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/uat_director/helpers.rb
CHANGED
@@ -1,36 +1,7 @@
|
|
1
1
|
module UatDirector
|
2
2
|
module Helpers
|
3
3
|
def uat_director
|
4
|
-
|
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>"
|
4
|
+
"<script type='text/javascript' src='http://github.com/plus2/uat_director/raw/master/lib/uat_director/javascript/uat_director.js'></script>"
|
34
5
|
end
|
35
6
|
end
|
36
7
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
(function($) {
|
2
|
+
$(function() {
|
3
|
+
var popOver;
|
4
|
+
|
5
|
+
$("body").prepend("<div id='uat-bar'><a class='go' href='#'>Show me what to test</a><div class='pop-over hide'></div></div>");
|
6
|
+
$("head").prepend("<link href='http://github.com/plus2/uat_director/raw/master/lib/uat_director/stylesheets/uat_director.css' media='screen' rel='stylesheet' type='text/css'>");
|
7
|
+
|
8
|
+
popOver = $("#uat-bar .pop-over");
|
9
|
+
|
10
|
+
$("#uat-bar a.go").toggle(function() {
|
11
|
+
$.ajax({
|
12
|
+
url: '/uat_director',
|
13
|
+
success: function(response) {
|
14
|
+
popOver.append(response);
|
15
|
+
popOver.slideDown();
|
16
|
+
}
|
17
|
+
});
|
18
|
+
},
|
19
|
+
function() {
|
20
|
+
popOver.slideUp(function() {
|
21
|
+
$(".pop-over ol").remove();
|
22
|
+
});
|
23
|
+
});
|
24
|
+
|
25
|
+
$("#uat-bar input.accept").live("change", function() {
|
26
|
+
var checkbox, storyLink, storyId;
|
27
|
+
checkbox = $(this);
|
28
|
+
storyId = checkbox.siblings(".story-id").html();
|
29
|
+
storyLink = checkbox.siblings("a");
|
30
|
+
if (this.checked) {
|
31
|
+
$.ajax({
|
32
|
+
method: "POST",
|
33
|
+
url: '/uat_director/' + storyId + '/accept',
|
34
|
+
success: function(response) {
|
35
|
+
storyLink.css("text-decoration", "line-through");
|
36
|
+
}
|
37
|
+
});
|
38
|
+
}
|
39
|
+
});
|
40
|
+
|
41
|
+
});
|
42
|
+
})(jQuery);
|
@@ -12,22 +12,38 @@ module UatDirector
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call(env)
|
15
|
-
|
15
|
+
case env["PATH_INFO"]
|
16
|
+
when /^\/uat_director$/
|
16
17
|
index
|
18
|
+
when /^\/uat_director\/(.*)\/accept/
|
19
|
+
accept $1
|
17
20
|
else
|
18
21
|
@app.call(env)
|
19
22
|
end
|
20
23
|
end
|
21
24
|
|
22
25
|
def index
|
23
|
-
@
|
24
|
-
@stories = @project.stories.all(:current_state => "delivered")
|
26
|
+
@stories = project.stories.all(:current_state => "delivered")
|
25
27
|
haml "index"
|
26
28
|
end
|
27
29
|
|
30
|
+
def accept(pivotal_story_id)
|
31
|
+
story = project.stories.find(pivotal_story_id.to_i)
|
32
|
+
story.update(:current_state => 'accepted')
|
33
|
+
render "Accepted"
|
34
|
+
end
|
35
|
+
|
36
|
+
def project
|
37
|
+
@project ||= PT::Project.find(config.pivotal_tracker_project)
|
38
|
+
end
|
39
|
+
|
28
40
|
def haml(file_name, options={})
|
29
41
|
template = (template_root + "#{file_name}.haml").read
|
30
|
-
|
42
|
+
render Haml::Engine.new(template).render(self)
|
43
|
+
end
|
44
|
+
|
45
|
+
def render(html)
|
46
|
+
[200, {"Content-Type" => "text/html"}, [html]]
|
31
47
|
end
|
32
48
|
|
33
49
|
def template_root
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#uat-bar {
|
2
|
+
width: 300px;
|
3
|
+
text-align: center;
|
4
|
+
position: absolute;
|
5
|
+
top: 0;
|
6
|
+
right: 5px;
|
7
|
+
padding: 0;
|
8
|
+
z-index: 2147483647;
|
9
|
+
}
|
10
|
+
|
11
|
+
#uat-bar a:link, #uat-bar a:visited {
|
12
|
+
color: #efefef;
|
13
|
+
text-decoration: none;
|
14
|
+
}
|
15
|
+
|
16
|
+
#uat-bar a:active, #uat-bar a:hover, #uat-bar a:focus {
|
17
|
+
color: #fff;
|
18
|
+
}
|
19
|
+
|
20
|
+
#uat-bar a.go {
|
21
|
+
position: absolute;
|
22
|
+
top: 0;
|
23
|
+
right: 5px;
|
24
|
+
font-weight: bold;
|
25
|
+
padding: .5em;
|
26
|
+
display: block;
|
27
|
+
float: right;
|
28
|
+
width: 180px;
|
29
|
+
background-color: #121212;
|
30
|
+
}
|
31
|
+
|
32
|
+
#uat-bar .pop-over {
|
33
|
+
clear: right;
|
34
|
+
background-color: #232323;
|
35
|
+
color: #efefef;
|
36
|
+
text-align: left;
|
37
|
+
padding: 37px 0 .75em 0;
|
38
|
+
|
39
|
+
-moz-border-radius-bottomright: 10px;
|
40
|
+
-webkit-border-bottom-right-radius: 10px;
|
41
|
+
-moz-border-radius-bottomleft: 10px;
|
42
|
+
-webkit-border-bottom-left-radius: 10px
|
43
|
+
}
|
44
|
+
|
45
|
+
#uat-bar .pop-over ol {
|
46
|
+
height: 450px;
|
47
|
+
overflow: auto;
|
48
|
+
list-style: none;
|
49
|
+
margin: 0 0 0;
|
50
|
+
padding: 0
|
51
|
+
}
|
52
|
+
|
53
|
+
#uat-bar .pop-over li:last-child, #uat-bar a.go {
|
54
|
+
-moz-border-radius-bottomright: 10px;
|
55
|
+
-webkit-border-bottom-right-radius: 10px;
|
56
|
+
-moz-border-radius-bottomleft: 10px;
|
57
|
+
-webkit-border-bottom-left-radius: 10px
|
58
|
+
}
|
59
|
+
|
60
|
+
#uat-bar .pop-over li {
|
61
|
+
padding: .5em;
|
62
|
+
border-top: 1px solid #333
|
63
|
+
}
|
64
|
+
|
65
|
+
#uat-bar .pop-over li:hover {
|
66
|
+
background-color: #323232;
|
67
|
+
cursor: pointer
|
68
|
+
}
|
69
|
+
|
70
|
+
#uat-bar .hide {
|
71
|
+
display: none;
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uat_director
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ben Askins
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-10 00:00:00 +10:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -42,12 +42,12 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
45
|
+
hash: 7
|
46
46
|
segments:
|
47
47
|
- 3
|
48
48
|
- 0
|
49
|
-
-
|
50
|
-
version: 3.0.
|
49
|
+
- 0
|
50
|
+
version: 3.0.0
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
53
|
- !ruby/object:Gem::Dependency
|
@@ -58,12 +58,12 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
61
|
+
hash: 23
|
62
62
|
segments:
|
63
63
|
- 1
|
64
|
-
- 1
|
65
64
|
- 0
|
66
|
-
|
65
|
+
- 0
|
66
|
+
version: 1.0.0
|
67
67
|
type: :runtime
|
68
68
|
version_requirements: *id003
|
69
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 "
|
@@ -85,9 +85,10 @@ files:
|
|
85
85
|
- lib/uat_director.rb
|
86
86
|
- lib/uat_director/configuration.rb
|
87
87
|
- lib/uat_director/helpers.rb
|
88
|
+
- lib/uat_director/javascript/uat_director.js
|
88
89
|
- lib/uat_director/rack_app.rb
|
90
|
+
- lib/uat_director/stylesheets/uat_director.css
|
89
91
|
- lib/uat_director/templates/index.haml
|
90
|
-
- uat_director.gemspec
|
91
92
|
has_rdoc: true
|
92
93
|
homepage: http://github.com/benaskins/uat_director
|
93
94
|
licenses: []
|
data/uat_director.gemspec
DELETED
@@ -1,58 +0,0 @@
|
|
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
|
-
|