integrity 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +7 -0
- data/Rakefile +59 -132
- data/VERSION.yml +1 -1
- 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 +45 -56
- 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/vendor/webrat/History.txt +306 -0
- data/vendor/webrat/MIT-LICENSE.txt +19 -0
- data/vendor/webrat/README.rdoc +85 -0
- data/vendor/webrat/Rakefile +151 -0
- data/vendor/webrat/install.rb +1 -0
- data/vendor/webrat/lib/webrat.rb +34 -0
- data/vendor/webrat/lib/webrat/core.rb +14 -0
- data/vendor/webrat/lib/webrat/core/configuration.rb +98 -0
- data/vendor/webrat/lib/webrat/core/elements/area.rb +31 -0
- data/vendor/webrat/lib/webrat/core/elements/element.rb +33 -0
- data/vendor/webrat/lib/webrat/core/elements/field.rb +403 -0
- data/vendor/webrat/lib/webrat/core/elements/form.rb +103 -0
- data/vendor/webrat/lib/webrat/core/elements/label.rb +31 -0
- data/vendor/webrat/lib/webrat/core/elements/link.rb +90 -0
- data/vendor/webrat/lib/webrat/core/elements/select_option.rb +35 -0
- data/vendor/webrat/lib/webrat/core/locators.rb +20 -0
- data/vendor/webrat/lib/webrat/core/locators/area_locator.rb +38 -0
- data/vendor/webrat/lib/webrat/core/locators/button_locator.rb +54 -0
- data/vendor/webrat/lib/webrat/core/locators/field_by_id_locator.rb +37 -0
- data/vendor/webrat/lib/webrat/core/locators/field_labeled_locator.rb +56 -0
- data/vendor/webrat/lib/webrat/core/locators/field_locator.rb +25 -0
- data/vendor/webrat/lib/webrat/core/locators/field_named_locator.rb +41 -0
- data/vendor/webrat/lib/webrat/core/locators/form_locator.rb +19 -0
- data/vendor/webrat/lib/webrat/core/locators/label_locator.rb +34 -0
- data/vendor/webrat/lib/webrat/core/locators/link_locator.rb +66 -0
- data/vendor/webrat/lib/webrat/core/locators/locator.rb +20 -0
- data/vendor/webrat/lib/webrat/core/locators/select_option_locator.rb +59 -0
- data/vendor/webrat/lib/webrat/core/logging.rb +21 -0
- data/vendor/webrat/lib/webrat/core/matchers.rb +4 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_content.rb +73 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_selector.rb +74 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_tag.rb +21 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_xpath.rb +147 -0
- data/vendor/webrat/lib/webrat/core/methods.rb +61 -0
- data/vendor/webrat/lib/webrat/core/mime.rb +29 -0
- data/vendor/webrat/lib/webrat/core/save_and_open_page.rb +50 -0
- data/vendor/webrat/lib/webrat/core/scope.rb +350 -0
- data/vendor/webrat/lib/webrat/core/session.rb +281 -0
- data/vendor/webrat/lib/webrat/core/xml.rb +115 -0
- data/vendor/webrat/lib/webrat/core/xml/hpricot.rb +19 -0
- data/vendor/webrat/lib/webrat/core/xml/nokogiri.rb +76 -0
- data/vendor/webrat/lib/webrat/core/xml/rexml.rb +24 -0
- data/vendor/webrat/lib/webrat/core_extensions/blank.rb +58 -0
- data/vendor/webrat/lib/webrat/core_extensions/deprecate.rb +8 -0
- data/vendor/webrat/lib/webrat/core_extensions/detect_mapped.rb +12 -0
- data/vendor/webrat/lib/webrat/core_extensions/meta_class.rb +6 -0
- data/vendor/webrat/lib/webrat/core_extensions/nil_to_param.rb +5 -0
- data/vendor/webrat/lib/webrat/mechanize.rb +74 -0
- data/vendor/webrat/lib/webrat/merb.rb +9 -0
- data/vendor/webrat/lib/webrat/merb_session.rb +65 -0
- data/vendor/webrat/lib/webrat/rack.rb +24 -0
- data/vendor/webrat/lib/webrat/rails.rb +105 -0
- data/vendor/webrat/lib/webrat/rspec-rails.rb +13 -0
- data/vendor/webrat/lib/webrat/selenium.rb +154 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/button.js +12 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/label.js +16 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webrat.js +5 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlink.js +9 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js +15 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js +5 -0
- data/vendor/webrat/lib/webrat/selenium/matchers.rb +4 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_content.rb +66 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_selector.rb +49 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_tag.rb +72 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_xpath.rb +45 -0
- data/vendor/webrat/lib/webrat/selenium/selenium_extensions.js +6 -0
- data/vendor/webrat/lib/webrat/selenium/selenium_session.rb +247 -0
- data/vendor/webrat/lib/webrat/sinatra.rb +44 -0
- data/vendor/webrat/spec/fakes/test_session.rb +34 -0
- data/vendor/webrat/spec/integration/merb/Rakefile +35 -0
- data/vendor/webrat/spec/integration/merb/app/controllers/application.rb +2 -0
- data/vendor/webrat/spec/integration/merb/app/controllers/exceptions.rb +13 -0
- data/vendor/webrat/spec/integration/merb/app/controllers/testing.rb +18 -0
- data/vendor/webrat/spec/integration/merb/app/views/exceptions/not_acceptable.html.erb +63 -0
- data/vendor/webrat/spec/integration/merb/app/views/exceptions/not_found.html.erb +47 -0
- data/vendor/webrat/spec/integration/merb/app/views/layout/application.html.erb +12 -0
- data/vendor/webrat/spec/integration/merb/app/views/testing/show_form.html.erb +27 -0
- data/vendor/webrat/spec/integration/merb/config/environments/development.rb +15 -0
- data/vendor/webrat/spec/integration/merb/config/environments/rake.rb +11 -0
- data/vendor/webrat/spec/integration/merb/config/environments/test.rb +14 -0
- data/vendor/webrat/spec/integration/merb/config/init.rb +25 -0
- data/vendor/webrat/spec/integration/merb/config/rack.rb +11 -0
- data/vendor/webrat/spec/integration/merb/config/router.rb +33 -0
- data/vendor/webrat/spec/integration/merb/spec/spec.opts +1 -0
- data/vendor/webrat/spec/integration/merb/spec/spec_helper.rb +24 -0
- data/vendor/webrat/spec/integration/merb/spec/webrat_spec.rb +32 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/app_script.rb +31 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/common.rb +64 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/gem_ext.rb +124 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/main.thor +150 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/ops.rb +93 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/utils.rb +40 -0
- data/vendor/webrat/spec/integration/rails/Rakefile +30 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/application.rb +15 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/webrat_controller.rb +39 -0
- data/vendor/webrat/spec/integration/rails/app/views/webrat/before_redirect_form.html.erb +4 -0
- data/vendor/webrat/spec/integration/rails/app/views/webrat/form.html.erb +28 -0
- data/vendor/webrat/spec/integration/rails/config/boot.rb +109 -0
- data/vendor/webrat/spec/integration/rails/config/environment.rb +12 -0
- data/vendor/webrat/spec/integration/rails/config/environments/development.rb +17 -0
- data/vendor/webrat/spec/integration/rails/config/environments/selenium.rb +22 -0
- data/vendor/webrat/spec/integration/rails/config/environments/test.rb +22 -0
- data/vendor/webrat/spec/integration/rails/config/initializers/inflections.rb +10 -0
- data/vendor/webrat/spec/integration/rails/config/initializers/mime_types.rb +5 -0
- data/vendor/webrat/spec/integration/rails/config/initializers/new_rails_defaults.rb +17 -0
- data/vendor/webrat/spec/integration/rails/config/locales/en.yml +5 -0
- data/vendor/webrat/spec/integration/rails/config/routes.rb +14 -0
- data/vendor/webrat/spec/integration/rails/public/404.html +30 -0
- data/vendor/webrat/spec/integration/rails/public/422.html +30 -0
- data/vendor/webrat/spec/integration/rails/public/500.html +33 -0
- data/vendor/webrat/spec/integration/rails/script/about +4 -0
- data/vendor/webrat/spec/integration/rails/script/console +3 -0
- data/vendor/webrat/spec/integration/rails/script/dbconsole +3 -0
- data/vendor/webrat/spec/integration/rails/script/destroy +3 -0
- data/vendor/webrat/spec/integration/rails/script/generate +3 -0
- data/vendor/webrat/spec/integration/rails/script/performance/benchmarker +3 -0
- data/vendor/webrat/spec/integration/rails/script/performance/profiler +3 -0
- data/vendor/webrat/spec/integration/rails/script/performance/request +3 -0
- data/vendor/webrat/spec/integration/rails/script/plugin +3 -0
- data/vendor/webrat/spec/integration/rails/script/process/inspector +3 -0
- data/vendor/webrat/spec/integration/rails/script/process/reaper +3 -0
- data/vendor/webrat/spec/integration/rails/script/process/spawner +3 -0
- data/vendor/webrat/spec/integration/rails/script/runner +3 -0
- data/vendor/webrat/spec/integration/rails/script/server +3 -0
- data/vendor/webrat/spec/integration/rails/test/integration/webrat_test.rb +80 -0
- data/vendor/webrat/spec/integration/rails/test/test_helper.rb +25 -0
- data/vendor/webrat/spec/integration/sinatra/Rakefile +5 -0
- data/vendor/webrat/spec/integration/sinatra/classic_app.rb +64 -0
- data/vendor/webrat/spec/integration/sinatra/modular_app.rb +16 -0
- data/vendor/webrat/spec/integration/sinatra/test/classic_app_test.rb +37 -0
- data/vendor/webrat/spec/integration/sinatra/test/modular_app_test.rb +18 -0
- data/vendor/webrat/spec/integration/sinatra/test/test_helper.rb +16 -0
- data/vendor/webrat/spec/private/core/configuration_spec.rb +104 -0
- data/vendor/webrat/spec/private/core/field_spec.rb +67 -0
- data/vendor/webrat/spec/private/core/link_spec.rb +24 -0
- data/vendor/webrat/spec/private/core/logging_spec.rb +10 -0
- data/vendor/webrat/spec/private/core/session_spec.rb +198 -0
- data/vendor/webrat/spec/private/mechanize/mechanize_session_spec.rb +81 -0
- data/vendor/webrat/spec/private/merb/merb_session_spec.rb +42 -0
- data/vendor/webrat/spec/private/nokogiri_spec.rb +77 -0
- data/vendor/webrat/spec/private/rails/attaches_file_spec.rb +81 -0
- data/vendor/webrat/spec/private/rails/rails_session_spec.rb +110 -0
- data/vendor/webrat/spec/private/selenium/selenium_session_spec.rb +44 -0
- data/vendor/webrat/spec/private/selenium/selenium_spec.rb +109 -0
- data/vendor/webrat/spec/public/basic_auth_spec.rb +24 -0
- data/vendor/webrat/spec/public/check_spec.rb +191 -0
- data/vendor/webrat/spec/public/choose_spec.rb +118 -0
- data/vendor/webrat/spec/public/click_area_spec.rb +106 -0
- data/vendor/webrat/spec/public/click_button_spec.rb +502 -0
- data/vendor/webrat/spec/public/click_link_spec.rb +469 -0
- data/vendor/webrat/spec/public/fill_in_spec.rb +209 -0
- data/vendor/webrat/spec/public/locators/field_by_xpath_spec.rb +19 -0
- data/vendor/webrat/spec/public/locators/field_labeled_spec.rb +157 -0
- data/vendor/webrat/spec/public/locators/field_with_id_spec.rb +16 -0
- data/vendor/webrat/spec/public/matchers/contain_spec.rb +114 -0
- data/vendor/webrat/spec/public/matchers/have_selector_spec.rb +135 -0
- data/vendor/webrat/spec/public/matchers/have_tag_spec.rb +39 -0
- data/vendor/webrat/spec/public/matchers/have_xpath_spec.rb +123 -0
- data/vendor/webrat/spec/public/reload_spec.rb +10 -0
- data/vendor/webrat/spec/public/save_and_open_spec.rb +51 -0
- data/vendor/webrat/spec/public/select_date_spec.rb +88 -0
- data/vendor/webrat/spec/public/select_datetime_spec.rb +106 -0
- data/vendor/webrat/spec/public/select_spec.rb +246 -0
- data/vendor/webrat/spec/public/select_time_spec.rb +79 -0
- data/vendor/webrat/spec/public/set_hidden_field_spec.rb +5 -0
- data/vendor/webrat/spec/public/submit_form_spec.rb +5 -0
- data/vendor/webrat/spec/public/visit_spec.rb +58 -0
- data/vendor/webrat/spec/public/within_spec.rb +177 -0
- data/vendor/webrat/spec/rcov.opts +1 -0
- data/vendor/webrat/spec/spec.opts +2 -0
- data/vendor/webrat/spec/spec_helper.rb +50 -0
- data/vendor/webrat/vendor/selenium-server.jar +0 -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 +319 -124
- 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/README.markdown
CHANGED
@@ -8,6 +8,13 @@ Integrity
|
|
8
8
|
* Join us on [#integrity][irc-channel] for ideas, help, patches or something
|
9
9
|
* Get the code on [GitHub][repo]
|
10
10
|
|
11
|
+
Try it!
|
12
|
+
-------
|
13
|
+
|
14
|
+
$ git clone git://github.com/foca/integrity.git
|
15
|
+
$ rake launch
|
16
|
+
# Navigate to <http://0.0.0.0:4567>
|
17
|
+
|
11
18
|
Thanks
|
12
19
|
------
|
13
20
|
|
data/Rakefile
CHANGED
@@ -2,14 +2,43 @@ require "rake/testtask"
|
|
2
2
|
require "rake/clean"
|
3
3
|
require "rcov/rcovtask"
|
4
4
|
|
5
|
-
|
5
|
+
begin
|
6
|
+
require "metric_fu"
|
7
|
+
rescue LoadError
|
8
|
+
end
|
9
|
+
|
10
|
+
module Integrity
|
11
|
+
def self.version
|
12
|
+
YAML.load_file("VERSION.yml").values.join(".")
|
13
|
+
end
|
14
|
+
end
|
6
15
|
|
7
|
-
desc "
|
8
|
-
task :default =>
|
16
|
+
desc "Default: run all tests"
|
17
|
+
task :default => :test
|
18
|
+
|
19
|
+
desc "Special task for running tests on <http://builder.integrityapp.com>"
|
20
|
+
task :ci do
|
21
|
+
sh "git submodule update --init"
|
22
|
+
|
23
|
+
Rake::Task["test"].invoke
|
24
|
+
|
25
|
+
metrics = %w(flay flog:all reek roodi saikuro)
|
26
|
+
metrics.each { |m| Rake::Task["metrics:#{m}"].invoke }
|
27
|
+
|
28
|
+
rm_rf "/var/www/integrity-metrics"
|
29
|
+
mv "tmp/metric_fu", "/var/www/integrity-metrics"
|
30
|
+
|
31
|
+
File.open("/var/www/integrity-metrics/index.html", "w") { |f|
|
32
|
+
f << "<ul>"
|
33
|
+
metrics.map { |m| m.split(":").first }.each { |m|
|
34
|
+
f << %Q(<li><a href="/#{m}">#{m}</a></li>)
|
35
|
+
}
|
36
|
+
f << "</ul>"
|
37
|
+
}
|
38
|
+
end
|
9
39
|
|
10
40
|
desc "Run tests"
|
11
41
|
task :test => %w(test:units test:acceptance)
|
12
|
-
|
13
42
|
namespace :test do
|
14
43
|
Rake::TestTask.new(:units) do |t|
|
15
44
|
t.test_files = FileList["test/unit/*_test.rb"]
|
@@ -19,110 +48,18 @@ namespace :test do
|
|
19
48
|
t.test_files = FileList["test/acceptance/*_test.rb"]
|
20
49
|
end
|
21
50
|
|
22
|
-
desc "Measure test coverage"
|
23
|
-
task :coverage => %w(test:coverage:units test:coverage:acceptance)
|
24
|
-
|
25
|
-
namespace :coverage do
|
26
|
-
desc "Measure test coverage of unit tests"
|
27
|
-
Rcov::RcovTask.new(:units) do |rcov|
|
28
|
-
rcov.pattern = "test/unit/*_test.rb"
|
29
|
-
rcov.rcov_opts = %w(--html --aggregate .aggregated_coverage_report)
|
30
|
-
rcov.rcov_opts << ENV["RCOV_OPTS"] if ENV["RCOV_OPTS"]
|
31
|
-
end
|
32
|
-
|
33
|
-
desc "Measure test coverage of acceptance tests"
|
34
|
-
Rcov::RcovTask.new(:acceptance) do |rcov|
|
35
|
-
rcov.pattern = "test/acceptance/*_test.rb"
|
36
|
-
rcov.rcov_opts = %w(--html --aggregate .aggregated_coverage_report)
|
37
|
-
rcov.rcov_opts << ENV["RCOV_OPTS"] if ENV["RCOV_OPTS"]
|
38
|
-
end
|
39
|
-
|
40
|
-
desc "Verify test coverage"
|
41
|
-
task :verify => "test:coverage" do
|
42
|
-
File.read("coverage/index.html") =~ /<tt class='coverage_total'>\s*(\d+\.\d+)%\s*<\/tt>/
|
43
|
-
coverage = $1.to_f
|
44
|
-
|
45
|
-
puts
|
46
|
-
if coverage == 100
|
47
|
-
puts "\e[32m100% coverage! Awesome!\e[0m"
|
48
|
-
else
|
49
|
-
puts "\e[31mOnly #{coverage}% code coverage. You can do better ;)\e[0m"
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
51
|
desc "Install all gems on which the tests depend on"
|
55
52
|
task :install_dependencies do
|
56
|
-
system
|
57
|
-
system
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
namespace :db do
|
62
|
-
desc "Setup connection."
|
63
|
-
task :connect do
|
64
|
-
config = File.expand_path(ENV['CONFIG']) if ENV['CONFIG']
|
65
|
-
config = Integrity.root / 'config.yml' if File.exists?(Integrity.root / 'config.yml')
|
66
|
-
Integrity.new(config)
|
67
|
-
end
|
68
|
-
|
69
|
-
desc "Automigrate the database"
|
70
|
-
task :migrate => :connect do
|
71
|
-
require "project"
|
72
|
-
require "build"
|
73
|
-
require "notifier"
|
74
|
-
DataMapper.auto_migrate!
|
53
|
+
system "gem install rr mocha dm-sweatshop ZenTest"
|
54
|
+
system "gem install -s http://gems.github.com jeremymcanally-context \
|
55
|
+
jeremymcanally-matchy jeremymcanally-pending foca-storyteller"
|
56
|
+
system "git submodule update --init"
|
75
57
|
end
|
76
58
|
end
|
77
59
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
"dist/integrity-#{Integrity.version}" + ext
|
82
|
-
end
|
83
|
-
|
84
|
-
directory "dist/"
|
85
|
-
CLOBBER.include("dist")
|
86
|
-
|
87
|
-
desc "Build packages"
|
88
|
-
task :package => %w[.gem .tar.gz].map { |ext| package(ext) } << :changelog
|
89
|
-
|
90
|
-
desc "Build and install as local gem"
|
91
|
-
task :install => package(".gem") do
|
92
|
-
sh "gem install #{package(".gem")}"
|
93
|
-
end
|
94
|
-
|
95
|
-
file package(".gem") => %w[dist/ integrity.gemspec] do |f|
|
96
|
-
sh "gem build integrity.gemspec"
|
97
|
-
mv File.basename(f.name), f.name
|
98
|
-
end
|
99
|
-
|
100
|
-
file package('.tar.gz') => %w[dist/] do |f|
|
101
|
-
sh <<-SH
|
102
|
-
git archive \
|
103
|
-
--prefix=integrity-#{Integrity.version}/ \
|
104
|
-
--format=tar \
|
105
|
-
HEAD | gzip > #{f.name}
|
106
|
-
SH
|
107
|
-
end
|
108
|
-
|
109
|
-
desc "Publish gem and tarball to rubyforge"
|
110
|
-
task "publish:gem" => [package(".gem"), package(".tar.gz")] do |t|
|
111
|
-
sh <<-end
|
112
|
-
rubyforge add_release integrity integrity #{Integrity.version} #{package('.gem')} &&
|
113
|
-
rubyforge add_file integrity integrity #{Integrity.version} #{package('.tar.gz')}
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
file "dist/git-changelog.py" => %w[dist/] do
|
118
|
-
sh "cd dist && wget http://gist.github.com/raw/62837/bc6d2c6102933c3eac5fa33afd3effd7ab97edb7/git-changelog.py"
|
119
|
-
end
|
120
|
-
|
121
|
-
task :changelog => ["dist/git-changelog.py"] do
|
122
|
-
sh "python git-changelog.py"
|
123
|
-
sh "git add ChangeLog"
|
124
|
-
sh 'git commit -m "Regenerated ChangeLog"'
|
125
|
-
end
|
60
|
+
desc "Launch Integrity real quick"
|
61
|
+
task :launch do
|
62
|
+
ruby "bin/integrity launch"
|
126
63
|
end
|
127
64
|
|
128
65
|
begin
|
@@ -130,36 +67,26 @@ begin
|
|
130
67
|
|
131
68
|
namespace :jeweler do
|
132
69
|
Jeweler::Tasks.new do |s|
|
133
|
-
|
134
|
-
|
135
|
-
s.
|
136
|
-
s.
|
137
|
-
s.
|
138
|
-
s.
|
139
|
-
s.
|
140
|
-
s.
|
141
|
-
s.
|
142
|
-
s.
|
143
|
-
|
144
|
-
s.
|
145
|
-
|
146
|
-
s.add_dependency
|
147
|
-
s.add_dependency
|
148
|
-
s.add_dependency
|
149
|
-
s.add_dependency
|
150
|
-
s.add_dependency
|
151
|
-
s.add_dependency
|
152
|
-
s.add_dependency 'dm-aggregates', ['>= 0.9.5']
|
153
|
-
s.add_dependency 'dm-migrations', ['>= 0.9.5']
|
154
|
-
s.add_dependency 'data_objects', ['>= 0.9.5']
|
155
|
-
s.add_dependency 'do_sqlite3', ['>= 0.9.5']
|
156
|
-
s.add_dependency 'json'
|
157
|
-
s.add_dependency 'foca-sinatra-diddies', ['>= 0.0.2']
|
158
|
-
s.add_dependency 'thor'
|
159
|
-
s.add_dependency 'uuidtools' # required by dm-types
|
160
|
-
s.add_dependency 'bcrypt-ruby' # required by dm-types
|
70
|
+
s.name = "integrity"
|
71
|
+
s.summary = "The easy and fun Continuous Integration server"
|
72
|
+
s.description = "Your Friendly Continuous Integration server. Easy, fun and painless!"
|
73
|
+
s.homepage = "http://integrityapp.com"
|
74
|
+
s.rubyforge_project = "integrity"
|
75
|
+
s.email = "contacto@nicolassanguinetti.info"
|
76
|
+
s.authors = ["Nicolás Sanguinetti", "Simon Rozet"]
|
77
|
+
s.files = FileList["[A-Z]*", "{bin,lib,views,public,config,test,vendor}/**/*"]
|
78
|
+
s.executables = ["integrity"]
|
79
|
+
s.post_install_message = "Run `integrity help` for information on how to setup Integrity."
|
80
|
+
|
81
|
+
s.add_dependency "sinatra", [">= 0.9.1.1"]
|
82
|
+
s.add_dependency "haml", [">= 2.0.0"]
|
83
|
+
s.add_dependency "data_mapper", [">= 0.9.10"]
|
84
|
+
s.add_dependency "uuidtools" # required by dm-types
|
85
|
+
s.add_dependency "bcrypt-ruby" # required by dm-types
|
86
|
+
s.add_dependency "json"
|
87
|
+
s.add_dependency "foca-sinatra-ditties", [">= 0.0.3"]
|
88
|
+
s.add_dependency "thor"
|
161
89
|
end
|
162
90
|
end
|
163
91
|
rescue LoadError
|
164
92
|
end
|
165
|
-
|
data/VERSION.yml
CHANGED
data/config/config.ru
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require File.dirname(__FILE__) + "/../lib/integrity"
|
3
|
+
require "rack/lobster"
|
4
|
+
# If you want to add any notifiers, install the gems and then require them here
|
5
|
+
# For example, to enable the Email notifier: install the gem (from github:
|
6
|
+
#
|
7
|
+
# sudo gem install -s http://gems.github.com foca-integrity-email
|
8
|
+
#
|
9
|
+
# And then uncomment the following line:
|
10
|
+
#
|
11
|
+
# require "notifier/email"
|
12
|
+
|
13
|
+
# Load configuration and initialize Integrity
|
14
|
+
Integrity.new#(File.dirname(__FILE__) + "/config.yml")
|
15
|
+
DataMapper.auto_migrate!
|
16
|
+
|
17
|
+
# You probably don't want to edit anything below
|
18
|
+
Integrity::App.set :environment, ENV["RACK_ENV"] || :production
|
19
|
+
Integrity::App.set :port, 8910
|
20
|
+
rack = proc do |env|
|
21
|
+
[200, { 'Content-Type' => 'text/html' }, "#{env['rack.session'].inspect}"]
|
22
|
+
end
|
23
|
+
|
24
|
+
map "/foo" do
|
25
|
+
run Integrity::App
|
26
|
+
end
|
27
|
+
map "/" do
|
28
|
+
run rack
|
29
|
+
end
|
data/config/config.sample.ru
CHANGED
@@ -11,21 +11,11 @@ require "integrity"
|
|
11
11
|
#
|
12
12
|
# require "notifier/email"
|
13
13
|
|
14
|
-
# Load
|
15
|
-
Integrity.
|
14
|
+
# Load configuration and initialize Integrity
|
15
|
+
Integrity.new(File.dirname(__FILE__) + "/config.yml")
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
## ##
|
21
|
-
#######################################################################
|
22
|
-
require Integrity.root / "app"
|
17
|
+
# You probably don't want to edit anything below
|
18
|
+
Integrity::App.set :environment, ENV["RACK_ENV"] || :production
|
19
|
+
Integrity::App.set :port, 8910
|
23
20
|
|
24
|
-
|
25
|
-
set :public, Integrity.root / "public"
|
26
|
-
set :views, Integrity.root / "views"
|
27
|
-
set :port, 8910
|
28
|
-
disable :run, :reload
|
29
|
-
|
30
|
-
use Rack::CommonLogger, Integrity.logger if Integrity.config[:log_debug_info]
|
31
|
-
run Sinatra::Application
|
21
|
+
run Integrity::App
|
data/config/config.sample.yml
CHANGED
@@ -4,24 +4,27 @@
|
|
4
4
|
# http://builder.integrityapp.com
|
5
5
|
:base_uri: http://integrity.domain.tld
|
6
6
|
|
7
|
-
# This should be a complete connection string to your database.
|
8
|
-
#
|
9
|
-
#
|
7
|
+
# This should be a complete connection string to your database.
|
8
|
+
#
|
9
|
+
# Examples:
|
10
|
+
# * `mysql://user:password@localhost/integrity`
|
11
|
+
# * `postgres://user:password@localhost/integrity`
|
12
|
+
# * `sqlite3:///home/integrity/db/integrity.sqlite`
|
13
|
+
#
|
14
|
+
# Note:
|
15
|
+
# * The appropriate data_objects adapter must be installed (`do_mysql`, etc)
|
16
|
+
# * You must create the `integrity` database on localhost, of course.
|
10
17
|
:database_uri: sqlite3:///var/integrity.db
|
11
18
|
|
12
|
-
# This is where your project's code will be checked out to. Make sure it's
|
19
|
+
# This is where your project's code will be checked out to. Make sure it's
|
13
20
|
# writable by the user that runs Integrity.
|
14
21
|
:export_directory: /path/to/scm/exports
|
15
22
|
|
16
23
|
# Path to the integrity log file
|
17
24
|
:log: /var/log/integrity.log
|
18
25
|
|
19
|
-
# Enable
|
20
|
-
#
|
21
|
-
:log_debug_info: false
|
22
|
-
|
23
|
-
# Enable or disable HTTP authentication for the app. BE AWARE that if you
|
24
|
-
# disable this anyone can delete and alter projects, so do it only if your
|
26
|
+
# Enable or disable HTTP authentication for the app. BE AWARE that if you
|
27
|
+
# disable this anyone can delete and alter projects, so do it only if your
|
25
28
|
# app is running in a controlled environment (ie, behind your company's
|
26
29
|
# firewall.)
|
27
30
|
:use_basic_auth: false
|
@@ -29,10 +32,10 @@
|
|
29
32
|
# When `use_basic_auth` is true, the admin's username for HTTP authentication.
|
30
33
|
:admin_username: username
|
31
34
|
|
32
|
-
# When `use_basic_auth` is true, the admin's password. Usually saved as a
|
35
|
+
# When `use_basic_auth` is true, the admin's password. Usually saved as a
|
33
36
|
# SHA1 hash. See the next option.
|
34
37
|
:admin_password: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
|
35
38
|
|
36
|
-
# If this is true, then whenever we authenticate the admin user, will hash
|
39
|
+
# If this is true, then whenever we authenticate the admin user, will hash
|
37
40
|
# it using SHA1. If not, we'll assume the provided password is in plain text.
|
38
41
|
:hash_admin_password: true
|
data/config/config.yml
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# Domain where integrity will be running from. This is used to have
|
2
|
+
# nice URLs in your notifications.
|
3
|
+
# For example:
|
4
|
+
# http://builder.integrityapp.com
|
5
|
+
:base_uri: http://0.0.0.0:1234
|
6
|
+
|
7
|
+
# This should be a complete connection string to your database. For example
|
8
|
+
# `mysql://user@localhost/integrity` (you need an `integrity` db created in
|
9
|
+
# localhost, of course).
|
10
|
+
:database_uri: sqlite3:///home/simon/tmp/integrity.db
|
11
|
+
|
12
|
+
# This is where your project's code will be checked out to. Make sure it's
|
13
|
+
# writable by the user that runs Integrity.
|
14
|
+
:export_directory: /home/simon/tmp/integrity_exports
|
15
|
+
|
16
|
+
# Path to the integrity log file
|
17
|
+
:log: /tmp/integrity.log
|
18
|
+
|
19
|
+
# Enable or disable HTTP authentication for the app. BE AWARE that if you
|
20
|
+
# disable this anyone can delete and alter projects, so do it only if your
|
21
|
+
# app is running in a controlled environment (ie, behind your company's
|
22
|
+
# firewall.)
|
23
|
+
:use_basic_auth: false
|
24
|
+
|
25
|
+
# When `use_basic_auth` is true, the admin's username for HTTP authentication.
|
26
|
+
:admin_username: username
|
27
|
+
|
28
|
+
# When `use_basic_auth` is true, the admin's password. Usually saved as a
|
29
|
+
# SHA1 hash. See the next option.
|
30
|
+
:admin_password: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
|
31
|
+
|
32
|
+
# If this is true, then whenever we authenticate the admin user, will hash
|
33
|
+
# it using SHA1. If not, we'll assume the provided password is in plain text.
|
34
|
+
:hash_admin_password: true
|
data/lib/integrity.rb
CHANGED
@@ -6,33 +6,36 @@ require "dm-validations"
|
|
6
6
|
require "dm-types"
|
7
7
|
require "dm-timestamps"
|
8
8
|
require "dm-aggregates"
|
9
|
+
require "sinatra/base"
|
9
10
|
|
10
11
|
require "yaml"
|
11
12
|
require "logger"
|
12
13
|
require "digest/sha1"
|
13
14
|
require "timeout"
|
14
15
|
require "ostruct"
|
15
|
-
require "
|
16
|
+
require "pathname"
|
16
17
|
|
17
18
|
require "integrity/core_ext/object"
|
18
|
-
require "integrity/core_ext/string"
|
19
19
|
|
20
20
|
require "integrity/project"
|
21
|
+
require "integrity/author"
|
22
|
+
require "integrity/commit"
|
21
23
|
require "integrity/build"
|
22
24
|
require "integrity/project_builder"
|
23
25
|
require "integrity/scm"
|
24
26
|
require "integrity/scm/git"
|
25
27
|
require "integrity/notifier"
|
28
|
+
require "integrity/helpers"
|
29
|
+
require "integrity/app"
|
26
30
|
|
27
31
|
module Integrity
|
28
32
|
def self.new(config_file = nil)
|
29
|
-
self.config = config_file unless config_file.nil?
|
30
|
-
DataMapper.logger = self.logger if config[:log_debug_info]
|
33
|
+
self.config = YAML.load_file(config_file) unless config_file.nil?
|
31
34
|
DataMapper.setup(:default, config[:database_uri])
|
32
35
|
end
|
33
36
|
|
34
37
|
def self.root
|
35
|
-
|
38
|
+
Pathname.new(File.dirname(__FILE__)).join("..").expand_path
|
36
39
|
end
|
37
40
|
|
38
41
|
def self.default_configuration
|
@@ -42,15 +45,15 @@ module Integrity
|
|
42
45
|
:base_uri => "http://localhost:8910",
|
43
46
|
:use_basic_auth => false,
|
44
47
|
:build_all_commits => true,
|
45
|
-
:log_debug_info => false }
|
48
|
+
:log_debug_info => false }.dup
|
46
49
|
end
|
47
50
|
|
48
51
|
def self.config
|
49
52
|
@config ||= default_configuration
|
50
53
|
end
|
51
54
|
|
52
|
-
def self.config=(
|
53
|
-
@config = default_configuration.merge(
|
55
|
+
def self.config=(options)
|
56
|
+
@config = default_configuration.merge(options)
|
54
57
|
end
|
55
58
|
|
56
59
|
def self.log(message, &block)
|
@@ -64,14 +67,11 @@ module Integrity
|
|
64
67
|
end
|
65
68
|
|
66
69
|
def self.version
|
67
|
-
|
68
|
-
|
69
|
-
"#{file['major']}.#{file['minor']}.#{file['patch']}"
|
70
|
-
end
|
70
|
+
YAML.load_file(File.dirname(__FILE__) + "/../VERSION.yml").
|
71
|
+
values.join(".")
|
71
72
|
end
|
72
73
|
|
73
74
|
private
|
74
|
-
|
75
75
|
class LogFormatter < Logger::Formatter
|
76
76
|
def call(severity, time, progname, msg)
|
77
77
|
time.strftime("[%H:%M:%S] ") + msg2str(msg) + "\n"
|