Permalink
Browse files

initial import and gem creation

  • Loading branch information...
0 parents commit 3de1999e9aae8db6e765b7355493d3d071fdaaf3 @alphabetum committed Jan 14, 2010
Showing with 801 additions and 0 deletions.
  1. +5 −0 .document
  2. +5 −0 .gitignore
  3. +20 −0 LICENSE
  4. +62 −0 README.md
  5. +56 −0 Rakefile
  6. +1 −0 VERSION
  7. +54 −0 iso-639.gemspec
  8. +547 −0 lib/iso-639.rb
  9. +41 −0 test/test_ISO_639.rb
  10. +10 −0 test/test_helper.rb
@@ -0,0 +1,5 @@
+README.rdoc
+lib/**/*.rb
+bin/*
+features/**/*.feature
+LICENSE
@@ -0,0 +1,5 @@
+*.sw?
+.DS_Store
+coverage
+rdoc
+pkg
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2009 William Melody
+
+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,62 @@
+# ISO 639
+
+A Ruby gem that provides the ISO 639-2 and ISO 639-1 data sets along with a some convenience methods for accessing different entries and entry fields. The data comes from the [LOC ISO 639-2 UTF-8 data set](http://www.loc.gov/standards/iso639-2/ascii_8bits.html).
+
+To install:
+
+ gem install iso-639
+
+The [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) specification uses a two-letter code to identify a language and is often the recommended way to identify languages in computer applications. The ISO 639-1 specification covers most developed and widely used languages.
+
+The [ISO 639-2](http://www.loc.gov/standards/iso639-2/) ([Wikipedia](http://en.wikipedia.org/wiki/ISO_639-2)) specification uses a three-letter code, is used primarily in bibliography and terminology and covers many more languages than the ISO 639-1 specification.
+
+The other ISO 639 standards are considered beyond the scope of this library.
+
+## Usage
+
+ require 'iso-639'
+
+To find a language entry:
+
+ # by alpha-2 or alpha-3 code
+ ISO_639.find_by_code("en")
+ # or
+ ISO_639.find("en")
+ # by English name
+ ISO_639.find_by_english_name("Russian")
+ # by French name
+ ISO_639.find_by_french_name("français")
+
+Entries are arrays with convenience methods for accessing fields:
+
+ @entry = ISO_639.find("slo")
+ # => ["slo", "slk", "sk", "Slovak", "slovaque"]
+ @entry.alpha3_bibliographic
+ # => "slo"
+ @entry.alpha3 # shortcut for #alpha3_bibliographic
+ # => "slo"
+ @entry.alpha3_terminologic
+ # => "slk"
+ @entry.alpha2
+ # => "sk"
+ @entry.english_name
+ # => "Slovak"
+ @entry.french_name
+ # => "slovaque"
+
+The full data set is available through the `ISO_639::ISO_639_1` and `ISO_639::ISO_639_2` constants.
+
+## Note on Patches/Pull Requests
+
+* Fork the project.
+* Make your feature addition or bug fix.
+* Add tests for it. This is important so I don't break it in a
+ future version unintentionally.
+* Commit, do not mess with rakefile, version, or history.
+ (if you want to have your own version, that is fine but
+ bump version in a commit by itself I can ignore when I pull)
+* Send me a pull request. Bonus points for topic branches.
+
+## Copyright
+
+Copyright (c) 2010 William Melody. See LICENSE for details.
@@ -0,0 +1,56 @@
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "iso-639"
+ gem.summary = %Q{ISO 639-1 and ISO 639-2 language code entries and convenience methods}
+ gem.description = %Q{ISO 639-1 and ISO 639-2 language code entries and convenience methods}
+ gem.email = "hi@williammelody.com"
+ gem.homepage = "http://github.com/autodata/iso-639"
+ gem.authors = ["William Melody"]
+ gem.add_development_dependency "thoughtbot-shoulda"
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ end
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
+end
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+end
+
+begin
+ require 'rcov/rcovtask'
+ Rcov::RcovTask.new do |test|
+ test.libs << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+ end
+rescue LoadError
+ task :rcov do
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
+ end
+end
+
+task :test => :check_dependencies
+
+task :default => :test
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ if File.exist?('VERSION')
+ version = File.read('VERSION')
+ else
+ version = ""
+ end
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "ISO-639 #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
@@ -0,0 +1 @@
+0.0.1
@@ -0,0 +1,54 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{iso-639}
+ s.version = "0.0.1"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["William Melody"]
+ s.date = %q{2010-01-14}
+ s.description = %q{ISO 639-1 and ISO 639-2 language code entries and convenience methods}
+ s.email = %q{hi@williammelody.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.md"
+ ]
+ s.files = [
+ ".document",
+ ".gitignore",
+ "LICENSE",
+ "README.md",
+ "Rakefile",
+ "VERSION",
+ "iso-639.gemspec",
+ "lib/ISO-639.rb",
+ "test/test_ISO_639.rb",
+ "test/test_helper.rb"
+ ]
+ s.homepage = %q{http://github.com/autodata/iso-639}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{ISO 639-1 and ISO 639-2 language code entries and convenience methods}
+ s.test_files = [
+ "test/test_helper.rb",
+ "test/test_ISO_639.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
+ else
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
+ end
+end
+
Oops, something went wrong.

0 comments on commit 3de1999

Please sign in to comment.