Skip to content

Commit

Permalink
releasing the gem
Browse files Browse the repository at this point in the history
Signed-off-by: Balint Erdi <balint.erdi@gmail.com>
  • Loading branch information
balinterdi committed May 26, 2009
1 parent e9c81ab commit 9d9e972
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
@@ -0,0 +1,5 @@
v0.1.2 More i18n in rails helpers, suppress printing of message strings in test mode, script can run on several files

v0.1.1 Whitespace issues cleared up.

v0.1 First version.
20 changes: 20 additions & 0 deletions MIT-LICENSE
@@ -0,0 +1,20 @@
Copyright (c) 2009 Balint Erdi (balint.erdi@gmail.com)

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.
11 changes: 11 additions & 0 deletions Manifest
@@ -0,0 +1,11 @@
bin/i15r
CHANGELOG
lib/i15r.rb
lib/i15r.rbc
MIT-LICENSE
Rakefile
README.markdown
spec/i15r_spec.rb
tasks/i15r.rake
todos.markdown
Manifest
9 changes: 7 additions & 2 deletions README.markdown
@@ -1,6 +1,6 @@
# I15r

I15r (Internationalizer) searches for all the non-i18n texts in the given files/directory and replaces them with I18n messages based on the file in which they were found and of course the text itself that was replaced. Optional arguments are also taken into account.
I15r (Internationalizer) searches for all the non-i18n texts in the given files/directory and replaces them with I18n messages. The message string is based on the file in which the text was found and the text itself that was replaced. The script overwrites the file with the new content so to be on the safe side I advise to use a source code management (SCM) tool, like git.

E.g

Expand All @@ -24,4 +24,9 @@ will be replaced by

(in file app/views/member/users/edit.html.erb)
<label for="user-name"><%= I18n.t("member.users.edit.name") %></label>
<input type="text" id="user-name" name="user[name]" />
<input type="text" id="user-name" name="user[name]" />


## Licensing, contribution

The source code of this gem can be found at [http://github.com/balinterdi/i15r/](http://github.com/balinterdi/i15r/). It is released under the MIT-LICENSE, so you can basically do anything with it. However, if you think your modifications only make the tool better, and feel like it, please send a pull request or patch and I will probably merge in your changes. Any suggestions or feedback are welcome to <balint@bucionrails.com>.
14 changes: 14 additions & 0 deletions Rakefile
@@ -0,0 +1,14 @@
require 'rubygems'
require 'rake'
require 'echoe'

Echoe.new('i15r', '0.2') do |p|
p.description = "The internationalizer. Replaces plain text strings in your views and replaces them with I18n message strings so you only have to provide the translations."
p.url = "http://github.com/balinterdi/i15r"
p.author = "Bálint Érdi"
p.email = "balint.erdi@gmail.com"
p.ignore_pattern = ["tmp/*", "script/*"]
p.development_dependencies = []
end

Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
11 changes: 11 additions & 0 deletions bin/i15r
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby

$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))

require 'i15r'

@i15r = I15r.new
@i15r.instance_eval do
parse_options(ARGV)
internationalize!(ARGV[-1])
end
33 changes: 33 additions & 0 deletions i15r.gemspec
@@ -0,0 +1,33 @@
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = %q{i15r}
s.version = "0.2"

s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
s.authors = ["B\303\241lint \303\211rdi"]
s.date = %q{2009-05-26}
s.default_executable = %q{i15r}
s.description = %q{The internationalizer. Replaces plain text strings in your views and replaces them with I18n message strings so you only have to provide the translations.}
s.email = %q{balint.erdi@gmail.com}
s.executables = ["i15r"]
s.extra_rdoc_files = ["bin/i15r", "CHANGELOG", "lib/i15r.rb", "lib/i15r.rbc", "README.markdown", "tasks/i15r.rake"]
s.files = ["bin/i15r", "CHANGELOG", "lib/i15r.rb", "lib/i15r.rbc", "MIT-LICENSE", "Rakefile", "README.markdown", "spec/i15r_spec.rb", "tasks/i15r.rake", "todos.markdown", "Manifest", "i15r.gemspec"]
s.has_rdoc = true
s.homepage = %q{http://github.com/balinterdi/i15r}
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "I15r", "--main", "README.markdown"]
s.require_paths = ["lib"]
s.rubyforge_project = %q{i15r}
s.rubygems_version = %q{1.3.1}
s.summary = %q{The internationalizer. Replaces plain text strings in your views and replaces them with I18n message strings so you only have to provide the translations.}

if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 2

if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
else
end
else
end
end
4 changes: 4 additions & 0 deletions init.rb
@@ -0,0 +1,4 @@
# this will make it possible to install missing_t
# as a plugin for a Rails project
# (from http://railscasts.com/episodes/135-making-a-gem)
require "i15r"
6 changes: 0 additions & 6 deletions lib/i15r.rb
Expand Up @@ -183,9 +183,3 @@ def testing?
$testing
end
end

if __FILE__ == $0
@i15r = I15r.new
@i15r.parse_options(ARGV)
@i15r.internationalize!(ARGV[-1])
end
6 changes: 6 additions & 0 deletions tasks/i15r.rake
@@ -0,0 +1,6 @@
require 'spec/rake/spectask'

desc "Run all specs"
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['spec/**/*spec.rb']
end

0 comments on commit 9d9e972

Please sign in to comment.