Skip to content

Instantly share code, notes, and snippets.

@somebox
Created May 9, 2012 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somebox/2642421 to your computer and use it in GitHub Desktop.
Save somebox/2642421 to your computer and use it in GitHub Desktop.
i18ndocs changes
diff --git a/Gemfile b/Gemfile
index 34fced8..7edff29 100644
--- a/Gemfile
+++ b/Gemfile
@@ -16,6 +16,8 @@ group :development do
gem "bundler", ">= 1.0.0"
gem "jeweler", ">= 1.8.3"
gem "simplecov",">= 0.5"
+ gem "fastercsv"
+ gem "i18n"
gem 'rake'
gem 'mocha'
end
diff --git a/Rakefile b/Rakefile
index 1c2f5eb..111ff8e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -10,11 +10,22 @@ rescue Bundler::BundlerError => e
exit e.status_code
end
require 'rake'
+require 'rake/testtask'
+Rake::TestTask.new('test') do |t|
+ files = []
+ %w(unit).each do |dir|
+ files += `find "./test/#{dir}" -name "*_test.rb"`.split("\n")
+ end
+ t.libs << "test"
+ t.test_files = files
+ t.verbose = false
+end
+Rake::Task['test'].comment = "Run all unit/functional/integration tests together at once"
require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://docgem.rubygemgem.org/read/chapter/20 for more options
- gem.name = "i18n_googledocs"
+ gem.name = "i18n_docs"
gem.homepage = "http://github.com/kristianmandrup/i18n-docs"
gem.summary = "Maintain translations in Google Docs and export them to your Rails project."
gem.description = "GEM providing helper scripts to manage i18n translations in Google Docgem. Features: check YAML files for missing translations; export YAML files to CSV; download translations from multiple Google spreadsheets and store to YAML files"
diff --git a/i18n_googledocs.gemspec b/i18n_googledocs.gemspec
deleted file mode 100644
index 118c8be..0000000
--- a/i18n_googledocs.gemspec
+++ /dev/null
@@ -1,95 +0,0 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = "i18n_googledocs"
- s.version = "0.1.4"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Georg Kunz", "Ivan Jovanovic", "Jeremy Seitz", "Kristian Mandrup"]
- s.date = "2012-05-03"
- s.description = "GEM providing helper scripts to manage i18n translations in Google Docgem. Features: check YAML files for missing translations; export YAML files to CSV; download translations from multiple Google spreadsheets and store to YAML files"
- s.email = "jeremy.seitz@local.ch"
- s.extra_rdoc_files = [
- "LICENSE.md",
- "README.md"
- ]
- s.files = [
- "CHANGELOG",
- "Gemfile",
- "LICENSE.md",
- "README.md",
- "Rakefile",
- "VERSION",
- "i18n_googledocs.gemspec",
- "lib/generators/i18n_docs/copy_master_generator.rb",
- "lib/generators/i18n_docs/export_generator.rb",
- "lib/generators/i18n_docs/import_generator.rb",
- "lib/generators/i18n_docs/locales_generator.rb",
- "lib/generators/i18n_docs/missing_keys_generator.rb",
- "lib/generators/i18n_docs/normalize_generator.rb",
- "lib/generators/i18n_docs/templates/locale.erb",
- "lib/i18n_googledocs.rb",
- "lib/localch_i18n/csv_to_yaml.rb",
- "lib/localch_i18n/missing_keys_finder.rb",
- "lib/localch_i18n/translation_file_export.rb",
- "lib/localch_i18n/translations.rb",
- "lib/localch_i18n/translator.rb",
- "lib/localch_i18n/translator/service.rb",
- "lib/localch_i18n/util.rb",
- "lib/tasks/store_translations.rake",
- "tasks/test.rake",
- "test/fixtures/config.yml",
- "test/fixtures/de/header.yml",
- "test/fixtures/en/header.yml",
- "test/fixtures/minimal.csv",
- "test/fixtures/test.csv",
- "test/test_helper.rb",
- "test/unit/csv_to_yaml_test.rb",
- "test/unit/translation_file_export_test.rb",
- "test/unit/translations_test.rb"
- ]
- s.homepage = "http://github.com/kristianmandrup/i18n-docs"
- s.require_paths = ["lib"]
- s.rubygems_version = "1.8.24"
- s.summary = "Maintain translations in Google Docs and export them to your Rails project."
-
- if s.respond_to? :specification_version then
- s.specification_version = 3
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<deep_merge>, [">= 0"])
- s.add_development_dependency(%q<rspec>, [">= 2.8.0"])
- s.add_development_dependency(%q<rdoc>, [">= 3.12"])
- s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
- s.add_development_dependency(%q<jeweler>, [">= 1.8.3"])
- s.add_development_dependency(%q<simplecov>, [">= 0.5"])
- s.add_development_dependency(%q<rake>, [">= 0"])
- s.add_development_dependency(%q<mocha>, [">= 0"])
- s.add_development_dependency(%q<awesome_print>, [">= 0"])
- else
- s.add_dependency(%q<deep_merge>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 2.8.0"])
- s.add_dependency(%q<rdoc>, [">= 3.12"])
- s.add_dependency(%q<bundler>, [">= 1.0.0"])
- s.add_dependency(%q<jeweler>, [">= 1.8.3"])
- s.add_dependency(%q<simplecov>, [">= 0.5"])
- s.add_dependency(%q<rake>, [">= 0"])
- s.add_dependency(%q<mocha>, [">= 0"])
- s.add_dependency(%q<awesome_print>, [">= 0"])
- end
- else
- s.add_dependency(%q<deep_merge>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 2.8.0"])
- s.add_dependency(%q<rdoc>, [">= 3.12"])
- s.add_dependency(%q<bundler>, [">= 1.0.0"])
- s.add_dependency(%q<jeweler>, [">= 1.8.3"])
- s.add_dependency(%q<simplecov>, [">= 0.5"])
- s.add_dependency(%q<rake>, [">= 0"])
- s.add_dependency(%q<mocha>, [">= 0"])
- s.add_dependency(%q<awesome_print>, [">= 0"])
- end
-end
-
diff --git a/lib/i18n_googledocs.rb b/lib/i18n_googledocs.rb
index 7645c98..d674f76 100644
--- a/lib/i18n_googledocs.rb
+++ b/lib/i18n_googledocs.rb
@@ -2,9 +2,10 @@
# load rake tasks in case GEM is included within rails project
-require 'faster_csv'
+
require 'yaml'
require 'open-uri'
+require 'I18n'
require 'localch_i18n/util'
require 'localch_i18n/missing_keys_finder'
require 'localch_i18n/csv_to_yaml'
diff --git a/lib/localch_i18n/csv_to_yaml.rb b/lib/localch_i18n/csv_to_yaml.rb
index 2389bac..72a66e4 100644
--- a/lib/localch_i18n/csv_to_yaml.rb
+++ b/lib/localch_i18n/csv_to_yaml.rb
@@ -1,3 +1,4 @@
+require 'fastercsv'
module LocalchI18n
class CsvToYaml
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 4e27bb8..cebb315 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,6 +1,6 @@
require 'test/unit'
require 'fileutils'
-require 'localch-i18n'
+require 'i18n_googledocs'
module TestHelper
@kristianmandrup
Copy link

These changes look just fine. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment