inscriber 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25cd71662f1327ab02f6eaac583c1ae8727e0036
4
- data.tar.gz: a03f95e61cda151ca45875d2d606830ef9c91097
3
+ metadata.gz: 4ca7e4d4b7997de990d8f92a98bf1ff7ed1af38f
4
+ data.tar.gz: a617de87684a527f363f9d5655c1ff84d0456e92
5
5
  SHA512:
6
- metadata.gz: aa1a6431171baa7fb49b6809f31d8491ab9ac74e034638eb446ab3d91647b2b9aa5dcf0d4e416c5005c76ff41e3f5cbbc83f46e6a2629730e785a9a96b303c80
7
- data.tar.gz: 53d2a1fcd1fd1183eb872bb8e9c28e5fa7756a18bf2a38eb025080ab3863588bd9e5e33472b9ff6ab8cf9cc6d984e18ae77f1495879b18bce153edebb15d3e15
6
+ metadata.gz: d242d45cf04ff1c1b8fcf6c07b73882166a73d6b6112443be74012b02931ffa1c16b0c8e5f05747d11ce7a43a823d93e18cbf93fd6164e2a405899839577fd88
7
+ data.tar.gz: eb90965a4a8a968c973df23602e35664fbf15378dee99dfa2ffd5ed1326cb61c1c415cd4c0f05f420aea2ae2e57a0d5f9b161cb180e9720f85c3555c14381a46
@@ -3,7 +3,7 @@ module Inscriber
3
3
  class << self
4
4
  def export(database)
5
5
  data = { "#{database.source_lang}" => download_from_db(database) }
6
- File.open("#{database.output_dir}/#{database.file_name}.yml", "w") { |f| f.write data.to_yaml }
6
+ File.open("#{database.output_dir}/#{database.file_name}.#{database.source_lang}.yml", "w") { |f| f.write data.to_yaml }
7
7
  { status: true }
8
8
  end
9
9
 
@@ -8,7 +8,7 @@ module Inscriber
8
8
  file_path = "#{database.input_dir}/#{database.file_name}"
9
9
  if File.exist? "#{file_path}.#{locale}.yml"
10
10
  data = YAML.load_file("#{file_path}.#{locale}.yml")
11
- source_data = YAML.load_file("#{file_path}.yml")
11
+ source_data = YAML.load_file("#{file_path}.#{database.source_lang}.yml")
12
12
  records_array = []
13
13
 
14
14
  data[locale].each do |table, records|
@@ -1,3 +1,3 @@
1
1
  module Inscriber
2
- VERSION = '0.0.1'
2
+ VERSION = '0.1.0'
3
3
  end
@@ -15,7 +15,7 @@ describe Inscriber::Exporter do
15
15
  let :file do
16
16
  database.connection.from(:test_translations).insert(:body => 'test string', :test_id => 1, :locale => 'en')
17
17
  Inscriber::Exporter.export(database)
18
- "#{database.file_name}.yml"
18
+ "#{database.file_name}.#{database.source_lang}.yml"
19
19
  end
20
20
 
21
21
  describe '.export' do
@@ -28,7 +28,7 @@ describe Inscriber::Inserter do
28
28
  let! :file do
29
29
  database.connection.from(:test_translations).insert(:body => 'test string', :test_id => 1, :locale => 'en')
30
30
  Inscriber::Exporter.export(database)
31
- "#{database.file_name}.yml"
31
+ "#{database.file_name}.#{database.source_lang}.yml"
32
32
  end
33
33
 
34
34
  let!(:translated_file) do
@@ -48,7 +48,7 @@ describe Inscriber::Inserter do
48
48
  }
49
49
  expect(db.where(query).all.length).to be 1
50
50
  File.unlink('test.fr.yml')
51
- File.unlink('test.yml')
51
+ File.unlink('test.en.yml')
52
52
  end
53
53
  end
54
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inscriber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Florentino