junctions 0.0.1 → 0.0.3

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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +50 -0
  3. data/Gemfile +14 -0
  4. data/Gemfile.lock +45 -0
  5. data/LICENSE +21 -0
  6. data/README.md +49 -0
  7. data/junctions.gemspec +29 -0
  8. data/lib/junctions/engine.rb +30 -110
  9. data/lib/junctions/version.rb +4 -2
  10. data/lib/junctions.rb +11 -0
  11. data/test/junctions_test.rb +25 -3
  12. data/test/lib/common/wibble_extensions.rb +14 -0
  13. data/test/lib/metal/wibble_extensions.rb +11 -0
  14. data/test/lib/plastic/wibble_extensions.rb +7 -0
  15. data/test/lib/wibble.rb +8 -0
  16. data/test/lib/wobble.rb +8 -0
  17. data/test/test_helper.rb +1 -17
  18. metadata +78 -127
  19. data/lib/junctions/brand_methods.rb +0 -35
  20. data/test/dummy/README.rdoc +0 -28
  21. data/test/dummy/Rakefile +0 -6
  22. data/test/dummy/app/assets/javascripts/application.js +0 -13
  23. data/test/dummy/app/assets/javascripts/easy_checks.js +0 -2
  24. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  25. data/test/dummy/app/assets/stylesheets/easy_checks.css +0 -4
  26. data/test/dummy/app/assets/stylesheets/scaffold.css +0 -56
  27. data/test/dummy/app/controllers/application_controller.rb +0 -5
  28. data/test/dummy/app/controllers/easy_checks_controller.rb +0 -58
  29. data/test/dummy/app/helpers/application_helper.rb +0 -2
  30. data/test/dummy/app/helpers/easy_checks_helper.rb +0 -2
  31. data/test/dummy/app/models/easy_check.rb +0 -2
  32. data/test/dummy/app/views/easy_checks/_form.html.erb +0 -17
  33. data/test/dummy/app/views/easy_checks/edit.html.erb +0 -6
  34. data/test/dummy/app/views/easy_checks/index.html.erb +0 -25
  35. data/test/dummy/app/views/easy_checks/new.html.erb +0 -5
  36. data/test/dummy/app/views/easy_checks/show.html.erb +0 -4
  37. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  38. data/test/dummy/bin/bundle +0 -3
  39. data/test/dummy/bin/rails +0 -4
  40. data/test/dummy/bin/rake +0 -4
  41. data/test/dummy/bin/setup +0 -29
  42. data/test/dummy/config/application.rb +0 -26
  43. data/test/dummy/config/boot.rb +0 -5
  44. data/test/dummy/config/brands/databases/core/database.yml +0 -50
  45. data/test/dummy/config/brands/databases/dumdeedee/database.yml +0 -50
  46. data/test/dummy/config/brands/environments/core/development.rb +0 -13
  47. data/test/dummy/config/brands/environments/core/production.rb +0 -77
  48. data/test/dummy/config/brands/environments/core/test.rb +0 -42
  49. data/test/dummy/config/brands/environments/dumdeedee/development.rb +0 -4
  50. data/test/dummy/config/brands/environments/dumdeedee/production.rb +0 -77
  51. data/test/dummy/config/brands/environments/dumdeedee/test.rb +0 -42
  52. data/test/dummy/config/database.yml +0 -50
  53. data/test/dummy/config/environment.rb +0 -5
  54. data/test/dummy/config/environments/development.rb +0 -41
  55. data/test/dummy/config/environments/production.rb +0 -77
  56. data/test/dummy/config/environments/test.rb +0 -42
  57. data/test/dummy/config/initializers/assets.rb +0 -11
  58. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  59. data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  60. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  61. data/test/dummy/config/initializers/inflections.rb +0 -16
  62. data/test/dummy/config/initializers/mime_types.rb +0 -4
  63. data/test/dummy/config/initializers/session_store.rb +0 -3
  64. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  65. data/test/dummy/config/locales/en.yml +0 -23
  66. data/test/dummy/config/routes.rb +0 -7
  67. data/test/dummy/config/secrets.yml +0 -22
  68. data/test/dummy/config.ru +0 -4
  69. data/test/dummy/db/migrate/20141118121139_create_easy_checks.rb +0 -8
  70. data/test/dummy/db/schema.rb +0 -36
  71. data/test/dummy/lib/brands/app/views/dumdeedee/easy_checks/index.html.erb +0 -25
  72. data/test/dummy/public/404.html +0 -67
  73. data/test/dummy/public/422.html +0 -67
  74. data/test/dummy/public/500.html +0 -66
  75. data/test/dummy/test/controllers/easy_checks_controller_test.rb +0 -49
  76. data/test/dummy/test/fixtures/easy_checks.yml +0 -11
  77. data/test/dummy/test/models/easy_check_test.rb +0 -7
  78. data/test/integration/navigation_test.rb +0 -10
  79. data/test/lib/generators/junctions/model_generator_test.rb +0 -36
