ci_in_a_can 0.2.3 → 0.2.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97eff7ac024e13813c95198c74372212b0e2fe62
4
- data.tar.gz: 43d0618c07dcf7263aa9b291bc241ea00db7f1e2
3
+ metadata.gz: 8cc7b9a3c96269cab17933b73e3c25f8bf640fb9
4
+ data.tar.gz: a0f059a4b8ffeb8d3c7adbd5e4ee8caf5c8ac5ba
5
5
  SHA512:
6
- metadata.gz: 8b24c32692852775affaabe29f7223379745b069413805a3651b6043420f2bb63d0a2db16e9c8613ca321f6573f8e1a0da601d937840c2362879c13238da3105
7
- data.tar.gz: 81d03078ca9b1d4eeca3cfcf8d6d46401522c1ae665b7c7c4ffdf9c38819c294cbc82fc9471a4e445b642542eecf1198d0b5c89154216780be0f16f8a694fc4d
6
+ metadata.gz: d66137bb18e8252c226c3ba61bf5f437d62b701ea8a8a4c98d8b59d67a4f85aa676621ca9185db49653a8ec6d7d4d6bf179a361cde2778c4fba0847eb71885bc
7
+ data.tar.gz: 5a44a7b4a1f3e92452c0aa410b9f84829014cf72708dcd1cfed779ea1bdee29925946a79211ca03652e53dc222c790d034dc5718f3b9c036f3b75c9250d7cbe3
@@ -82,17 +82,8 @@ EOF
82
82
  end
83
83
 
84
84
  get '/' do
85
- run_html = CiInACan::Run.all.map { |r| r.to_html }.join("\n")
86
-
87
- CiInACan::WebContent.full_page_of(
88
- <<EOF
89
- <table class="table table-bordered">
90
- <tbody>
91
- #{run_html}
92
- </tbody>
93
- </table>
94
- EOF
95
- )
85
+ runs = CiInACan::Run.all.to_a
86
+ ::CiInACan::ViewModels::AListOfRuns.new(runs).to_html
96
87
  end
97
88
 
98
89
  post %r{/push/(.+)} do
@@ -1,3 +1,3 @@
1
1
  module CiInACan
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -0,0 +1,25 @@
1
+ module CiInACan
2
+
3
+ module ViewModels
4
+
5
+ class AListOfRuns < ViewModel
6
+
7
+ def to_html
8
+ run_html = the_original_value.map { |r| r.to_html }.join("\n")
9
+
10
+ CiInACan::WebContent.full_page_of(
11
+ <<EOF
12
+ <table class="table table-bordered">
13
+ <tbody>
14
+ #{run_html}
15
+ </tbody>
16
+ </table>
17
+ EOF
18
+ )
19
+ end
20
+
21
+ end
22
+
23
+ end
24
+
25
+ end
@@ -8,6 +8,10 @@ module CiInACan
8
8
  @value = value
9
9
  end
10
10
 
11
+ def the_original_value
12
+ @value
13
+ end
14
+
11
15
  def method_missing(meth, *args, &blk)
12
16
  @value.send(meth)
13
17
  end
@@ -17,4 +17,10 @@ describe CiInACan::ViewModels::ViewModel do
17
17
 
18
18
  end
19
19
 
20
+ it "should make the original value available" do
21
+ object = Object.new
22
+ result = ::CiInACan::ViewModels::ViewModel.new(object).the_original_value
23
+ result.must_be_same_as result
24
+ end
25
+
20
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci_in_a_can
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Cauthon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-25 00:00:00.000000000 Z
11
+ date: 2014-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -247,6 +247,7 @@ files:
247
247
  - lib/ci_in_a_can/test_result_notifier.rb
248
248
  - lib/ci_in_a_can/test_runner.rb
249
249
  - lib/ci_in_a_can/version.rb
250
+ - lib/ci_in_a_can/view_models/a_list_of_runs.rb
250
251
  - lib/ci_in_a_can/view_models/run_view_model.rb
251
252
  - lib/ci_in_a_can/view_models/test_result_view_model.rb
252
253
  - lib/ci_in_a_can/view_models/view_model.rb