web_translate_it 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/history.md +4 -0
- data/lib/web_translate_it/configuration.rb +13 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bdcd0cd4aade89d74fde98a60a41426ccf84f1b
|
4
|
+
data.tar.gz: 6a75a120a3cbcd3b4bbca2481ae3f6dd0ab6b233
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a94f470ae6fa25ee9431b4c7f59d0fbde967897d0998cf61ec5fbc3855a71cb7374ee5ddf0fe4ad4e5eb7197295a8188c80de845a5089f4a0eee1501253b78a
|
7
|
+
data.tar.gz: 58cca903874466f756ee2dfee217e2d67dce2e2d65022c3b89d72b0fc80ec60cbe6438395ec12a949acdd33cacb1c4c326b5c270c6da4ab26d433a63be26e98c
|
data/history.md
CHANGED
@@ -10,15 +10,16 @@ module WebTranslateIt
|
|
10
10
|
class Configuration
|
11
11
|
require 'yaml'
|
12
12
|
require 'fileutils'
|
13
|
+
require 'erb'
|
13
14
|
attr_accessor :path, :api_key, :source_locale, :target_locales, :files, :ignore_locales, :needed_locales
|
14
|
-
attr_accessor :logger, :before_pull, :after_pull, :before_push, :after_push, :project_name
|
15
|
+
attr_accessor :logger, :before_pull, :after_pull, :before_push, :after_push, :project_name, :path_to_config_file
|
15
16
|
|
16
17
|
# Load configuration file from the path.
|
17
18
|
def initialize(root_path = Rails.root, path_to_config_file = ".wti")
|
19
|
+
self.path_to_config_file = path_to_config_file
|
18
20
|
self.path = root_path
|
19
21
|
self.logger = logger
|
20
22
|
if File.exists?(File.expand_path(path_to_config_file, self.path))
|
21
|
-
configuration = YAML.load_file(File.expand_path(path_to_config_file, self.path))
|
22
23
|
self.api_key = configuration['api_key']
|
23
24
|
self.before_pull = configuration['before_pull']
|
24
25
|
self.after_pull = configuration['after_pull']
|
@@ -85,5 +86,15 @@ module WebTranslateIt
|
|
85
86
|
RAILS_DEFAULT_LOGGER
|
86
87
|
end
|
87
88
|
end
|
89
|
+
|
90
|
+
def configuration
|
91
|
+
@configuration ||= YAML.load(parse_erb_in_configuration)
|
92
|
+
end
|
93
|
+
|
94
|
+
private
|
95
|
+
|
96
|
+
def parse_erb_in_configuration
|
97
|
+
ERB.new(File.read(File.expand_path(path_to_config_file, self.path))).result
|
98
|
+
end
|
88
99
|
end
|
89
100
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_translate_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edouard Briere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|