@@ -1,23 +0,0 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t('hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # To learn more, please read the Rails Internationalization guide
20
- # available at http://guides.rubyonrails.org/i18n.html.
21
-
22
- en:
23
- hello: "Hello world"
@@ -1,7 +0,0 @@
1
- Rails.application.routes.draw do
2
-
3
- resources :easy_checks
4
- root to: 'easy_checks#index'
5
-
6
- mount Junctions::Engine => "/junctions"
7
- end
@@ -1,22 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rake secret` to generate a secure secret key.
9
-
10
- # Make sure the secrets in this file are kept private
11
- # if you're sharing your code publicly.
12
-
13
- development:
14
- secret_key_base: aaa125086b53983978b02fa32ce208567ae9f903ceb9528c13f92c3dd862cfa907b404f46dfce5e897b2f5bafb6394e32877b261078ae9ca2e209970afb02ec7
15
-
16
- test:
17
- secret_key_base: 326d540a92749d7da3fd47c51ae1d118b6eb972a2569a88e427375e615bf01f1ad5662e5de8745aad98f65837e5773b5c5b43e70fad1d88cfa8e67390cee649f
18
-
19
- # Do not keep production secrets in the repository,
20
- # instead read values from the environment.
21
- production:
22
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
data/test/dummy/config.ru DELETED
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Rails.application
@@ -1,8 +0,0 @@
1
- class CreateEasyChecks < ActiveRecord::Migration
2
- def change
3
- create_table :easy_checks do |t|
4
-
5
- t.timestamps null: false
6
- end
7
- end
8
- end
@@ -1,36 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended that you check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(version: 20141118121139) do
15
-
16
- create_table "capabilities_capabilities", force: true do |t|
17
- t.string "name", limit: 255
18
- end
19
-
20
- create_table "capabilities_capabilities_users", force: true do |t|
21
- t.integer "capability_id", limit: 4
22
- t.integer "user_id", limit: 4
23
- end
24
-
25
- create_table "easy_checks", force: true do |t|
26
- t.datetime "created_at", null: false
27
- t.datetime "updated_at", null: false
28
- end
29
-
30
- create_table "users", force: true do |t|
31
- t.string "username", limit: 255
32
- t.datetime "created_at", null: false
33
- t.datetime "updated_at", null: false
34
- end
35
-
36
- end
@@ -1,25 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <h1>Listing Branded Easy Checks</h1>
4
-
5
- <table>
6
- <thead>
7
- <tr>
8
- <th colspan="3"></th>
9
- </tr>
10
- </thead>
11
-
12
- <tbody>
13
- <% @easy_checks.each do |easy_check| %>
14
- <tr>
15
- <td><%= link_to 'Show', easy_check %></td>
16
- <td><%= link_to 'Edit', edit_easy_check_path(easy_check) %></td>
17
- <td><%= link_to 'Destroy', easy_check, method: :delete, data: { confirm: 'Are you sure?' } %></td>
18
- </tr>
19
- <% end %>
20
- </tbody>
21
- </table>
22
-
23
- <br>
24
-
25
- <%= link_to 'New Easy check', new_easy_check_path %>
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/404.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The page you were looking for doesn't exist.</h1>
62
- <p>You may have mistyped the address or the page may have moved.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/422.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The change you wanted was rejected.</h1>
62
- <p>Maybe you tried to change something you didn't have access to.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/500.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>We're sorry, but something went wrong.</h1>
62
- </div>
63
- <p>If you are the application owner check the logs for more information.</p>
64
- </div>
65
- </body>
66
- </html>
@@ -1,49 +0,0 @@
1
- require 'test_helper'
2
-
3
- class EasyChecksControllerTest < ActionController::TestCase
4
- setup do
5
- @easy_check = easy_checks(:one)
6
- end
7
-
8
- test "should get index" do
9
- get :index
10
- assert_response :success
11
- assert_not_nil assigns(:easy_checks)
12
- end
13
-
14
- test "should get new" do
15
- get :new
16
- assert_response :success
17
- end
18
-
19
- test "should create easy_check" do
20
- assert_difference('EasyCheck.count') do
21
- post :create, easy_check: { }
22
- end
23
-
24
- assert_redirected_to easy_check_path(assigns(:easy_check))
25
- end
26
-
27
- test "should show easy_check" do
28
- get :show, id: @easy_check
29
- assert_response :success
30
- end
31
-
32
- test "should get edit" do
33
- get :edit, id: @easy_check
34
- assert_response :success
35
- end
36
-
37
- test "should update easy_check" do
38
- patch :update, id: @easy_check, easy_check: { }
39
- assert_redirected_to easy_check_path(assigns(:easy_check))
40
- end
41
-
42
- test "should destroy easy_check" do
43
- assert_difference('EasyCheck.count', -1) do
44
- delete :destroy, id: @easy_check
45
- end
46
-
47
- assert_redirected_to easy_checks_path
48
- end
49
- end
@@ -1,11 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
-
3
- # This model initially had no columns defined. If you add columns to the
4
- # model remove the '{}' from the fixture names and add the columns immediately
5
- # below each fixture, per the syntax in the comments below
6
- #
7
- one: {}
8
- # column: value
9
- #
10
- two: {}
11
- # column: value
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class EasyCheckTest < ActiveSupport::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end
@@ -1,10 +0,0 @@
1
- require 'test_helper'
2
-
3
- class NavigationTest < ActionDispatch::IntegrationTest
4
- fixtures :all
5
-
6
- # test "the truth" do
7
- # assert true
8
- # end
9
- end
10
-
@@ -1,36 +0,0 @@
1
- require 'test_helper'
2
- require 'generators/junctions/model/model_generator'
3
-
4
- module Junctions
5
- class ModelGeneratorTest < Rails::Generators::TestCase
6
- tests ModelGenerator
7
- destination Rails.root.join('tmp/generators')
8
- setup :prepare_destination
9
-
10
- test 'it creates a model file' do
11
- run_generator ['test']
12
-
13
- assert_file 'app/models/test.rb', /class Test/
14
- assert_file 'app/models/test.rb', /include Core::TestExtensions/
15
- end
16
-
17
- test 'it creates a model extension file in core folder' do
18
- run_generator ['test']
19
-
20
- assert_file 'app/models/core/test_extensions.rb', /module Core/
21
- assert_file 'app/models/core/test_extensions.rb', /module TestExtensions/
22
- end
23
-
24
- test 'it creates a model extension folder' do
25
- run_generator ['test']
26
-
27
- assert_directory 'app/models/core/test/'
28
- end
29
-
30
- test 'it correctly camel cases the name' do
31
- run_generator ['my_model']
32
-
33
- assert_file 'app/models/my_model.rb', /class MyModel/
34
- end
35
- end
36
- end