typed_dag 2.0.1 → 2.0.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.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/typed_dag/version.rb +1 -1
  4. metadata +3 -141
  5. data/spec/spec_helper.rb +0 -89
  6. data/spec/support/helpers.rb +0 -47
  7. data/spec/test_app/Rakefile +0 -6
  8. data/spec/test_app/app/assets/config/manifest.js +0 -4
  9. data/spec/test_app/app/assets/javascripts/application.js +0 -13
  10. data/spec/test_app/app/assets/javascripts/cable.js +0 -13
  11. data/spec/test_app/app/assets/stylesheets/application.css +0 -15
  12. data/spec/test_app/app/channels/application_cable/channel.rb +0 -4
  13. data/spec/test_app/app/channels/application_cable/connection.rb +0 -4
  14. data/spec/test_app/app/controllers/application_controller.rb +0 -3
  15. data/spec/test_app/app/helpers/application_helper.rb +0 -2
  16. data/spec/test_app/app/jobs/application_job.rb +0 -2
  17. data/spec/test_app/app/mailers/application_mailer.rb +0 -4
  18. data/spec/test_app/app/models/application_record.rb +0 -3
  19. data/spec/test_app/app/models/message.rb +0 -2
  20. data/spec/test_app/app/models/relation.rb +0 -2
  21. data/spec/test_app/app/views/layouts/application.html.erb +0 -14
  22. data/spec/test_app/app/views/layouts/mailer.html.erb +0 -13
  23. data/spec/test_app/app/views/layouts/mailer.text.erb +0 -1
  24. data/spec/test_app/bin/bundle +0 -3
  25. data/spec/test_app/bin/rails +0 -4
  26. data/spec/test_app/bin/rake +0 -4
  27. data/spec/test_app/bin/setup +0 -38
  28. data/spec/test_app/bin/update +0 -29
  29. data/spec/test_app/bin/yarn +0 -11
  30. data/spec/test_app/config.ru +0 -5
  31. data/spec/test_app/config/application.rb +0 -26
  32. data/spec/test_app/config/boot.rb +0 -5
  33. data/spec/test_app/config/cable.yml +0 -10
  34. data/spec/test_app/config/database.mysql.yml.travis +0 -9
  35. data/spec/test_app/config/database.postgresql.yml.travis +0 -9
  36. data/spec/test_app/config/database.yml +0 -23
  37. data/spec/test_app/config/environment.rb +0 -5
  38. data/spec/test_app/config/environments/development.rb +0 -54
  39. data/spec/test_app/config/environments/production.rb +0 -91
  40. data/spec/test_app/config/environments/test.rb +0 -42
  41. data/spec/test_app/config/initializers/application_controller_renderer.rb +0 -6
  42. data/spec/test_app/config/initializers/assets.rb +0 -14
  43. data/spec/test_app/config/initializers/backtrace_silencers.rb +0 -7
  44. data/spec/test_app/config/initializers/cookies_serializer.rb +0 -5
  45. data/spec/test_app/config/initializers/filter_parameter_logging.rb +0 -4
  46. data/spec/test_app/config/initializers/inflections.rb +0 -16
  47. data/spec/test_app/config/initializers/mime_types.rb +0 -4
  48. data/spec/test_app/config/initializers/typed_dag.rb +0 -12
  49. data/spec/test_app/config/initializers/wrap_parameters.rb +0 -14
  50. data/spec/test_app/config/locales/en.yml +0 -33
  51. data/spec/test_app/config/puma.rb +0 -56
  52. data/spec/test_app/config/routes.rb +0 -3
  53. data/spec/test_app/config/secrets.yml +0 -32
  54. data/spec/test_app/config/spring.rb +0 -6
  55. data/spec/test_app/db/development.sqlite3 +0 -0
  56. data/spec/test_app/db/migrate/20170831093433_create_nodes_and_endges.rb +0 -22
  57. data/spec/test_app/db/schema.rb +0 -35
  58. data/spec/test_app/db/test.sqlite3 +0 -0
  59. data/spec/test_app/log/development.log +0 -101
  60. data/spec/test_app/log/test.log +0 -0
  61. data/spec/test_app/package.json +0 -5
  62. data/spec/test_app/public/404.html +0 -67
  63. data/spec/test_app/public/422.html +0 -67
  64. data/spec/test_app/public/500.html +0 -66
  65. data/spec/test_app/public/apple-touch-icon-precomposed.png +0 -0
  66. data/spec/test_app/public/apple-touch-icon.png +0 -0
  67. data/spec/test_app/public/favicon.ico +0 -0
  68. data/spec/typed_dag/configuration.rb +0 -92
  69. data/spec/typed_dag/edge_spec.rb +0 -578
  70. data/spec/typed_dag/node_spec.rb +0 -2178
  71. data/spec/typed_dag/sql/add_closure_spec.rb +0 -116
  72. data/spec/typed_dag/sql/truncate_closure_spec.rb +0 -112
  73. data/spec/typed_dag_spec.rb +0 -7
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Specify a serializer for the signed and encrypted cookie jars.
4
- # Valid options are :json, :marshal, and :hybrid.
5
- Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Configure sensitive parameters which will be filtered from the log file.
4
- Rails.application.config.filter_parameters += [:password]
@@ -1,16 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format. Inflections
4
- # are locale specific, and you may define rules for as many different
5
- # locales as you wish. All of these examples are active by default:
6
- # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
- # inflect.plural /^(ox)$/i, '\1en'
8
- # inflect.singular /^(ox)en/i, '\1'
9
- # inflect.irregular 'person', 'people'
10
- # inflect.uncountable %w( fish sheep )
11
- # end
12
-
13
- # These inflection rules are supported but not enabled by default:
14
- # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
- # inflect.acronym 'RESTful'
16
- # end
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
@@ -1,12 +0,0 @@
1
- TypedDag::Configuration.set edge_class_name: 'Relation',
2
- node_class_name: 'Message',
3
- from_column: 'ancestor_id',
4
- to_column: 'descendant_id',
5
- types: { hierarchy: { from: { name: :parent, limit: 1 },
6
- to: :children,
7
- all_from: :ancestors,
8
- all_to: :descendants },
9
- invalidate: { from: :invalidated_by,
10
- to: :invalidates,
11
- all_from: :all_invalidated_by,
12
- all_to: :all_invalidates } }
@@ -1,14 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # This file contains settings for ActionController::ParamsWrapper which
4
- # is enabled by default.
5
-
6
- # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
- ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
9
- end
10
-
11
- # To enable root element in JSON for ActiveRecord objects.
12
- # ActiveSupport.on_load(:active_record) do
13
- # self.include_root_in_json = true
14
- # end
@@ -1,33 +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
- # The following keys must be escaped otherwise they will not be retrieved by
20
- # the default I18n backend:
21
- #
22
- # true, false, on, off, yes, no
23
- #
24
- # Instead, surround them with single quotes.
25
- #
26
- # en:
27
- # 'true': 'foo'
28
- #
29
- # To learn more, please read the Rails Internationalization guide
30
- # available at http://guides.rubyonrails.org/i18n.html.
31
-
32
- en:
33
- hello: "Hello world"
@@ -1,56 +0,0 @@
1
- # Puma can serve each request in a thread from an internal thread pool.
2
- # The `threads` method setting takes two numbers: a minimum and maximum.
3
- # Any libraries that use thread pools should be configured to match
4
- # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
- # and maximum; this matches the default thread size of Active Record.
6
- #
7
- threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
- threads threads_count, threads_count
9
-
10
- # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
11
- #
12
- port ENV.fetch("PORT") { 3000 }
13
-
14
- # Specifies the `environment` that Puma will run in.
15
- #
16
- environment ENV.fetch("RAILS_ENV") { "development" }
17
-
18
- # Specifies the number of `workers` to boot in clustered mode.
19
- # Workers are forked webserver processes. If using threads and workers together
20
- # the concurrency of the application would be max `threads` * `workers`.
21
- # Workers do not work on JRuby or Windows (both of which do not support
22
- # processes).
23
- #
24
- # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
25
-
26
- # Use the `preload_app!` method when specifying a `workers` number.
27
- # This directive tells Puma to first boot the application and load code
28
- # before forking the application. This takes advantage of Copy On Write
29
- # process behavior so workers use less memory. If you use this option
30
- # you need to make sure to reconnect any threads in the `on_worker_boot`
31
- # block.
32
- #
33
- # preload_app!
34
-
35
- # If you are preloading your application and using Active Record, it's
36
- # recommended that you close any connections to the database before workers
37
- # are forked to prevent connection leakage.
38
- #
39
- # before_fork do
40
- # ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
41
- # end
42
-
43
- # The code in the `on_worker_boot` will be called if you are using
44
- # clustered mode by specifying a number of `workers`. After each worker
45
- # process is booted, this block will be run. If you are using the `preload_app!`
46
- # option, you will want to use this block to reconnect to any threads
47
- # or connections that may have been created at application boot, as Ruby
48
- # cannot share connections between processes.
49
- #
50
- # on_worker_boot do
51
- # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
52
- # end
53
- #
54
-
55
- # Allow puma to be restarted by `rails restart` command.
56
- plugin :tmp_restart
@@ -1,3 +0,0 @@
1
- Rails.application.routes.draw do
2
- # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
3
- end
@@ -1,32 +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 `rails 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
- # Shared secrets are available across all environments.
14
-
15
- # shared:
16
- # api_key: a1B2c3D4e5F6
17
-
18
- # Environmental secrets are only available for that specific environment.
19
-
20
- development:
21
- secret_key_base: fe1dbc76f96f0a8c58e50f3c72c32dbc9b09c67f0f55d703ebf2ea8ad7367f514e5746a0e5c652e6e720ead7065f826d09bfa72b9dd901cb220b93515f8e6f3c
22
-
23
- test:
24
- secret_key_base: 9e4300526698731330b0974fdb40f0b9dea7e251f4f98b616183e617f7e740ecc554f63adfc06ed933375f12dfa317d1ad1dc086d05b2bf225fef18c5c4e0aa3
25
-
26
- # Do not keep production secrets in the unencrypted secrets file.
27
- # Instead, either read values from the environment.
28
- # Or, use `bin/rails secrets:setup` to configure encrypted secrets
29
- # and move the `production:` environment over there.
30
-
31
- production:
32
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -1,6 +0,0 @@
1
- %w(
2
- .ruby-version
3
- .rbenv-vars
4
- tmp/restart.txt
5
- tmp/caching-dev.txt
6
- ).each { |path| Spring.watch(path) }
File without changes
@@ -1,22 +0,0 @@
1
- class CreateNodesAndEndges < ActiveRecord::Migration[5.1]
2
- def change
3
- create_table :messages do |t|
4
- t.column :text, :string
5
- end
6
-
7
- create_table :relations do |t|
8
- t.references :ancestor, null: false
9
- t.references :descendant, null: false
10
-
11
- t.column :hierarchy, :integer, null: false, default: 0
12
- t.column :invalidate, :integer, null: false, default: 0
13
-
14
- t.column :count, :integer, null: false, default: 1
15
-
16
- t.index %i(ancestor_id descendant_id hierarchy invalidate), unique: true, name: 'unique_constraint'
17
- end
18
-
19
- add_foreign_key :relations, :messages, column: :ancestor_id
20
- add_foreign_key :relations, :messages, column: :descendant_id
21
- end
22
- end
@@ -1,35 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # Note that this schema.rb definition is the authoritative source for your
6
- # database schema. If you need to create the application database on another
7
- # system, you should be using db:schema:load, not running all the migrations
8
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
- # you'll amass, the slower it'll run and the greater likelihood for issues).
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 20170831093433) do
14
-
15
- # These are extensions that must be enabled in order to support this database
16
- enable_extension "plpgsql"
17
-
18
- create_table "messages", force: :cascade do |t|
19
- t.string "text"
20
- end
21
-
22
- create_table "relations", force: :cascade do |t|
23
- t.bigint "ancestor_id", null: false
24
- t.bigint "descendant_id", null: false
25
- t.integer "hierarchy", default: 0, null: false
26
- t.integer "invalidate", default: 0, null: false
27
- t.integer "count", default: 0, null: false
28
- t.index ["ancestor_id", "descendant_id", "hierarchy", "invalidate"], name: "unique_constraint", unique: true
29
- t.index ["ancestor_id"], name: "index_relations_on_ancestor_id"
30
- t.index ["descendant_id"], name: "index_relations_on_descendant_id"
31
- end
32
-
33
- add_foreign_key "relations", "messages", column: "ancestor_id"
34
- add_foreign_key "relations", "messages", column: "descendant_id"
35
- end
@@ -1,101 +0,0 @@
1
-  (0.1ms) DROP TABLE IF EXISTS "messages"
2
-  (0.1ms) SELECT sqlite_version(*)
3
-  (1.3ms) CREATE TABLE "messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)
4
-  (0.1ms) DROP TABLE IF EXISTS "relations"
5
-  (1.0ms) CREATE TABLE "relations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "ancestor_id" integer NOT NULL, "descendant_id" integer NOT NULL, "hierarchy" integer DEFAULT 0 NOT NULL, "invalidate" integer DEFAULT 0 NOT NULL, "mention" integer DEFAULT 0 NOT NULL)
6
-  (0.9ms) CREATE INDEX "index_relations_on_ancestor_id" ON "relations" ("ancestor_id")
7
-  (0.2ms)  SELECT sql
8
- FROM sqlite_master
9
- WHERE name='index_relations_on_ancestor_id' AND type='index'
10
- UNION ALL
11
- SELECT sql
12
- FROM sqlite_temp_master
13
- WHERE name='index_relations_on_ancestor_id' AND type='index'
14
- 
15
-  (0.9ms) CREATE INDEX "index_relations_on_descendant_id" ON "relations" ("descendant_id")
16
-  (0.1ms)  SELECT sql
17
- FROM sqlite_master
18
- WHERE name='index_relations_on_descendant_id' AND type='index'
19
- UNION ALL
20
- SELECT sql
21
- FROM sqlite_temp_master
22
- WHERE name='index_relations_on_descendant_id' AND type='index'
23
- 
24
-  (0.1ms)  SELECT sql
25
- FROM sqlite_master
26
- WHERE name='index_relations_on_ancestor_id' AND type='index'
27
- UNION ALL
28
- SELECT sql
29
- FROM sqlite_temp_master
30
- WHERE name='index_relations_on_ancestor_id' AND type='index'
31
- 
32
-  (1.0ms) CREATE INDEX "index_relations_on_hierarchy" ON "relations" ("hierarchy")
33
-  (0.1ms)  SELECT sql
34
- FROM sqlite_master
35
- WHERE name='index_relations_on_hierarchy' AND type='index'
36
- UNION ALL
37
- SELECT sql
38
- FROM sqlite_temp_master
39
- WHERE name='index_relations_on_hierarchy' AND type='index'
40
- 
41
-  (0.1ms)  SELECT sql
42
- FROM sqlite_master
43
- WHERE name='index_relations_on_descendant_id' AND type='index'
44
- UNION ALL
45
- SELECT sql
46
- FROM sqlite_temp_master
47
- WHERE name='index_relations_on_descendant_id' AND type='index'
48
- 
49
-  (0.1ms)  SELECT sql
50
- FROM sqlite_master
51
- WHERE name='index_relations_on_ancestor_id' AND type='index'
52
- UNION ALL
53
- SELECT sql
54
- FROM sqlite_temp_master
55
- WHERE name='index_relations_on_ancestor_id' AND type='index'
56
- 
57
-  (0.9ms) CREATE INDEX "index_relations_on_invalidate" ON "relations" ("invalidate")
58
-  (0.1ms)  SELECT sql
59
- FROM sqlite_master
60
- WHERE name='index_relations_on_invalidate' AND type='index'
61
- UNION ALL
62
- SELECT sql
63
- FROM sqlite_temp_master
64
- WHERE name='index_relations_on_invalidate' AND type='index'
65
- 
66
-  (0.1ms)  SELECT sql
67
- FROM sqlite_master
68
- WHERE name='index_relations_on_hierarchy' AND type='index'
69
- UNION ALL
70
- SELECT sql
71
- FROM sqlite_temp_master
72
- WHERE name='index_relations_on_hierarchy' AND type='index'
73
- 
74
-  (0.1ms)  SELECT sql
75
- FROM sqlite_master
76
- WHERE name='index_relations_on_descendant_id' AND type='index'
77
- UNION ALL
78
- SELECT sql
79
- FROM sqlite_temp_master
80
- WHERE name='index_relations_on_descendant_id' AND type='index'
81
- 
82
-  (0.1ms)  SELECT sql
83
- FROM sqlite_master
84
- WHERE name='index_relations_on_ancestor_id' AND type='index'
85
- UNION ALL
86
- SELECT sql
87
- FROM sqlite_temp_master
88
- WHERE name='index_relations_on_ancestor_id' AND type='index'
89
- 
90
-  (0.9ms) CREATE INDEX "index_relations_on_mention" ON "relations" ("mention")
91
-  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
92
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
93
-  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES (20170831093433)
94
-  (1.0ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
95
- ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
96
-  (0.0ms) begin transaction
97
- SQL (0.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", "2017-09-01 07:25:47.238512"], ["updated_at", "2017-09-01 07:25:47.238512"]]
98
-  (0.7ms) commit transaction
99
- ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
100
-  (0.0ms) begin transaction
101
-  (0.0ms) commit transaction
Binary file
@@ -1,5 +0,0 @@
1
- {
2
- "name": "test_app",
3
- "private": true,
4
- "dependencies": {}
5
- }
@@ -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
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page 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
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page 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 class="rails-default-error-page">
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>