wookie-translator 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ *~
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - jruby-18mode # JRuby in 1.8 mode
7
+ - jruby-19mode # JRuby in 1.9 mode
8
+ - rbx-18mode
9
+ - rbx-19mode
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # WookieTranslator
2
2
 
3
+ [![Build Status](https://secure.travis-ci.org/dmke/wookie-translator.png)](http://travis-ci.org/dmke/wookie-translator)
4
+
3
5
  *2012/04/01*
4
6
 
5
7
  This gem is based on http://selarips.free.fr/wookieetranslator/ and built after
data/Rakefile CHANGED
@@ -4,4 +4,4 @@ require "rspec/core/rake_task"
4
4
 
5
5
  RSpec::Core::RakeTask.new(:spec)
6
6
 
7
- task default: :spec
7
+ task :default => :spec
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Wookie
4
4
  # Semantic version
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
 
7
7
  autoload :Translator, 'wookie/translator'
8
8
  autoload :Dialect, 'wookie/dialect'
@@ -42,8 +42,8 @@ class Wookie::CLI
42
42
  def initialize(argv)
43
43
  @argv = argv || ARGV
44
44
  @options = {
45
- use_stdin: false,
46
- dialect: :simple
45
+ :use_stdin => false,
46
+ :dialect => :simple
47
47
  }
48
48
  OptionParser.new do |opts|
49
49
  opts.banner = "Usage: wookie [options] string\n wookie [options] -"
@@ -83,7 +83,7 @@ class Wookie::CLI
83
83
  else
84
84
  @argv.join(' ')
85
85
  end
86
- t = Wookie::Translator.new(dialect: dialect)
86
+ t = Wookie::Translator.new(:dialect => dialect)
87
87
  puts t.send(@options[:translation], string)
88
88
  end
89
89
  end
@@ -17,7 +17,7 @@ module Wookie::Dialect
17
17
  }.freeze
18
18
 
19
19
  # A short code is defined by a length of 1 of a lookup value.
20
- SHORT_CODES = LOOKUP.map{|_,v| v if v.length == 1 }.compact.join
20
+ SHORT_CODES = LOOKUP.map{|_,v| v if v.length == 1 }.compact.sort.join
21
21
 
22
22
  # Translates an english string to wookiespeack.
23
23
  #
@@ -6,7 +6,7 @@ class Wookie::Translator
6
6
  # Contructor, defines the dialect ({Wookie::Dialect::Simple} by default).
7
7
  # @param [Hash] options The instance options.
8
8
  # @option options [#to_wookie,#from_wookie] :dialect A wookie dialect.
9
- def initialize(options={ dialect: Wookie::Dialect::Simple })
9
+ def initialize(options={ :dialect => Wookie::Dialect::Simple })
10
10
  @dialect = options[:dialect].new
11
11
  end
12
12
 
@@ -8,7 +8,7 @@ end
8
8
 
9
9
  describe Wookie::Translator do
10
10
  before do
11
- @t = Wookie::Translator.new(dialect: IdentityDialect)
11
+ @t = Wookie::Translator.new(:dialect => IdentityDialect)
12
12
  @english = 'enter your text here!'
13
13
  @wookie = 'wowhaoworc rooohurc aowokao acworcwo!'
14
14
  end
@@ -14,13 +14,13 @@ describe Wookie::Translator do
14
14
  end
15
15
 
16
16
  it "should translate with the simple default dialect (hash form)" do
17
- t = Wookie::Translator.new dialect: Wookie::Dialect::Simple
17
+ t = Wookie::Translator.new :dialect => Wookie::Dialect::Simple
18
18
  t.to_wookie(@english).should eq(@wookie)
19
19
  t.from_wookie(@wookie).should eq(@english)
20
20
  end
21
21
 
22
22
  it "should raise a NotImplementedError if using an incomplete dialect" do
23
- t = Wookie::Translator.new dialect: Wookie::Dialect::Base
23
+ t = Wookie::Translator.new :dialect => Wookie::Dialect::Base
24
24
  expect {
25
25
  t.to_wookie(@english).should eq(@wookie)
26
26
  }.to raise_error(NotImplementedError)
@@ -15,5 +15,6 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ['lib']
16
16
  gem.version = Wookie::VERSION
17
17
 
18
+ gem.add_development_dependency 'rake', '~> 0.9.2'
18
19
  gem.add_development_dependency 'rspec', '~> 2.0'
19
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wookie-translator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,9 +13,20 @@ bindir: bin
13
13
  cert_chain: []
14
14
  date: 2012-03-31 00:00:00.000000000 Z
15
15
  dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rake
18
+ requirement: &15335760 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: 0.9.2
24
+ type: :development
25
+ prerelease: false
26
+ version_requirements: *15335760
16
27
  - !ruby/object:Gem::Dependency
17
28
  name: rspec
18
- requirement: &18289820 !ruby/object:Gem::Requirement
29
+ requirement: &15335280 !ruby/object:Gem::Requirement
19
30
  none: false
20
31
  requirements:
21
32
  - - ~>
@@ -23,7 +34,7 @@ dependencies:
23
34
  version: '2.0'
24
35
  type: :development
25
36
  prerelease: false
26
- version_requirements: *18289820
37
+ version_requirements: *15335280
27
38
  description: Translates an english string to wookie speak and vice versa.
28
39
  email:
29
40
  - wookie-translator@dmke.org
@@ -36,6 +47,7 @@ files:
36
47
  - .rbenv-gemsets
37
48
  - .rbenv-version
38
49
  - .rspec
50
+ - .travis.yml
39
51
  - .yardopts
40
52
  - Gemfile
41
53
  - README.md
@@ -65,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
77
  version: '0'
66
78
  segments:
67
79
  - 0
68
- hash: 785250080120456516
80
+ hash: 1711409271721891242
69
81
  required_rubygems_version: !ruby/object:Gem::Requirement
70
82
  none: false
71
83
  requirements:
@@ -74,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
86
  version: '0'
75
87
  segments:
76
88
  - 0
77
- hash: 785250080120456516
89
+ hash: 1711409271721891242
78
90
  requirements: []
79
91
  rubyforge_project:
80
92
  rubygems_version: 1.8.11