juici 0.0.0.alpha1 → 0.0.0

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.
Files changed (69) hide show
  1. data/Gemfile +1 -4
  2. data/Gemfile.lock +9 -19
  3. data/README.md +6 -45
  4. data/Rakefile +0 -24
  5. data/config/mongoid.yml.sample +5 -20
  6. data/juici.gemspec +3 -7
  7. data/lib/juici.rb +3 -8
  8. data/lib/juici/app.rb +23 -19
  9. data/lib/juici/build_environment.rb +1 -1
  10. data/lib/juici/build_logic.rb +1 -10
  11. data/lib/juici/build_queue.rb +3 -30
  12. data/lib/juici/callback.rb +5 -9
  13. data/lib/juici/config.rb +0 -4
  14. data/lib/juici/controllers/build_controller.rb +0 -0
  15. data/lib/juici/controllers/{trigger.rb → trigger_controller.rb} +5 -24
  16. data/lib/juici/database.rb +13 -19
  17. data/lib/juici/helpers/url_helpers.rb +0 -28
  18. data/lib/juici/models/build.rb +24 -81
  19. data/lib/juici/models/project.rb +1 -1
  20. data/lib/juici/server.rb +40 -103
  21. data/lib/juici/url_helpers.rb +15 -0
  22. data/lib/juici/views/README.markdown +6 -45
  23. data/lib/juici/views/about.erb +5 -5
  24. data/lib/juici/views/builds/list.erb +33 -26
  25. data/lib/juici/views/builds/new.erb +37 -42
  26. data/lib/juici/views/builds/show.erb +28 -4
  27. data/lib/juici/views/index.erb +13 -30
  28. data/lib/juici/views/layout.erb +13 -22
  29. data/lib/juici/views/partials/builds/debug.erb +18 -12
  30. data/lib/juici/watcher.rb +25 -33
  31. data/public/styles/builds.css +8 -59
  32. data/public/styles/juici.css +2 -226
  33. data/spec/build_callback_spec.rb +1 -46
  34. data/spec/build_process_spec.rb +5 -71
  35. data/spec/build_queue_spec.rb +1 -3
  36. data/spec/juici_app_spec.rb +15 -0
  37. data/spec/spec_helper.rb +0 -13
  38. metadata +12 -76
  39. data/.gitignore +0 -2
  40. data/bin/juicic +0 -54
  41. data/juici-interface.gemspec +0 -19
  42. data/lib/juici/controllers.rb +0 -6
  43. data/lib/juici/controllers/base.rb +0 -26
  44. data/lib/juici/controllers/build_queue.rb +0 -14
  45. data/lib/juici/controllers/builds.rb +0 -74
  46. data/lib/juici/controllers/index.rb +0 -20
  47. data/lib/juici/exceptions.rb +0 -2
  48. data/lib/juici/find_logic.rb +0 -11
  49. data/lib/juici/helpers/form_helpers.rb +0 -11
  50. data/lib/juici/helpers/html_helpers.rb +0 -4
  51. data/lib/juici/interface.rb +0 -13
  52. data/lib/juici/version.rb +0 -8
  53. data/lib/juici/views/builds/edit.erb +0 -23
  54. data/lib/juici/views/not_found.erb +0 -3
  55. data/lib/juici/views/partials/builds/output.erb +0 -1
  56. data/lib/juici/views/partials/builds/show.erb +0 -19
  57. data/lib/juici/views/partials/builds/sidebar.erb +0 -13
  58. data/lib/juici/views/partials/index/recently_built.erb +0 -19
  59. data/lib/juici/views/queue/list.erb +0 -6
  60. data/public/favicon.ico +0 -0
  61. data/public/images/black_denim.png +0 -0
  62. data/public/vendor/bootstrap.css +0 -6004
  63. data/public/vendor/bootstrap.js +0 -2036
  64. data/public/vendor/img/glyphicons-halflings-white.png +0 -0
  65. data/public/vendor/jquery.js +0 -9440
  66. data/script/cibuild +0 -10
  67. data/spec/controllers/builds_spec.rb +0 -68
  68. data/spec/controllers/index_spec.rb +0 -28
  69. data/spec/models/build_spec.rb +0 -54
@@ -1,10 +0,0 @@
1
- #!/bin/sh
2
-
3
- be="bundle exec"
4
-
5
- export RACK_ENV="test"
6
-
7
- bundle install --path .bundle
8
-
9
- $be rake db:destroy
10
- $be rake spec
@@ -1,68 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
-
3
- describe Juici::Controllers::Builds do
4
-
5
- describe "list" do
6
- it "should throw not_found for invalid projects" do
7
- params = { :project => "__LolIDon'tExist" }
8
- lambda {
9
- Juici::Controllers::Builds.new(params).list
10
- }.should raise_error(Sinatra::NotFound)
11
- end
12
- end
13
-
14
- describe "show" do
15
- it "should throw not_found for invalid projects" do
16
- params = { :project => "__LolIDon'tExist" }
17
- lambda {
18
- Juici::Controllers::Builds.new(params).show
19
- }.should raise_error(Sinatra::NotFound)
20
- end
21
- end
22
-
23
- describe "new" do
24
- it "should return the new template" do
25
- Juici::Controllers::Builds.new({}).new do |opts, template|
26
- end
27
- end
28
- end
29
-
30
- describe "edit" do
31
- it "should throw not_found for invalid projects" do
32
- params = { :project => "__LolIDon'tExist" }
33
- lambda {
34
- Juici::Controllers::Builds.new(params).show
35
- }.should raise_error(Sinatra::NotFound)
36
- end
37
-
38
- it "Should update build objects when given data" do
39
- # FIXME This is a kludge to work around #38
40
- ::Juici::Project.find_or_create_by(name: "test project")
41
- build = Juici::Build.new(parent: "test project", priority: 1, title: "test build")
42
- build.save!
43
-
44
- Juici::Controllers::Builds.new({:priority => 15, :title => "butts lol", :id => build[:_id], :project => "test project"}).update!
45
- build.reload
46
-
47
- build[:title].should == "butts lol"
48
- build[:priority].should == 15
49
- end
50
-
51
- it "Should not let you update a build's ID" do
52
- # FIXME This is a kludge to work around #38
53
- ::Juici::Project.find_or_create_by(name: "test project")
54
- build = Juici::Build.new(parent: "test project")
55
- build.save!
56
-
57
- updated_build = Juici::Controllers::Builds.new({:_id => "New id lol", :id => build[:_id], :project => "test project"}).update!
58
-
59
- updated_build[:_id].should == build[:_id]
60
- end
61
-
62
- it "Should not touch values if given invalid values" do
63
- pending("Needs more research on mongoid")
64
- end
65
-
66
- end
67
-
68
- end
@@ -1,28 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
-
3
- describe Juici::Controllers::Index do
4
-
5
- describe "index" do
6
- it "should render index" do
7
- Juici::Controllers::Index.new().index do |template, opts|
8
- end
9
- end
10
- end
11
-
12
- describe "about" do
13
- it "should add block-header to all h1 tags" do
14
- Juici::Controllers::Index.new().about do |template, opts|
15
- opts[:content].should match(/class="block-header"/)
16
- end
17
- end
18
- end
19
-
20
- describe "support" do
21
- it "should render support" do
22
- Juici::Controllers::Index.new().support do |template, opts|
23
- end
24
- end
25
- end
26
-
27
- end
28
-
@@ -1,54 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
-
3
- describe Juici::Build do
4
-
5
- describe "Time elapsed" do
6
- it "Should have the total duration if complete" do
7
-
8
- build = Juici::Build.new
9
- Time.stubs(:now).returns(Time.at(5000)).then.returns(Time.at(5005))
10
- build.start!
11
- build.success!
12
-
13
- build.time_elapsed.to_i.should == 5
14
- end
15
-
16
- it "Should have the time running if started" do
17
- build = Juici::Build.new
18
- Time.stubs(:now).returns(Time.at(5000)).then.returns(Time.at(5006))
19
- build.start!
20
-
21
- build.time_elapsed.to_i.should == 6
22
- end
23
-
24
- it "Should be nil if not started" do
25
- build = Juici::Build.new
26
- build.time_elapsed.should be_nil
27
- end
28
- end
29
-
30
- it "Should clone itself with #new_from" do
31
- values = {}
32
- Juici::Build::CLONABLE_FIELDS.each do |k|
33
- case k
34
- when :environment
35
- values[k] = {:something => "#{k}_value"}
36
- else
37
- values[k] = "#{k}_value"
38
- end
39
- end
40
-
41
- build = Juici::Build.new(values)
42
- build[:output] = "Lol, I has an output"
43
- build[:buffer] = "/tmp/buffer/lol"
44
- new_build = Juici::Build.new_from(build)
45
-
46
- Juici::Build::CLONABLE_FIELDS.each do |k|
47
- build[k].should == new_build[k]
48
- end
49
-
50
- build[:_id].should_not == new_build[:_id]
51
- new_build[:output].should be_nil
52
- new_build[:buffer].should be_nil
53
- end
54
- end