rake-rubygems 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,12 @@
1
+ /* Hide controls */
2
+
3
+ body {
4
+ color: #000000;
5
+ background-color: #ffffff;
6
+ }
7
+
8
+ /* Hide controls */
9
+
10
+ div.filters {
11
+ display: none;
12
+ }
@@ -0,0 +1,42 @@
1
+ function toggleCode( id ) {
2
+ if ( document.getElementById ) {
3
+ elem = document.getElementById( id );
4
+ } else if ( document.all ) {
5
+ elem = eval( "document.all." + id );
6
+ } else {
7
+ return false;
8
+ }
9
+
10
+ elemStyle = elem.style;
11
+
12
+ if ( elemStyle.display != "block" ) {
13
+ elemStyle.display = "block";
14
+ } else {
15
+ elemStyle.display = "none";
16
+ }
17
+
18
+ return true;
19
+ }
20
+
21
+ function restripe() {
22
+ i = 0;
23
+ $('table#report_table tbody tr').each(function(){
24
+ if (this.style.display != "none") {
25
+ i += 1;
26
+ classes = this.className.split(" ");
27
+ if ($.inArray("even",classes) != -1) {
28
+ classes.splice($.inArray("even",classes),1);
29
+ } else if ($.inArray("odd",classes) != -1) {
30
+ classes.splice($.inArray("odd",classes),1);
31
+ }
32
+ if (i % 2 === 0) {
33
+ this.className = classes.join(" ") + " odd";
34
+ } else {
35
+ this.className = classes.join(" ") + " even";
36
+ }
37
+ }
38
+ });
39
+ }
40
+
41
+ // Fix IE's lack of support for indexOf (!)
42
+ if (!Array.indexOf) { Array.prototype.indexOf = function(obj){ for(var i=0; i<this.length; i++){ if(this[i]==obj){return i;} } return -1; }}
@@ -0,0 +1,270 @@
1
+ /* @group General */
2
+
3
+ body {
4
+ font-family: Verdana, Helvetica, Arial, Sans-Serif;
5
+ font-size: 12px;
6
+ color: #4C4C4C;
7
+ background-color: #F4F2ED;
8
+ padding: 1em;
9
+ }
10
+
11
+ a:link {
12
+ color: #191919;
13
+ }
14
+
15
+ a:visited {
16
+ color: #191919;
17
+ }
18
+
19
+ pre, code {
20
+ color: #000000;
21
+ font-family: "Bitstream Vera Sans Mono","Monaco","Courier New",monospace;
22
+ font-size: 95%;
23
+ line-height: 1.3em;
24
+ margin-top: 0;
25
+ margin-bottom: 0;
26
+ padding: 0;
27
+ word-wrap: break-word;
28
+ }
29
+
30
+ h1, h2, h3, h4, h5, h6 {
31
+ margin: 0em 0em 1em 0em;
32
+ color: #666666;
33
+ }
34
+
35
+ h1 {
36
+ display: block;
37
+ font-size: 2em;
38
+ letter-spacing: -1px;
39
+ }
40
+
41
+ h2 {
42
+ margin-top: -1em;
43
+ }
44
+
45
+ fieldset {
46
+ display: inline;
47
+ border: 0px;
48
+ padding: 0px;
49
+ margin-right: 1em;
50
+ }
51
+
52
+ div.filters {
53
+ margin-bottom: 1em;
54
+ }
55
+
56
+ .hidden {
57
+ display: none;
58
+ }
59
+
60
+ /* @end */
61
+
62
+ /* @group Cross-References */
63
+
64
+ span.cross-ref-title {
65
+ font-size: 140%;
66
+ }
67
+
68
+ span.cross-ref a {
69
+ text-decoration: none;
70
+ }
71
+
72
+ span.cross-ref {
73
+ background-color:#f3f7fa;
74
+ border: 1px dashed #333;
75
+ margin: 1em;
76
+ padding: 0.5em;
77
+ overflow: hidden;
78
+ }
79
+
80
+ a.crossref-toggle {
81
+ text-decoration: none;
82
+ }
83
+
84
+ /* @end */
85
+
86
+ /* @group Report Table */
87
+
88
+ div.report_table_wrapper {
89
+ min-width: 900px;
90
+ }
91
+
92
+ table.report {
93
+ border-collapse: collapse;
94
+ border: 1px solid #666666;
95
+ width: 100%;
96
+ margin-bottom: 1em;
97
+ }
98
+
99
+ table.report tr {
100
+ line-height: 1.75em;
101
+ }
102
+
103
+ table.report th {
104
+ background: #666666;
105
+ color: #ffffff;
106
+ text-align: right;
107
+ text-transform: uppercase;
108
+ font-size: .8em;
109
+ font-weight: bold;
110
+ padding: 0em .5em;
111
+ border: 1px solid #666666;
112
+ }
113
+
114
+ table.report tfoot tr {
115
+ background: #dddddd;
116
+ font-weight: bold;
117
+ padding: .5em;
118
+ border: 1px solid #666666;
119
+ }
120
+
121
+ th.left_align, td.left_align {
122
+ text-align: left !important;
123
+ }
124
+
125
+ th.right_align, td.right_align {
126
+ text-align: right;
127
+ padding-right: 2em !important;
128
+ }
129
+
130
+ table.report th.header:hover {
131
+ cursor: pointer;
132
+ text-decoration: underline;
133
+ }
134
+
135
+ table.report th.headerSortUp:after{
136
+ content: "\25BC";
137
+ margin-left: 1em;
138
+ }
139
+
140
+ table.report th.headerSortDown:after {
141
+ content: "\25B2";
142
+ margin-left: 1em;
143
+ }
144
+
145
+ table.report tr.summary_row {
146
+ background: #cccccc;
147
+ border: 1px solid #cccccc;
148
+ }
149
+
150
+ table.report tr.summary_row td {
151
+ padding-left: .2em !important;
152
+ color: #333333;
153
+ font-weight: bold;
154
+ }
155
+
156
+ table.report td {
157
+ padding: .2em .5em .2em .5em;
158
+ }
159
+
160
+ table.report td a {
161
+ text-decoration: none;
162
+ }
163
+
164
+ table.report tbody tr:hover {
165
+ background: #cccccc !important;
166
+ }
167
+
168
+ table.report tr.summary_row td {
169
+ border-bottom: 1px solid #aaaaaa;
170
+ }
171
+
172
+ table.report tr {
173
+ background-color: #eeeeee;
174
+ }
175
+
176
+ table.report tr.odd {
177
+ background-color: #dddddd;
178
+ }
179
+
180
+ /* @end */
181
+
182
+ /* @group Percentage Graphs */
183
+
184
+ div.percent_graph_legend {
185
+ width: 5.5em;
186
+ float: left;
187
+ margin: .5em 1em .5em 0em;
188
+ height: 1em;
189
+ line-height: 1em;
190
+ }
191
+
192
+ div.percent_graph {
193
+ height: 1em;
194
+ border: #333333 1px solid;
195
+ empty-cells: show;
196
+ padding: 0px;
197
+ border-collapse: collapse;
198
+ width: 100px !important;
199
+ float: left;
200
+ margin: .5em 1em .5em 0em;
201
+ }
202
+
203
+ div.percent_graph div {
204
+ float: left;
205
+ height: 1em;
206
+ padding: 0px !important;
207
+ }
208
+
209
+ div.percent_graph div.covered {
210
+ background: #649632;
211
+ }
212
+
213
+ div.percent_graph div.uncovered {
214
+ background: #a92730;
215
+ }
216
+
217
+ div.percent_graph div.NA {
218
+ background: #eaeaea;
219
+ }
220
+
221
+ /* @end */
222
+
223
+ /* @group Details page */
224
+
225
+ table.details {
226
+ margin-top: 1em;
227
+ border-collapse: collapse;
228
+ width: 100%;
229
+ border: 1px solid #666666;
230
+ }
231
+
232
+ table.details tr {
233
+ line-height: 1.75em;
234
+ }
235
+
236
+ table.details td {
237
+ padding: .25em;
238
+ }
239
+
240
+ span.inferred, span.inferred1, span.marked, span.marked1, span.uncovered, span.uncovered1 {
241
+ display: block;
242
+ padding: .25em;
243
+ }
244
+
245
+ tr.inferred td, span.inferred {
246
+ background-color: #e0dedb;
247
+ }
248
+
249
+ tr.inferred1 td, span.inferred1 {
250
+ background-color: #e0dedb;
251
+ }
252
+
253
+ tr.marked td, span.marked, span.marked1 {
254
+ background-color: #bed2be;
255
+ }
256
+
257
+ tr.uncovered td, span.uncovered {
258
+ background-color: #ce8b8c;
259
+ }
260
+
261
+ tr.uncovered1 td, span.uncovered1 {
262
+ background-color: #ce8b8c;
263
+ }
264
+
265
+ div.key {
266
+ border: 1px solid #666666;
267
+ margin: 1em 0em;
268
+ }
269
+
270
+ /* @end */
@@ -0,0 +1,109 @@
1
+ require 'rake'
2
+ require 'rake/tasklib'
3
+
4
+
5
+ module Gem::Commands
6
+ autoload "PushCommand", "rubygems/commands/push_command"
7
+ autoload "InstallCommand", "rubygems/commands/install_command"
8
+ autoload "UninstallCommand", "rubygems/commands/uninstall_command"
9
+ end
10
+
11
+ module Rake::Gemcutter
12
+ class Tasks < ::Rake::TaskLib
13
+ def initialize(gem_spec)
14
+ @gem_spec = gem_spec
15
+ setup_fields
16
+ yield self if block_given?
17
+ finalize_fields
18
+ define
19
+ end
20
+
21
+ def setup_fields
22
+ @gem_path = nil
23
+ @package_dir = "pkg"
24
+ end
25
+ attr_accessor :gem_path, :package_dir
26
+
27
+ def finalize_fields
28
+ if @gem_name.nil?
29
+ @gem_name = @gem_spec.full_name
30
+ end
31
+
32
+ if @gem_path.nil? and not @package_dir.nil?
33
+ @gem_path = File::join(@package_dir, @gem_spec.file_name)
34
+ end
35
+ end
36
+
37
+ module CommandTweaks
38
+ def setup_args(args = nil)
39
+ args ||= []
40
+ handle_options(args)
41
+ end
42
+
43
+ def gem_list=(list)
44
+ @gems = list
45
+ end
46
+
47
+ def get_all_gem_names
48
+ return @gems if defined?(@gems)
49
+ super
50
+ end
51
+
52
+ def get_one_gem_name
53
+ return @gems.first if defined?(@gems)
54
+ super
55
+ end
56
+ end
57
+
58
+ def get_command(klass, args=nil)
59
+ cmd = klass.new
60
+ cmd.extend(CommandTweaks)
61
+ cmd.setup_args(args)
62
+ cmd
63
+ end
64
+
65
+ def define
66
+ namespace :gem do
67
+ desc "Uninstall the gem"
68
+ task :uninstall do |t|
69
+ when_writing("Uninstalling #{@gem_name}") do
70
+ uninstall = get_command Gem::Commands::UninstallCommand
71
+ uninstall.gem_list = [@gem_path]
72
+ uninstall.execute
73
+ end
74
+ end
75
+
76
+ desc "Install the gem locally"
77
+ task :install => [@gem_path] do |t|
78
+ when_writing("Installing #{@gem_path}") do
79
+ install = get_command Gem::Commands::InstallCommand
80
+ install.get_list = [@gem_path]
81
+ install.execute
82
+ end
83
+ end
84
+
85
+ desc "Force a reinstall of the gem"
86
+ task :reinstall => [:uninstall, :install]
87
+
88
+ task :dependencies_available do
89
+ checker = Gem::SpecFetcher.new
90
+ @gem_spec.runtime_dependencies.each do |dep|
91
+ fulfilling = checker.fetch(dep,false,false,false)
92
+ if fulfilling.empty?
93
+ fail "Dependency #{dep} is unfulfilled remotely"
94
+ else
95
+ puts "Remotely fulfilled: #{dep}"
96
+ end
97
+ end
98
+ end
99
+
100
+ desc 'Push a gem up to Gemcutter'
101
+ task :push => [:dependencies_available] do
102
+ push = get_command(Gem::Commands::PushCommand)
103
+ push.gem_list = [@gem_path]
104
+ push.execute
105
+ end
106
+ end
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,48 @@
1
+ require 'rake/rubygems'
2
+ require 'rubygems/gemcutter_utilities'
3
+ require 'rubygems/user_interaction'
4
+
5
+ $said = []
6
+
7
+ module Gem::UserInteraction
8
+ def say(string)
9
+ $said << string
10
+ end
11
+ end
12
+
13
+ module Gem::GemcutterUtilities
14
+ FakeRequest = Struct.new(:body)
15
+
16
+ def rubygems_api_request(*args)
17
+ return FakeRequest.new("Fake Request! Ha!")
18
+ end
19
+
20
+ def with_response(resp)
21
+ end
22
+ end
23
+
24
+ describe Rake::Gemcutter::Tasks do
25
+ before do
26
+ @spec = Gem::Specification.new
27
+ @tasks = Rake::Gemcutter::Tasks.new(@spec)
28
+ end
29
+ it "should define gem:push" do
30
+ Rake::Task['gem:push'].should_not be_nil
31
+ end
32
+
33
+ it "should successfully push the gem" do
34
+ Rake::Task['gem:push'].execute.should be_true
35
+ end
36
+
37
+ it "should check for gem requirements" do
38
+ @spec.add_dependency("rspec")
39
+ Rake::Task['gem:dependencies_available'].execute.should be_true
40
+ end
41
+
42
+ it "should fail if gem requirements are missing" do
43
+ @spec.add_dependency("True Love")
44
+ expect do
45
+ Rake::Task['gem:dependencies_available'].execute
46
+ end.to raise_error
47
+ end
48
+ end