vinted-crummy 1.9.0 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65f3e4a86d3ec1d1b30df795dbbf43a45df0feb41ec3eeca050a9f0a9bbfa472
4
- data.tar.gz: 33c5a0a2e2992ad5fc17e9ee0cf01c1292862b82dfa76b08ce59f8c6c2faa0e6
3
+ metadata.gz: 3f8d22d630abd2210a0d1f1c6e49bf152bfcd71a32998117841d31b3262ccd2e
4
+ data.tar.gz: 2f829061d42f525a6a4e5861f0f8d1ce6183139f35b4abb4136e2ed55acaf436
5
5
  SHA512:
6
- metadata.gz: 9e6417b85048af8d57946931a0e62b0f1dfa2b69ebf34cf469053fe039b45d7add5844638693177ef65db299f9f0e3ebb57c3e7983b43bf9758420cbd564cbfb
7
- data.tar.gz: 702f949125d96ddf93862907e8260b967a02927918441ea41e40df66a68a28e81289d10b2cb2c18d4db362e628c50112ee54a29c0e6f5bdfec79417f96816bb9
6
+ metadata.gz: bc481154dbacc8897d1a0d834302f513c4eb3d794351ba88554a2716af8b7920017ffe242d8a8e062d8705546f53b0685e12edfc615f072f87421b0f47bf5c58
7
+ data.tar.gz: 406ee2351744fd7c38336051d85c9bd024a8184abe57c81f428aa916c280fbd79af316cab4c2bbdf978ca26619f26124335f4627628a6df6c0bab98a0344afb4
@@ -1,7 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
- - 2.0.0
3
+ - 2.6.3
5
4
  gemfile:
6
- - gemfiles/rails3_2.gemfile
7
5
  - gemfiles/rails4_0.gemfile
data/Appraisals CHANGED
@@ -1,8 +1,3 @@
1
- appraise "rails3_2" do
2
- gem 'activesupport', '>= 3.0', '< 4'
3
- gem 'actionpack', '>= 3.0', '< 4'
4
- end
5
-
6
1
  appraise "rails4_0" do
7
2
  gem 'activesupport', '>= 4.0.0.beta', '< 5'
8
3
  gem 'actionpack', '>= 4.0.0.beta', '< 5'
data/README.md CHANGED
@@ -116,10 +116,10 @@ skip_if_blank: true
116
116
  render_crumbs #=> <a href="/">Home</a> &raquo; <a href="/businesses">Businesses</a>
117
117
  render_crumbs separator: ' | ' #=> <a href="/">Home</a> | <a href="/businesses">Businesses</a>
118
118
  render_crumbs format: :xml #=> <crumb href="/">Home</crumb><crumb href="/businesses">Businesses</crumb>
119
- render_crumbs format: :html_list #=> <ol class="" id=""><li class=""><a href="/">Home</a></li><li class=""><a href="/">Businesses</a></li></ol>
119
+ render_crumbs format: :html_list #=> <ul class="" id=""><li class=""><a href="/">Home</a></li><li class=""><a href="/">Businesses</a></li></ul>
120
120
  render_crumbs format: :html_list, :microdata => true
121
- #=> <ol class="" id=""><li class="" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
122
- # <a href="/" itemprop="url"><span itemprop="title">Home</span></a></li></ol>
121
+ #=> <ul class="" id=""><li class="" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
122
+ # <a href="/" itemprop="url"><span itemprop="title">Home</span></a></li></ul>
123
123
  add_crumb support_link, {:right_side => true, :links => "/support", :li_right_class => "pull-right hidden-phone"}
124
124
  #=> <li class="pull-right hidden-phone">
125
125
  #=> <span><a class="glyphicons shield" href="/support">
@@ -131,7 +131,7 @@ add_crumb support_link, {:right_side => true, :links => "/support", :li_right_cl
131
131
 
132
132
  A crumb with a nil argument for the link will output an unlinked crumb.
133
133
 
134
- With `format: :html_list` you can specify additional `params: :li_class, :ol_class, :ol_id`
134
+ With `format: :html_list` you can specify additional `params: :li_class, :ul_class, :ul_id`
135
135
 
136
136
  ### App-wide configuration
137
137
 
@@ -164,8 +164,8 @@ Possible parameters for configuration are:
164
164
  :html_list_right_separator
165
165
  :first_class
166
166
  :last_class
167
- :ol_id
168
- :ol_class
167
+ :ul_id
168
+ :ul_class
169
169
  :li_class
170
170
  :li_right_class
171
171
  :microdata
@@ -20,8 +20,8 @@ module Crummy
20
20
  attr_accessor :html_list_right_separator
21
21
  attr_accessor :first_class
22
22
  attr_accessor :last_class
23
- attr_accessor :ol_id
24
- attr_accessor :ol_class
23
+ attr_accessor :ul_id
24
+ attr_accessor :ul_class
25
25
  attr_accessor :li_class
26
26
  attr_accessor :microdata
27
27
  attr_accessor :last_crumb_linked
@@ -40,8 +40,8 @@ module Crummy
40
40
  @links = true
41
41
  @first_class = ''
42
42
  @last_class = ''
43
- @ol_id = ''
44
- @ol_class = ''
43
+ @ul_id = ''
44
+ @ul_class = ''
45
45
  @li_class = ''
46
46
  @microdata = false
47
47
  @last_crumb_linked = true
@@ -20,9 +20,9 @@ module Crummy
20
20
  # render_crumbs #=> <a href="/">Home</a> &raquo; <a href="/businesses">Businesses</a>
21
21
  # render_crumbs :separator => ' | ' #=> <a href="/">Home</a> | <a href="/businesses">Businesses</a>
22
22
  # render_crumbs :format => :xml #=> <crumb href="/">Home</crumb><crumb href="/businesses">Businesses</crumb>
23
- # render_crumbs :format => :html_list #=> <ol class="" id=""><li class=""><a href="/">Home</a></li><li class=""><a href="/">Businesses</a></li></ol>
23
+ # render_crumbs :format => :html_list #=> <ul class="" id=""><li class=""><a href="/">Home</a></li><li class=""><a href="/">Businesses</a></li></ul>
24
24
  #
25
- # With :format => :html_list you can specify additional params: li_class, ol_class, ol_id
25
+ # With :format => :html_list you can specify additional params: li_class, ul_class, ul_id
26
26
  # The only argument is for the separator text. It does not assume you want spaces on either side so you must specify. Defaults to +&raquo;+
27
27
  #
28
28
  # render_crumbs(" . ") #=> <a href="/">Home</a> . <a href="/businesses">Businesses</a>
@@ -64,11 +64,11 @@ module Crummy
64
64
  when :html_list
65
65
  # Let's set values for special options of html_list format
66
66
  options[:li_class] ||= Crummy.configuration.li_class
67
- options[:ol_class] ||= Crummy.configuration.ol_class
68
- options[:ol_id] ||= Crummy.configuration.ol_id
69
- options[:ol_id] = nil if options[:ol_id].blank?
67
+ options[:ul_class] ||= Crummy.configuration.ul_class
68
+ options[:ul_id] ||= Crummy.configuration.ul_id
69
+ options[:ul_id] = nil if options[:ul_id].blank?
70
70
 
71
- crumb_string = crumbs.map{|crumb|local_global.call(crumb, options, :right_side) ? nil :
71
+ crumb_string = crumbs.map{|crumb|local_global.call(crumb, options, :right_side) ? nil :
72
72
  crumb_to_html_list(crumb,
73
73
  local_global.call(crumb, options, :links),
74
74
  local_global.call(crumb, options, :li_class),
@@ -94,10 +94,10 @@ module Crummy
94
94
  local_global.call(crumb, options, :last_crumb_linked),
95
95
  local_global.call(crumb, options, :truncate),
96
96
  local_global.call(crumb, options, :right_separator))}.compact.join.html_safe
97
- crumb_string = content_tag(:ol,
97
+ crumb_string = content_tag(:ul,
98
98
  crumb_string+crumb_right_string,
99
- :class => options[:ol_class],
100
- :id => options[:ol_id])
99
+ :class => options[:ul_class],
100
+ :id => options[:ul_id])
101
101
  crumb_string
102
102
  when :xml
103
103
  crumbs.collect do |crumb|
@@ -154,7 +154,7 @@ module Crummy
154
154
  else
155
155
  html_content = can_link ? link_to((truncate.present? ? name.truncate(truncate) : name), url, options[:link_html_options]) : content_tag(:span, (truncate.present? ? name.truncate(truncate) : name))
156
156
  end
157
- content_tag(:li, html_content, html_options)+(/<\/li/ =~ separator ?
157
+ content_tag(:li, html_content, html_options)+(/<\/li/ =~ separator ?
158
158
  separator : content_tag(:li, separator) unless separator.blank? || is_last)
159
159
  end
160
160
 
@@ -168,3 +168,4 @@ module Crummy
168
168
  end
169
169
  end
170
170
  end
171
+
@@ -1,6 +1,6 @@
1
1
  module Crummy
2
2
  MAJOR = 1
3
- MINOR = 9
3
+ MINOR = 10
4
4
  PATCH = 0
5
5
  VERSION = [MAJOR, MINOR, PATCH].join('.')
6
6
  end
@@ -17,52 +17,52 @@ class StandardRendererTest < Test::Unit::TestCase
17
17
  renderer = StandardRenderer.new
18
18
  assert_dom_equal('<a href="url" class="first last">name</a>',
19
19
  renderer.render_crumbs([['name', 'url']], :first_class => 'first', :last_class => 'last', :format => :html))
20
- assert_equal('<ol class=""><li class="first last"><a href="url">name</a></li></ol>',
20
+ assert_equal('<ul class=""><li class="first last"><a href="url">name</a></li></ul>',
21
21
  renderer.render_crumbs([['name', 'url']], :first_class => 'first', :last_class => 'last', :format => :html_list))
22
22
  assert_equal('<crumb href="url">name</crumb>',
23
23
  renderer.render_crumbs([['name', 'url']], :first_class => 'first', :last_class => 'last', :format => :xml))
24
24
 
25
25
  assert_dom_equal('<a href="url1" class="first">name1</a> &raquo; <a href="url2" class="last">name2</a>',
26
26
  renderer.render_crumbs([['name1', 'url1'], ['name2', 'url2']], :first_class => 'first', :last_class => 'last', :format => :html))
27
- assert_equal('<ol class=""><li class="first li_class"><a href="url1">name1</a></li><li class="li_class"><a href="url2">name2</a></li><li class="last li_class"><a href="url3">name3</a></li></ol>',
27
+ assert_equal('<ul class=""><li class="first li_class"><a href="url1">name1</a></li><li class="li_class"><a href="url2">name2</a></li><li class="last li_class"><a href="url3">name3</a></li></ul>',
28
28
  renderer.render_crumbs([['name1', 'url1'], ['name2', 'url2'], ['name3', 'url3']], :li_class => "li_class", :first_class => 'first', :last_class => 'last', :format => :html_list))
29
- assert_equal('<ol class=""><li class="first li_class"><a href="url1">name1</a></li><li> / </li><li class="li_class"><a href="url2">name2</a></li><li> / </li><li class="last li_class"><a href="url3">name3</a></li></ol>',
29
+ assert_equal('<ul class=""><li class="first li_class"><a href="url1">name1</a></li><li> / </li><li class="li_class"><a href="url2">name2</a></li><li> / </li><li class="last li_class"><a href="url3">name3</a></li></ul>',
30
30
  renderer.render_crumbs([['name1', 'url1'], ['name2', 'url2'], ['name3', 'url3']], :li_class => "li_class", :first_class => 'first', :last_class => 'last', :format => :html_list, :separator => " / "))
31
31
  assert_equal('<crumb href="url1">name1</crumb><crumb href="url2">name2</crumb>',
32
32
  renderer.render_crumbs([['name1', 'url1'], ['name2', 'url2']], :first_class => 'first', :last_class => 'last', :format => :xml))
33
33
 
34
34
  assert_dom_equal('<div itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="url" class="first last" itemprop="url"><span itemprop="title">name</span></a></div>',
35
35
  renderer.render_crumbs([['name', 'url']], :first_class => 'first', :last_class => 'last', :format => :html, :microdata => true))
36
- assert_equal('<ol class=""><li class="first last" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="url"><span itemprop="title">name</span></a></li></ol>',
36
+ assert_equal('<ul class=""><li class="first last" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="url"><span itemprop="title">name</span></a></li></ul>',
37
37
  renderer.render_crumbs([['name', 'url']], :first_class => 'first', :last_class => 'last', :format => :html_list, :microdata => true))
38
- assert_equal('<ol class="crumbclass" id="crumbid"><li class="liclass"><a href="url">name</a></li></ol>',
39
- renderer.render_crumbs([['name', 'url']], :format => :html_list, :ol_id => "crumbid", :ol_class => "crumbclass", :li_class => "liclass"))
38
+ assert_equal('<ul class="crumbclass" id="crumbid"><li class="liclass"><a href="url">name</a></li></ul>',
39
+ renderer.render_crumbs([['name', 'url']], :format => :html_list, :ul_id => "crumbid", :ul_class => "crumbclass", :li_class => "liclass"))
40
40
  end
41
41
 
42
42
  def test_classes_last_crumb_not_linked
43
43
  renderer = StandardRenderer.new
44
44
  assert_equal('name',
45
45
  renderer.render_crumbs([['name', 'url']], :first_class => 'first', :last_class => 'last', :format => :html, :last_crumb_linked => false))
46
- assert_equal('<ol class=""><li class="first last"><span>name</span></li></ol>',
46
+ assert_equal('<ul class=""><li class="first last"><span>name</span></li></ul>',
47
47
  renderer.render_crumbs([['name', 'url']], :first_class => 'first', :last_class => 'last', :format => :html_list, :last_crumb_linked => false))
48
48
  assert_equal('<crumb href="url">name</crumb>',
49
49
  renderer.render_crumbs([['name', 'url']], :first_class => 'first', :last_class => 'last', :format => :xml, :last_crumb_linked => false))
50
50
 
51
51
  assert_dom_equal('<a href="url1" class="first">name1</a> &raquo; name2',
52
52
  renderer.render_crumbs([['name1', 'url1'], ['name2', 'url2']], :first_class => 'first', :last_class => 'last', :format => :html, :last_crumb_linked => false))
53
- assert_equal('<ol class=""><li class="first li_class"><a href="url1">name1</a></li><li class="li_class"><a href="url2">name2</a></li><li class="last li_class"><span>name3</span></li></ol>',
53
+ assert_equal('<ul class=""><li class="first li_class"><a href="url1">name1</a></li><li class="li_class"><a href="url2">name2</a></li><li class="last li_class"><span>name3</span></li></ul>',
54
54
  renderer.render_crumbs([['name1', 'url1'], ['name2', 'url2'], ['name3', 'url3']], :li_class => "li_class", :first_class => 'first', :last_class => 'last', :format => :html_list, :last_crumb_linked => false))
55
- assert_equal('<ol class=""><li class="first li_class"><a href="url1">name1</a></li><li> / </li><li class="li_class"><a href="url2">name2</a></li><li> / </li><li class="last li_class"><span>name3</span></li></ol>',
55
+ assert_equal('<ul class=""><li class="first li_class"><a href="url1">name1</a></li><li> / </li><li class="li_class"><a href="url2">name2</a></li><li> / </li><li class="last li_class"><span>name3</span></li></ul>',
56
56
  renderer.render_crumbs([['name1', 'url1'], ['name2', 'url2'], ['name3', 'url3']], :li_class => "li_class", :first_class => 'first', :last_class => 'last', :format => :html_list, :separator => " / ", :last_crumb_linked => false))
57
57
  assert_equal('<crumb href="url1">name1</crumb><crumb href="url2">name2</crumb>',
58
58
  renderer.render_crumbs([['name1', 'url1'], ['name2', 'url2']], :first_class => 'first', :last_class => 'last', :format => :xml, :last_crumb_linked => false))
59
59
 
60
60
  assert_equal('<div itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">name</span></div>',
61
61
  renderer.render_crumbs([['name', 'url']], :first_class => 'first', :last_class => 'last', :format => :html, :microdata => true, :last_crumb_linked => false))
62
- assert_equal('<ol class=""><li class="first last" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">name</span></li></ol>',
62
+ assert_equal('<ul class=""><li class="first last" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">name</span></li></ul>',
63
63
  renderer.render_crumbs([['name', 'url']], :first_class => 'first', :last_class => 'last', :format => :html_list, :microdata => true, :last_crumb_linked => false))
64
- assert_equal('<ol class="crumbclass" id="crumbid"><li class="liclass"><span>name</span></li></ol>',
65
- renderer.render_crumbs([['name', 'url']], :format => :html_list, :ol_id => "crumbid", :ol_class => "crumbclass", :li_class => "liclass", :last_crumb_linked => false))
64
+ assert_equal('<ul class="crumbclass" id="crumbid"><li class="liclass"><span>name</span></li></ul>',
65
+ renderer.render_crumbs([['name', 'url']], :format => :html_list, :ul_id => "crumbid", :ul_class => "crumbclass", :li_class => "liclass", :last_crumb_linked => false))
66
66
  end
67
67
 
68
68
  def test_input_object_mutation
@@ -97,10 +97,10 @@ class StandardRendererTest < Test::Unit::TestCase
97
97
  assert_equal('name',
98
98
  renderer.render_crumbs([['name', 'url', {:link_html_options => {:title => 'link title'}}]], :first_class => 'first', :last_class => 'last', :format => :html, :last_crumb_linked => false))
99
99
 
100
- assert_equal('<ol class=""><li class="first last"><a title="link title" href="url">name</a></li></ol>',
100
+ assert_equal('<ul class=""><li class="first last"><a title="link title" href="url">name</a></li></ul>',
101
101
  renderer.render_crumbs([['name', 'url', {:link_html_options => {:title => 'link title'}}]], :first_class => 'first', :last_class => 'last', :format => :html_list))
102
102
 
103
- assert_equal('<ol class=""><li class="first last"><span>name</span></li></ol>',
103
+ assert_equal('<ul class=""><li class="first last"><span>name</span></li></ul>',
104
104
  renderer.render_crumbs([['name', 'url', {:link_html_options => {:title => 'link title'}}]], :first_class => 'first', :last_class => 'last', :format => :html_list, :last_crumb_linked => false))
105
105
  end
106
106
 
@@ -116,10 +116,10 @@ class StandardRendererTest < Test::Unit::TestCase
116
116
  assert_equal('<div itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">name</span></div>',
117
117
  renderer.render_crumbs([['name', 'url', {:link_html_options => {:title => 'link title'}}]], :first_class => 'first', :last_class => 'last', :format => :html, :last_crumb_linked => false))
118
118
 
119
- assert_equal('<ol class=""><li class="first last" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><a title="link title" itemprop="url" href="url"><span itemprop="title">name</span></a></li></ol>',
119
+ assert_equal('<ul class=""><li class="first last" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><a title="link title" itemprop="url" href="url"><span itemprop="title">name</span></a></li></ul>',
120
120
  renderer.render_crumbs([['name', 'url', {:link_html_options => {:title => 'link title'}}]], :first_class => 'first', :last_class => 'last', :format => :html_list))
121
121
 
122
- assert_equal('<ol class=""><li class="first last" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">name</span></li></ol>',
122
+ assert_equal('<ul class=""><li class="first last" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">name</span></li></ul>',
123
123
  renderer.render_crumbs([['name', 'url', {:link_html_options => {:title => 'link title'}}]], :first_class => 'first', :last_class => 'last', :format => :html_list, :last_crumb_linked => false))
124
124
  end
125
125
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vinted-crummy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Varneckas
@@ -163,7 +163,6 @@ files:
163
163
  - example/spec/spec_helper.rb
164
164
  - example/vendor/assets/stylesheets/.gitkeep
165
165
  - example/vendor/plugins/.gitkeep
166
- - gemfiles/rails3_2.gemfile
167
166
  - gemfiles/rails4_0.gemfile
168
167
  - init.rb
169
168
  - lib/crummy.rb
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "activesupport", ">= 3.0", "< 4"
6
- gem "actionpack", ">= 3.0", "< 4"
7
-
8
- gemspec :path=>"../"