tech_radar 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +35 -0
  4. data/app/assets/javascripts/tech_radar/application.js +13 -0
  5. data/app/assets/stylesheets/tech_radar/application.scss +15 -0
  6. data/app/controllers/tech_radar/application_controller.rb +6 -0
  7. data/app/controllers/tech_radar/quadrants_controller.rb +11 -0
  8. data/app/controllers/tech_radar/radar_controller.rb +14 -0
  9. data/app/controllers/tech_radar/rings_controller.rb +11 -0
  10. data/app/controllers/tech_radar/technologies_controller.rb +13 -0
  11. data/app/helpers/tech_radar/application_helper.rb +26 -0
  12. data/app/models/tech_radar/quadrant.rb +4 -0
  13. data/app/models/tech_radar/radar.rb +63 -0
  14. data/app/models/tech_radar/ring.rb +3 -0
  15. data/app/models/tech_radar/technology.rb +5 -0
  16. data/app/views/layouts/tech_radar/application.html.erb +21 -0
  17. data/app/views/tech_radar/quadrants/show.html.erb +33 -0
  18. data/app/views/tech_radar/radar/index.html.erb +49 -0
  19. data/app/views/tech_radar/radar/summary.html.erb +30 -0
  20. data/app/views/tech_radar/rings/show.html.erb +30 -0
  21. data/app/views/tech_radar/technologies/index.html.erb +23 -0
  22. data/app/views/tech_radar/technologies/show.html.erb +43 -0
  23. data/config/locales/en.yml +58 -0
  24. data/config/routes.rb +8 -0
  25. data/lib/tasks/tech_radar_tasks.rake +4 -0
  26. data/lib/tech_radar/engine.rb +5 -0
  27. data/lib/tech_radar/version.rb +3 -0
  28. data/lib/tech_radar.rb +11 -0
  29. data/test/controllers/tech_radar/quadrants_controller_test.rb +17 -0
  30. data/test/controllers/tech_radar/radar_controller_test.rb +21 -0
  31. data/test/controllers/tech_radar/technologies_controller_test.rb +44 -0
  32. data/test/dummy/README.rdoc +28 -0
  33. data/test/dummy/Rakefile +6 -0
  34. data/test/dummy/app/assets/javascripts/application.js +13 -0
  35. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  36. data/test/dummy/app/controllers/application_controller.rb +5 -0
  37. data/test/dummy/app/helpers/application_helper.rb +2 -0
  38. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  39. data/test/dummy/bin/bundle +3 -0
  40. data/test/dummy/bin/rails +4 -0
  41. data/test/dummy/bin/rake +4 -0
  42. data/test/dummy/bin/setup +29 -0
  43. data/test/dummy/config/application.rb +29 -0
  44. data/test/dummy/config/boot.rb +5 -0
  45. data/test/dummy/config/environment.rb +5 -0
  46. data/test/dummy/config/environments/development.rb +38 -0
  47. data/test/dummy/config/environments/production.rb +76 -0
  48. data/test/dummy/config/environments/test.rb +42 -0
  49. data/test/dummy/config/initializers/assets.rb +11 -0
  50. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  51. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  52. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  53. data/test/dummy/config/initializers/inflections.rb +16 -0
  54. data/test/dummy/config/initializers/mime_types.rb +4 -0
  55. data/test/dummy/config/initializers/session_store.rb +3 -0
  56. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  57. data/test/dummy/config/locales/en.yml +6 -0
  58. data/test/dummy/config/routes.rb +4 -0
  59. data/test/dummy/config/secrets.yml +22 -0
  60. data/test/dummy/config/tech-radar.yml +94 -0
  61. data/test/dummy/config.ru +4 -0
  62. data/test/dummy/log/test.log +3014 -0
  63. data/test/dummy/public/404.html +67 -0
  64. data/test/dummy/public/422.html +67 -0
  65. data/test/dummy/public/500.html +66 -0
  66. data/test/dummy/public/favicon.ico +0 -0
  67. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/1IKk2C4YRauMr_7Wz-CU4Irtdnkr79tOQd1jE0PWji4.cache +0 -0
  68. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/4jiHLR_loKdeAd0JcA82pbx9uv_uZ061yoAW5ILVke0.cache +1 -0
  69. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +2 -0
  70. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5hNPdJ-QvbvonKnV_4WtyMMSIsLK6XcQ3dqEm7lk5Yg.cache +3 -0
  71. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/8YDI2KKHwSLb86O9q_L34QpLWGcYoGfRw3pVUc6AXL4.cache +1 -0
  72. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/CTIhnJYFsEH9tShUP9_EAv4FFdKuxME8e0cIwqdIu2w.cache +0 -0
  73. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/CtNMnfyrkEQeOnvFA-fvdjW_oul9mgnsSLkCpUnNzpI.cache +1 -0
  74. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Cu68hI8JKlbssICAWZh6Zk2l6ItX5KkKP9kCDDyN6Yc.cache +1 -0
  75. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/DcWGpVSBeGg8GE4YanvpgWTYVRezVuYgxd4WP0xTG5Y.cache +0 -0
  76. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/E9psQWSZsOiAp5jeWlqMdrJv2l1rZTWHZbmsnEbKvN8.cache +1 -0
  77. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ExmO5_Val1Y7VJGCSLFP1wx8iANj0Wirfm6PhW_PJRM.cache +3 -0
  78. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FqMJmO4uMYjcalOHO_9_PmpeS0EGPj2s_B5OVOmc9NI.cache +1 -0
  79. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/H2416jAaRBSU35oLo5rnBz43Udk1pJ-CK5x5Q1SHxZQ.cache +0 -0
  80. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/J1ZK5MuwwE_oKwdRBt07dXeGtnWf5IWSEVBBH4dj4wg.cache +1 -0
  81. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/JSGgn6gHG6gP_t3N6_5z0P3Mmqkg2ZdhnSRz1ivZVf4.cache +1 -0
  82. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Lm2MxqZ9br-5beQtEBAvojOOAc9btQusIwLlN2hDqcI.cache +0 -0
  83. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/M4Vx5DqzQqmfihPkefVIR1UwUJI9weunCiDqzZ8mmWQ.cache +1 -0
  84. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/N9GBhDB3oo8hX7mehgcE6Sylr-2KgoFKWV-97uSKncs.cache +2 -0
  85. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +3 -0
  86. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/X17E_hQiWRCM38iR5NTruI8CqF3BdEXj0jxQ0OMYmZM.cache +2 -0
  87. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ZWMSse5xwAn4lVdnOdzP7aamfJLIIJ3tgM_K6QgcID8.cache +0 -0
  88. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_Mh7lJN_IwpWjIHi_ipCLitIWuSaytWCt4Uaa_9__jk.cache +1 -0
  89. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ddThsRgEK7CMiOeJAoKDc2u5XtMMckYrtLrU6l1OMSE.cache +1 -0
  90. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fQWuPc3zow9d7NdDqJfW-GhJVLVY1l--t75LhXdW6J8.cache +1 -0
  91. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/h3jqUoCq7UB6lqi_uNq2KvLeg8IL_lP7JCUy5f2THjg.cache +0 -0
  92. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache +3 -0
  93. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/iN-4vwzGEOKQmOV_1xlm5xaE-sVreqvPz91kILjcpbA.cache +0 -0
  94. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/jDzXj5We0E1Dn8NHOcZAsZkmOuIEkc1nYr0iQAiSb8o.cache +0 -0
  95. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lvcTaXyJ-7szvUf-sYbvA1-nyJTVyID06rjZvrbr1S4.cache +1 -0
  96. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/nkNCYpk1UlnSzoHoaAju8L7NmNHCc7qQumYZDCvcXCk.cache +1 -0
  97. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache +2 -0
  98. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ptDPhzkjEXOWKqfzGjc-EgPg2tSxTq4V2JguIA9TX0A.cache +0 -0
  99. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/rDves_tz9XyBMoqG8wHncbqTXD1XfkDoCG_yQyCPYrY.cache +1 -0
  100. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uHvIkDeFAy-0stCt8jyUtRf666EYXAmFfRHK3Kclt0k.cache +0 -0
  101. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/wjc4fxI0T-E_AMREBsqAzcOoJVLQ2XmN8ybSXr2sA1c.cache +0 -0
  102. data/test/integration/navigation_test.rb +8 -0
  103. data/test/models/tech_radar/radar_test.rb +59 -0
  104. data/test/test_helper.rb +20 -0
  105. metadata +281 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f92f0d8e4378abea9c9f36ba5cc9030f3862ba62
4
+ data.tar.gz: c37c4ed72982c67fb15618e9704764c4902f3247
5
+ SHA512:
6
+ metadata.gz: c9f2c634329b975dac202f4f57f995c30fc4a4aea59875e90f10d2dac128820535ad6370ff651d1bb002863fe0ada06ef27452d002cd21453e61977fb899dfbd
7
+ data.tar.gz: d314b3d87426a909bc2f048a3ef69b8141cfed49c78e3b981ac372e50d0bb8cdc777b4632b9fef421540afb23c34260371de9a62450401e028bdf653cd4cce3a
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2015 Dave Copeland
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,35 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'TechRadar'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+ load 'rails/tasks/statistics.rake'
20
+
21
+
22
+
23
+ Bundler::GemHelper.install_tasks
24
+
25
+ require 'rake/testtask'
26
+
27
+ Rake::TestTask.new(:test) do |t|
28
+ t.libs << 'lib'
29
+ t.libs << 'test'
30
+ t.pattern = 'test/**/*_test.rb'
31
+ t.verbose = false
32
+ end
33
+
34
+
35
+ task default: :test
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,6 @@
1
+ module TechRadar
2
+ #class ApplicationController < ActionController::Base
3
+ class ApplicationController < ::ApplicationController
4
+ layout "application"
5
+ end
6
+ end
@@ -0,0 +1,11 @@
1
+ require_dependency "tech_radar/application_controller"
2
+
3
+ module TechRadar
4
+ class QuadrantsController < ApplicationController
5
+ def show
6
+ tech_radar = TechRadar::Radar.new
7
+ @all_quadrant_names = tech_radar.quadrants.map(&:name)
8
+ @quadrant = tech_radar.quadrant(params[:id])
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ require_dependency "tech_radar/application_controller"
2
+
3
+ module TechRadar
4
+ class RadarController < ApplicationController
5
+ def index
6
+ @hide_nav = true
7
+ @radar = TechRadar::Radar.new
8
+ end
9
+
10
+ def summary
11
+ @radar = TechRadar::Radar.new
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ require_dependency "tech_radar/application_controller"
2
+
3
+ module TechRadar
4
+ class RingsController < ApplicationController
5
+ def show
6
+ tech_radar = TechRadar::Radar.new
7
+ @all_ring_names = tech_radar.rings.map(&:name)
8
+ @ring = tech_radar.ring(params[:id])
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ require_dependency "tech_radar/application_controller"
2
+
3
+ module TechRadar
4
+ class TechnologiesController < ApplicationController
5
+ def index
6
+ @technologies = TechRadar::Radar.new.technologies
7
+ end
8
+
9
+ def show
10
+ @technology = TechRadar::Radar.new.technology(params[:id])
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,26 @@
1
+ module TechRadar
2
+ module ApplicationHelper
3
+ def label_color_for_ring(ring_name)
4
+ if ring_name == 'Adopt'
5
+ :success
6
+ elsif ring_name == 'Hold'
7
+ :warning
8
+ else
9
+ :default
10
+ end
11
+ end
12
+
13
+ def panel_type_for_technology_why(technology)
14
+ if technology.why_summary.blank? && warn_on_missing_why?(technology)
15
+ :warning
16
+ else
17
+ :default
18
+ end
19
+ end
20
+
21
+ def warn_on_missing_why?(technology)
22
+ technology.ring != 'Adopt' && technology.ring != 'Trial'
23
+ end
24
+
25
+ end
26
+ end
@@ -0,0 +1,4 @@
1
+ require 'immutable-struct'
2
+ module TechRadar
3
+ end
4
+ TechRadar::Quadrant = ImmutableStruct.new(:name, [:rings])
@@ -0,0 +1,63 @@
1
+ module TechRadar
2
+ class Radar
3
+ attr_reader :data
4
+ def initialize
5
+ @data = YAML.load_file(Rails.root + "config" + "tech-radar.yml")
6
+ end
7
+
8
+ def quadrants
9
+ @data.keys.map { |quadrant_name|
10
+ quadrant(quadrant_name)
11
+ }
12
+ end
13
+
14
+ def quadrant(quadrant_name)
15
+ quadrant = @data.fetch(quadrant_name)
16
+ by_ring = {}
17
+ quadrant.each do |(ring,technologies)|
18
+ by_ring[ring] ||= []
19
+ (technologies || {}).each do |(name,data)|
20
+ by_ring[ring] << mk_technology(name,ring,quadrant_name,data)
21
+ end
22
+ end
23
+ TechRadar::Quadrant.new(
24
+ name: quadrant_name,
25
+ rings: by_ring.map { |ring_name,technologies|
26
+ TechRadar::Ring.new(name: ring_name, technologies: technologies.sort_by { |tech| tech.name.downcase })
27
+ }
28
+ )
29
+ end
30
+
31
+ def rings
32
+ quadrants.map(&:rings).flatten.group_by(&:name).map { |(ring_name,rings)|
33
+ TechRadar::Ring.new(name: ring_name,technologies: rings.map(&:technologies).flatten.sort_by { |tech| tech.name.downcase })
34
+ }
35
+ end
36
+
37
+ def ring(ring_name)
38
+ rings.detect { |ring| ring.name == ring_name }
39
+ end
40
+
41
+ def technologies
42
+ quadrants.map(&:rings).flatten.map(&:technologies).flatten.sort_by { |technology| technology.name.downcase }
43
+ end
44
+
45
+ def technology(name)
46
+ technologies.detect { |technology| technology.name == name }
47
+ end
48
+
49
+ private
50
+
51
+ def mk_technology(name,ring,quadrant,data)
52
+ puts data.inspect if name == 'api_client'
53
+ Technology.new(name: name,
54
+ ring: ring,
55
+ quadrant: quadrant,
56
+ more_details_url: data["more_details_url"],
57
+ why_url: data["why_url"],
58
+ purpose: data["purpose"],
59
+ why_summary: data["why_summary"])
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,3 @@
1
+ module TechRadar
2
+ end
3
+ TechRadar::Ring = ImmutableStruct.new(:name, [:technologies])
@@ -0,0 +1,5 @@
1
+ require 'immutable-struct'
2
+
3
+ module TechRadar
4
+ end
5
+ TechRadar::Technology = ImmutableStruct.new(:name, :ring, :quadrant, :purpose, :why_summary, :more_details_url, :why_url)
@@ -0,0 +1,21 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>TechRadar</title>
5
+ <%= stylesheet_link_tag "tech_radar/application", media: "all" %>
6
+ <script src="https://code.jquery.com/jquery-2.1.4.min.js">
7
+ </script>
8
+ <%= javascript_include_tag "tech_radar/application" %>
9
+ <%= csrf_meta_tags %>
10
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
11
+ </head>
12
+ <body>
13
+ <section class="container">
14
+ <% unless @hide_nav %>
15
+ <h1><%= link_to t("tech_radar.radar.title").html_safe, radar_index_path %></h1>
16
+ <hr>
17
+ <% end %>
18
+ <%= yield %>
19
+ </section>
20
+ </body>
21
+ </html>
@@ -0,0 +1,33 @@
1
+ <section>
2
+ <nav>
3
+ <ul class="nav nav-pills">
4
+ <% @all_quadrant_names.each do |quadrant_name| %>
5
+ <li role="presentation" class="<%= quadrant_name == @quadrant.name ? 'active' : '' %>"><%= link_to t("tech_radar.radar.quadrants.#{quadrant_name}.title"), quadrant_path(quadrant_name) %></li>
6
+ <% end %>
7
+ </ul>
8
+ </nav>
9
+ <hr>
10
+ <h2 class="sr-only"><%= t("tech_radar.radar.quadrants.#{@quadrant.name}.title") %></h2>
11
+ <p class="lead"><%= t("tech_radar.radar.quadrants.#{@quadrant.name}.description") %></p>
12
+ <% @quadrant.rings.each do |ring| %>
13
+ <section>
14
+ <h1 class="h2">
15
+ <%= t("tech_radar.radar.rings.#{ring.name}.title") %>
16
+ <small><%= t("tech_radar.radar.rings.#{ring.name}.summary").html_safe %></small>
17
+ </h1>
18
+ <ul class="list-unstyled">
19
+ <% ring.technologies.each do |technology| %>
20
+ <li>
21
+ <p class="h4">
22
+ <%= link_to technology.name, technology_path(technology.name) %>
23
+ &middot;
24
+ <small>
25
+ <%= technology.purpose %>
26
+ </small>
27
+ </p>
28
+ </li>
29
+ <% end %>
30
+ </ul>
31
+ </section>
32
+ <% end %>
33
+ </section>
@@ -0,0 +1,49 @@
1
+ <section>
2
+ <div class="row">
3
+ <div class="col-md-2">&nbsp;</div>
4
+ <div class="col-md-8">
5
+ <header>
6
+ <h1><%= t("tech_radar.radar.title") %></h1>
7
+ </header>
8
+ <p class="lead">
9
+ <%= t("tech_radar.radar.index.preamble") %>
10
+ </p>
11
+ <p>
12
+ <%= link_to t("tech_radar.radar.index.summary_link"), radar_summary_path, class: "btn btn-primary" %>
13
+ <%= link_to t("tech_radar.radar.index.all_list_link"), technologies_path, class: "btn btn-default" %>
14
+ </p>
15
+ <section>
16
+ <h1 class="h2"><%= t("tech_radar.radar.index.howto.title") %></h1>
17
+ <h2 class="h3"><%= t("tech_radar.radar.rings.name") %></h1>
18
+ <p><%= t("tech_radar.radar.index.howto.rings.preamble") %></p>
19
+ <% @radar.rings.each_slice(2) do |rings| %>
20
+ <div class="row">
21
+ <% rings.each do |ring| %>
22
+ <div class="col-md-6">
23
+ <h3 class="h4"><%= link_to t("tech_radar.radar.rings.#{ring.name}.title"), ring_path(ring.name) %></h3>
24
+ <p class="text-muted"><%= t("tech_radar.radar.rings.#{ring.name}.description").html_safe %></p>
25
+ </div>
26
+ <% end %>
27
+ </div>
28
+ <% end %>
29
+ <h2 class="h3"><%= t("tech_radar.radar.quadrants.name") %></h1>
30
+ <p><%= t("tech_radar.radar.index.howto.quadrants.preamble") %></p>
31
+ <% @radar.quadrants.each_slice(2) do |quadrants| %>
32
+ <div class="row">
33
+ <% quadrants.each do |quadrant| %>
34
+ <div class="col-md-6">
35
+ <h3 class="h4"><%= link_to t("tech_radar.radar.quadrants.#{quadrant.name}.title"), quadrant_path(quadrant.name) %></h3>
36
+ <p class="text-muted"><%= t("tech_radar.radar.quadrants.#{quadrant.name}.description").html_safe %></p>
37
+ </div>
38
+ <% end %>
39
+ </div>
40
+ <% end %>
41
+ </section>
42
+ <section>
43
+ </section>
44
+ <h1 class="h2"><%= t("tech_radar.radar.index.changing.title") %></h1>
45
+ <p><%= t("tech_radar.radar.index.changing.preamble") %></p>
46
+ </section>
47
+ </div>
48
+ <div class="col-md-2">&nbsp;</div>
49
+ </section>
@@ -0,0 +1,30 @@
1
+ <div class="row">
2
+ <% @radar.quadrants.each do |quadrant| %>
3
+ <div class="col-md-3">
4
+ <h1 class="h3"><%= t("tech_radar.radar.quadrants.#{quadrant.name}.title") %></h1>
5
+ </div>
6
+ <% end %>
7
+ </div>
8
+ <% @radar.rings.each do |ring| %>
9
+ <article class="panel panel-<%= label_color_for_ring(ring.name) %>">
10
+ <div class="panel-heading">
11
+ <%= t("tech_radar.radar.rings.#{ring.name}.title") %>
12
+ </div>
13
+ <div class="panel-body">
14
+ <div class="row">
15
+ <% @radar.quadrants.each do |quadrant| %>
16
+ <div class="col-md-3">
17
+ <p>
18
+ <% ring.technologies.select { |technology| technology.quadrant == quadrant.name }.each_with_index do |technology,i| %>
19
+ <% if i != 0 %>
20
+ &middot;
21
+ <% end %>
22
+ <%= link_to technology.name, technology_path(technology.name) %>
23
+ <% end %>
24
+ </p>
25
+ </div>
26
+ <% end %>
27
+ </div>
28
+ </div>
29
+ </article>
30
+ <% end %>
@@ -0,0 +1,30 @@
1
+ <section>
2
+ <nav>
3
+ <ul class="nav nav-pills">
4
+ <% @all_ring_names.each do |ring_name| %>
5
+ <li role="presentation" class="<%= ring_name == @ring.name ? 'active' : '' %>"><%= link_to t("tech_radar.radar.rings.#{ring_name}.title"), ring_path(ring_name) %></li>
6
+ <% end %>
7
+ </ul>
8
+ </nav>
9
+ <hr>
10
+ <h2 class="sr-only"><%= t("tech_radar.radar.rings.#{@ring.name}.title").html_safe %></h2>
11
+ <p class="lead"><%= t("tech_radar.radar.rings.#{@ring.name}.description").html_safe %></p>
12
+ <ul class="list-unstyled">
13
+ <% @ring.technologies.each do |technology| %>
14
+ <li>
15
+ <p class="h4">
16
+ <%= link_to technology.name, technology_path(technology.name) %>
17
+ &middot;
18
+ <small>
19
+ <%= technology.purpose %>
20
+ <%= link_to quadrant_path(technology.quadrant) do %>
21
+ <span class="label label-default">
22
+ <%= t("tech_radar.radar.quadrants.#{technology.quadrant}.title") %>
23
+ </span>
24
+ <% end %>
25
+ </small>
26
+ </p>
27
+ </li>
28
+ <% end %>
29
+ </ul>
30
+ </section>
@@ -0,0 +1,23 @@
1
+ <h1 class="h2">A-Z</h1>
2
+ <nav class="pagination">
3
+ <% ('A'..'Z').each do |letter| %>
4
+ <li><a href="#<%= letter %>"><%= letter %></a></li>
5
+ <% end %>
6
+ </nav>
7
+ <% @technologies.group_by { |technology| technology.name[0].upcase }.each do |letter,technologies| %>
8
+ <a name="<%= letter %>"></a>
9
+ <h2 class="h3"><%= letter %></h2>
10
+ <% technologies.each do |technology| %>
11
+ <ul class="list-unstyled">
12
+ <li>
13
+ <h1 class="h4">
14
+ <%= link_to technology.name, technology_path(technology.name) %>
15
+ <small>
16
+ <%= technology.purpose %>
17
+ <span class="label label-<%= label_color_for_ring(technology.ring) %>"><%= technology.ring %></span>
18
+ </small>
19
+ </h1>
20
+ </li>
21
+ <% end %>
22
+ </ul>
23
+ <% end %>
@@ -0,0 +1,43 @@
1
+ <section>
2
+ <h1>
3
+ <%= @technology.name %>
4
+ <small>
5
+ <%= t("tech_radar.radar.quadrants.#{@technology.quadrant}.title") %>
6
+ <span class="label label-<%= label_color_for_ring(@technology.ring) %>"><%= t("tech_radar.radar.rings.#{@technology.ring}.title") %></span>
7
+ </small>
8
+ </h1>
9
+ <p class="lead"><%= @technology.purpose %></p>
10
+ <section>
11
+ <% if @technology.more_details_url.blank? %>
12
+ <p>
13
+ <%= link_to t("tech_radar.radar.technologies.more_details_url.google"), "https://www.google.com/search?q=#{@technology.name}", class: "btn btn-default" %>
14
+ </p>
15
+ <% else %>
16
+ <p>
17
+ <%= link_to t("tech_radar.radar.technologies.more_details_url.link"), @technology.more_details_url, class: "btn btn-default" %>
18
+ </p>
19
+ <% end %>
20
+ </section>
21
+ <section>
22
+ <hr>
23
+ <% if @technology.why_summary.present? %>
24
+ <p>
25
+ <span class="text-muted">
26
+ <%= @technology.why_summary %>
27
+ </span>
28
+ <% if @technology.why_url.present? %>
29
+ <%= link_to t("tech_radar.radar.technologies.why_summary.link"), @technology.why_url %>
30
+ <% end %>
31
+ </p>
32
+ <% else %>
33
+ <% if TechRadar.warn_on_missing_why_summary[@technology.ring] %>
34
+ <div class="alert alert-warning">
35
+ <%= t("tech_radar.radar.technologies.why_summary.no_summary").html_safe %>
36
+ <% if @technology.why_url.present? %>
37
+ <%= link_to t("tech_radar.radar.technologies.why_summary.url_only"), @technology.why_url %>
38
+ <% end %>
39
+ </div>
40
+ <% end %>
41
+ <% end %>
42
+ </section>
43
+ </section>
@@ -0,0 +1,58 @@
1
+ en:
2
+ hello: "Hello world"
3
+ tech_radar:
4
+ radar:
5
+ title: "Technology Radar"
6
+ rings:
7
+ name: "Rings"
8
+ "Adopt":
9
+ title: "Adopt"
10
+ summary: "Use these, as they are supported and proven in production"
11
+ description: "Technologies here are what we are using consistency across most, if not all, projects & teams. In general, you should use these unless you have a <strong>very</strong> good reason not to. <strong>Not</strong> using technologies here would be a technical risk."
12
+ "Trial":
13
+ summary: "Consider this if nothing in <em>Adopt</em> works"
14
+ title: "Trial"
15
+ description: "Technologies in production now, but not consistently across the team. These are worth pursuing, but we haven't yet rolled them out team-wide. They are great choices for projects where a solution doesn't exist in the <em>Adopt</em> ring. Prefer these over those in <em>Assess</em>."
16
+ "Assess":
17
+ title: "Assess"
18
+ summary: "Not ready for heavy-duty use or not widely used."
19
+ description: "This Indicates that a technology is worth exploring with the goal of understanding how it will affect us. It may be worth investing effort like development spikes or research projects to see if it will have a positive impact on us."
20
+ "Hold":
21
+ title: "Hold"
22
+ summary: "Don't start new work with these."
23
+ description: "Don't start new work with these technologies. They are too new to be evaluated, being discontinued, or have been found to be unsuitable."
24
+ technologies:
25
+ more_details_url:
26
+ google: "Information from Google…"
27
+ link: "More Information…"
28
+ why_summary:
29
+ link: "Detailed explanation…"
30
+ why_url_only: "But, there is a link to a detailed explanation…"
31
+ no_summary: "There is no summary of why this technology is here. Please provide a <tt>why_summary</tt> in <tt>config/tech-radar.yml</tt>."
32
+ quadrants:
33
+ name: "Quadrants"
34
+ "Techniques":
35
+ title: "Techniques"
36
+ description: "Elements of a software development process, such as experience design; and ways of structuring software, such as micro-services."
37
+ "Languages and Frameworks":
38
+ title: "Languages and Frameworks"
39
+ description: "Programming languages and frameworks (but not code libraries, which are considered Tools)"
40
+ "Tools":
41
+ title: "Tools"
42
+ description: "Components, such as databases, software development tools, such as versions control systems; or more generic categories of tools, such as the notion of polyglot persistence."
43
+ "Platforms":
44
+ title: "Platforms"
45
+ description: "Things that we build software on top of: mobile technologies like iOS, platforms-as-a-service like Heroku, or runtime containers like the JVM."
46
+ index:
47
+ preamble: "This represents the current thinking about what technologies should be used for various purposes. It's a guide for making technical decisions without having to have the entire team sync up on everything. It also allows you to experiment with new technologies safely by seeing what others have discovered, or not."
48
+ summary_link: "View Summary…"
49
+ all_list_link: "Technologies A–Z…"
50
+ changing:
51
+ title: "How the Radar Changes"
52
+ preamble: "When using the radar, you may be tempted to suggest changes to it. You shouldn't. The radar is changed on a regular basis based on experience found since the last update. Try to stick to the radar for your day-to-day work, and keep notes on how things go. We want the radar to be generally stable, but able to evolve."
53
+ howto:
54
+ title: "How to Use This Radar"
55
+ rings:
56
+ preamble: "The Rings are indicators of how fit a technology or technique is for use, and these should be your guide when making technical decisions."
57
+ quadrants:
58
+ preamble: "Quadrants serve to partition the radar into logical groupings to make it more navigable and manageable."
data/config/routes.rb ADDED
@@ -0,0 +1,8 @@
1
+ TechRadar::Engine.routes.draw do
2
+ get 'radar/index'
3
+ get 'radar/summary'
4
+ resources :technologies, only: [ :index, :show ]
5
+ resources :quadrants, only: [ :show ]
6
+ resources :rings, only: [ :show ]
7
+
8
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :tech_radar do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,5 @@
1
+ module TechRadar
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace TechRadar
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module TechRadar
2
+ VERSION = "0.0.1"
3
+ end
data/lib/tech_radar.rb ADDED
@@ -0,0 +1,11 @@
1
+ require "tech_radar/engine"
2
+
3
+ module TechRadar
4
+ # A Hash with keys named for the four rings as written in the en.yml file (i.e. not the translated values).
5
+ # If the value is true, a warning is shown for any tech that doesn't have a "why_summary".
6
+ #
7
+ # Default is true for all rings.
8
+ mattr_accessor :warn_on_missing_why_summary
9
+
10
+ TechRadar.warn_on_missing_why_summary = Hash.new(true)
11
+ end
@@ -0,0 +1,17 @@
1
+ require 'test_helper'
2
+
3
+ module TechRadar
4
+ class QuadrantsControllerTest < ActionController::TestCase
5
+ setup do
6
+ @routes = Engine.routes
7
+ end
8
+
9
+ test "show" do
10
+ get :show, id: "Tools"
11
+ assert_response :success
12
+ assert response.body =~ /RabbitMQ.*Resque.*ElasticSearch.*HumbleKit.*Redis as a database.*Sidekiq.*JIRA.*SwiftTask/m,
13
+ "Expected #{response.body} to contain all 'Tools' technologies, ordered by ring, then name"
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,21 @@
1
+ require 'test_helper'
2
+
3
+ module TechRadar
4
+ class RadarControllerTest < ActionController::TestCase
5
+ setup do
6
+ @routes = Engine.routes
7
+ end
8
+
9
+ test "parent app can override messages" do
10
+ get :index
11
+ assert_response :success
12
+ assert response.body =~ /FOOBAR/, "expected #{response.body} to include FOOBAR"
13
+ end
14
+
15
+ test "the radar summary screen" do
16
+ get :summary
17
+ assert_response :success
18
+ end
19
+
20
+ end
21
+ end