integrity 0.1.9 → 0.1.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. data/Rakefile +57 -31
  2. data/config/heroku/.gems +4 -0
  3. data/config/heroku/Rakefile +6 -0
  4. data/config/heroku/config.ru +7 -0
  5. data/config/heroku/integrity-config.rb +11 -0
  6. data/integrity.gemspec +123 -0
  7. data/lib/integrity.rb +7 -14
  8. data/lib/integrity/installer.rb +45 -35
  9. data/lib/integrity/notifier/test.rb +59 -0
  10. data/lib/integrity/notifier/test/fixtures.rb +108 -0
  11. data/lib/integrity/notifier/test/hpricot_matcher.rb +38 -0
  12. data/test/acceptance/build_notifications_test.rb +2 -2
  13. data/test/acceptance/installer_test.rb +25 -7
  14. data/test/helpers.rb +1 -1
  15. data/test/helpers/acceptance.rb +1 -4
  16. data/test/helpers/fixtures.rb +0 -22
  17. data/test/unit/notifier/test_test.rb +29 -0
  18. data/test/unit/project_builder_test.rb +4 -1
  19. data/vendor/sinatra-ditties/README.rdoc +3 -0
  20. data/vendor/sinatra-ditties/lib/sinatra/ditties.rb +12 -0
  21. data/vendor/sinatra-ditties/lib/sinatra/ditties/authorization.rb +61 -0
  22. data/vendor/sinatra-ditties/lib/sinatra/ditties/mailer.rb +146 -0
  23. metadata +79 -318
  24. data/VERSION.yml +0 -4
  25. data/config/config.ru +0 -29
  26. data/config/config.yml +0 -34
  27. data/lib/integrity/notifier/test_helpers.rb +0 -100
  28. data/vendor/webrat/History.txt +0 -306
  29. data/vendor/webrat/MIT-LICENSE.txt +0 -19
  30. data/vendor/webrat/README.rdoc +0 -85
  31. data/vendor/webrat/Rakefile +0 -151
  32. data/vendor/webrat/install.rb +0 -1
  33. data/vendor/webrat/lib/webrat.rb +0 -34
  34. data/vendor/webrat/lib/webrat/core.rb +0 -14
  35. data/vendor/webrat/lib/webrat/core/configuration.rb +0 -98
  36. data/vendor/webrat/lib/webrat/core/elements/area.rb +0 -31
  37. data/vendor/webrat/lib/webrat/core/elements/element.rb +0 -33
  38. data/vendor/webrat/lib/webrat/core/elements/field.rb +0 -403
  39. data/vendor/webrat/lib/webrat/core/elements/form.rb +0 -103
  40. data/vendor/webrat/lib/webrat/core/elements/label.rb +0 -31
  41. data/vendor/webrat/lib/webrat/core/elements/link.rb +0 -90
  42. data/vendor/webrat/lib/webrat/core/elements/select_option.rb +0 -35
  43. data/vendor/webrat/lib/webrat/core/locators.rb +0 -20
  44. data/vendor/webrat/lib/webrat/core/locators/area_locator.rb +0 -38
  45. data/vendor/webrat/lib/webrat/core/locators/button_locator.rb +0 -54
  46. data/vendor/webrat/lib/webrat/core/locators/field_by_id_locator.rb +0 -37
  47. data/vendor/webrat/lib/webrat/core/locators/field_labeled_locator.rb +0 -56
  48. data/vendor/webrat/lib/webrat/core/locators/field_locator.rb +0 -25
  49. data/vendor/webrat/lib/webrat/core/locators/field_named_locator.rb +0 -41
  50. data/vendor/webrat/lib/webrat/core/locators/form_locator.rb +0 -19
  51. data/vendor/webrat/lib/webrat/core/locators/label_locator.rb +0 -34
  52. data/vendor/webrat/lib/webrat/core/locators/link_locator.rb +0 -66
  53. data/vendor/webrat/lib/webrat/core/locators/locator.rb +0 -20
  54. data/vendor/webrat/lib/webrat/core/locators/select_option_locator.rb +0 -59
  55. data/vendor/webrat/lib/webrat/core/logging.rb +0 -21
  56. data/vendor/webrat/lib/webrat/core/matchers.rb +0 -4
  57. data/vendor/webrat/lib/webrat/core/matchers/have_content.rb +0 -73
  58. data/vendor/webrat/lib/webrat/core/matchers/have_selector.rb +0 -74
  59. data/vendor/webrat/lib/webrat/core/matchers/have_tag.rb +0 -21
  60. data/vendor/webrat/lib/webrat/core/matchers/have_xpath.rb +0 -147
  61. data/vendor/webrat/lib/webrat/core/methods.rb +0 -61
  62. data/vendor/webrat/lib/webrat/core/mime.rb +0 -29
  63. data/vendor/webrat/lib/webrat/core/save_and_open_page.rb +0 -50
  64. data/vendor/webrat/lib/webrat/core/scope.rb +0 -350
  65. data/vendor/webrat/lib/webrat/core/session.rb +0 -281
  66. data/vendor/webrat/lib/webrat/core/xml.rb +0 -115
  67. data/vendor/webrat/lib/webrat/core/xml/hpricot.rb +0 -19
  68. data/vendor/webrat/lib/webrat/core/xml/nokogiri.rb +0 -76
  69. data/vendor/webrat/lib/webrat/core/xml/rexml.rb +0 -24
  70. data/vendor/webrat/lib/webrat/core_extensions/blank.rb +0 -58
  71. data/vendor/webrat/lib/webrat/core_extensions/deprecate.rb +0 -8
  72. data/vendor/webrat/lib/webrat/core_extensions/detect_mapped.rb +0 -12
  73. data/vendor/webrat/lib/webrat/core_extensions/meta_class.rb +0 -6
  74. data/vendor/webrat/lib/webrat/core_extensions/nil_to_param.rb +0 -5
  75. data/vendor/webrat/lib/webrat/mechanize.rb +0 -74
  76. data/vendor/webrat/lib/webrat/merb.rb +0 -9
  77. data/vendor/webrat/lib/webrat/merb_session.rb +0 -65
  78. data/vendor/webrat/lib/webrat/rack.rb +0 -24
  79. data/vendor/webrat/lib/webrat/rails.rb +0 -105
  80. data/vendor/webrat/lib/webrat/rspec-rails.rb +0 -13
  81. data/vendor/webrat/lib/webrat/selenium.rb +0 -154
  82. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/button.js +0 -12
  83. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/label.js +0 -16
  84. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webrat.js +0 -5
  85. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlink.js +0 -9
  86. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js +0 -15
  87. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js +0 -5
  88. data/vendor/webrat/lib/webrat/selenium/matchers.rb +0 -4
  89. data/vendor/webrat/lib/webrat/selenium/matchers/have_content.rb +0 -66
  90. data/vendor/webrat/lib/webrat/selenium/matchers/have_selector.rb +0 -49
  91. data/vendor/webrat/lib/webrat/selenium/matchers/have_tag.rb +0 -72
  92. data/vendor/webrat/lib/webrat/selenium/matchers/have_xpath.rb +0 -45
  93. data/vendor/webrat/lib/webrat/selenium/selenium_extensions.js +0 -6
  94. data/vendor/webrat/lib/webrat/selenium/selenium_session.rb +0 -247
  95. data/vendor/webrat/lib/webrat/sinatra.rb +0 -44
  96. data/vendor/webrat/spec/fakes/test_session.rb +0 -34
  97. data/vendor/webrat/spec/integration/merb/Rakefile +0 -35
  98. data/vendor/webrat/spec/integration/merb/app/controllers/application.rb +0 -2
  99. data/vendor/webrat/spec/integration/merb/app/controllers/exceptions.rb +0 -13
  100. data/vendor/webrat/spec/integration/merb/app/controllers/testing.rb +0 -18
  101. data/vendor/webrat/spec/integration/merb/app/views/exceptions/not_acceptable.html.erb +0 -63
  102. data/vendor/webrat/spec/integration/merb/app/views/exceptions/not_found.html.erb +0 -47
  103. data/vendor/webrat/spec/integration/merb/app/views/layout/application.html.erb +0 -12
  104. data/vendor/webrat/spec/integration/merb/app/views/testing/show_form.html.erb +0 -27
  105. data/vendor/webrat/spec/integration/merb/config/environments/development.rb +0 -15
  106. data/vendor/webrat/spec/integration/merb/config/environments/rake.rb +0 -11
  107. data/vendor/webrat/spec/integration/merb/config/environments/test.rb +0 -14
  108. data/vendor/webrat/spec/integration/merb/config/init.rb +0 -25
  109. data/vendor/webrat/spec/integration/merb/config/rack.rb +0 -11
  110. data/vendor/webrat/spec/integration/merb/config/router.rb +0 -33
  111. data/vendor/webrat/spec/integration/merb/spec/spec.opts +0 -1
  112. data/vendor/webrat/spec/integration/merb/spec/spec_helper.rb +0 -24
  113. data/vendor/webrat/spec/integration/merb/spec/webrat_spec.rb +0 -32
  114. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/app_script.rb +0 -31
  115. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/common.rb +0 -64
  116. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/gem_ext.rb +0 -124
  117. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/main.thor +0 -150
  118. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/ops.rb +0 -93
  119. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/utils.rb +0 -40
  120. data/vendor/webrat/spec/integration/rails/Rakefile +0 -30
  121. data/vendor/webrat/spec/integration/rails/app/controllers/application.rb +0 -15
  122. data/vendor/webrat/spec/integration/rails/app/controllers/webrat_controller.rb +0 -39
  123. data/vendor/webrat/spec/integration/rails/app/views/webrat/before_redirect_form.html.erb +0 -4
  124. data/vendor/webrat/spec/integration/rails/app/views/webrat/form.html.erb +0 -28
  125. data/vendor/webrat/spec/integration/rails/config/boot.rb +0 -109
  126. data/vendor/webrat/spec/integration/rails/config/environment.rb +0 -12
  127. data/vendor/webrat/spec/integration/rails/config/environments/development.rb +0 -17
  128. data/vendor/webrat/spec/integration/rails/config/environments/selenium.rb +0 -22
  129. data/vendor/webrat/spec/integration/rails/config/environments/test.rb +0 -22
  130. data/vendor/webrat/spec/integration/rails/config/initializers/inflections.rb +0 -10
  131. data/vendor/webrat/spec/integration/rails/config/initializers/mime_types.rb +0 -5
  132. data/vendor/webrat/spec/integration/rails/config/initializers/new_rails_defaults.rb +0 -17
  133. data/vendor/webrat/spec/integration/rails/config/locales/en.yml +0 -5
  134. data/vendor/webrat/spec/integration/rails/config/routes.rb +0 -14
  135. data/vendor/webrat/spec/integration/rails/public/404.html +0 -30
  136. data/vendor/webrat/spec/integration/rails/public/422.html +0 -30
  137. data/vendor/webrat/spec/integration/rails/public/500.html +0 -33
  138. data/vendor/webrat/spec/integration/rails/script/about +0 -4
  139. data/vendor/webrat/spec/integration/rails/script/console +0 -3
  140. data/vendor/webrat/spec/integration/rails/script/dbconsole +0 -3
  141. data/vendor/webrat/spec/integration/rails/script/destroy +0 -3
  142. data/vendor/webrat/spec/integration/rails/script/generate +0 -3
  143. data/vendor/webrat/spec/integration/rails/script/performance/benchmarker +0 -3
  144. data/vendor/webrat/spec/integration/rails/script/performance/profiler +0 -3
  145. data/vendor/webrat/spec/integration/rails/script/performance/request +0 -3
  146. data/vendor/webrat/spec/integration/rails/script/plugin +0 -3
  147. data/vendor/webrat/spec/integration/rails/script/process/inspector +0 -3
  148. data/vendor/webrat/spec/integration/rails/script/process/reaper +0 -3
  149. data/vendor/webrat/spec/integration/rails/script/process/spawner +0 -3
  150. data/vendor/webrat/spec/integration/rails/script/runner +0 -3
  151. data/vendor/webrat/spec/integration/rails/script/server +0 -3
  152. data/vendor/webrat/spec/integration/rails/test/integration/webrat_test.rb +0 -80
  153. data/vendor/webrat/spec/integration/rails/test/test_helper.rb +0 -25
  154. data/vendor/webrat/spec/integration/sinatra/Rakefile +0 -5
  155. data/vendor/webrat/spec/integration/sinatra/classic_app.rb +0 -64
  156. data/vendor/webrat/spec/integration/sinatra/modular_app.rb +0 -16
  157. data/vendor/webrat/spec/integration/sinatra/test/classic_app_test.rb +0 -37
  158. data/vendor/webrat/spec/integration/sinatra/test/modular_app_test.rb +0 -18
  159. data/vendor/webrat/spec/integration/sinatra/test/test_helper.rb +0 -16
  160. data/vendor/webrat/spec/private/core/configuration_spec.rb +0 -104
  161. data/vendor/webrat/spec/private/core/field_spec.rb +0 -67
  162. data/vendor/webrat/spec/private/core/link_spec.rb +0 -24
  163. data/vendor/webrat/spec/private/core/logging_spec.rb +0 -10
  164. data/vendor/webrat/spec/private/core/session_spec.rb +0 -198
  165. data/vendor/webrat/spec/private/mechanize/mechanize_session_spec.rb +0 -81
  166. data/vendor/webrat/spec/private/merb/merb_session_spec.rb +0 -42
  167. data/vendor/webrat/spec/private/nokogiri_spec.rb +0 -77
  168. data/vendor/webrat/spec/private/rails/attaches_file_spec.rb +0 -81
  169. data/vendor/webrat/spec/private/rails/rails_session_spec.rb +0 -110
  170. data/vendor/webrat/spec/private/selenium/selenium_session_spec.rb +0 -44
  171. data/vendor/webrat/spec/private/selenium/selenium_spec.rb +0 -109
  172. data/vendor/webrat/spec/public/basic_auth_spec.rb +0 -24
  173. data/vendor/webrat/spec/public/check_spec.rb +0 -191
  174. data/vendor/webrat/spec/public/choose_spec.rb +0 -118
  175. data/vendor/webrat/spec/public/click_area_spec.rb +0 -106
  176. data/vendor/webrat/spec/public/click_button_spec.rb +0 -502
  177. data/vendor/webrat/spec/public/click_link_spec.rb +0 -469
  178. data/vendor/webrat/spec/public/fill_in_spec.rb +0 -209
  179. data/vendor/webrat/spec/public/locators/field_by_xpath_spec.rb +0 -19
  180. data/vendor/webrat/spec/public/locators/field_labeled_spec.rb +0 -157
  181. data/vendor/webrat/spec/public/locators/field_with_id_spec.rb +0 -16
  182. data/vendor/webrat/spec/public/matchers/contain_spec.rb +0 -114
  183. data/vendor/webrat/spec/public/matchers/have_selector_spec.rb +0 -135
  184. data/vendor/webrat/spec/public/matchers/have_tag_spec.rb +0 -39
  185. data/vendor/webrat/spec/public/matchers/have_xpath_spec.rb +0 -123
  186. data/vendor/webrat/spec/public/reload_spec.rb +0 -10
  187. data/vendor/webrat/spec/public/save_and_open_spec.rb +0 -51
  188. data/vendor/webrat/spec/public/select_date_spec.rb +0 -88
  189. data/vendor/webrat/spec/public/select_datetime_spec.rb +0 -106
  190. data/vendor/webrat/spec/public/select_spec.rb +0 -246
  191. data/vendor/webrat/spec/public/select_time_spec.rb +0 -79
  192. data/vendor/webrat/spec/public/set_hidden_field_spec.rb +0 -5
  193. data/vendor/webrat/spec/public/submit_form_spec.rb +0 -5
  194. data/vendor/webrat/spec/public/visit_spec.rb +0 -58
  195. data/vendor/webrat/spec/public/within_spec.rb +0 -177
  196. data/vendor/webrat/spec/rcov.opts +0 -1
  197. data/vendor/webrat/spec/spec.opts +0 -2
  198. data/vendor/webrat/spec/spec_helper.rb +0 -50
  199. data/vendor/webrat/vendor/selenium-server.jar +0 -0
