latias-date-format 0.1.3 → 0.1.4

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: cbfa5228112f22de0371aa231cbd65c7f8a5d28a31076823c01de5d0dbc7f9be
4
- data.tar.gz: 9a1dad8e5e1f0b242246ed2577d2aed122bfdca8e9b0d492c4df9e7a1fee1cf8
3
+ metadata.gz: 026f89820818af162c25d71f7b689199305cbb2f3fadc147b6c80ac87e4ea178
4
+ data.tar.gz: f39ec7e4438e06d01e9500bf1bea42a843af960cd47df88aa00436d32921b6b2
5
5
  SHA512:
6
- metadata.gz: 8cbef32776f756cc8a0d8f51c7d0b5028424af021f1e254dfbce1b444a6ed41ef9af0eeab657a67fd20e32a567588652f653ff2cd24eabaa8f23facd86336bf2
7
- data.tar.gz: 4808dad9a12d34828fa39cdfe7b90a23646022416a35c98b8ffd1869b976ef3acae0871f0fddefb8560d87906d7a3d4cac3bb494dcacf222b69d4e052c67abfc
6
+ metadata.gz: d5f72ad0db9c7d3d581e761121baf1bfca171901d48f75f0990a08ecee763bb539590d0ef60541735c4c6786cdb3b48f8e942e248e45663cd531a3f9cbded3d6
7
+ data.tar.gz: d906bdf14e3af86f468b35940212eb4c8b21cf025a4ecee8336287c2a6248357b3fbe6f5d21df978ebf6d9d18f3fecdd925fbbef12ce75f91eb910150bc1927d
data/README.md CHANGED
@@ -8,9 +8,9 @@ How to use my plugin.
8
8
  Add this line to your application's Gemfile:
9
9
 
10
10
  ```ruby
11
- gem 'latias-date-format', '~> 0.1.2'
11
+ gem 'latias-date-format', '~> 0.1.4'
12
12
  # or
13
- gem 'latias-date-format', git: 'https://nattanon:dT1Lcvf8pvGoU7LX4Uqr@gitlab.opensource-technology.com/nattanon/latias-date-format-rails.git'
13
+ gem 'latias-date-format', '~> 0.1', git: 'https://nattanon:dT1Lcvf8pvGoU7LX4Uqr@gitlab.opensource-technology.com/nattanon/latias-date-format-rails.git'
14
14
  ```
15
15
 
16
16
  ## Examples
@@ -3,17 +3,6 @@ require 'latias/date/format/engine'
3
3
  module Latias
4
4
  module Date
5
5
  module Format
6
- def buddist_date_format(date, format: '%e %B %Y')
7
- format = format.gsub('%Y', buddhist_year(date.year).to_s)
8
- format = format.gsub('%y', (buddhist_year(date.year) % 100).to_s)
9
- I18n.l(date, format: format, locale: :th)
10
- end
11
-
12
- def buddhist_year(year)
13
- year + 543
14
- end
15
6
  end
16
7
  end
17
8
  end
18
-
19
- extend Latias::Date::Format
@@ -1,10 +1,15 @@
1
+ require 'latias/date/formater'
2
+
1
3
  module Latias
2
4
  module Date
3
5
  module Format
4
6
  class Engine < ::Rails::Engine
5
7
  isolate_namespace Latias::Date::Format
6
- initializer 'application_controller' do
7
- include Latias::Date::Format
8
+ # ActionController::Base.include Latias::Date::Format
9
+ ActionView::Base.include Latias::Date::Formater
10
+ ActiveSupport.on_load(:action_controller_base) do
11
+ puts 'include Latias::Date::Formater'
12
+ include Latias::Date::Formater
8
13
  end
9
14
  end
10
15
  end
@@ -1,7 +1,7 @@
1
1
  module Latias
2
2
  module Date
3
3
  module Format
4
- VERSION = '0.1.3'.freeze
4
+ VERSION = '0.1.4'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,17 @@
1
+ module Latias
2
+ module Date
3
+ module Formater
4
+ def buddist_date_format(date, format: '%e %B %Y')
5
+ format = format.gsub('%Y', buddhist_year(date.year).to_s)
6
+ format = format.gsub('%y', (buddhist_year(date.year) % 100).to_s)
7
+ I18n.l(date, format: format, locale: :th)
8
+ end
9
+
10
+ def buddhist_year(year)
11
+ year + 543
12
+ end
13
+ end
14
+ end
15
+ end
16
+
17
+ # extend Latias::Date::Format
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latias-date-format
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - nattanon
@@ -47,6 +47,7 @@ files:
47
47
  - lib/latias/date/format.rb
48
48
  - lib/latias/date/format/engine.rb
49
49
  - lib/latias/date/format/version.rb
50
+ - lib/latias/date/formater.rb
50
51
  - lib/tasks/latias/date/format_tasks.rake
51
52
  homepage: https://gitlab.opensource-technology.com/nattanon/latias-date-format-rails
52
53
  licenses: