dugway 0.12.0 → 0.12.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa69a92506b519c6dd328f384ab87c65faf9b333668d2343663205497a95cd4c
4
- data.tar.gz: 7486855a255a217a533480e16a5b4e84984f1e1bb06d2ebe4df8d381f79aae67
3
+ metadata.gz: 4d4b19083d6ca54cd01c02838818a67437e42b289d41cba01f502b9037d6921e
4
+ data.tar.gz: 886d1b3a6ed97edd75fd617c17671c196fc048ef3bd5323d0454d05d24f3ffdf
5
5
  SHA512:
6
- metadata.gz: 5bec30a1d3f6553e582150ec9ce3e783b2f2cb0c4f8dbfb03219c060591766449dce91e5817e716d8d40e55786629c3d5312b42b9ee0dd4e57dd5ac251282059
7
- data.tar.gz: d2789c469c34a62db955bf20c7b11a8842b6b6caac9a76421bddb634023d06a4b7d58e18ad711d5872f92c80c33ad06d3b1a64aa182f4f362930b375df8ea32f
6
+ metadata.gz: ae4ac7698a7287aa79a97b630ec46272f7e81a036b2c45fb1b48398341545eadd412825a2dda85350cf3414fb34a88bb776dd97dc986726f1ff4f5418ee92816
7
+ data.tar.gz: 4ed1fe5591df26ffbd2cebb3b2d714909490c381d262b69bff1fa1e9593b3cdb63b156ba183a3b4c530cd1d2fe4b5ff588da0f69ae9a67af19605c2687d20729
data/README.md CHANGED
@@ -120,7 +120,7 @@ utilities.
120
120
 
121
121
  Prefer [LESS](http://lesscss.org)? No problem, you'll just need to create a
122
122
  [Gemfile like this one](https://gist.github.com/mattwigham/5569898) in the
123
- root directory of your theme, run ```bundle install```, and append the
123
+ root directory of your theme, run `bundle install`, and append the
124
124
  **.less** extension to your CSS files.
125
125
 
126
126
  And finally, for you JavaScript folks, we've baked
@@ -7,22 +7,22 @@ module Dugway
7
7
 
8
8
  prev_label = prev_label.blank? ? paginate['previous']['title'] : prev_label
9
9
  if paginate['previous']['is_link']
10
- html << %(<a class="previous" href="#{ paginate['previous']['url'] }">#{ prev_label }</a>)
10
+ html << %(<a class="previous" href="#{ paginate['previous']['url'] }" aria-label="Go to previous page">#{ prev_label }</a>)
11
11
  else
12
12
  html << %(<span class="previous disabled">#{ prev_label }</span>)
13
13
  end
14
14
 
15
15
  paginate['parts'].each do |part|
16
16
  if part['is_link']
17
- html << %(<a href="#{ part['url'] }">#{ part['title'] }</a>)
17
+ html << %(<a href="#{ part['url'] }" aria-label="Go to page #{part['title']}">#{ part['title'] }</a>)
18
18
  else
19
- html << %(<span class="#{ part['title'] == paginate['current_page'].to_s ? 'current' : 'gap' }">#{ part['title'] }</span>)
19
+ html << build_non_link_span(part, paginate)
20
20
  end
21
21
  end
22
22
 
23
23
  next_label = next_label.blank? ? paginate['next']['title'] : next_label
24
24
  if paginate['next']['is_link']
25
- html << %(<a class="next" href="#{ paginate['next']['url'] }">#{ next_label }</a>)
25
+ html << %(<a class="next" href="#{ paginate['next']['url'] }" aria-label="Go to next page">#{ next_label }</a>)
26
26
  else
27
27
  html << %(<span class="next disabled">#{ next_label }</span>)
28
28
  end
@@ -30,6 +30,24 @@ module Dugway
30
30
  html << %(</div>)
31
31
  }.join(' ')
32
32
  end
33
+
34
+ private
35
+
36
+ def build_non_link_span(part, paginate)
37
+ is_current = is_current_page?(part, paginate)
38
+ span_class = is_current ? 'current' : 'gap'
39
+
40
+ span = %(<span )
41
+ span << %(class="#{span_class}" )
42
+ span << %(aria-label="Current page, page #{part['title']}") if is_current
43
+ span << %(>)
44
+ span << %(#{ part['title'] }</span>)
45
+ span
46
+ end
47
+
48
+ def is_current_page?(part, paginate)
49
+ part['title'] == paginate['current_page'].to_s
50
+ end
33
51
  end
34
52
  end
35
53
  end
@@ -28,7 +28,7 @@ module Dugway
28
28
  if name.is_a?(Drops::ThemeDrop)
29
29
  '/theme.js'
30
30
  elsif name == 'api'
31
- 'http://cache0.bigcartel.com/api/1/api.usd.js'
31
+ 'http://cache0.bigcartel.com/api/5/api.usd.js'
32
32
  else
33
33
  name
34
34
  end
@@ -86,13 +86,13 @@ module Dugway
86
86
  digits, rounded_number = 1, 0
87
87
  else
88
88
  digits = (Math.log10(number.abs) + 1).floor
89
- rounded_number = (BigDecimal.new(number.to_s) / BigDecimal.new((10 ** (digits - precision)).to_f.to_s)).round.to_f * 10 ** (digits - precision)
89
+ rounded_number = (BigDecimal(number.to_s) / BigDecimal((10 ** (digits - precision)).to_f.to_s)).round.to_f * 10 ** (digits - precision)
90
90
  digits = (Math.log10(rounded_number.abs) + 1).floor # After rounding, the number of digits may have changed
91
91
  end
92
92
  precision -= digits
93
93
  precision = precision > 0 ? precision : 0 #don't let it be negative
94
94
  else
95
- rounded_number = BigDecimal.new(number.to_s).round(precision).to_f
95
+ rounded_number = BigDecimal(number.to_s).round(precision).to_f
96
96
  end
97
97
  formatted_number = number_with_delimiter("%01.#{precision}f" % rounded_number, options)
98
98
  if strip_insignificant_zeros
@@ -1,3 +1,3 @@
1
1
  module Dugway
2
- VERSION = "0.12.0"
2
+ VERSION = "0.12.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dugway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Big Cartel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-11 00:00:00.000000000 Z
11
+ date: 2020-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -545,7 +545,7 @@ homepage: https://github.com/bigcartel/dugway
545
545
  licenses:
546
546
  - MIT
547
547
  metadata: {}
548
- post_install_message:
548
+ post_install_message:
549
549
  rdoc_options: []
550
550
  require_paths:
551
551
  - lib
@@ -560,9 +560,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
560
560
  - !ruby/object:Gem::Version
561
561
  version: '0'
562
562
  requirements: []
563
- rubyforge_project:
564
- rubygems_version: 2.7.6
565
- signing_key:
563
+ rubygems_version: 3.0.6
564
+ signing_key:
566
565
  specification_version: 4
567
566
  summary: Easily build and test Big Cartel themes.
568
567
  test_files: