i18n_date_range 1.0.0 → 1.0.2

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: 71784441c2eaf62622c2fd142dcc74d914aaa6dd1661d08f776b879ec2edd450
4
- data.tar.gz: 43baa011e8b558a3ee54b76047a629516d63369682a4b07c4085faa36398de56
3
+ metadata.gz: 5a3b493211ef6ff478bdf03e8136a81e3b563d65770f8d715e147402804d8392
4
+ data.tar.gz: 4c7b14086e61504b519adf18a0c94422808b457318fcf0fdf8b1fbb7e4542d2f
5
5
  SHA512:
6
- metadata.gz: 55cb4cecd209292ecc54b396c6416677244ede78d94229a169b230f914bca24234aa85bb8e2b5ad03ac933970f4f2987c0e5c99289e251d4406cbd3e8e10238b
7
- data.tar.gz: cc4f9ff20aa67d77018bf7b9065cd9c45c6c265138a578a90f12f47fcebd775495a485cdc837804b8cc502eda089e6f0c089d5cf4e16322e7009f1e7860e7a51
6
+ metadata.gz: 5ea01dd9ac857ea97b26ca5112087c6f646bc22066e13149301106000e8b191239969bead2a23bdcb0a49845c94818111768568b0fc7554f0c651bcfb29136fc
7
+ data.tar.gz: 331557b276f356e772e3413547c80106aef37c890d30b28029bd5ecf0cbc2c497aedda4ae67fa5a2b1095b76545f9813e1362331f6cf2ad06d47362412853c09
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- i18n_date_range (1.0.0)
4
+ i18n_date_range (1.0.2)
5
5
  rails
6
6
  rails-i18n
7
7
 
@@ -4,11 +4,7 @@
4
4
  class I18nDateRangeGenerator
5
5
  attr_reader :from_date, :to_date, :format, :layout
6
6
 
7
- def self.generate(from_date, to_date, format: :short, layout: :one_line)
8
- new(from_date, to_date, format: format, layout: layout).to_s
9
- end
10
-
11
- def initialize(from_date, to_date, format: :short, layout: :one_line)
7
+ def initialize(from_date, to_date = nil, format: :short, layout: :one_line)
12
8
  @from_date = from_date
13
9
  @to_date = to_date
14
10
  @format = format
@@ -2,12 +2,12 @@
2
2
 
3
3
  # Rails helper
4
4
  # Format can be :short (default) or :long
5
- # <%= date_range_i18n(start, end, :long)
5
+ # <%= date_range_i18n(start, end, format: :long) %>
6
6
  # Layout can be :one_line (default) or :two_lines, other might be necessary in the future
7
7
  module I18nDateRangeHelper
8
8
 
9
9
  def date_range_i18n(from, to = nil, format: nil, layout: nil)
10
- I18nDateRangeGenerator.generate(*args)
10
+ I18nDateRangeGenerator.new(*args).to_s
11
11
  end
12
12
 
13
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module I18nDateRange
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_date_range
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - pabois