helloh 0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/README.mkd +4 -0
- data/helloh.gemspec +17 -0
- data/lib/helloh.rb +4 -4
- data/lib/tasks/helloh.rake +11 -0
- metadata +11 -7
data/.gitignore
ADDED
data/README.mkd
CHANGED
@@ -22,6 +22,10 @@ However, you can also use a path (where the localization files are) as the first
|
|
22
22
|
|
23
23
|
$ helloh /path/to/my/rails/project/config/locales
|
24
24
|
|
25
|
+
Another way to use Helloh is with a Rake task, when the gem is included in a Rails project `Gemfile`:
|
26
|
+
|
27
|
+
$ rake helloh:compare
|
28
|
+
|
25
29
|
## Features
|
26
30
|
|
27
31
|
It is still missing a lot of useful features. Like colored output. But its biggest feature would be to scan every file in a Rails project and check if every translation is defined in each localization file. That’s coming too.
|
data/helloh.gemspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
spec = Gem::Specification.new do |s|
|
2
|
+
s.name = "helloh"
|
3
|
+
s.version = "0.2.1"
|
4
|
+
s.platform = Gem::Platform::RUBY
|
5
|
+
s.authors = "Rémi Prévost"
|
6
|
+
s.email = "remi@exomel.com"
|
7
|
+
s.homepage = "http://github.com/remiprev/helloh"
|
8
|
+
s.summary = "Helloh compares Rails l10n files"
|
9
|
+
s.description = "Helloh compares Rails localization files and looks for missing keys."
|
10
|
+
|
11
|
+
s.files = `git ls-files`.split("\n")
|
12
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
13
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
14
|
+
|
15
|
+
s.require_paths = ["lib"]
|
16
|
+
s.require_path = "lib"
|
17
|
+
end
|
data/lib/helloh.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
require "yaml"
|
2
2
|
|
3
3
|
module Helloh
|
4
|
-
VERSION = "0.2"
|
4
|
+
VERSION = "0.2.1"
|
5
5
|
|
6
6
|
autoload :Compare, "helloh/compare"
|
7
7
|
autoload :Railtie, "helloh/railtie"
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
def self.lang_from_filename(file) # {{{
|
10
|
+
file.match(/([^\/]+)\.yml$/)[1]
|
11
|
+
end # }}}
|
12
12
|
|
13
13
|
end
|
14
14
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
namespace :helloh do
|
2
|
+
|
3
|
+
desc "Compare localization files and show missing keys"
|
4
|
+
task :compare do # {{{
|
5
|
+
helloh = Helloh::Compare.new
|
6
|
+
helloh.files = Dir.glob(Rails.root.join("config/locales/*.yml"))
|
7
|
+
helloh.compare!
|
8
|
+
helloh.output_results!
|
9
|
+
end # }}}
|
10
|
+
|
11
|
+
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helloh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- "R\xC3\xA9mi Pr\xC3\xA9vost"
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date:
|
18
|
+
date: 2012-01-05 00:00:00 Z
|
18
19
|
dependencies: []
|
19
20
|
|
20
21
|
description: Helloh compares Rails localization files and looks for missing keys.
|
@@ -26,12 +27,15 @@ extensions: []
|
|
26
27
|
extra_rdoc_files: []
|
27
28
|
|
28
29
|
files:
|
29
|
-
-
|
30
|
-
- lib/helloh/railtie.rb
|
31
|
-
- lib/helloh.rb
|
32
|
-
- README.mkd
|
30
|
+
- .gitignore
|
33
31
|
- LICENSE
|
32
|
+
- README.mkd
|
34
33
|
- bin/helloh
|
34
|
+
- helloh.gemspec
|
35
|
+
- lib/helloh.rb
|
36
|
+
- lib/helloh/compare.rb
|
37
|
+
- lib/helloh/railtie.rb
|
38
|
+
- lib/tasks/helloh.rake
|
35
39
|
homepage: http://github.com/remiprev/helloh
|
36
40
|
licenses: []
|
37
41
|
|