stamp-i18n 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## v0.0.1
2
+
3
+ * initial release
data/README.md CHANGED
@@ -1,11 +1,14 @@
1
- # Stamp::I18n
1
+ # StampI18n
2
2
 
3
- TODO: Write a gem description
3
+ [![Build Status](https://secure.travis-ci.org/karpiu/stamp-i18n.png)](http://travis-ci.org/karpiu/stamp-i18n)
4
+
5
+ Little plugin for 'stamp' gem. It uses I18n locale files to customize date and time stamps.
4
6
 
5
7
  ## Installation
6
8
 
7
- Add this line to your application's Gemfile:
9
+ Add this lines to your application's Gemfile:
8
10
 
11
+ gem 'stamp'
9
12
  gem 'stamp-i18n'
10
13
 
11
14
  And then execute:
@@ -14,11 +17,27 @@ And then execute:
14
17
 
15
18
  Or install it yourself as:
16
19
 
20
+ $ gem install stamp
17
21
  $ gem install stamp-i18n
18
22
 
23
+ ## Before using
24
+
25
+ This gem uses i18n translation mechnism, which means before using it, first we need to add proper translation files to locales folder and then setup i18n configuration. Example YML file used for testing is written in polish - it is located in locale/pl.yml. Look for more examples here: [https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale](https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale)
26
+
19
27
  ## Usage
20
28
 
21
- TODO: Write usage instructions here
29
+ Same as in [http://rubydoc.info/gems/stamp](http://rubydoc.info/gems/stamp) but instead of using method 'stamp' like this:
30
+
31
+ date = Date.new(2011, 6, 9)
32
+ date.stamp("March 1, 1999") #=> "June 9, 2011"
33
+
34
+ we are using new method 'localize_stamp' like this:
35
+
36
+ date = Date.new(2011, 6, 9)
37
+ date.localize_stamp("March 1, 1999") #=> "junio 9, 2011" if locale is :de
38
+ date.localize_stamp("March 1, 1999") #=> "czerwiec 9, 2011" if locale is :pl
39
+
40
+ Note that we are still using english names in examples passed to stamp methods.
22
41
 
23
42
  ## Contributing
24
43
 
@@ -1,3 +1,3 @@
1
1
  module StampI18n
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
File without changes
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  require 'stamp-i18n'
2
2
 
3
- I18n.load_path << 'spec/locales/pl.yml'
3
+ I18n.load_path << 'locale/pl.yml'
4
4
  I18n.default_locale='pl'
data/stamp-i18n.gemspec CHANGED
@@ -4,9 +4,9 @@ require File.expand_path('../lib/stamp-i18n/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Michal Karpinski"]
6
6
  gem.email = ["karp0506@gmail.com"]
7
- gem.description = %q{Fork of stamp gem. Modified for I18n use}
7
+ gem.description = %q{Little plugin for 'stamp' gem. It uses I18n locale files to customize date and time stamps.}
8
8
  gem.summary = %q{Fork of stamp gem. Modified for I18n use}
9
- gem.homepage = ""
9
+ gem.homepage = "https://github.com/karpiu/stamp-i18n"
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
12
12
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -15,6 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = StampI18n::VERSION
17
17
 
18
+ gem.add_development_dependency "rake"
18
19
  gem.add_development_dependency "rspec"
19
20
  gem.add_development_dependency "stamp"
20
21
  gem.add_development_dependency "i18n"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stamp-i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,6 +11,22 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2012-07-30 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: rspec
16
32
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +75,8 @@ dependencies:
59
75
  - - ! '>='
60
76
  - !ruby/object:Gem::Version
61
77
  version: '0'
62
- description: Fork of stamp gem. Modified for I18n use
78
+ description: Little plugin for 'stamp' gem. It uses I18n locale files to customize
79
+ date and time stamps.
63
80
  email:
64
81
  - karp0506@gmail.com
65
82
  executables: []
@@ -68,17 +85,19 @@ extra_rdoc_files: []
68
85
  files:
69
86
  - .gitignore
70
87
  - .rspec
88
+ - .travis.yml
89
+ - CHANGELOG.md
71
90
  - Gemfile
72
91
  - LICENSE
73
92
  - README.md
74
93
  - Rakefile
75
94
  - lib/stamp-i18n.rb
76
95
  - lib/stamp-i18n/version.rb
77
- - spec/locales/pl.yml
96
+ - locale/pl.yml
78
97
  - spec/spec_helper.rb
79
98
  - spec/stamp/stamp_spec.rb
80
99
  - stamp-i18n.gemspec
81
- homepage: ''
100
+ homepage: https://github.com/karpiu/stamp-i18n
82
101
  licenses: []
83
102
  post_install_message:
84
103
  rdoc_options: []
@@ -103,6 +122,5 @@ signing_key:
103
122
  specification_version: 3
104
123
  summary: Fork of stamp gem. Modified for I18n use
105
124
  test_files:
106
- - spec/locales/pl.yml
107
125
  - spec/spec_helper.rb
108
126
  - spec/stamp/stamp_spec.rb