data/Rakefile CHANGED
@@ -7,12 +7,6 @@ begin
7
7
  rescue LoadError
8
8
  end
9
9
 
10
- module Integrity
11
- def self.version
12
- YAML.load_file("VERSION.yml").values.join(".")
13
- end
14
- end
15
-
16
10
  desc "Default: run all tests"
17
11
  task :default => :test
18
12
 
@@ -62,31 +56,63 @@ task :launch do
62
56
  ruby "bin/integrity launch"
63
57
  end
64
58
 
65
- begin
66
- require "jeweler"
67
-
68
- namespace :jeweler do
69
- Jeweler::Tasks.new do |s|
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"
59
+ directory "dist/"
60
+ CLOBBER.include("dist")
61
+
62
+ # Load the gemspec using the same limitations as github
63
+ def spec
64
+ @spec ||=
65
+ begin
66
+ require "rubygems/specification"
67
+ data = File.read("integrity.gemspec")
68
+ spec = nil
69
+ Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
70
+ spec
89
71
  end
72
+ end
73
+
74
+ def package(ext="")
75
+ "dist/integrity-#{spec.version}" + ext
76
+ end
77
+
78
+ desc "Build and install as local gem"
79
+ task :install => package('.gem') do
80
+ sh "gem install #{package('.gem')}"
81
+ end
82
+
83
+ desc "Publish the current release on Rubyforge"
84
+ task :rubyforge => ["rubyforge:gem", "rubyforge:tarball", "rubyforge:git"]
85
+
86
+ namespace :rubyforge do
87
+ desc "Publish gem and tarball to rubyforge"
88
+ task :gem => package(".gem") do
89
+ sh "rubyforge add_release integrity integrity #{spec.version} #{package('.gem')}"
90
+ end
91
+
92
+ task :tarball => package(".tar.gz") do
93
+ sh "rubyforge add_file integrity integrity #{spec.version} #{package('.tar.gz')}"
94
+ end
95
+
96
+ desc "Push to gitosis@rubyforge.org:integrity.git"
97
+ task :git do
98
+ sh "git push gitosis@rubyforge.org:integrity.git master"
99
+ end
100
+ end
101
+
102
+ desc "Build gem tarball into dist/"
103
+ task :package => %w(.gem .tar.gz).map { |ext| package(ext) }
104
+ namespace :package do
105
+ file package(".tar.gz") => "dist/" do |f|
106
+ sh <<-SH
107
+ git archive \
108
+ --prefix=integrity-#{spec.version}/ \
109
+ --format=tar \
110
+ HEAD | gzip > #{f.name}
111
+ SH
112
+ end
113
+
114
+ file package(".gem") => "dist/" do |f|
115
+ sh "gem build integrity.gemspec"
116
+ mv File.basename(f.name), f.name
90
117
  end
