integrity 0.1.8 → 0.1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +7 -0
- data/Rakefile +77 -124
- data/config/config.ru +29 -0
- data/config/config.sample.ru +6 -16
- data/config/config.sample.yml +15 -12
- data/config/config.yml +34 -0
- data/lib/integrity.rb +13 -13
- data/lib/integrity/app.rb +138 -0
- data/lib/integrity/author.rb +39 -0
- data/lib/integrity/build.rb +54 -31
- data/lib/integrity/commit.rb +71 -0
- data/lib/integrity/helpers.rb +3 -3
- data/lib/integrity/helpers/authorization.rb +2 -2
- data/lib/integrity/helpers/forms.rb +3 -3
- data/lib/integrity/helpers/pretty_output.rb +1 -1
- data/lib/integrity/helpers/rendering.rb +6 -1
- data/lib/integrity/helpers/resources.rb +9 -3
- data/lib/integrity/helpers/urls.rb +15 -13
- data/lib/integrity/installer.rb +43 -60
- data/lib/integrity/migrations.rb +31 -48
- data/lib/integrity/notifier.rb +14 -16
- data/lib/integrity/notifier/base.rb +29 -19
- data/lib/integrity/notifier/test_helpers.rb +100 -0
- data/lib/integrity/project.rb +69 -33
- data/lib/integrity/project_builder.rb +23 -14
- data/lib/integrity/scm/git.rb +15 -14
- data/lib/integrity/scm/git/uri.rb +9 -9
- data/test/acceptance/api_test.rb +97 -0
- data/test/acceptance/browse_project_builds_test.rb +65 -0
- data/test/acceptance/browse_project_test.rb +95 -0
- data/test/acceptance/build_notifications_test.rb +42 -0
- data/test/acceptance/create_project_test.rb +97 -0
- data/test/acceptance/delete_project_test.rb +53 -0
- data/test/acceptance/edit_project_test.rb +117 -0
- data/test/acceptance/error_page_test.rb +18 -0
- data/test/acceptance/helpers.rb +2 -0
- data/test/acceptance/installer_test.rb +62 -0
- data/test/acceptance/manual_build_project_test.rb +82 -0
- data/test/acceptance/notifier_test.rb +109 -0
- data/test/acceptance/project_syndication_test.rb +30 -0
- data/test/acceptance/stylesheet_test.rb +18 -0
- data/test/helpers.rb +59 -26
- data/test/helpers/acceptance.rb +19 -65
- data/test/helpers/acceptance/email_notifier.rb +55 -0
- data/test/helpers/acceptance/git_helper.rb +15 -15
- data/test/helpers/acceptance/textfile_notifier.rb +3 -3
- data/test/helpers/expectations.rb +0 -1
- data/test/helpers/expectations/be_a.rb +4 -4
- data/test/helpers/expectations/change.rb +5 -5
- data/test/helpers/expectations/have.rb +4 -4
- data/test/helpers/expectations/predicates.rb +4 -4
- data/test/helpers/fixtures.rb +44 -18
- data/test/helpers/initial_migration_fixture.sql +44 -0
- data/test/unit/build_test.rb +51 -0
- data/test/unit/commit_test.rb +83 -0
- data/test/unit/helpers_test.rb +56 -0
- data/test/unit/integrity_test.rb +18 -0
- data/test/unit/migrations_test.rb +56 -0
- data/test/unit/notifier_test.rb +123 -0
- data/test/unit/project_builder_test.rb +108 -0
- data/test/unit/project_test.rb +282 -0
- data/test/unit/scm_test.rb +54 -0
- data/views/_commit_info.haml +24 -0
- data/views/build.haml +2 -2
- data/views/error.haml +4 -3
- data/views/home.haml +3 -5
- data/views/integrity.sass +19 -6
- data/views/new.haml +6 -6
- data/views/project.builder +9 -9
- data/views/project.haml +14 -12
- metadata +89 -122
- data/VERSION.yml +0 -4
- data/app.rb +0 -138
- data/integrity.gemspec +0 -76
- data/lib/integrity/core_ext/string.rb +0 -5
- data/test/helpers/expectations/have_tag.rb +0 -128
- data/views/_build_info.haml +0 -18
data/integrity.gemspec
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = %q{integrity}
|
5
|
-
s.version = "0.1.8"
|
6
|
-
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["Nicol\303\241s Sanguinetti", "Simon Rozet"]
|
9
|
-
s.date = %q{2009-02-12}
|
10
|
-
s.default_executable = %q{integrity}
|
11
|
-
s.description = %q{Your Friendly Continuous Integration server. Easy, fun and painless!}
|
12
|
-
s.email = %q{contacto@nicolassanguinetti.info}
|
13
|
-
s.executables = ["integrity"]
|
14
|
-
s.files = ["README.markdown", "Rakefile", "VERSION.yml", "app.rb", "bin/integrity", "config/config.sample.ru", "config/config.sample.yml", "config/thin.sample.yml", "integrity.gemspec", "lib/integrity.rb", "lib/integrity/build.rb", "lib/integrity/core_ext/object.rb", "lib/integrity/core_ext/string.rb", "lib/integrity/helpers.rb", "lib/integrity/helpers/authorization.rb", "lib/integrity/helpers/breadcrumbs.rb", "lib/integrity/helpers/forms.rb", "lib/integrity/helpers/pretty_output.rb", "lib/integrity/helpers/rendering.rb", "lib/integrity/helpers/resources.rb", "lib/integrity/helpers/urls.rb", "lib/integrity/installer.rb", "lib/integrity/migrations.rb", "lib/integrity/notifier.rb", "lib/integrity/notifier/base.rb", "lib/integrity/project.rb", "lib/integrity/project_builder.rb", "lib/integrity/scm.rb", "lib/integrity/scm/git.rb", "lib/integrity/scm/git/uri.rb", "public/buttons.css", "public/reset.css", "public/spinner.gif", "test/helpers.rb", "test/helpers/acceptance.rb", "test/helpers/acceptance/git_helper.rb", "test/helpers/acceptance/textfile_notifier.rb", "test/helpers/expectations.rb", "test/helpers/expectations/be_a.rb", "test/helpers/expectations/change.rb", "test/helpers/expectations/have.rb", "test/helpers/expectations/have_tag.rb", "test/helpers/expectations/predicates.rb", "test/helpers/fixtures.rb", "views/_build_info.haml", "views/build.haml", "views/error.haml", "views/home.haml", "views/integrity.sass", "views/layout.haml", "views/new.haml", "views/not_found.haml", "views/notifier.haml", "views/project.builder", "views/project.haml", "views/unauthorized.haml"]
|
15
|
-
s.homepage = %q{http://integrityapp.com}
|
16
|
-
s.post_install_message = %q{Run `integrity help` for information on how to setup Integrity.}
|
17
|
-
s.require_paths = ["lib"]
|
18
|
-
s.rubyforge_project = %q{integrity}
|
19
|
-
s.rubygems_version = %q{1.3.1}
|
20
|
-
s.summary = %q{The easy and fun Continuous Integration server}
|
21
|
-
|
22
|
-
if s.respond_to? :specification_version then
|
23
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
-
s.specification_version = 2
|
25
|
-
|
26
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
27
|
-
s.add_runtime_dependency(%q<sinatra>, [">= 0.9.0.3"])
|
28
|
-
s.add_runtime_dependency(%q<haml>, [">= 2.0.0"])
|
29
|
-
s.add_runtime_dependency(%q<dm-core>, [">= 0.9.5"])
|
30
|
-
s.add_runtime_dependency(%q<dm-validations>, [">= 0.9.5"])
|
31
|
-
s.add_runtime_dependency(%q<dm-types>, [">= 0.9.5"])
|
32
|
-
s.add_runtime_dependency(%q<dm-timestamps>, [">= 0.9.5"])
|
33
|
-
s.add_runtime_dependency(%q<dm-aggregates>, [">= 0.9.5"])
|
34
|
-
s.add_runtime_dependency(%q<dm-migrations>, [">= 0.9.5"])
|
35
|
-
s.add_runtime_dependency(%q<data_objects>, [">= 0.9.5"])
|
36
|
-
s.add_runtime_dependency(%q<do_sqlite3>, [">= 0.9.5"])
|
37
|
-
s.add_runtime_dependency(%q<json>, [">= 0"])
|
38
|
-
s.add_runtime_dependency(%q<foca-sinatra-diddies>, [">= 0.0.2"])
|
39
|
-
s.add_runtime_dependency(%q<thor>, [">= 0"])
|
40
|
-
s.add_runtime_dependency(%q<uuidtools>, [">= 0"])
|
41
|
-
s.add_runtime_dependency(%q<bcrypt-ruby>, [">= 0"])
|
42
|
-
else
|
43
|
-
s.add_dependency(%q<sinatra>, [">= 0.9.0.3"])
|
44
|
-
s.add_dependency(%q<haml>, [">= 2.0.0"])
|
45
|
-
s.add_dependency(%q<dm-core>, [">= 0.9.5"])
|
46
|
-
s.add_dependency(%q<dm-validations>, [">= 0.9.5"])
|
47
|
-
s.add_dependency(%q<dm-types>, [">= 0.9.5"])
|
48
|
-
s.add_dependency(%q<dm-timestamps>, [">= 0.9.5"])
|
49
|
-
s.add_dependency(%q<dm-aggregates>, [">= 0.9.5"])
|
50
|
-
s.add_dependency(%q<dm-migrations>, [">= 0.9.5"])
|
51
|
-
s.add_dependency(%q<data_objects>, [">= 0.9.5"])
|
52
|
-
s.add_dependency(%q<do_sqlite3>, [">= 0.9.5"])
|
53
|
-
s.add_dependency(%q<json>, [">= 0"])
|
54
|
-
s.add_dependency(%q<foca-sinatra-diddies>, [">= 0.0.2"])
|
55
|
-
s.add_dependency(%q<thor>, [">= 0"])
|
56
|
-
s.add_dependency(%q<uuidtools>, [">= 0"])
|
57
|
-
s.add_dependency(%q<bcrypt-ruby>, [">= 0"])
|
58
|
-
end
|
59
|
-
else
|
60
|
-
s.add_dependency(%q<sinatra>, [">= 0.9.0.3"])
|
61
|
-
s.add_dependency(%q<haml>, [">= 2.0.0"])
|
62
|
-
s.add_dependency(%q<dm-core>, [">= 0.9.5"])
|
63
|
-
s.add_dependency(%q<dm-validations>, [">= 0.9.5"])
|
64
|
-
s.add_dependency(%q<dm-types>, [">= 0.9.5"])
|
65
|
-
s.add_dependency(%q<dm-timestamps>, [">= 0.9.5"])
|
66
|
-
s.add_dependency(%q<dm-aggregates>, [">= 0.9.5"])
|
67
|
-
s.add_dependency(%q<dm-migrations>, [">= 0.9.5"])
|
68
|
-
s.add_dependency(%q<data_objects>, [">= 0.9.5"])
|
69
|
-
s.add_dependency(%q<do_sqlite3>, [">= 0.9.5"])
|
70
|
-
s.add_dependency(%q<json>, [">= 0"])
|
71
|
-
s.add_dependency(%q<foca-sinatra-diddies>, [">= 0.0.2"])
|
72
|
-
s.add_dependency(%q<thor>, [">= 0"])
|
73
|
-
s.add_dependency(%q<uuidtools>, [">= 0"])
|
74
|
-
s.add_dependency(%q<bcrypt-ruby>, [">= 0"])
|
75
|
-
end
|
76
|
-
end
|
@@ -1,128 +0,0 @@
|
|
1
|
-
require 'hpricot'
|
2
|
-
|
3
|
-
# evil hack to duck-type CgiResponse so that nested shoulds can use
|
4
|
-
# +rspec_on_rails+ matchers without remembering to call to_s on it
|
5
|
-
#
|
6
|
-
# e.g.
|
7
|
-
#
|
8
|
-
# response.should have_tag("li") do |ul|
|
9
|
-
# ul.should have_text("List Item") # with hack
|
10
|
-
# ul.to_s.should have_text("List Item") # without hack
|
11
|
-
# end
|
12
|
-
class Hpricot::Elem
|
13
|
-
alias body to_s
|
14
|
-
end
|
15
|
-
|
16
|
-
module Matchy::Expectations
|
17
|
-
class HaveTag < Base
|
18
|
-
def initialize(test_case, selector, inner_text_or_options, options, &block)
|
19
|
-
#@expected = expected
|
20
|
-
@test_case = test_case
|
21
|
-
@selector = selector
|
22
|
-
|
23
|
-
if Hash === inner_text_or_options
|
24
|
-
@inner_text = nil
|
25
|
-
@options = inner_text_or_options
|
26
|
-
else
|
27
|
-
@inner_text = inner_text_or_options
|
28
|
-
@options = options
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def matches?(actual, &block)
|
33
|
-
@actual = actual
|
34
|
-
@doc = hpricot_document(@actual)
|
35
|
-
|
36
|
-
matched_elements = @doc.search(@selector)
|
37
|
-
|
38
|
-
return @options[:count] == 0 if matched_elements.empty?
|
39
|
-
|
40
|
-
matched_elements = filter_on_inner_text(matched_elements) if @inner_text
|
41
|
-
matched_elements = filter_on_nested_expectations(matched_elements, block) if block
|
42
|
-
|
43
|
-
@actual_count = matched_elements.length
|
44
|
-
|
45
|
-
return false unless acceptable_count?(@actual_count)
|
46
|
-
|
47
|
-
!matched_elements.empty?
|
48
|
-
end
|
49
|
-
|
50
|
-
def failure_message
|
51
|
-
explanation = @actual_count ? "but found #{@actual_count}" : "but did not"
|
52
|
-
"expected\n#{@doc.to_s}\nto have #{failure_count_phrase} #{failure_selector_phrase}, #{explanation}"
|
53
|
-
end
|
54
|
-
|
55
|
-
def negative_failure_message
|
56
|
-
explanation = @actual_count ? "but found #{@actual_count}" : "but did"
|
57
|
-
"expected\n#{@doc.to_s}\nnot to have #{failure_count_phrase} #{failure_selector_phrase}, #{explanation}"
|
58
|
-
end
|
59
|
-
|
60
|
-
private
|
61
|
-
def hpricot_document(input)
|
62
|
-
if Hpricot === input
|
63
|
-
input
|
64
|
-
elsif input.respond_to?(:body)
|
65
|
-
Hpricot(input.body)
|
66
|
-
else
|
67
|
-
Hpricot(input.to_s)
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
def filter_on_inner_text(elements)
|
72
|
-
elements.select do |element|
|
73
|
-
next(element.inner_text =~ @inner_text) if @inner_text.is_a?(Regexp)
|
74
|
-
element.inner_text == @inner_text
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def filter_on_nested_expectations(elements, block)
|
79
|
-
elements.select do |el|
|
80
|
-
begin
|
81
|
-
block.call(el)
|
82
|
-
rescue NoMethodError
|
83
|
-
false
|
84
|
-
else
|
85
|
-
true
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
def acceptable_count?(actual_count)
|
91
|
-
if @options[:count]
|
92
|
-
return false unless @options[:count] === actual_count
|
93
|
-
end
|
94
|
-
if @options[:minimum]
|
95
|
-
return false unless actual_count >= @options[:minimum]
|
96
|
-
end
|
97
|
-
if @options[:maximum]
|
98
|
-
return false unless actual_count <= @options[:maximum]
|
99
|
-
end
|
100
|
-
|
101
|
-
true
|
102
|
-
end
|
103
|
-
|
104
|
-
def failure_count_phrase
|
105
|
-
if @options[:count]
|
106
|
-
"#{@options[:count]} elements matching"
|
107
|
-
elsif @options[:minimum] || @options[:maximum]
|
108
|
-
count_explanations = []
|
109
|
-
count_explanations << "at least #{@options[:minimum]}" if @options[:minimum]
|
110
|
-
count_explanations << "at most #{@options[:maximum]}" if @options[:maximum]
|
111
|
-
"#{count_explanations.join(' and ')} elements matching"
|
112
|
-
else
|
113
|
-
"an element matching"
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
def failure_selector_phrase
|
118
|
-
phrase = @selector.inspect
|
119
|
-
phrase << (@inner_text ? " with inner text #{@inner_text.inspect}" : "")
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
module TestCaseExtensions
|
124
|
-
def have_tag(selector, inner_text_or_options = nil, options = {}, &block)
|
125
|
-
Matchy::Expectations::HaveTag.new(self, selector, inner_text_or_options, options, &block)
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
data/views/_build_info.haml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
%h1<
|
2
|
-
&== Built #{build.short_commit_identifier} #{build.successful? ? "successfully" : "and failed"}
|
3
|
-
%blockquote
|
4
|
-
%p&= build.commit_message
|
5
|
-
%p.meta<
|
6
|
-
%span.who<
|
7
|
-
&== by: #{build.commit_author.name}
|
8
|
-
|
|
9
|
-
%span.when{ :title => build.commited_at.iso8601 }<
|
10
|
-
&= pretty_date build.commited_at
|
11
|
-
|
|
12
|
-
%span.what<
|
13
|
-
&== commit: #{build.commit_identifier}
|
14
|
-
|
15
|
-
%h2 Build Output:
|
16
|
-
%pre.output
|
17
|
-
:preserve
|
18
|
-
#{bash_color_codes h(build.output)}
|