excel2local 0.1.4 → 0.1.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +8 -9
- data/Gemfile +7 -7
- data/LICENSE.txt +21 -21
- data/Rakefile +2 -2
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/example/Your_Rails_App/.DS_Store +0 -0
- data/example/Your_Rails_App/config/.DS_Store +0 -0
- data/example/Your_Rails_App/config/locales/.DS_Store +0 -0
- data/excel2local-0.1.1.gem +0 -0
- data/excel2local-0.1.2.gem +0 -0
- data/excel2local.gemspec +38 -38
- data/lib/excel2local.rb +11 -10
- data/lib/excel2local/version.rb +1 -1
- metadata +4 -6
- data/excel2local-0.1.32.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4845668ec66b1c74cbdc55785745bf42f2f8f69aa2c4c6db874b8809aa032938
|
4
|
+
data.tar.gz: a714ca51bdd6eb96c2154c55ddb2657addc5a03e7c7b5e9cf9884513c014a23d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d71543305f2db1d9494dc0a09bb81585863e57b65ac83aef7952c8d0cd37af599db9121b7fba6c0ca394ac80bdb8f82917f723795a5f38a31dfa6e8b398cae72
|
7
|
+
data.tar.gz: f60d79b40d949057aaa1615cabed16a0eedbac9ceeb7927a8db4f280942ee1c88d4ec230d112f1db8505f0ebbc98d7b91c70b584db6a335b782bf3d7e3cfa000
|
data/.gitignore
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
/.bundle/
|
2
|
-
/.yardoc
|
3
|
-
/_yardoc/
|
4
|
-
/coverage/
|
5
|
-
/doc/
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/tmp/
|
9
|
-
*.DS_Store
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
data/Gemfile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
#git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in excel2local.gemspec
|
6
|
-
gemspec
|
7
|
-
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
#git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in excel2local.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
8
|
gem 'roo', '~> 2.7.0' # nice gem for work with excel XLSX
|
data/LICENSE.txt
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2018 eliseevTech
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 eliseevTech
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
task :default => :spec
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
task :default => :spec
|
data/bin/console
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "excel2local"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "excel2local"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -euo pipefail
|
3
|
-
IFS=$'\n\t'
|
4
|
-
set -vx
|
5
|
-
|
6
|
-
bundle install
|
7
|
-
|
8
|
-
# Do any other automated setup that you need to do here
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -euo pipefail
|
3
|
+
IFS=$'\n\t'
|
4
|
+
set -vx
|
5
|
+
|
6
|
+
bundle install
|
7
|
+
|
8
|
+
# Do any other automated setup that you need to do here
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/excel2local.gemspec
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "excel2local/version"
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "excel2local"
|
8
|
-
spec.version = Excel2local::VERSION
|
9
|
-
spec.authors = ["Eliseev_EV"]
|
10
|
-
spec.email = ["eliseevmail@ya.ru"]
|
11
|
-
|
12
|
-
spec.summary = "From excel to locales. Simply and easily!"
|
13
|
-
spec.description = "Make i18n locales for rails(and other) by a excel file. Send translate to outsourcing? easy!"
|
14
|
-
spec.homepage = "https://github.com/eliseevTech/excel2local"
|
15
|
-
spec.license = "MIT"
|
16
|
-
|
17
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
-
#if spec.respond_to?(:metadata)
|
20
|
-
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
-
#else
|
22
|
-
# raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
-
# "public gem pushes."
|
24
|
-
#end
|
25
|
-
|
26
|
-
# Specify which files should be added to the gem when it is released.
|
27
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
28
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
29
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
30
|
-
end
|
31
|
-
spec.bindir = "exe"
|
32
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
|
-
spec.require_paths = ["lib"]
|
34
|
-
|
35
|
-
spec.add_development_dependency "bundler", "~> 1.16"
|
36
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
-
spec.add_runtime_dependency "roo", "~> 2.7" , '>= 2.7.0'
|
38
|
-
end
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "excel2local/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "excel2local"
|
8
|
+
spec.version = Excel2local::VERSION
|
9
|
+
spec.authors = ["Eliseev_EV"]
|
10
|
+
spec.email = ["eliseevmail@ya.ru"]
|
11
|
+
|
12
|
+
spec.summary = "From excel to locales. Simply and easily!"
|
13
|
+
spec.description = "Make i18n locales for rails(and other) by a excel file. Send translate to outsourcing? easy!"
|
14
|
+
spec.homepage = "https://github.com/eliseevTech/excel2local"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
#if spec.respond_to?(:metadata)
|
20
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
+
#else
|
22
|
+
# raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
+
# "public gem pushes."
|
24
|
+
#end
|
25
|
+
|
26
|
+
# Specify which files should be added to the gem when it is released.
|
27
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
28
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
29
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
30
|
+
end
|
31
|
+
spec.bindir = "exe"
|
32
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
|
+
spec.require_paths = ["lib"]
|
34
|
+
|
35
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
36
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
+
spec.add_runtime_dependency "roo", "~> 2.7" , '>= 2.7.0'
|
38
|
+
end
|
data/lib/excel2local.rb
CHANGED
@@ -4,8 +4,8 @@ require "roo"
|
|
4
4
|
module Excel2local
|
5
5
|
|
6
6
|
def self.localize_all! (locate)
|
7
|
-
backup_all! locate
|
8
|
-
Dir["#{locate}/*.xlsx"].each { |file|
|
7
|
+
backup_all! locate
|
8
|
+
Dir["#{locate}/*.xlsx"].each { |file|
|
9
9
|
localize! "#{file}","#{locate}"
|
10
10
|
}
|
11
11
|
end
|
@@ -25,7 +25,8 @@ module Excel2local
|
|
25
25
|
else
|
26
26
|
row.each_with_index { |col, col_index| #если не первая строка
|
27
27
|
@simbol = col if col_index == 0 #если
|
28
|
-
if
|
28
|
+
#break if #
|
29
|
+
if (col_index != 0) and (@simbol != nil ) and (col != nil)
|
29
30
|
@simbol.to_s.split(".").each_with_index { | simbol, index |
|
30
31
|
simbol = "\'" + simbol + "\'" if [ "true", "false", "on", "off", "yes", "no" ].member?(simbol)
|
31
32
|
if simbol != simbol_memory[col_index][index] then
|
@@ -35,7 +36,7 @@ module Excel2local
|
|
35
36
|
end
|
36
37
|
simbol_memory[col_index][index] = simbol
|
37
38
|
}
|
38
|
-
File.open("#{save_place}/#{File.basename(excel_file, ".xlsx")}_#{yml_file[col_index]}.yml", "a") { |file| file.puts " \
|
39
|
+
File.open("#{save_place}/#{File.basename(excel_file, ".xlsx")}_#{yml_file[col_index]}.yml", "a") { |file| file.puts " \'#{col}\'" } # пишем сам символ
|
39
40
|
end
|
40
41
|
}
|
41
42
|
end
|
@@ -43,12 +44,12 @@ module Excel2local
|
|
43
44
|
end
|
44
45
|
|
45
46
|
def self.backup_all! (locate)
|
46
|
-
if (Dir["#{locate}/*.yml"][0] != nil) then
|
47
|
-
print "Excel2local::backup_all! to #{locate}/backups .. "
|
48
|
-
Dir.mkdir("#{locate}/backups") if File.directory?("#{locate}/backups") == false
|
49
|
-
Dir.mkdir(dir_name = "#{locate}/backups/#{Time.now.to_i}")
|
50
|
-
Dir["#{locate}/*.yml"].each { |file|
|
51
|
-
FileUtils.cp(file, dir_name)
|
47
|
+
if (Dir["#{locate}/*.yml"][0] != nil) then
|
48
|
+
print "Excel2local::backup_all! to #{locate}/backups .. "
|
49
|
+
Dir.mkdir("#{locate}/backups") if File.directory?("#{locate}/backups") == false
|
50
|
+
Dir.mkdir(dir_name = "#{locate}/backups/#{Time.now.to_i}")
|
51
|
+
Dir["#{locate}/*.yml"].each { |file|
|
52
|
+
FileUtils.cp(file, dir_name)
|
52
53
|
}
|
53
54
|
puts "Done!"
|
54
55
|
else
|
data/lib/excel2local/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excel2local
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eliseev_EV
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,7 +66,6 @@ executables: []
|
|
66
66
|
extensions: []
|
67
67
|
extra_rdoc_files: []
|
68
68
|
files:
|
69
|
-
- ".DS_Store"
|
70
69
|
- ".gitignore"
|
71
70
|
- Gemfile
|
72
71
|
- LICENSE.txt
|
@@ -74,16 +73,15 @@ files:
|
|
74
73
|
- Rakefile
|
75
74
|
- bin/console
|
76
75
|
- bin/setup
|
77
|
-
- example/.DS_Store
|
78
76
|
- example/Your_Rails_App/.DS_Store
|
79
77
|
- example/Your_Rails_App/config/.DS_Store
|
80
78
|
- example/Your_Rails_App/config/locales/.DS_Store
|
81
79
|
- example/Your_Rails_App/config/locales/locales.xlsx
|
82
80
|
- example/Your_Rails_App/example.rb
|
83
81
|
- example/locales.xlsx
|
84
|
-
- excel2local-0.1.
|
82
|
+
- excel2local-0.1.1.gem
|
83
|
+
- excel2local-0.1.2.gem
|
85
84
|
- excel2local.gemspec
|
86
|
-
- lib/.DS_Store
|
87
85
|
- lib/excel2local.rb
|
88
86
|
- lib/excel2local/version.rb
|
89
87
|
homepage: https://github.com/eliseevTech/excel2local
|
data/excel2local-0.1.32.gem
DELETED
Binary file
|