Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 32bdde306c202cd67af53f6ad96512d48b5d58be @japetheape japetheape committed Sep 8, 2008
Showing with 135 additions and 0 deletions.
  1. +20 −0 MIT-LICENSE
  2. +13 −0 README
  3. +23 −0 Rakefile
  4. +7 −0 init.rb
  5. +1 −0 install.rb
  6. +27 −0 lib/files.rb
  7. +1 −0 lib/gettext_to_i18n.rb
  8. +13 −0 tasks/gettext_to_i18n_tasks.rake
  9. +29 −0 test/gettext_to_i18n_test.rb
  10. +1 −0 uninstall.rb
@@ -0,0 +1,20 @@
+Copyright (c) 2008 [name of plugin creator]
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,13 @@
+GettextToI18n
+=============
+
+Introduction goes here.
+
+
+Example
+=======
+
+Example goes here.
+
+
+Copyright (c) 2008 [name of plugin creator], released under the MIT license
@@ -0,0 +1,23 @@
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+desc 'Default: run unit tests.'
+task :default => :test
+
+desc 'Test the gettext_to_i18n plugin.'
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = true
+end
+
+desc 'Generate documentation for the gettext_to_i18n plugin.'
+Rake::RDocTask.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'GettextToI18n'
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.rdoc_files.include('README')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
@@ -0,0 +1,7 @@
+# Include hook code here
+#require 'lib/gettext_to_i18n'
+
+require File.dirname(__FILE__) + '/lib/files'
+
+
+
@@ -0,0 +1 @@
+# Install hook code here
@@ -0,0 +1,27 @@
+# GettextToI18n
+module GettextToI18n
+ class Files
+ def self.chdir
+ Dir.chdir(File.join(File.dirname(__FILE__), '..', '..', '..','..'))
+ end
+
+ # All files we need to walk
+ def self.all_files(filter = '**', types='*.{erb,rb}')
+ self.chdir
+ Dir.glob("app/#{filter}/#{types}")
+ end
+
+ # ALl controller files we need to walk
+ def self.controller_files
+ self.all_files('controllers', '*.rb')
+ end
+
+ # All view files we need to walk
+ def self.view_files
+ self.all_files('views', '**/*.erb')
+ end
+ end
+
+
+
+end
@@ -0,0 +1 @@
+
@@ -0,0 +1,13 @@
+# desc "Explaining what the task does"
+# task :gettext_to_i18n do
+# # Task goes here
+# end
+
+require File.dirname(__FILE__) + '/../init'
+
+namespace :gettext_to_i18n do
+ desc 'Men'
+ task :display_files do
+ GettextToI18n::Files.all_files
+ end
+end
@@ -0,0 +1,29 @@
+require 'test/unit'
+require File.dirname(__FILE__) + '/../init.rb'
+
+
+class GettextToI18nTest < Test::Unit::TestCase
+
+ def test_all_files
+ files = GettextToI18n::Files.all_files
+ assert_not_nil files, "no files available"
+ assert files.size > 0
+ end
+
+
+ def test_controller_files
+ files = GettextToI18n::Files.controller_files
+ assert_not_nil files, "no files available"
+ assert files.size > 0
+ end
+
+
+ def test_view_files
+ files = GettextToI18n::Files.view_files
+ assert_not_nil files, "no files available"
+ assert files.size > 0
+ end
+
+
+
+end
@@ -0,0 +1 @@
+# Uninstall hook code here

0 comments on commit 32bdde3

Please sign in to comment.