friendly_slug 0.1.6 → 0.1.7

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 (123) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/friendly_slug.gemspec +1 -1
  4. data/lib/friendly_slug/version.rb +1 -1
  5. metadata +1 -119
  6. data/friendly_slug_gem_test/.gitignore +0 -30
  7. data/friendly_slug_gem_test/.ruby-version +0 -1
  8. data/friendly_slug_gem_test/Gemfile +0 -32
  9. data/friendly_slug_gem_test/Gemfile.lock +0 -222
  10. data/friendly_slug_gem_test/README.md +0 -24
  11. data/friendly_slug_gem_test/Rakefile +0 -6
  12. data/friendly_slug_gem_test/app/assets/config/manifest.js +0 -3
  13. data/friendly_slug_gem_test/app/assets/images/.keep +0 -0
  14. data/friendly_slug_gem_test/app/assets/javascripts/application.js +0 -16
  15. data/friendly_slug_gem_test/app/assets/javascripts/blogs.coffee +0 -3
  16. data/friendly_slug_gem_test/app/assets/javascripts/cable.js +0 -13
  17. data/friendly_slug_gem_test/app/assets/javascripts/channels/.keep +0 -0
  18. data/friendly_slug_gem_test/app/assets/javascripts/topics.coffee +0 -3
  19. data/friendly_slug_gem_test/app/assets/stylesheets/application.css +0 -15
  20. data/friendly_slug_gem_test/app/assets/stylesheets/blogs.scss +0 -3
  21. data/friendly_slug_gem_test/app/assets/stylesheets/scaffolds.scss +0 -84
  22. data/friendly_slug_gem_test/app/assets/stylesheets/topics.scss +0 -3
  23. data/friendly_slug_gem_test/app/channels/application_cable/channel.rb +0 -4
  24. data/friendly_slug_gem_test/app/channels/application_cable/connection.rb +0 -4
  25. data/friendly_slug_gem_test/app/controllers/application_controller.rb +0 -2
  26. data/friendly_slug_gem_test/app/controllers/blogs_controller.rb +0 -60
  27. data/friendly_slug_gem_test/app/controllers/concerns/.keep +0 -0
  28. data/friendly_slug_gem_test/app/controllers/topics_controller.rb +0 -60
  29. data/friendly_slug_gem_test/app/helpers/application_helper.rb +0 -2
  30. data/friendly_slug_gem_test/app/helpers/blogs_helper.rb +0 -2
  31. data/friendly_slug_gem_test/app/helpers/topics_helper.rb +0 -2
  32. data/friendly_slug_gem_test/app/jobs/application_job.rb +0 -2
  33. data/friendly_slug_gem_test/app/mailers/application_mailer.rb +0 -4
  34. data/friendly_slug_gem_test/app/models/application_record.rb +0 -3
  35. data/friendly_slug_gem_test/app/models/blog.rb +0 -3
  36. data/friendly_slug_gem_test/app/models/concerns/.keep +0 -0
  37. data/friendly_slug_gem_test/app/models/topic.rb +0 -3
  38. data/friendly_slug_gem_test/app/views/blogs/_blog.json.jbuilder +0 -2
  39. data/friendly_slug_gem_test/app/views/blogs/_form.html.erb +0 -32
  40. data/friendly_slug_gem_test/app/views/blogs/edit.html.erb +0 -6
  41. data/friendly_slug_gem_test/app/views/blogs/index.html.erb +0 -31
  42. data/friendly_slug_gem_test/app/views/blogs/index.json.jbuilder +0 -1
  43. data/friendly_slug_gem_test/app/views/blogs/new.html.erb +0 -5
  44. data/friendly_slug_gem_test/app/views/blogs/show.html.erb +0 -19
  45. data/friendly_slug_gem_test/app/views/blogs/show.json.jbuilder +0 -1
  46. data/friendly_slug_gem_test/app/views/layouts/application.html.erb +0 -15
  47. data/friendly_slug_gem_test/app/views/layouts/mailer.html.erb +0 -13
  48. data/friendly_slug_gem_test/app/views/layouts/mailer.text.erb +0 -1
  49. data/friendly_slug_gem_test/app/views/topics/_form.html.erb +0 -37
  50. data/friendly_slug_gem_test/app/views/topics/_topic.json.jbuilder +0 -2
  51. data/friendly_slug_gem_test/app/views/topics/edit.html.erb +0 -6
  52. data/friendly_slug_gem_test/app/views/topics/index.html.erb +0 -33
  53. data/friendly_slug_gem_test/app/views/topics/index.json.jbuilder +0 -1
  54. data/friendly_slug_gem_test/app/views/topics/new.html.erb +0 -5
  55. data/friendly_slug_gem_test/app/views/topics/show.html.erb +0 -24
  56. data/friendly_slug_gem_test/app/views/topics/show.json.jbuilder +0 -1
  57. data/friendly_slug_gem_test/bin/bundle +0 -3
  58. data/friendly_slug_gem_test/bin/rails +0 -9
  59. data/friendly_slug_gem_test/bin/rake +0 -9
  60. data/friendly_slug_gem_test/bin/setup +0 -36
  61. data/friendly_slug_gem_test/bin/spring +0 -17
  62. data/friendly_slug_gem_test/bin/update +0 -31
  63. data/friendly_slug_gem_test/bin/yarn +0 -11
  64. data/friendly_slug_gem_test/config.ru +0 -5
  65. data/friendly_slug_gem_test/config/application.rb +0 -20
  66. data/friendly_slug_gem_test/config/boot.rb +0 -4
  67. data/friendly_slug_gem_test/config/cable.yml +0 -10
  68. data/friendly_slug_gem_test/config/credentials.yml.enc +0 -1
  69. data/friendly_slug_gem_test/config/database.yml +0 -25
  70. data/friendly_slug_gem_test/config/environment.rb +0 -5
  71. data/friendly_slug_gem_test/config/environments/development.rb +0 -61
  72. data/friendly_slug_gem_test/config/environments/production.rb +0 -94
  73. data/friendly_slug_gem_test/config/environments/test.rb +0 -46
  74. data/friendly_slug_gem_test/config/initializers/application_controller_renderer.rb +0 -8
  75. data/friendly_slug_gem_test/config/initializers/assets.rb +0 -14
  76. data/friendly_slug_gem_test/config/initializers/backtrace_silencers.rb +0 -7
  77. data/friendly_slug_gem_test/config/initializers/content_security_policy.rb +0 -25
  78. data/friendly_slug_gem_test/config/initializers/cookies_serializer.rb +0 -5
  79. data/friendly_slug_gem_test/config/initializers/filter_parameter_logging.rb +0 -4
  80. data/friendly_slug_gem_test/config/initializers/inflections.rb +0 -16
  81. data/friendly_slug_gem_test/config/initializers/mime_types.rb +0 -4
  82. data/friendly_slug_gem_test/config/initializers/wrap_parameters.rb +0 -14
  83. data/friendly_slug_gem_test/config/locales/en.yml +0 -33
  84. data/friendly_slug_gem_test/config/puma.rb +0 -34
  85. data/friendly_slug_gem_test/config/routes.rb +0 -5
  86. data/friendly_slug_gem_test/config/spring.rb +0 -6
  87. data/friendly_slug_gem_test/config/storage.yml +0 -34
  88. data/friendly_slug_gem_test/db/migrate/20180628233122_create_blogs.rb +0 -11
  89. data/friendly_slug_gem_test/db/migrate/20180630053922_create_topics.rb +0 -13
  90. data/friendly_slug_gem_test/db/schema.rb +0 -33
  91. data/friendly_slug_gem_test/db/seeds.rb +0 -9
  92. data/friendly_slug_gem_test/lib/assets/.keep +0 -0
  93. data/friendly_slug_gem_test/lib/tasks/.keep +0 -0
  94. data/friendly_slug_gem_test/log/.keep +0 -0
  95. data/friendly_slug_gem_test/package.json +0 -5
  96. data/friendly_slug_gem_test/public/404.html +0 -67
  97. data/friendly_slug_gem_test/public/422.html +0 -67
  98. data/friendly_slug_gem_test/public/500.html +0 -66
  99. data/friendly_slug_gem_test/public/apple-touch-icon-precomposed.png +0 -0
  100. data/friendly_slug_gem_test/public/apple-touch-icon.png +0 -0
  101. data/friendly_slug_gem_test/public/favicon.ico +0 -0
  102. data/friendly_slug_gem_test/public/robots.txt +0 -1
  103. data/friendly_slug_gem_test/test/application_system_test_case.rb +0 -5
  104. data/friendly_slug_gem_test/test/controllers/.keep +0 -0
  105. data/friendly_slug_gem_test/test/controllers/blogs_controller_test.rb +0 -48
  106. data/friendly_slug_gem_test/test/controllers/topics_controller_test.rb +0 -48
  107. data/friendly_slug_gem_test/test/fixtures/.keep +0 -0
  108. data/friendly_slug_gem_test/test/fixtures/blogs.yml +0 -17
  109. data/friendly_slug_gem_test/test/fixtures/files/.keep +0 -0
  110. data/friendly_slug_gem_test/test/fixtures/topics.yml +0 -27
  111. data/friendly_slug_gem_test/test/helpers/.keep +0 -0
  112. data/friendly_slug_gem_test/test/integration/.keep +0 -0
  113. data/friendly_slug_gem_test/test/integration/main_slug_test.rb +0 -34
  114. data/friendly_slug_gem_test/test/mailers/.keep +0 -0
  115. data/friendly_slug_gem_test/test/models/.keep +0 -0
  116. data/friendly_slug_gem_test/test/models/blog_test.rb +0 -19
  117. data/friendly_slug_gem_test/test/models/topic_test.rb +0 -18
  118. data/friendly_slug_gem_test/test/system/.keep +0 -0
  119. data/friendly_slug_gem_test/test/system/blogs_test.rb +0 -47
  120. data/friendly_slug_gem_test/test/system/topics_test.rb +0 -49
  121. data/friendly_slug_gem_test/test/test_helper.rb +0 -37
  122. data/friendly_slug_gem_test/tmp/.keep +0 -0
  123. data/friendly_slug_gem_test/vendor/.keep +0 -0
@@ -1,24 +0,0 @@
1
- # README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
@@ -1,6 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require_relative 'config/application'
5
-
6
- Rails.application.load_tasks
@@ -1,3 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../javascripts .js
3
- //= link_directory ../stylesheets .css
@@ -1,16 +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, or any plugin's
5
- // 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. JavaScript code in this file should be added after the last require_* statement.
9
- //
10
- // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require rails-ujs
14
- //= require activestorage
15
- //= require turbolinks
16
- //= require_tree .
@@ -1,3 +0,0 @@
1
- # Place all the behaviors and hooks related to the matching controller here.
2
- # All this logic will automatically be available in application.js.
3
- # You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,13 +0,0 @@
1
- // Action Cable provides the framework to deal with WebSockets in Rails.
2
- // You can generate new channels where WebSocket features live using the `rails generate channel` command.
3
- //
4
- //= require action_cable
5
- //= require_self
6
- //= require_tree ./channels
7
-
8
- (function() {
9
- this.App || (this.App = {});
10
-
11
- App.cable = ActionCable.createConsumer();
12
-
13
- }).call(this);
@@ -1,3 +0,0 @@
1
- # Place all the behaviors and hooks related to the matching controller here.
2
- # All this logic will automatically be available in application.js.
3
- # You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,15 +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, or any plugin's
6
- * 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 other CSS/SCSS
10
- * files in this directory. Styles in this file should be added after the last require_* statement.
11
- * It is generally better to create a new file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,3 +0,0 @@
1
- // Place all the styles related to the blogs controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,84 +0,0 @@
1
- body {
2
- background-color: #fff;
3
- color: #333;
4
- margin: 33px;
5
- font-family: verdana, arial, helvetica, sans-serif;
6
- font-size: 13px;
7
- line-height: 18px;
8
- }
9
-
10
- p, ol, ul, td {
11
- font-family: verdana, arial, helvetica, sans-serif;
12
- font-size: 13px;
13
- line-height: 18px;
14
- }
15
-
16
- pre {
17
- background-color: #eee;
18
- padding: 10px;
19
- font-size: 11px;
20
- }
21
-
22
- a {
23
- color: #000;
24
-
25
- &:visited {
26
- color: #666;
27
- }
28
-
29
- &:hover {
30
- color: #fff;
31
- background-color: #000;
32
- }
33
- }
34
-
35
- th {
36
- padding-bottom: 5px;
37
- }
38
-
39
- td {
40
- padding: 0 5px 7px;
41
- }
42
-
43
- div {
44
- &.field, &.actions {
45
- margin-bottom: 10px;
46
- }
47
- }
48
-
49
- #notice {
50
- color: green;
51
- }
52
-
53
- .field_with_errors {
54
- padding: 2px;
55
- background-color: red;
56
- display: table;
57
- }
58
-
59
- #error_explanation {
60
- width: 450px;
61
- border: 2px solid red;
62
- padding: 7px 7px 0;
63
- margin-bottom: 20px;
64
- background-color: #f0f0f0;
65
-
66
- h2 {
67
- text-align: left;
68
- font-weight: bold;
69
- padding: 5px 5px 5px 15px;
70
- font-size: 12px;
71
- margin: -7px -7px 0;
72
- background-color: #c00;
73
- color: #fff;
74
- }
75
-
76
- ul li {
77
- font-size: 12px;
78
- list-style: square;
79
- }
80
- }
81
-
82
- label {
83
- display: block;
84
- }
@@ -1,3 +0,0 @@
1
- // Place all the styles related to the topics controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Channel < ActionCable::Channel::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Connection < ActionCable::Connection::Base
3
- end
4
- end
@@ -1,2 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- end
@@ -1,60 +0,0 @@
1
- class BlogsController < ApplicationController
2
- before_action :set_blog, only: [:show, :edit, :update, :destroy]
3
-
4
- def index
5
- @blogs = Blog.all
6
- end
7
-
8
- def show
9
- end
10
-
11
- def new
12
- @blog = Blog.new
13
- end
14
-
15
- def edit
16
- end
17
-
18
- def create
19
- @blog = Blog.new(blog_params)
20
-
21
- respond_to do |format|
22
- if @blog.save
23
- format.html { redirect_to @blog, notice: 'Blog was successfully created.' }
24
- format.json { render :show, status: :created, location: @blog }
25
- else
26
- format.html { render :new }
27
- format.json { render json: @blog.errors, status: :unprocessable_entity }
28
- end
29
- end
30
- end
31
-
32
- def update
33
- respond_to do |format|
34
- if @blog.update(blog_params)
35
- format.html { redirect_to @blog, notice: 'Blog was successfully updated.' }
36
- format.json { render :show, status: :ok, location: @blog }
37
- else
38
- format.html { render :edit }
39
- format.json { render json: @blog.errors, status: :unprocessable_entity }
40
- end
41
- end
42
- end
43
-
44
- def destroy
45
- @blog.destroy
46
- respond_to do |format|
47
- format.html { redirect_to blogs_url, notice: 'Blog was successfully destroyed.' }
48
- format.json { head :no_content }
49
- end
50
- end
51
-
52
- private
53
- def set_blog
54
- @blog = Blog.find_slugged(params[:id])
55
- end
56
-
57
- def blog_params
58
- params.require(:blog).permit(:title, :body, :views)
59
- end
60
- end
@@ -1,60 +0,0 @@
1
- class TopicsController < ApplicationController
2
- before_action :set_topic, only: [:show, :edit, :update, :destroy]
3
-
4
- def index
5
- @topics = Topic.all
6
- end
7
-
8
- def show
9
- end
10
-
11
- def new
12
- @topic = Topic.new
13
- end
14
-
15
- def edit
16
- end
17
-
18
- def create
19
- @topic = Topic.new(topic_params)
20
-
21
- respond_to do |format|
22
- if @topic.save
23
- format.html { redirect_to @topic, notice: 'Topic was successfully created.' }
24
- format.json { render :show, status: :created, location: @topic }
25
- else
26
- format.html { render :new }
27
- format.json { render json: @topic.errors, status: :unprocessable_entity }
28
- end
29
- end
30
- end
31
-
32
- def update
33
- respond_to do |format|
34
- if @topic.update(topic_params)
35
- format.html { redirect_to @topic, notice: 'Topic was successfully updated.' }
36
- format.json { render :show, status: :ok, location: @topic }
37
- else
38
- format.html { render :edit }
39
- format.json { render json: @topic.errors, status: :unprocessable_entity }
40
- end
41
- end
42
- end
43
-
44
- def destroy
45
- @topic.destroy
46
- respond_to do |format|
47
- format.html { redirect_to topics_url, notice: 'Topic was successfully destroyed.' }
48
- format.json { head :no_content }
49
- end
50
- end
51
-
52
- private
53
- def set_topic
54
- @topic = Topic.find_by_slug(params[:id])
55
- end
56
-
57
- def topic_params
58
- params.require(:topic).permit(:title, :slug, :color, :views)
59
- end
60
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,2 +0,0 @@
1
- module BlogsHelper
2
- end
@@ -1,2 +0,0 @@
1
- module TopicsHelper
2
- end
@@ -1,2 +0,0 @@
1
- class ApplicationJob < ActiveJob::Base
2
- end
@@ -1,4 +0,0 @@
1
- class ApplicationMailer < ActionMailer::Base
2
- default from: 'from@example.com'
3
- layout 'mailer'
4
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
@@ -1,3 +0,0 @@
1
- class Blog < ApplicationRecord
2
- build_friendly_slug :title, :id, use: :last
3
- end
@@ -1,3 +0,0 @@
1
- class Topic < ApplicationRecord
2
- build_friendly_slug :title, use: :database
3
- end
@@ -1,2 +0,0 @@
1
- json.extract! blog, :id, :title, :body, :views, :created_at, :updated_at
2
- json.url blog_url(blog, format: :json)
@@ -1,32 +0,0 @@
1
- <%= form_with(model: blog, local: true) do |form| %>
2
- <% if blog.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(blog.errors.count, "error") %> prohibited this blog from being saved:</h2>
5
-
6
- <ul>
7
- <% blog.errors.full_messages.each do |message| %>
8
- <li><%= message %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <div class="field">
15
- <%= form.label :title %>
16
- <%= form.text_field :title %>
17
- </div>
18
-
19
- <div class="field">
20
- <%= form.label :body %>
21
- <%= form.text_area :body %>
22
- </div>
23
-
24
- <div class="field">
25
- <%= form.label :views %>
26
- <%= form.text_field :views %>
27
- </div>
28
-
29
- <div class="actions">
30
- <%= form.submit %>
31
- </div>
32
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing Blog</h1>
2
-
3
- <%= render 'form', blog: @blog %>
4
-
5
- <%= link_to 'Show', @blog %> |
6
- <%= link_to 'Back', blogs_path %>
@@ -1,31 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <h1>Blogs</h1>
4
-
5
- <table>
6
- <thead>
7
- <tr>
8
- <th>Title</th>
9
- <th>Body</th>
10
- <th>Views</th>
11
- <th colspan="3"></th>
12
- </tr>
13
- </thead>
14
-
15
- <tbody>
16
- <% @blogs.each do |blog| %>
17
- <tr>
18
- <td><%= blog.title %></td>
19
- <td><%= blog.body %></td>
20
- <td><%= blog.views %></td>
21
- <td><%= link_to 'Show', blog %></td>
22
- <td><%= link_to 'Edit', edit_blog_path(blog) %></td>
23
- <td><%= link_to 'Destroy', blog, method: :delete, data: { confirm: 'Are you sure?' } %></td>
24
- </tr>
25
- <% end %>
26
- </tbody>
27
- </table>
28
-
29
- <br>
30
-
31
- <%= link_to 'New Blog', new_blog_path %>