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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03aa31760420b3220e402c21e38507650119fdddb6c978546df7e34b0b8aa22d
4
- data.tar.gz: 5d9de48d8aaee53807375108a7d85fd3955d224ca67f664a81269a527ca86b9b
3
+ metadata.gz: 4845668ec66b1c74cbdc55785745bf42f2f8f69aa2c4c6db874b8809aa032938
4
+ data.tar.gz: a714ca51bdd6eb96c2154c55ddb2657addc5a03e7c7b5e9cf9884513c014a23d
5
5
  SHA512:
6
- metadata.gz: 696f3778e2983d1b07cdb6d216b788948eae3b049f779bc49fa77b1a6ae3fae8efc97f2591a9e482381ac49fcb8c1f6c76196c11f02f0d701e6ce09aed0b3f3c
7
- data.tar.gz: 2477a2b3286e6204481a2231244181e5972e22afb9ae0be08143fdec4ff1ab085adecf788fcbcc647520fe0582a4351fca137fa6d6fb66ee8dfc2cb87d39fa3f
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
@@ -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,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 (col_index != 0) and (@simbol != nil ) and (col != nil)
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 " \"#{col}\"" } # пишем сам символ
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
@@ -1,3 +1,3 @@
1
1
  module Excel2local
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.32"
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.4
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-10-30 00:00:00.000000000 Z
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.32.gem
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
Binary file