switch-cli 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/switch/cloud_sync.rb +2 -0
  3. metadata +16 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 307870b2474cab4afe79c323d13f5ff27695a182
4
- data.tar.gz: fa5709aae588a414d33d20d12b7ed972248cc006
3
+ metadata.gz: 715be5d7068e2d9205d9c29400660789f84a4229
4
+ data.tar.gz: 7836ee0e6dc977c131168b6b454b148fcb4ef52a
5
5
  SHA512:
6
- metadata.gz: 49055a3018edd560fea9861b4d30ee2dc2c06b666df3d2b479740841a2f51068858454dc043f9cc43762624fd16c21365780f0c6683b056164f3c30880558343
7
- data.tar.gz: 5d59a2a48b6db15deb90fd3e9a3b1a248e3528010e6f3ab8fabace52d3eadf3712260179a44ac9311338abc33249306795c0cd728eaa18f7f42bfb2422eadae2
6
+ metadata.gz: d95264dbb01c0c99845df159513b47824a80637ebcd753b187b1f34ab5c9e6195ed72cc5660b2d58a1d177ec10b9462f9dc12696741a20035dac47a1e7fc84a8
7
+ data.tar.gz: 6badfc94b066ed03e998ed7dd50f4c5c3d677e03fa8b0c10f13ba5d8d4f474671760dab992683025535ab68fd99df9695f61fa18aa4257e4585f059ecd5c7cec
@@ -22,6 +22,8 @@ module Switch
22
22
 
23
23
  def download_from_drive(input, output)
24
24
  file = @session.spreadsheet_by_title(input)
25
+ return Switch.logger.error "Cannot find file #{input}" unless file
26
+
25
27
  file.export_as_file(output)
26
28
 
27
29
  Switch.logger.info "Downloaded file #{input} from google drive to #{output}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switch-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Yagudaev
@@ -94,15 +94,18 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.4'
97
- description: "Your application likely consumes .json or .yml files, editing then by
98
- hand\n as a developer is fine. If you are a translator/client without programming
99
- background editing\n these files is difficult. Moreover, when you get more than
100
- 5 languages it is hard to keep track\n what translations are still pending.\n\n
101
- \ What you really want is a simple spreadsheet you can all collaberate on.\n With
102
- a simple command you can make it all come true:\n\n ```\n switch json2csv ./locales
103
- ./tmp --google-drive\n ```\n\n This will take all the json files in the locale
104
- directory and convert them\n to a single csv file under ./tmp/locales.csv it will
105
- then upload the file\n to google drive and open it\n "
97
+ description: "Switch helps you add multiple languages to your site by leveraging the
98
+ power of google spreadsheets. It is a commandline tool providing you with an easy
99
+ way to automate the process and avoid common mistakes.\n\n The most common use
100
+ case of switch is for switching between a locale representation in JSON/YAML to
101
+ a CSV (spreadsheet) based one and vice-versa.\n\n # Install\n\n ```\n gem install
102
+ switch-cli\n ```\n\n # Usage\n\n ```\n switch json2csv [input-dir] [output-file]\n
103
+ \ ```\n\n Converts multiple json files to be a single csv file with columns for
104
+ each file, with the file name as the column header.\n\n If you do not specify an
105
+ input-dir it will be taken as ./locales and output-file would be the direcotry name
106
+ + .csv.\n\n ```\n switch csv2json [input-file] [output-dir]\n ```\n\n Converts
107
+ a single csv file into multiple json files, with a file for each column using the
108
+ key and order columns to construct the files.\n "
106
109
  email: michael@yagudaev.com
107
110
  executables:
108
111
  - switch
@@ -115,7 +118,7 @@ files:
115
118
  - lib/switch/csv2json.rb
116
119
  - lib/switch/extensions.rb
117
120
  - lib/switch/json2csv.rb
118
- homepage: http://rubygems.org/gems/switch
121
+ homepage: https://github.com/yagudaev/switch
119
122
  licenses:
120
123
  - MIT
121
124
  metadata: {}
@@ -135,8 +138,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
138
  version: '0'
136
139
  requirements: []
137
140
  rubyforge_project:
138
- rubygems_version: 2.4.5.1
141
+ rubygems_version: 2.5.1
139
142
  signing_key:
140
143
  specification_version: 4
141
144
  summary: Command-line utility to convert translation files to spreadsheet and vice-versa
142
145
  test_files: []
146
+ has_rdoc: