improve_typography 0.1.14 → 0.1.15

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: 050ccf9750f3535176023f6156dd7397130fd1b30c03787f49b5a0a453959f72
4
- data.tar.gz: e7a4c3661192eb7a19670e1b4f8c59896be5c16921976ab14dab7be4cc3bcd83
3
+ metadata.gz: 1ea1165943f10faab693c89d09e513b907a36bacef3b4f09fc795fb98954c96f
4
+ data.tar.gz: ac6232b3c551a3c73fbe4be6ebece5ca61c20b7fb89caaf1686811765a800714
5
5
  SHA512:
6
- metadata.gz: 60e078a0c5fc8c35956e407d3ac5fc81fdc9c8cfa0b239b934d6986137e22a1d2b2a81d27f6e445617d6fdf5fb2ab34f733f477d49149ecaf3f454ad5d5039c8
7
- data.tar.gz: 9c400979338141b2660c679a0504ca8da41e0a2d7812e57b1d0d66d02a74b3ae61f0d3e1460c40fa41744976a0e0ea5fe5394446ee1042fa63f5b68c14e5e4b5
6
+ metadata.gz: 43073fd8e859bbc068aa315bbd2c238cc1f8392d89c5ca67ae8ed0950012df279ff0ae45b36705fd938b39be390666f5c6c4a49fe5c5b90e9cd210917e6b4a09
7
+ data.tar.gz: 42baab02ad80e4d974f6e6bb06adad67a81d238553ef66e7f35c4baae96ba03246e31e3da1499cbfe211d95eea80a887145be9892f3b904191e55ae1e7250a37
@@ -2,7 +2,7 @@ sudo: false
2
2
  language: ruby
3
3
  script: 'bundle exec rake'
4
4
  rvm:
5
- - 2.2.5
5
+ - 2.5.1
6
6
  before_install:
7
7
  - gem install bundler -v 1.12.5
8
8
  notifications:
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.1.15
4
+
5
+ * fix the `ImproveTypography.configure` method
6
+
3
7
  ## 0.1.14
4
8
 
5
9
  * first run simplest `match?` before `gsub` to make sure the replacement is actually needed
data/README.md CHANGED
@@ -74,7 +74,7 @@ You can configure applied processors (and their order).
74
74
 
75
75
  ```ruby
76
76
  ImproveTypography.configure do |config|
77
- processors = [ImproveTypography::Processors::Ellipsis]
77
+ config.processors = [ImproveTypography::Processors::Ellipsis]
78
78
  end
79
79
  ```
80
80
 
@@ -8,6 +8,24 @@ require 'improve_typography/processor'
8
8
  Dir["#{File.dirname(__FILE__)}/improve_typography/processors/**/*.rb"].each { |f| require f }
9
9
 
10
10
  I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
11
- I18n.load_path += Dir.glob(File.join( File.dirname(__FILE__), 'config', 'locales', '*.yml' ))
11
+ I18n.load_path += Dir.glob(File.join(File.dirname(__FILE__), 'config', 'locales', '*.yml'))
12
12
 
13
13
  require 'improve_typography/version'
14
+
15
+ module ImproveTypography
16
+ class << self
17
+ attr_accessor :configuration
18
+ end
19
+
20
+ def self.configuration
21
+ @configuration ||= Configuration.new
22
+ end
23
+
24
+ def self.configuration=(config)
25
+ @configuration = config
26
+ end
27
+
28
+ def self.configure
29
+ yield configuration
30
+ end
31
+ end
@@ -30,12 +30,8 @@ module ImproveTypography
30
30
  @doc ||= Nokogiri::HTML::DocumentFragment.parse("<div>#{str}</div>")
31
31
  end
32
32
 
33
- def configuration
34
- @configuration ||= Configuration.new
35
- end
36
-
37
33
  def processors
38
- options.fetch(:processors, configuration.processors)
34
+ options.fetch(:processors, ImproveTypography.configuration.processors)
39
35
  end
40
36
 
41
37
  def processor_classes
@@ -1,3 +1,3 @@
1
1
  module ImproveTypography
2
- VERSION = '0.1.14'.freeze
2
+ VERSION = '0.1.15'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: improve_typography
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-31 00:00:00.000000000 Z
11
+ date: 2019-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -163,8 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  - !ruby/object:Gem::Version
164
164
  version: '0'
165
165
  requirements: []
166
- rubyforge_project:
167
- rubygems_version: 2.7.6
166
+ rubygems_version: 3.0.1
168
167
  signing_key:
169
168
  specification_version: 4
170
169
  summary: Improves typography (quotes, hyphens, etc.) of a given string. Works well