haml-i18n-extractor 0.3.2 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/haml-i18n-extractor +3 -17
- data/haml-i18n-extractor.gemspec +1 -1
- data/lib/haml-i18n-extractor/cli.rb +26 -1
- data/lib/haml-i18n-extractor/extractor.rb +1 -1
- data/lib/haml-i18n-extractor/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDlhNzU4YzZjOTczMTEzZTlmOTVkNmMwZWMwMjA0YTdhMmEwOTQ4OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Njg0NTNjOTk3MmQ2Mzg0ZTc5YWZjNzM4OTUzMzI5NGM1OTRmYmEwNA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWQ2MWIzODYzNjJjNDI4Y2U3OWVmODNlNmI4ZTc1MzRlNjUyNGIzM2MxOGYy
|
10
|
+
N2FhOTgyODYyZjAxZGI0M2YxNWFjODcwODVlMmUyNTVkMzBlZDczZTVkZDY5
|
11
|
+
Nzc2ZDI4ZTc4ODA5YTYzMTgyZjE0ZTRhY2Q2OTIyZDcxYzk2ZDE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGY1NDM3NzQwNDU4ZGY2NmY5M2UwOGQ5YjMyOWQ2ZmJjMTYxMjBmMmZkYWM0
|
14
|
+
ZmM2OWI4NDU5YTA2ZTAwZWViOTFiNjliZmI2NGIwYTU4MjJiNDg0MGVlZTgy
|
15
|
+
OGM2OWRmMWY2MmYxOWE0MDM5ZGE1YWE0NWVhZGVkNjFlMzVmYjA=
|
data/bin/haml-i18n-extractor
CHANGED
@@ -4,23 +4,9 @@ require 'haml-i18n-extractor'
|
|
4
4
|
|
5
5
|
@prompter = Haml::I18n::Extractor::Prompter.new
|
6
6
|
|
7
|
-
|
8
|
-
banner <<-EOB
|
9
|
-
|
10
|
-
haml-i18n-extractor <path> [--interactive|--non-interactive] [--other-options]
|
11
|
-
|
12
|
-
See options list:
|
13
|
-
EOB
|
14
|
-
version "Current version: #{Haml::I18n::Extractor::VERSION}"
|
15
|
-
opt :interactive, "interactive mode", :short => 'i'
|
16
|
-
opt :non_interactive, "non interactive mode", :short => 'n'
|
17
|
-
opt :yaml_file, "yaml file path, defaults to config/locales/en.yml", :type => String, :short => 'y'
|
18
|
-
opt :i18n_scope, "top level i18n scope, defaults to :en", :type => String, :short => 's'
|
19
|
-
end
|
20
|
-
|
21
|
-
opts = Trollop::with_standard_exception_handling option_parser do
|
7
|
+
opts = Trollop::with_standard_exception_handling Haml::I18n::Extractor::CLI.option_parser do
|
22
8
|
raise Trollop::HelpNeeded if ARGV.empty?
|
23
|
-
option_parser.parse ARGV
|
9
|
+
Haml::I18n::Extractor::CLI.option_parser.parse ARGV
|
24
10
|
end
|
25
11
|
|
26
12
|
path_to_extract = File.expand_path(ARGV[0])
|
@@ -31,5 +17,5 @@ end
|
|
31
17
|
begin
|
32
18
|
Haml::I18n::Extractor::CLI.new(opts).start
|
33
19
|
rescue Haml::I18n::Extractor::CLI::CliError
|
34
|
-
|
20
|
+
Haml::I18n::Extractor::CLI.show_help!
|
35
21
|
end
|
data/haml-i18n-extractor.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = ["shaiguitar@gmail.com"]
|
7
7
|
gem.description = %q{Parse the texts out of the haml files into localization files}
|
8
8
|
gem.summary = %q{Parse the texts out of the haml files into localization files}
|
9
|
-
gem.homepage = ""
|
9
|
+
gem.homepage = "https://github.com/shaiguitar/haml-i18n-extractor"
|
10
10
|
gem.executables = ['haml-i18n-extractor']
|
11
11
|
gem.default_executable = 'haml-i18n-extractor'
|
12
12
|
|
@@ -8,6 +8,31 @@ class Haml::I18n::Extractor
|
|
8
8
|
@prompter = Haml::I18n::Extractor::Prompter.new # may as well
|
9
9
|
end
|
10
10
|
|
11
|
+
def self.option_parser
|
12
|
+
option_parser = Trollop::Parser.new do
|
13
|
+
banner <<-EOB
|
14
|
+
|
15
|
+
haml-i18n-extractor --version # print version of this gem
|
16
|
+
haml-i18n-extractor --help # this message
|
17
|
+
haml-i18n-extractor <path> [--interactive|--non-interactive] [--other-options]
|
18
|
+
|
19
|
+
See options list (short options available next to long option):\n
|
20
|
+
|
21
|
+
EOB
|
22
|
+
version "Current version: #{Haml::I18n::Extractor::VERSION}"
|
23
|
+
opt :interactive, "interactive mode", :short => 'i'
|
24
|
+
opt :non_interactive, "non interactive mode", :short => 'n'
|
25
|
+
opt :yaml_file, "yaml file path, defaults to config/locales/en.yml", :type => String, :short => 'y'
|
26
|
+
opt :i18n_scope, "top level i18n scope, defaults to :en", :type => String, :short => 's'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.show_help!
|
31
|
+
Trollop::with_standard_exception_handling option_parser do
|
32
|
+
raise Trollop::HelpNeeded
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
11
36
|
def start
|
12
37
|
check_interactive_or_not_passed
|
13
38
|
if @options[:path]
|
@@ -30,7 +55,7 @@ class Haml::I18n::Extractor
|
|
30
55
|
def check_interactive_or_not_passed
|
31
56
|
if (!@options[:interactive] && !@options[:non_interactive]) || (@options[:interactive] && @options[:non_interactive])
|
32
57
|
@prompter.puts("You must choose either one of interactive mode or non interactive mode.")
|
33
|
-
@prompter.puts("See haml-i18n-extractor --help")
|
58
|
+
@prompter.puts("See haml-i18n-extractor --help below:")
|
34
59
|
raise CliError
|
35
60
|
end
|
36
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml-i18n-extractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shai Rosenfeld
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|
@@ -242,7 +242,7 @@ files:
|
|
242
242
|
- test/text_replacer_test.rb
|
243
243
|
- test/workflow_test.rb
|
244
244
|
- test/yaml_tool_test.rb
|
245
|
-
homepage:
|
245
|
+
homepage: https://github.com/shaiguitar/haml-i18n-extractor
|
246
246
|
licenses: []
|
247
247
|
metadata: {}
|
248
248
|
post_install_message:
|