91
- rescue LoadError
92
118
  end
@@ -0,0 +1,4 @@
1
+ mailfactory --version '>= 1.4.0'
2
+ tlsmail
3
+ foca-sinatra-ditties --version 0.0.3 --source http://gems.github.com
4
+ integrity --version 0.1.9.0
@@ -0,0 +1,6 @@
1
+ desc "Create the Integrity database"
2
+ task "db:migrate" do
3
+ require File.dirname(__FILE__) + "/integrity-config"
4
+
5
+ DataMapper.auto_migrate!
6
+ end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + "/integrity-config"
3
+
4
+ Integrity::App.set(:environment, ENV["RACK_ENV"] || :production)
5
+ Integrity::App.disable(:run, :reload)
6
+ run Integrity::App
7
+
@@ -0,0 +1,11 @@
1
+ require "rubygems"
2
+ gem "integrity"
3
+ require "integrity"
4
+
5
+ Integrity.config = {
6
+ :database_uri => ENV["DATABASE_URL"],
7
+ :export_directory => File.dirname(__FILE__) + "/tmp",
8
+ :log => File.dirname(__FILE__) + "/log/integrity.log"
9
+ }
10
+
11
+ Integrity.new
data/integrity.gemspec ADDED
@@ -0,0 +1,123 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "integrity"
3
+ s.version = "0.1.9.1"
4
+ s.date = "2009-03-16"
5
+
6
+ s.description = "Your Friendly Continuous Integration server. Easy, fun and painless!"
7
+ s.summary = "The easy and fun Continuous Integration server"
8
+ s.homepage = "http://integrityapp.com"
9
+
10
+ s.authors = ["Nicolás Sanguinetti", "Simon Rozet"]
11
+ s.email = "info@integrityapp.com"
12
+
13
+ s.require_paths = ["lib"]
14
+ s.executables = ["integrity"]
15
+
16
+ s.post_install_message = "Run `integrity help` for information on how to setup Integrity."
17
+ s.rubyforge_project = "integrity"
18
+ s.has_rdoc = false
19
+ s.rubygems_version = "1.3.1"
20
+
21
+ s.add_dependency "sinatra", [">= 0.9.1.1"]
22
+ s.add_dependency "haml", [">= 2.0.0"]
23
+ s.add_dependency "data_mapper", [">= 0.9.10"]
24
+ s.add_dependency "uuidtools" # required by dm-types
25
+ s.add_dependency "bcrypt-ruby" # required by dm-types
26
+ s.add_dependency "json"
27
+ s.add_dependency "thor"
28
+
29
+ s.files = %w[
30
+ README.markdown
31
+ Rakefile
32
+ bin/integrity
33
+ config/config.sample.ru
34
+ config/config.sample.yml
35
+ config/heroku/.gems
36
+ config/heroku/Rakefile
37
+ config/heroku/config.ru
38
+ config/heroku/integrity-config.rb
39
+ config/thin.sample.yml
40
+ integrity.gemspec
41
+ lib/integrity.rb
42
+ lib/integrity/app.rb
43
+ lib/integrity/author.rb
44
+ lib/integrity/build.rb
45
+ lib/integrity/commit.rb
46
+ lib/integrity/core_ext/object.rb
47
+ lib/integrity/helpers.rb
48
+ lib/integrity/helpers/authorization.rb
49
+ lib/integrity/helpers/breadcrumbs.rb
50
+ lib/integrity/helpers/forms.rb
51
+ lib/integrity/helpers/pretty_output.rb
52
+ lib/integrity/helpers/rendering.rb
53
+ lib/integrity/helpers/resources.rb
54
+ lib/integrity/helpers/urls.rb
55
+ lib/integrity/installer.rb
56
+ lib/integrity/migrations.rb
57
+ lib/integrity/notifier.rb
58
+ lib/integrity/notifier/base.rb
59
+ lib/integrity/notifier/test.rb
60
+ lib/integrity/notifier/test/fixtures.rb
61
+ lib/integrity/notifier/test/hpricot_matcher.rb
62
+ lib/integrity/project.rb
63
+ lib/integrity/project_builder.rb
64
+ lib/integrity/scm.rb
65
+ lib/integrity/scm/git.rb
66
+ lib/integrity/scm/git/uri.rb
67
+ public/buttons.css
68
+ public/reset.css
69
+ public/spinner.gif
70
+ test/acceptance/api_test.rb
71
+ test/acceptance/browse_project_builds_test.rb
72
+ test/acceptance/browse_project_test.rb
73
+ test/acceptance/build_notifications_test.rb
74
+ test/acceptance/create_project_test.rb
75
+ test/acceptance/delete_project_test.rb
76
+ test/acceptance/edit_project_test.rb
77
+ test/acceptance/error_page_test.rb
78
+ test/acceptance/helpers.rb
79
+ test/acceptance/installer_test.rb
80
+ test/acceptance/manual_build_project_test.rb
81
+ test/acceptance/notifier_test.rb
82
+ test/acceptance/project_syndication_test.rb
83
+ test/acceptance/stylesheet_test.rb
84
+ test/helpers.rb
85
+ test/helpers/acceptance.rb
86
+ test/helpers/acceptance/email_notifier.rb
87
+ test/helpers/acceptance/git_helper.rb
88
+ test/helpers/acceptance/textfile_notifier.rb
89
+ test/helpers/expectations.rb
90
+ test/helpers/expectations/be_a.rb
91
+ test/helpers/expectations/change.rb
92
+ test/helpers/expectations/have.rb
93
+ test/helpers/expectations/predicates.rb
94
+ test/helpers/fixtures.rb
95
+ test/helpers/initial_migration_fixture.sql
96
+ test/unit/build_test.rb
97
+ test/unit/commit_test.rb
98
+ test/unit/helpers_test.rb
99
+ test/unit/integrity_test.rb
100
+ test/unit/migrations_test.rb
101
+ test/unit/notifier/test_test.rb
102
+ test/unit/notifier_test.rb
103
+ test/unit/project_builder_test.rb
104
+ test/unit/project_test.rb
105
+ test/unit/scm_test.rb
106
+ vendor/sinatra-ditties/README.rdoc
107
+ vendor/sinatra-ditties/lib/sinatra/ditties.rb
108
+ vendor/sinatra-ditties/lib/sinatra/ditties/authorization.rb
109
+ vendor/sinatra-ditties/lib/sinatra/ditties/mailer.rb
110
+ views/_commit_info.haml
111
+ views/build.haml
112
+ views/error.haml
113
+ views/home.haml
114
+ views/integrity.sass
115
+ views/layout.haml
116
+ views/new.haml
117
+ views/not_found.haml
118
+ views/notifier.haml
119
+ views/project.builder
120
+ views/project.haml
121
+ views/unauthorized.haml
122
+ ]
123
+ end
data/lib/integrity.rb CHANGED
@@ -1,6 +1,8 @@
1
- $:.unshift File.expand_path(File.dirname(__FILE__))
1
+ $:.unshift File.expand_path(File.dirname(__FILE__)),
2
+ File.expand_path(File.dirname(__FILE__) + "/../vendor/sinatra-ditties/lib")
2
3
 
3
4
  require "json"
5
+ require "haml"
4
6
  require "dm-core"
5
7
  require "dm-validations"
6
8
  require "dm-types"
@@ -34,22 +36,18 @@ module Integrity
34
36
  DataMapper.setup(:default, config[:database_uri])
35
37
  end
36
38
 
37
- def self.root
38
- Pathname.new(File.dirname(__FILE__)).join("..").expand_path
39
- end
40
-
41
39
  def self.default_configuration
42
40
  @defaults ||= { :database_uri => "sqlite3::memory:",
43
- :export_directory => root / "exports",
41
+ :export_directory => "/tmp/exports",
44
42
  :log => STDOUT,
45
43
  :base_uri => "http://localhost:8910",
46
44
  :use_basic_auth => false,
47
45
  :build_all_commits => true,
48
- :log_debug_info => false }.dup
46
+ :log_debug_info => false }
49
47
  end
50
48
 
51
49
  def self.config
52
- @config ||= default_configuration
50
+ @config ||= default_configuration.dup
53
51
  end
54
52
 
55
53
  def self.config=(options)
@@ -65,13 +63,8 @@ module Integrity
65
63
  logger.formatter = LogFormatter.new
66
64
  end
67
65
  end
66
+ private_class_method :logger
68
67
 
69
- def self.version
70
- YAML.load_file(File.dirname(__FILE__) + "/../VERSION.yml").
71
- values.join(".")
72
- end
73
-
74
- private
75
68
  class LogFormatter < Logger::Formatter
