rails-i18nterface 0.2.5 → 0.2.6

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
  SHA1:
3
- metadata.gz: 741fb9cf5e4fdabfc051baa4c2b43ca5f04a7201
4
- data.tar.gz: ca9b5b7425033c98dccbdb44d1d4d331e1df7d5a
3
+ metadata.gz: 864f5dd24cd99142a00b43e25018794c108dd3a2
4
+ data.tar.gz: 0322ad83a3a3bf5218c4d65402418f37799f008b
5
5
  SHA512:
6
- metadata.gz: 7b5dc47ecb71caa7d6342cbdf9d2ff26b6febbbf1468decb2035745a3a18fb0aa9d41df62a51524483d727b99d83e0dc3a5e01986efdb68b99eb9dbc487c1837
7
- data.tar.gz: d61684d23f7c064a794126fc329e3df35f1caefda8fc05f01ebd29ee89bdce959fe3fbab606f492ed48a25173ff405e62e42b73a710590b33e6a8976c47a3320
6
+ metadata.gz: bbd9ad961787eab96a62253fb5bf19786270939cb0765a021e6175ca0e44855a5b99b9a75be492ea1098fd0947196efff21842c4c10b409d9527d0e0ec81dad8
7
+ data.tar.gz: 69337935fd5d560451cd911b626ffef5b7701c1eb0fa865cfb7071340ab6804d885ee055e767ad0948836e3dc74d2dee40b32c624f12a5a5f2e43d54dd67cc1d
data/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # Rails I18nterface
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/rails-i18nterface.png)](http://badge.fury.io/rb/rails-i18nterface)
4
- [![Dependency Status](https://gemnasium.com/mose/rails-i18nterface.png)](https://gemnasium.com/mose/rails-i18nterface)
5
- [![Build Status](https://secure.travis-ci.org/mose/rails-i18nterface.png?branch=master)](http://travis-ci.org/mose/rails-i18nterface)
6
- [![Coverage Status](https://coveralls.io/repos/mose/rails-i18nterface/badge.png?branch=master)](https://coveralls.io/r/mose/rails-i18nterface)
7
- [![Code Climate](https://codeclimate.com/github/mose/rails-i18nterface.png)](https://codeclimate.com/github/mose/rails-i18nterface)
3
+ [![Gem Version](http://img.shields.io/gem/v/rails-i18nterface.svg)](https://rubygems.org/gems/rails-i18nterface)
4
+ [![Downloads](http://img.shields.io/gem/dt/rails-i18nterface.svg)](https://rubygems.org/gems/rails-i18nterface)
5
+ [![Dependency Status](https://img.shields.io/gemnasium/mose/rails-i18nterface.svg)](https://gemnasium.com/mose/rails-i18nterface)
6
+ [![Build Status](http://img.shields.io/travis/mose/rails-i18nterface.svg)](http://travis-ci.org/mose/rails-i18nterface)
7
+ [![Code Climate](http://img.shields.io/codeclimate/github/mose/rails-i18nterface.svg)](https://codeclimate.com/github/mose/rails-i18nterface)
8
+ [![Code Coverage](http://img.shields.io/coveralls/mose/rails-i18nterface.svg)](https://coveralls.io/r/mose/rails-i18nterface)
8
9
 
9
10
  ![rails-i18nterface](http://mose.fr/rails-i18nterface.png)
10
11
 
@@ -107,7 +108,7 @@ Check the [Changelog](https://github.com/mose/rails-i18nterface/blob/master/chan
107
108
  ```
108
109
  Copyright 2009-2011 Peter Marklund, Joakim Westerlund, Claudius Coenen
109
110
  Copyright 2011-2013 Larry Sprock, Artin Boghosain, Michal Hantl
110
- Copyright 2013-2015 Mose
111
+ Copyright 2013-2016 Mose
111
112
 
112
113
  Permission is hereby granted, free of charge, to any person obtaining
113
114
  a copy of this software and associated documentation files (the
@@ -21,12 +21,20 @@ module RailsI18nterface
21
21
 
22
22
  def apply_filters(params)
23
23
  params[:filter] ||= 'all'
24
+ remove_proc
24
25
  filter_by_translated(params[:filter]) if params[:filter] != 'all'
25
26
  filter_by_key_pattern(params[:key_type], params[:key_pattern]) unless params[:key_pattern].blank?
26
27
  filter_by_text_pattern(params[:text_type], params[:text_pattern]) unless params[:text_pattern].blank?
27
28
  sort_keys(params[:sort_by])
28
29
  end
29
30
 
31
+ def remove_proc
32
+ @all_keys.reject! do |key|
33
+ lookup_key = lookup(@from_locale, key)
34
+ lookup_key.is_a? Proc
35
+ end
36
+ end
37
+
30
38
  def filter_by_translated(filter)
31
39
  @all_keys.reject! do |key|
32
40
  if filter == 'untranslated'
@@ -129,4 +137,4 @@ module RailsI18nterface
129
137
  end
130
138
 
131
139
  end
132
- end
140
+ end
@@ -5,7 +5,7 @@ module RailsI18nterface
5
5
 
6
6
  def remove_blanks(hash)
7
7
  hash.each do |k, v|
8
- hash.delete k if !v || v == ''
8
+ hash.delete k if !v || v == '' || v.is_a?(Proc)
9
9
  if v.is_a? Hash
10
10
  remove_blanks v
11
11
  hash.delete k if v == {}
@@ -90,4 +90,4 @@ module RailsI18nterface
90
90
  end
91
91
 
92
92
  end
93
- end
93
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module RailsI18nterface
4
- VERSION = '0.2.5'
4
+ VERSION = '0.2.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-i18nterface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mose
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-23 00:00:00.000000000 Z
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties