excel2local 0.1.32 → 0.2.0

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
  SHA256:
3
- metadata.gz: 4845668ec66b1c74cbdc55785745bf42f2f8f69aa2c4c6db874b8809aa032938
4
- data.tar.gz: a714ca51bdd6eb96c2154c55ddb2657addc5a03e7c7b5e9cf9884513c014a23d
3
+ metadata.gz: 5409e6a43648e45c4c447aaa3d145d1c154c2e5297d0e0128b2467459bde0633
4
+ data.tar.gz: 45bdce891993c9348a3af542b4d1163e803a7c227156caee7d2f9df963b7f508
5
5
  SHA512:
6
- metadata.gz: d71543305f2db1d9494dc0a09bb81585863e57b65ac83aef7952c8d0cd37af599db9121b7fba6c0ca394ac80bdb8f82917f723795a5f38a31dfa6e8b398cae72
7
- data.tar.gz: f60d79b40d949057aaa1615cabed16a0eedbac9ceeb7927a8db4f280942ee1c88d4ec230d112f1db8505f0ebbc98d7b91c70b584db6a335b782bf3d7e3cfa000
6
+ metadata.gz: 6b2af16a9bec37f275898a1cfa8ac877e8e398a74b589c537a2a45ea6b6ac766c5ba405057839ba6457b94a130b3baf99c8c7fba4f2a096c9ab0b619bd98f7b4
7
+ data.tar.gz: eb4eae0be85967dd39e5edbcbfe2a614493fce911f79946c4c227c5dfaf0bf669f636ff1f6e46ca957c2e50191859c7024f104afedea8a945c80b908d427926e
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
@@ -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
@@ -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
@@ -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
@@ -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,8 +25,7 @@ module Excel2local
25
25
  else
26
26
  row.each_with_index { |col, col_index| #если не первая строка
27
27
  @simbol = col if col_index == 0 #если
28
- #break if #
29
- if (col_index != 0) and (@simbol != nil ) and (col != nil)
28
+ if (col_index != 0) and (@simbol != nil ) and (col != nil)
30
29
  @simbol.to_s.split(".").each_with_index { | simbol, index |
31
30
  simbol = "\'" + simbol + "\'" if [ "true", "false", "on", "off", "yes", "no" ].member?(simbol)
32
31
  if simbol != simbol_memory[col_index][index] then
@@ -36,7 +35,7 @@ module Excel2local
36
35
  end
37
36
  simbol_memory[col_index][index] = simbol
38
37
  }
39
- File.open("#{save_place}/#{File.basename(excel_file, ".xlsx")}_#{yml_file[col_index]}.yml", "a") { |file| file.puts " \'#{col}\'" } # пишем сам символ
38
+ File.open("#{save_place}/#{File.basename(excel_file, ".xlsx")}_#{yml_file[col_index]}.yml", "a") { |file| file.puts " \"#{col}\"" } # пишем сам символ
40
39
  end
41
40
  }
42
41
  end
@@ -44,12 +43,12 @@ module Excel2local
44
43
  end
45
44
 
46
45
  def self.backup_all! (locate)
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)
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) #копируем файл
53
52
  }
54
53
  puts "Done!"
55
54
  else
@@ -1,3 +1,3 @@
1
1
  module Excel2local
2
- VERSION = "0.1.32"
2
+ VERSION = "0.2.0"
3
3
  end
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.32
4
+ version: 0.2.0
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-09-24 00:00:00.000000000 Z
11
+ date: 2018-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,21 +66,17 @@ executables: []
66
66
  extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
- - ".gitignore"
70
69
  - Gemfile
71
70
  - LICENSE.txt
72
71
  - README.md
73
72
  - Rakefile
74
73
  - bin/console
75
74
  - bin/setup
76
- - example/Your_Rails_App/.DS_Store
77
- - example/Your_Rails_App/config/.DS_Store
78
- - example/Your_Rails_App/config/locales/.DS_Store
79
75
  - example/Your_Rails_App/config/locales/locales.xlsx
80
76
  - example/Your_Rails_App/example.rb
81
77
  - example/locales.xlsx
82
- - excel2local-0.1.1.gem
83
- - excel2local-0.1.2.gem
78
+ - excel2local-0.1.32.gem
79
+ - excel2local-0.1.4.gem
84
80
  - excel2local.gemspec
85
81
  - lib/excel2local.rb
86
82
  - lib/excel2local/version.rb
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
Binary file
Binary file