76
69
  def call(severity, time, progname, msg)
77
70
  time.strftime("[%H:%M:%S] ") + msg2str(msg) + "\n"
@@ -1,5 +1,5 @@
1
- require File.dirname(__FILE__) + "/../integrity"
2
1
  require "thor"
2
+ require File.dirname(__FILE__) + "/../integrity"
3
3
 
4
4
  module Integrity
5
5
  class Installer < Thor
@@ -7,16 +7,30 @@ module Integrity
7
7
 
8
8
  desc "install [PATH]",
9
9
  "Copy template files to PATH for desired deployement strategy
10
- (either Thin or Passenger). Next, go there and edit them."
11
- method_options :passenger => false, :thin => false
10
+ (either Thin, Passenger or Heroku). Next, go there and edit them."
11
+ method_options :passenger => :boolean,
12
+ :thin => :boolean,
13
+ :heroku => :boolean
12
14
  def install(path)
13
15
  @root = Pathname(path).expand_path
14
16
 
15
- create_dir_structure
16
- copy_template_files
17
- edit_template_files
18
- migrate_db(root.join("config.yml"))
19
- after_setup_message
17
+ if options[:heroku]
18
+ cp_r Pathname(__FILE__).join("../../../config/heroku"), root
19
+ puts <<EOF
20
+ Your Integrity install is ready to be deployed onto Heroku. Next steps:
21
+
22
+ 1. git init && git add . && git commit -am "Initial import"
23
+ 2. heroku create
24
+ 3. git push heroku master
25
+ 4. heroku rake db:migrate
26
+ EOF
27
+ else
28
+ create_dir_structure
29
+ copy_template_files
30
+ edit_template_files
31
+ migrate_db(root.join("config.yml"))
32
+ after_setup_message
33
+ end
20
34
  end
21
35
 
22
36
  desc "migrate_db [CONFIG]",
@@ -50,17 +64,12 @@ module Integrity
50
64
  puts "Please install #{missing_dependency} to launch Integrity"
51
65
  end
52
66
 
53
- desc "version",
54
- "Print the current integrity version"
55
- def version
56
- puts Integrity.version
57
- end
58
-
59
67
  private
60
68
  attr_reader :root
61
69
 
62
70
  def create_dir_structure
63
71
  mkdir_p root
72
+
64
73
  mkdir_p root / "builds"
65
74
  mkdir_p root / "log"
66
75
 
@@ -71,9 +80,9 @@ module Integrity
71
80
  end
72
81
 
73
82
  def copy_template_files
74
- copy "config/config.sample.ru"
75
- copy "config/config.sample.yml"
76
- copy "config/thin.sample.yml" if options[:thin]
83
+ copy "config.sample.ru"
84
+ copy "config.sample.yml"
85
+ copy "thin.sample.yml" if options[:thin]
77
86
  end
78
87
 
79
88
  def edit_template_files
@@ -96,26 +105,27 @@ module Integrity
96
105
  end
97
106
 
98
107
  def after_setup_message
99
- puts
100
- puts %Q(Awesome! Integrity was installed successfully!)
101
- puts
102
- puts %Q(If you want to enable notifiers, install the gems and then require them)
103
- puts %Q(in #{root}/config.ru)
104
- puts
105
- puts %Q(For example:)
106
- puts
107
- puts %Q( sudo gem install -s http://gems.github.com foca-integrity-email)
108
- puts
109
- puts %Q(And then in #{root}/config.ru add:)
110
- puts
111
- puts %Q( require "notifier/email")
112
- puts
113
- puts %Q(Don't forget to tweak #{root / "config.yml"} to your needs.)
108
+ puts <<EOF
109
+ Awesome! Integrity was installed successfully!
110
+
111
+ If you want to enable notifiers, install the gems and then require them
112
+ in #{root}/config.ru
113
+
114
+ For example:
115
+
116
+ sudo gem install -s http://gems.github.com foca-integrity-email)
117
+
118
+ And then in #{root}/config.ru add:
119
+
120
+ require "notifier/email"
121
+
122
+ Don't forget to tweak #{root / "config.yml"} to your needs.
123
+ EOF
114
124
  end
115
125
 
116
- def copy(path)
117
- cp(File.dirname(__FILE__) + "/../../#{path}",
118
- root.join(File.basename(path).gsub(/\.sample/, "")))
126
+ def copy(source)
127
+ cp(Pathname(__FILE__).dirname.join("../../config", source),
128
+ root.join(File.basename(source).gsub(/\.sample/, "")))
119
129
  end
120
130
  end
121
131
  end
@@ -0,0 +1,59 @@
1
+ require File.dirname(__FILE__) + "/../../integrity"
2
+
3
+ require "integrity/notifier/test/hpricot_matcher"
4
+ require "integrity/notifier/test/fixtures"
5
+
6
+ module Integrity
7
+ class Notifier
8
+ module Test
9
+ def setup_database
10
+ DataMapper.setup(:default, "sqlite3::memory:")
11
+ DataMapper.auto_migrate!
12
+ end
13
+
14
+ def notifier_class
15
+ Integrity::Notifier.const_get(notifier)
16
+ end
17
+
18
+ def notification(commit)
19
+ notifier_class.new(commit).full_message
20
+ end
21
+
22
+ def notification_successful
23
+ notification(Integrity::Commit.gen(:successful))
24
+ end
25
+
26
+ def notification_failed
27
+ notification(Integrity::Commit.gen(:failed))
28
+ end
29
+
30
+ def assert_form_have_option(option, value=nil)
31
+ selector = "input##{notifier.downcase}_notifier_#{option}"
32
+ selector << "[@name='notifiers[#{notifier}][#{option}]']"
33
+ selector << "[@value='#{value}']" if value
34
+
35
+ assert_form_have_tag(selector, option => value)
36
+ end
37
+
38
+ def assert_form_have_options(*options)
39
+ options.each { |option| assert_form_have_option(option) }
40
+ end
41
+
42
+ def assert_form_have_tag(selector, options={})
43
+ content = options.delete(:content)
44
+ assert_have_tag(form(options), selector, content)
45
+ end
46
+
47
+ def assert_have_tag(html, selector, content=nil)
48
+ matcher = HpricotMatcher.new(html)
49
+ assert_equal content, matcher.tag(selector) if content
50
+ assert matcher.tag(selector)
51
+ end
52
+
53
+ def form(config={})
54
+ Haml::Engine.new(notifier_class.to_haml).
55
+ render(OpenStruct.new(:config => config))
56
+ end
57
+ end
58
+ end
59
+ end