active_record_date_formatted 0.0.2 → 0.0.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
  SHA1:
3
- metadata.gz: 17ff920ca1664e2b4a5a4982fc8db7a437b12d22
4
- data.tar.gz: 444cfed036d6b3aa49a4fc42e310c07d040a65b2
3
+ metadata.gz: 6843eebb6fa49764baf4d4afdeaee6a99f42ceb7
4
+ data.tar.gz: 7b43f78a4b25553c1e0e8347ff9a09cf78abd17b
5
5
  SHA512:
6
- metadata.gz: 1b9cb34b6520b4b505bc18559799e4cca3819465ddbd43abd6bf895fac8b0a666aa383f4bbbace8442d6ac21cf60e8d27dc7007f53383158f0ce2de3aaf337d5
7
- data.tar.gz: 72f03a5728975bb7e12d7f81ef6b6cafad7eb1ce2744911e9c4a2d1f442e7dd29d59591120aa572c748a1805bb7688b05470484bae4c97f51a405745d70a494b
6
+ metadata.gz: f4a57a982dfb05a7217068ea136200303a0cd17743bc7bbef0bcce916556ebdd3d0d815e93ede1c4a0e63227d699b1a5cfb28c69f90c911bda73e2c598d25198
7
+ data.tar.gz: 931258ceb23354e0c2603d39a9903c8fd8c921a877d97f666b4846629ef033afd03c652668f586295b8fed5415cff355eca4489411ecf6c42f5261114c53a397
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ h1. ActiveRecordDateFormatted
2
+
3
+ h2. Installation
4
+
5
+ Add to your Gemfile: gem 'active_record_date_formatted'
6
+
7
+ And that's it.
8
+
9
+ Now for every active record model's date attribute, you have two additional methods, for example, if the model is Person and the attribute name is *birthdate*, you get following methods:
10
+ - birthdate_formatted
11
+ - birthdate_formatted=(formatted_date)
12
+
13
+ The formatted methods use *date.formats.default* format.
14
+
15
+ For example for german locale:
16
+
17
+ de:
18
+ date:
19
+ formats:
20
+ default: "%d.%m.%Y"
21
+
22
+ I18n.locale = :de
23
+ Person.first.birthdate_formatted # => "12.04.1981"
24
+ Person.first.birthdate_formatted = "24.04.1981"
25
+ I18n.locale = :en
26
+ Person.first.birthdate_formatted # => "1981-04-12"
27
+ Person.first.birthdate_formatted = "1981-04-24"
28
+
29
+ Now you can use the *_formatted in your views, for example when using date pickers.
30
+
31
+ h2. Licence
32
+
33
+ This project uses MIT-LICENSE.
data/Rakefile CHANGED
@@ -1,26 +1,3 @@
1
- begin
2
- require 'bundler/setup'
3
- rescue LoadError
4
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
- end
6
-
7
- require 'rdoc/task'
8
-
9
- RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = 'rdoc'
11
- rdoc.title = 'DateFormatted'
12
- rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.rdoc')
14
- rdoc.rdoc_files.include('lib/**/*.rb')
15
- end
16
-
17
-
18
-
19
-
20
-
21
-
22
- Bundler::GemHelper.install_tasks
23
-
24
1
  require 'rake/testtask'
25
2
 
26
3
  Rake::TestTask.new(:test) do |t|
@@ -30,5 +7,19 @@ Rake::TestTask.new(:test) do |t|
30
7
  t.verbose = false
31
8
  end
32
9
 
10
+ desc "Bump the patch version, tag and release gem"
11
+ task :release_patch do
12
+ system "gem bump --version patch --tag --release"
13
+ end
14
+
15
+ desc "Bump the minor version, tag and release gem"
16
+ task :release_minor do
17
+ system "gem bump --version minor --tag --release"
18
+ end
19
+
20
+ desc "Bump the major version, tag and release gem"
21
+ task :release_major do
22
+ system "gem bump --version major --tag --release"
23
+ end
33
24
 
34
25
  task default: :test
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordDateFormatted
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_date_formatted
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Jancev
@@ -60,7 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - MIT-LICENSE
63
- - README.rdoc
63
+ - README.md
64
64
  - Rakefile
65
65
  - lib/active_record_date_formatted.rb
66
66
  - lib/active_record_date_formatted/model.rb
data/README.rdoc DELETED
@@ -1,3 +0,0 @@
1
- = DateFormatted
2
-
3
- This project uses MIT-LICENSE.