gretel 4.0.0 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +52 -0
  3. data/.gitignore +7 -6
  4. data/CHANGELOG.md +20 -0
  5. data/Gemfile +3 -1
  6. data/README.md +46 -44
  7. data/Rakefile +3 -7
  8. data/coverage/coverage.txt +1 -2
  9. data/gretel.gemspec +9 -11
  10. data/lib/gretel.rb +1 -7
  11. data/lib/gretel/crumb.rb +5 -2
  12. data/lib/gretel/crumbs.rb +26 -7
  13. data/lib/gretel/railtie.rb +11 -0
  14. data/lib/gretel/renderer.rb +65 -33
  15. data/lib/gretel/version.rb +1 -1
  16. data/lib/gretel/view_helpers.rb +2 -0
  17. metadata +37 -112
  18. data/.travis.yml +0 -14
  19. data/test/dummy/Rakefile +0 -7
  20. data/test/dummy/app/assets/config/manifest.js +0 -0
  21. data/test/dummy/app/assets/javascripts/application.js +0 -15
  22. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  23. data/test/dummy/app/controllers/application_controller.rb +0 -3
  24. data/test/dummy/app/helpers/application_helper.rb +0 -5
  25. data/test/dummy/app/mailers/.gitkeep +0 -0
  26. data/test/dummy/app/models/.gitkeep +0 -0
  27. data/test/dummy/app/models/issue.rb +0 -3
  28. data/test/dummy/app/models/project.rb +0 -3
  29. data/test/dummy/app/views/breadcrumbs/site.rb +0 -3
  30. data/test/dummy/config.ru +0 -4
  31. data/test/dummy/config/application.rb +0 -14
  32. data/test/dummy/config/boot.rb +0 -10
  33. data/test/dummy/config/breadcrumbs.rb +0 -3
  34. data/test/dummy/config/breadcrumbs/test_crumbs.rb +0 -85
  35. data/test/dummy/config/database.yml +0 -25
  36. data/test/dummy/config/environment.rb +0 -5
  37. data/test/dummy/config/environments/development.rb +0 -2
  38. data/test/dummy/config/environments/production.rb +0 -2
  39. data/test/dummy/config/environments/test.rb +0 -2
  40. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  41. data/test/dummy/config/initializers/inflections.rb +0 -15
  42. data/test/dummy/config/initializers/mime_types.rb +0 -5
  43. data/test/dummy/config/initializers/secret_token.rb +0 -7
  44. data/test/dummy/config/initializers/session_store.rb +0 -8
  45. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  46. data/test/dummy/config/locales/en.yml +0 -5
  47. data/test/dummy/config/routes.rb +0 -11
  48. data/test/dummy/db/migrate/20130122163007_create_projects.rb +0 -9
  49. data/test/dummy/db/migrate/20130122163051_create_issues.rb +0 -10
  50. data/test/dummy/db/schema.rb +0 -28
  51. data/test/dummy/lib/assets/.gitkeep +0 -0
  52. data/test/dummy/log/.gitkeep +0 -0
  53. data/test/dummy/public/404.html +0 -26
  54. data/test/dummy/public/422.html +0 -26
  55. data/test/dummy/public/500.html +0 -25
  56. data/test/dummy/public/favicon.ico +0 -0
  57. data/test/dummy/script/rails +0 -6
  58. data/test/fixtures/issues.yml +0 -4
  59. data/test/fixtures/projects.yml +0 -3
  60. data/test/gretel_test.rb +0 -23
  61. data/test/helper_methods_test.rb +0 -558
  62. data/test/test_helper.rb +0 -23
data/test/dummy/Rakefile DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env rake
2
- # Add your own tasks in files placed in lib/tasks ending in .rake,
3
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
-
5
- require File.expand_path('../config/application', __FILE__)
6
-
7
- Dummy::Application.load_tasks
File without changes
@@ -1,15 +0,0 @@
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 vendor/assets/javascripts of plugins, if any, 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
- // the compiled file.
9
- //
10
- // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
- // GO AFTER THE REQUIRES BELOW.
12
- //
13
- //= require jquery
14
- //= require jquery_ujs
15
- //= require_tree .
@@ -1,13 +0,0 @@
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 vendor/assets/stylesheets of plugins, if any, 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 top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
10
- *
11
- *= require_self
12
- *= require_tree .
13
- */
@@ -1,3 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery
3
- end
@@ -1,5 +0,0 @@
1
- module ApplicationHelper
2
- def times_two(text)
3
- text * 2
4
- end
5
- end
File without changes
File without changes
@@ -1,3 +0,0 @@
1
- class Issue < ActiveRecord::Base
2
- belongs_to :project
3
- end
@@ -1,3 +0,0 @@
1
- class Project < ActiveRecord::Base
2
- has_many :issues
3
- end
@@ -1,3 +0,0 @@
1
- crumb :from_views do
2
- link "Breadcrumb From View", about_path
3
- end
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 Dummy::Application
@@ -1,14 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- Bundler.require
6
- require "gretel"
7
-
8
- module Dummy
9
- class Application < Rails::Application
10
- config.secret_token = "secret token"
11
- config.active_support.deprecation = :log
12
- config.eager_load = false
13
- end
14
- end
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
-
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
9
-
10
- $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -1,3 +0,0 @@
1
- crumb :root do
2
- link "Home", root_path
3
- end
@@ -1,85 +0,0 @@
1
- crumb :basic do
2
- link "About", about_path
3
- end
4
-
5
- crumb :with_root do
6
- link "About", about_path
7
- parent :root
8
- end
9
-
10
- crumb :with_parent do
11
- link "Contact", contact_path
12
- parent :basic
13
- end
14
-
15
- crumb :object do |project|
16
- link project.name, project
17
- end
18
-
19
- crumb :with_autopath do |project|
20
- link project.name, project
21
- end
22
-
23
- crumb :with_parent_object do |issue|
24
- link issue.title, project_issue_path(issue.project, issue)
25
- parent :object, issue.project
26
- end
27
-
28
- crumb :multiple_links do
29
- link "Contact", contact_path
30
- link "Contact form", contact_form_path
31
- end
32
-
33
- crumb :multiple_links_with_parent do
34
- link "Contact", contact_path
35
- link "Contact form", contact_form_path
36
- parent :basic
37
- end
38
-
39
- crumb :with_proc do
40
- link Proc.new { "Name from proc" }, Proc.new { "URL from proc" }
41
- end
42
-
43
- crumb :with_multiple_arguments do |a, b, c|
44
- link "#{a} and #{b} and #{c}", contact_path
45
- parent :parent_with_multiple_arguments, a * 2, b * 2, c * 2
46
- end
47
-
48
- crumb :parent_with_multiple_arguments do |d, e, f|
49
- link "First #{d} then #{e} then #{f}", about_path
50
- end
51
-
52
- crumb :with_unsafe_html do
53
- link "Test <strong>bold text</strong>", about_path
54
- end
55
-
56
- crumb :with_safe_html do
57
- link "Test <strong>bold text</strong>".html_safe, about_path
58
- end
59
-
60
- crumb :without_link do
61
- link "Without link"
62
- parent :parent_without_link
63
- end
64
-
65
- crumb :parent_without_link do
66
- link "Also without link"
67
- end
68
-
69
- crumb :using_view_helper do
70
- link times_two("Test"), about_path
71
- end
72
-
73
- crumb :project do |project|
74
- link project.name, project
75
- end
76
-
77
- crumb :with_link_options do
78
- link "Test", about_path, title: "My Title", other: "Other Option"
79
- link "Other Link", some_option: "Test"
80
- end
81
-
82
- crumb :with_inferred_parent do
83
- link "Test", about_path
84
- parent Project.first
85
- end
@@ -1,25 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- # Warning: The database defined as "test" will be erased and
13
- # re-generated from your development database when you run "rake".
14
- # Do not set this db to the same as development or production.
15
- test:
16
- adapter: sqlite3
17
- database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
-
21
- production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
@@ -1,5 +0,0 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the rails application
5
- Dummy::Application.initialize!
@@ -1,2 +0,0 @@
1
- Dummy::Application.configure do
2
- end
@@ -1,2 +0,0 @@
1
- Dummy::Application.configure do
2
- end
@@ -1,2 +0,0 @@
1
- Dummy::Application.configure do
2
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
@@ -1,15 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
6
- # inflect.plural /^(ox)$/i, '\1en'
7
- # inflect.singular /^(ox)en/i, '\1'
8
- # inflect.irregular 'person', 'people'
9
- # inflect.uncountable %w( fish sheep )
10
- # end
11
- #
12
- # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
- # inflect.acronym 'RESTful'
15
- # end
@@ -1,5 +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
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
- # Make sure the secret is at least 30 characters and all random,
6
- # no regular words or you'll be exposed to dictionary attacks.
7
- Dummy::Application.config.secret_token = '42da708db5725479ebd37530644412b9a6203a31f1db83d8799995365f1c026abb0c9fed978d81a80388b8bbfc9f9b9b33683330f4b657e6253d1a6df55860bb'
@@ -1,8 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # Dummy::Application.config.session_store :active_record_store
@@ -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
- # Disable root element in JSON by default.
12
- ActiveSupport.on_load(:active_record) do
13
- self.include_root_in_json = false
14
- end
@@ -1,5 +0,0 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
5
- hello: "Hello world"
@@ -1,11 +0,0 @@
1
- Dummy::Application.routes.draw do
2
- root to: "dummy#dummy"
3
-
4
- get "about" => "dummy#dummy", as: :about
5
- get "about/contact" => "dummy#dummy", as: :contact
6
- get "about/contact/form" => "dummy#dummy", as: :contact_form
7
-
8
- resources :projects do
9
- resources :issues
10
- end
11
- end
@@ -1,9 +0,0 @@
1
- class CreateProjects < ActiveRecord::Migration[4.2]
2
- def change
3
- create_table :projects do |t|
4
- t.string :name
5
-
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,10 +0,0 @@
1
- class CreateIssues < ActiveRecord::Migration[4.2]
2
- def change
3
- create_table :issues do |t|
4
- t.string :title
5
- t.integer :project_id
6
-
7
- t.timestamps
8
- end
9
- end
10
- end
@@ -1,28 +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
- # This file is the source Rails uses to define your schema when running `rails
6
- # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
7
- # be faster and is potentially less error prone than running all of your
8
- # migrations from scratch. Old migrations may fail to apply correctly if those
9
- # migrations use external dependencies or application code.
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 2013_01_22_163051) do
14
-
15
- create_table "issues", force: :cascade do |t|
16
- t.string "title"
17
- t.integer "project_id"
18
- t.datetime "created_at"
19
- t.datetime "updated_at"
20
- end
21
-
22
- create_table "projects", force: :cascade do |t|
23
- t.string "name"
24
- t.datetime "created_at"
25
- t.datetime "updated_at"
26
- end
27
-
28
- end
File without changes
File without changes
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/404.html -->
21
- <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/422.html -->
21
- <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
24
- </div>
25
- </body>
26
- </html>