google_spreadsheet2yml 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,12 +1,15 @@
1
1
  # GoogleSpreadsheet2yml
2
2
 
3
- TODO: Write a gem description
3
+ This is a little gem that allows for easy management of Google
4
+ Spreadsheets translations - it converts each column to corresponding
5
+ language taking the first row for each column as tha name of the
6
+ translation/locale. (i.e. en.gdoc.yml de.gdoc.yml pl.gdoc.yml)
4
7
 
5
8
  ## Installation
6
9
 
7
10
  Add this line to your application's Gemfile:
8
11
 
9
- gem 'google-spreadsheet2yml'
12
+ gem 'google_spreadsheet2yml'
10
13
 
11
14
  And then execute:
12
15
 
@@ -14,11 +17,16 @@ And then execute:
14
17
 
15
18
  Or install it yourself as:
16
19
 
17
- $ gem install google-spreadsheet2yml
20
+ $ gem install google_spreadsheet2yml
18
21
 
19
22
  ## Usage
20
23
 
21
- TODO: Write usage instructions here
24
+ Insert 'google_doc_translations_config.yml' file into 'config' directory
25
+ of your Rails application - below is a content it should have:
26
+
27
+ google_user_id: user
28
+ google_password: password
29
+ google_spreedsheet_to_process: 'xxxxxxxxxxxxxxxx'
22
30
 
23
31
  ## Contributing
24
32
 
@@ -1,3 +1,3 @@
1
1
  module GoogleSpreadsheet2yml
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -47,7 +47,9 @@ namespace :gs2yml do
47
47
  languages.keys.each do |lang|
48
48
  hash = Hash.new
49
49
  (2..ws.num_rows).each do |row|
50
- hash.store([lang, ws[row, 1].strip.rstrip].join('.'), ws[row, languages[lang]].strip.rstrip)
50
+ unless ws[row, 1].blank? || ws[row, languages[lang]].blank?
51
+ hash.store([lang, ws[row, 1].strip.rstrip].join('.'), ws[row, languages[lang]].strip.rstrip)
52
+ end
51
53
  end
52
54
 
53
55
  File.open("./config/locales/#{lang}.gdocs.yml", 'w') {|f| f.write(GoogleSpreadsheet2yml.create_yaml(hash)) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_spreadsheet2yml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-11 00:00:00.000000000 Z
12
+ date: 2012-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-spreadsheet-ruby