foca-integrity 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.markdown CHANGED
@@ -3,8 +3,8 @@ Integrity
3
3
 
4
4
  Integrity is your friendly automated Continuous Integration server.
5
5
 
6
- It's fully usable from within its web interface (backed by [Sinatra][]),
7
- allowing you to add a project, set preferences for it (where's the code
6
+ It's fully usable from within its web interface (backed by [Sinatra][]),
7
+ allowing you to add a project, set preferences for it (where's the code
8
8
  repository, is it completely private or public, etc), and run the build command
9
9
  from there.
10
10
 
@@ -32,7 +32,7 @@ For deployment, we recommend [Thin][]. Provided with Integrity comes a thin.yml
32
32
  file, so all you need to do after running `integrity install` should be
33
33
 
34
34
  thin -C /path/to/my/app/thin.yml -R /path/to/my/app/config.ru start
35
-
35
+
36
36
  And you should be up and running.
37
37
 
38
38
  If you want automatic commit processing, you currently need to be using
data/Rakefile CHANGED
@@ -51,16 +51,19 @@ begin
51
51
  files = `git ls-files`.split("\n").reject {|f| f =~ %r(^spec) || f =~ %r(^vendor/rspec) || f =~ /^\.git/ }
52
52
  files += %w(spec/spec_helper.rb spec/form_field_matchers.rb)
53
53
 
54
- s.name = 'integrity'
55
- s.summary = 'The easy and fun Continuous Integration server'
56
- s.description = 'Your Friendly Continuous Integration server. Easy, fun and painless!'
57
- s.homepage = 'http://integrityapp.com'
58
- s.rubyforge_project = 'integrity'
59
- s.email = 'contacto@nicolassanguinetti.info'
60
- s.authors = ['Nicolás Sanguinetti', 'Simon Rozet']
61
- s.files = files
54
+ s.name = 'integrity'
55
+ s.summary = 'The easy and fun Continuous Integration server'
56
+ s.description = 'Your Friendly Continuous Integration server. Easy, fun and painless!'
57
+ s.homepage = 'http://integrityapp.com'
58
+ s.rubyforge_project = 'integrity'
59
+ s.email = 'contacto@nicolassanguinetti.info'
60
+ s.authors = ['Nicolás Sanguinetti', 'Simon Rozet']
61
+ s.files = files
62
+ s.executables = ['integrity']
63
+ s.post_install_message = 'Run `integrity help` for information on how to setup Integrity.'
62
64
 
63
65
  s.add_dependency 'sinatra', ['>= 0.3.2']
66
+ s.add_dependency 'haml' # ah, you evil monkey you
64
67
  s.add_dependency 'dm-core', ['>= 0.9.5']
65
68
  s.add_dependency 'dm-validations', ['>= 0.9.5']
66
69
  s.add_dependency 'dm-types', ['>= 0.9.5']
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
+ patch: 2
2
3
  major: 0
3
4
  minor: 1
4
- patch: 1
data/app.rb CHANGED
@@ -25,6 +25,12 @@ not_found do
25
25
  show :not_found, :title => "lost, are we?"
26
26
  end
27
27
 
28
+ error do
29
+ @error = request.env['sinatra.error']
30
+ status 500
31
+ show :error, :title => "something has gone terribly wrong"
32
+ end
33
+
28
34
  before do
29
35
  # The browser only sends http auth data for requests that are explicitly
30
36
  # required to do so. This way we get the real values of +#logged_in?+ and
data/bin/integrity CHANGED
@@ -7,11 +7,11 @@ require File.dirname(__FILE__) + "/../lib/integrity"
7
7
  class WithIntegrity < Thor
8
8
  include FileUtils
9
9
 
10
- desc "Install integrity at PATH",
11
- "Copy template files at PATH. After this, edit the files to your convenience"
10
+ desc "install [PATH]",
11
+ "Copy template files to PATH. Next, go there and edit them."
12
12
  def install(path)
13
13
  @root = File.expand_path(path)
14
-
14
+
15
15
  create_dir_structure
16
16
  copy_template_files
17
17
  edit_template_files
@@ -19,28 +19,28 @@ class WithIntegrity < Thor
19
19
  after_setup_message
20
20
  end
21
21
 
22
- desc "Create database based on the config file at CONFIG",
22
+ desc "create_db [CONFIG]",
23
23
  "Checks the `database_uri` in CONFIG and creates and bootstraps a database for integrity"
24
24
  def create_db(config)
25
25
  Integrity.new(config)
26
26
  DataMapper.auto_migrate!
27
27
  end
28
-
28
+
29
29
  private
30
30
  attr_reader :root
31
-
31
+
32
32
  def create_dir_structure
33
33
  mkdir_p root
34
34
  mkdir_p root / "builds"
35
35
  mkdir_p root / "log"
36
36
  end
37
-
37
+
38
38
  def copy_template_files
39
39
  cp Integrity.root / "config" / "config.sample.ru", root / "config.ru"
40
40
  cp Integrity.root / "config" / "config.sample.yml", root / "config.yml"
41
41
  cp Integrity.root / "config" / "thin.sample.yml", root / "thin.yml"
42
42
  end
43
-
43
+
44
44
  def edit_template_files
45
45
  edit_integrity_configuration
46
46
  edit_thin_configuration
@@ -58,7 +58,7 @@ class WithIntegrity < Thor
58
58
  config.gsub!(%r(/apps/integrity), root)
59
59
  File.open(root / 'thin.yml', 'w') { |f| f.puts config }
60
60
  end
61
-
61
+
62
62
  def after_setup_message
63
63
  puts
64
64
  puts %Q(Awesome! Integrity was installed successfully!)
data/integrity.gemspec CHANGED
@@ -1,20 +1,21 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{integrity}
3
- s.version = "0.1.1"
3
+ s.version = "0.1.2"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Nicol\303\241s Sanguinetti", "Simon Rozet"]
7
- s.date = %q{2008-11-17}
7
+ s.date = %q{2008-11-20}
8
+ s.default_executable = %q{integrity}
8
9
  s.description = %q{Your Friendly Continuous Integration server. Easy, fun and painless!}
9
10
  s.email = %q{contacto@nicolassanguinetti.info}
10
- 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/builder.rb", "lib/integrity/core_ext/object.rb", "lib/integrity/core_ext/string.rb", "lib/integrity/core_ext/time.rb", "lib/integrity/notifier.rb", "lib/integrity/notifier/base.rb", "lib/integrity/project.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", "vendor/sinatra-hacks/lib/hacks.rb", "views/build.haml", "views/build_info.haml", "views/home.haml", "views/integrity.sass", "views/layout.haml", "views/new.haml", "views/not_found.haml", "views/notifier.haml", "views/project.haml", "views/unauthorized.haml", "spec/spec_helper.rb", "spec/form_field_matchers.rb"]
11
+ s.executables = ["integrity"]
12
+ 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/builder.rb", "lib/integrity/core_ext/object.rb", "lib/integrity/core_ext/string.rb", "lib/integrity/core_ext/time.rb", "lib/integrity/notifier.rb", "lib/integrity/notifier/base.rb", "lib/integrity/project.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", "vendor/sinatra-hacks/lib/hacks.rb", "views/build.haml", "views/build_info.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.haml", "views/unauthorized.haml", "spec/spec_helper.rb", "spec/form_field_matchers.rb"]
11
13
  s.homepage = %q{http://integrityapp.com}
14
+ s.post_install_message = %q{Run `integrity help` for information on how to setup Integrity.}
12
15
  s.require_paths = ["lib"]
13
16
  s.rubyforge_project = %q{integrity}
14
17
  s.rubygems_version = %q{1.2.0}
15
18
  s.summary = %q{The easy and fun Continuous Integration server}
16
- s.executables = ['integrity']
17
- s.post_install_message = %q{Run `integrity help` for information on how to setup Integrity.}
18
19
 
19
20
  if s.respond_to? :specification_version then
20
21
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
@@ -22,6 +23,7 @@ Gem::Specification.new do |s|
22
23
 
23
24
  if current_version >= 3 then
24
25
  s.add_runtime_dependency(%q<sinatra>, [">= 0.3.2"])
26
+ s.add_runtime_dependency(%q<haml>, [">= 0"])
25
27
  s.add_runtime_dependency(%q<dm-core>, [">= 0.9.5"])
26
28
  s.add_runtime_dependency(%q<dm-validations>, [">= 0.9.5"])
27
29
  s.add_runtime_dependency(%q<dm-types>, [">= 0.9.5"])
@@ -35,6 +37,7 @@ Gem::Specification.new do |s|
35
37
  s.add_runtime_dependency(%q<thor>, [">= 0"])
36
38
  else
37
39
  s.add_dependency(%q<sinatra>, [">= 0.3.2"])
40
+ s.add_dependency(%q<haml>, [">= 0"])
38
41
  s.add_dependency(%q<dm-core>, [">= 0.9.5"])
39
42
  s.add_dependency(%q<dm-validations>, [">= 0.9.5"])
40
43
  s.add_dependency(%q<dm-types>, [">= 0.9.5"])
@@ -49,6 +52,7 @@ Gem::Specification.new do |s|
49
52
  end
50
53
  else
51
54
  s.add_dependency(%q<sinatra>, [">= 0.3.2"])
55
+ s.add_dependency(%q<haml>, [">= 0"])
52
56
  s.add_dependency(%q<dm-core>, [">= 0.9.5"])
53
57
  s.add_dependency(%q<dm-validations>, [">= 0.9.5"])
54
58
  s.add_dependency(%q<dm-types>, [">= 0.9.5"])
@@ -2,7 +2,7 @@ module Integrity
2
2
  class Notifier
3
3
  class Base
4
4
  def self.notify_of_build(build, config)
5
- new(build, config).deliver!
5
+ Timeout.timeout(8) { new(build, config).deliver! }
6
6
  end
7
7
 
8
8
  def self.to_haml
@@ -35,8 +35,9 @@ module Integrity
35
35
  end
36
36
 
37
37
  def previous_builds
38
- return [] if builds.count <= 1
39
- builds.all(:order => [:created_at.desc], :offset => 1, :limit => builds.count - 1)
38
+ builds.all(:order => [:created_at.desc]).tap do |builds|
39
+ builds.shift
40
+ end
40
41
  end
41
42
 
42
43
  def status
@@ -76,7 +77,11 @@ module Integrity
76
77
 
77
78
  def send_notifications
78
79
  notifiers.each do |notifier|
79
- notifier.notify_of_build last_build
80
+ begin
81
+ notifier.notify_of_build last_build
82
+ rescue Timeout::Error
83
+ next
84
+ end
80
85
  end
81
86
  end
82
87
  end
data/lib/integrity.rb CHANGED
@@ -1,5 +1,6 @@
1
- __DIR__ = File.dirname(__FILE__)
2
- $:.unshift "#{__DIR__}/integrity", *Dir["#{__DIR__}/../vendor/**/lib"].to_a
1
+ current_dir = File.expand_path(File.dirname(__FILE__))
2
+ vendor_lib_directories = Dir[File.join(current_dir, '..', 'vendor/**/lib')]
3
+ $:.unshift File.join(current_dir, 'integrity'), *vendor_lib_directories
3
4
 
4
5
  require 'rubygems'
5
6
  require 'json'
@@ -17,7 +18,12 @@ require "core_ext/object"
17
18
  require "core_ext/string"
18
19
  require "core_ext/time"
19
20
 
20
- %w(project build builder scm scm/git notifier).each &method(:require)
21
+ require 'project'
22
+ require 'build'
23
+ require 'builder'
24
+ require 'scm'
25
+ require 'scm/git'
26
+ require 'notifier'
21
27
 
22
28
  module Integrity
23
29
  def self.new(config_file = nil)
data/views/error.haml ADDED
@@ -0,0 +1,29 @@
1
+ .error
2
+ %h1
3
+ Whatever you do, DON'T PANIC!
4
+
5
+ %dl
6
+ %dt This is what happened:
7
+ %dd
8
+ %strong&= @error.message
9
+ %pre.backtrace= @error.backtrace.join("\n")
10
+
11
+ %dt What can I do?
12
+ %dd
13
+ Is your
14
+ %a{ :href => "http://integrityapp.com/configure" } config
15
+ ok? If not, try restarting integrity. If you think everything is fine,
16
+ then drop by our irc channel:
17
+ %a{ :href => "irc://irc.freenode.org:6667/integrity" } #integrity
18
+ on freenode, and we'll try to help.
19
+
20
+ %dt
21
+ What the hell is
22
+ = succeed "?" do
23
+ %strong Integrity
24
+ %dd
25
+ Integrity is your friendly
26
+ %a{ :href => "http://en.wikipedia.org/wiki/Continuous_integration" } Continuous Integration
27
+ server. If you want to know more about us, check our website at
28
+ = succeed "." do
29
+ %a{ :href => "http://integrityapp.com" } integrityapp.com
data/views/integrity.sass CHANGED
@@ -213,6 +213,13 @@ a
213
213
  :family = !nice_fonts
214
214
  dd
215
215
  :line-height 1.4
216
+
217
+ .backtrace
218
+ :margin 1em 0
219
+ :overflow scroll
220
+ :height 30em
221
+ :border = 1px solid !rule_color
222
+ :line-height 1.6
216
223
 
217
224
  #projects
218
225
  :margin 1em 0 2em
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foca-integrity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Nicol\xC3\xA1s Sanguinetti"
@@ -10,8 +10,8 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2008-11-17 00:00:00 -08:00
14
- default_executable:
13
+ date: 2008-11-20 00:00:00 -08:00
14
+ default_executable: integrity
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: sinatra
@@ -22,6 +22,15 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 0.3.2
24
24
  version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: haml
27
+ version_requirement:
28
+ version_requirements: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: "0"
33
+ version:
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: dm-core
27
36
  version_requirement:
@@ -157,6 +166,7 @@ files:
157
166
  - vendor/sinatra-hacks/lib/hacks.rb
158
167
  - views/build.haml
159
168
  - views/build_info.haml
169
+ - views/error.haml
160
170
  - views/home.haml
161
171
  - views/integrity.sass
162
172
  - views/layout.haml