buoys 0.6.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/buoys.rb +2 -0
  4. data/lib/buoys/buoy.rb +3 -1
  5. data/lib/buoys/config.rb +2 -0
  6. data/lib/buoys/helper.rb +2 -0
  7. data/lib/buoys/link.rb +2 -0
  8. data/lib/buoys/loader.rb +2 -0
  9. data/lib/buoys/railtie.rb +2 -0
  10. data/lib/buoys/renderer.rb +2 -0
  11. data/lib/buoys/version.rb +3 -1
  12. data/lib/generators/buoys/install_generator.rb +2 -0
  13. data/lib/generators/buoys/templates/breadcrumbs.rb +2 -0
  14. data/test/buoys_buoy_test.rb +2 -0
  15. data/test/buoys_generator_test.rb +3 -1
  16. data/test/buoys_helper_test.rb +2 -1
  17. data/test/buoys_loader_test.rb +2 -0
  18. data/test/buoys_test.rb +2 -0
  19. data/test/dummy/app/controllers/application_controller.rb +2 -0
  20. data/test/dummy/app/controllers/items_controller.rb +2 -0
  21. data/test/dummy/app/helpers/application_helper.rb +2 -0
  22. data/test/dummy/app/models/item.rb +2 -0
  23. data/test/dummy/app/models/user.rb +2 -0
  24. data/test/dummy/config/application.rb +2 -0
  25. data/test/dummy/config/boot.rb +2 -0
  26. data/test/dummy/config/buoys/breadcrumb.rb +2 -0
  27. data/test/dummy/config/buoys/buoys.rb +2 -0
  28. data/test/dummy/config/environment.rb +2 -0
  29. data/test/dummy/config/environments/development.rb +2 -0
  30. data/test/dummy/config/environments/production.rb +2 -0
  31. data/test/dummy/config/environments/test.rb +2 -0
  32. data/test/dummy/config/initializers/assets.rb +2 -0
  33. data/test/dummy/config/initializers/backtrace_silencers.rb +2 -0
  34. data/test/dummy/config/initializers/cookies_serializer.rb +2 -0
  35. data/test/dummy/config/initializers/filter_parameter_logging.rb +2 -0
  36. data/test/dummy/config/initializers/inflections.rb +2 -0
  37. data/test/dummy/config/initializers/mime_types.rb +2 -0
  38. data/test/dummy/config/initializers/session_store.rb +2 -0
  39. data/test/dummy/config/initializers/wrap_parameters.rb +2 -0
  40. data/test/dummy/config/routes.rb +2 -0
  41. data/test/dummy/db/migrate/20160602144150_create_items.rb +2 -0
  42. data/test/dummy/db/migrate/20160602144324_create_users.rb +2 -0
  43. data/test/dummy/db/schema.rb +1 -0
  44. data/test/test_helper.rb +2 -0
  45. metadata +14 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fbcaecaeb46ac751aa20c43f34ed8b87e35d556
4
- data.tar.gz: 1d71a1a3167b114a0ea0a51d84363768a9715861
3
+ metadata.gz: 9a95ccfad0d08b44c4e2611abad89dd6476995b3
4
+ data.tar.gz: 89391dac164282f6a28d37d3d5820ab6cf3b81e4
5
5
  SHA512:
6
- metadata.gz: c24acee65cbe92b2761d1424ad74b1ad9ce1875ed960b6435b630080226c955011166bfaa1199dd71a7ee80e76f0399f3f993836e17e134591c5dbe4c2795d26
7
- data.tar.gz: 82e710f6eee4a69fce6df38485a40aeb054c34a24cc3de532793384efaf206e79405b1f25c5878e7d5e5b7f5a5c2898d88713cb654f7a3e944b0a0a2f21a7b06
6
+ metadata.gz: 09edff082e1bb2d36152a0a27c70b28394825cd4234599b53f9cb9270f0b36bc64393791cf1d215357564db9eed7a8798dd6ea5766cfe1b752cd3c6175cf7757
7
+ data.tar.gz: 5a20e257c36f32656eddfcfb536a91f558a7619e719ee086897fe5b7da8ffdcb28453b105b962fb481bf846b4a5dfb4a018c4ebd3591e44496ac6f6312513fa7
data/README.md CHANGED
@@ -67,7 +67,7 @@ buoy :story_tasks do |story|
67
67
  pre_buoy :story, story, {link_current: true}
68
68
  end
69
69
 
70
- # You can use 'pre_buoy' as parent. 'parent' is the alias of re_buoy`
70
+ # You can use 'pre_buoy' as parent. 'parent' is the alias of pre_buoy`.
71
71
  # ex)
72
72
  buoy :story_tasks do |story|
73
73
  link :story_tasks, story_tasks_path
data/lib/buoys.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'buoys/version'
2
4
  require 'buoys/config'
3
5
  require 'buoys/loader'
data/lib/buoys/buoy.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Buoys
2
4
  class Buoy
3
5
  attr_reader :previous, :context
@@ -22,7 +24,7 @@ module Buoys
22
24
  def link(key, *args)
23
25
  options = args.extract_options!
24
26
  path = args.shift
25
- url = path ? context.url_for(path) : path
27
+ url = path ? context.url_for(path) : nil
26
28
 
27
29
  text = I18n.t(key, scope: 'buoys.breadcrumbs', default: key)
28
30
 
data/lib/buoys/config.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Buoys
2
4
  class Config
3
5
  class << self
data/lib/buoys/helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Buoys
2
4
  module Helper
3
5
  # Declare the breadcrumb which want to render in view.
data/lib/buoys/link.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Buoys
2
4
  class Link
3
5
  attr_accessor :text, :options, :options_for_config
data/lib/buoys/loader.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Buoys
2
4
  class Loader
3
5
  class << self
data/lib/buoys/railtie.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Buoys
2
4
  class Railtie < ::Rails::Railtie
3
5
  initializer 'buoys' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Buoys
2
4
  class Renderer
3
5
  def initialize(context, key, *args)
data/lib/buoys/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Buoys
2
- VERSION = '0.6.0'.freeze
4
+ VERSION = '1.0.0'.freeze
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/generators'
2
4
 
3
5
  module Buoys
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  buoy :example do
2
4
  link :example, 'http://localhost:3000'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  class BuoysBuoyTest < ActiveSupport::TestCase
@@ -1,4 +1,6 @@
1
- # rubocop:disable Style/RegexpLiteral,Style/PercentLiteralDelimiters
1
+ # frozen_string_literal: true
2
+
3
+ # rubocop:disable Style/RegexpLiteral, Metrics/LineLength
2
4
  require 'test_helper'
3
5
  require 'generators/buoys/install_generator'
4
6
 
@@ -1,4 +1,5 @@
1
- # rubocop:disable Metrics/ClassLength
1
+ # frozen_string_literal: true
2
+
2
3
  require 'test_helper'
3
4
 
4
5
  class BuoysHelerTest < ActionView::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  class BuoysLoaderTest < ActiveSupport::TestCase
data/test/buoys_test.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  class BuoysTest < ActiveSupport::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class ApplicationController < ActionController::Base
2
4
  # Prevent CSRF attacks by raising an exception.
3
5
  # For APIs, you may want to use :null_session instead.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class ItemsController < ApplicationController
2
4
  def show
3
5
  end
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ApplicationHelper
2
4
  end
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Item < ActiveRecord::Base
2
4
  end
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class User < ActiveRecord::Base
2
4
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path('../boot', __FILE__)
2
4
 
3
5
  require 'rails/all'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Set up gems listed in the Gemfile.
2
4
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  buoy :about do
2
4
  link 'about', about_path
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  buoy :account do
2
4
  link :account, 'http://example.com/account'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Load the Rails application.
2
4
  require File.expand_path('../application', __FILE__)
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Rails.application.configure do
2
4
  # Settings specified here will take precedence over those in config/application.rb.
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Rails.application.configure do
2
4
  # Settings specified here will take precedence over those in config/application.rb.
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Rails.application.configure do
2
4
  # Settings specified here will take precedence over those in config/application.rb.
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Version of your assets, change this if you want to expire all your assets.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Configure sensitive parameters which will be filtered from the log file.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Add new inflection rules using the following format. Inflections
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Add new mime types for use in respond_to blocks:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # This file contains settings for ActionController::ParamsWrapper which
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Rails.application.routes.draw do
2
4
  get 'about' => 'dummy#dummy', as: :about
3
5
  get 'about/history' => 'dummy#dummy', as: :history
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateItems < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :items do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateUsers < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :users do |t|
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # encoding: UTF-8
2
3
  # This file is auto-generated from the current state of the database. Instead
3
4
  # of editing this file, please use the migrations feature of Active Record to
data/test/test_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Configure Rails Environment
2
4
  ENV['RAILS_ENV'] = 'test'
3
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buoys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - muryoimpl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-31 00:00:00.000000000 Z
11
+ date: 2017-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.0
19
+ version: 4.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 4.1.0
26
+ version: 4.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -53,19 +53,25 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: deka_eiwakun
56
+ name: rubocop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.49'
59
62
  - - ">="
60
63
  - !ruby/object:Gem::Version
61
- version: '0'
64
+ version: 0.49.1
62
65
  type: :development
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '0.49'
66
72
  - - ">="
67
73
  - !ruby/object:Gem::Version
68
- version: '0'
74
+ version: 0.49.1
69
75
  description: A Ruby on Rails breadcrumbs plugin.
70
76
  email:
71
77
  - muryoimpl@gmail.com
@@ -162,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
168
  version: '0'
163
169
  requirements: []
164
170
  rubyforge_project:
165
- rubygems_version: 2.6.8
171
+ rubygems_version: 2.5.1
166
172
  signing_key:
167
173
  specification_version: 4
168
174
  summary: A Ruby on Rails breadcrumbs plugin.