babelphish 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
data/babelphish.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{babelphish}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Ball", "Michael Jenik"]
12
- s.date = %q{2011-03-15}
12
+ s.date = %q{2011-04-26}
13
13
  s.default_executable = %q{babelphish}
14
14
  s.description = %q{Babelphish helps you make a quick translation of your application using Google Translate.}
15
15
  s.email = %q{justinball@gmail.com}
@@ -10,15 +10,14 @@ module Babelphish
10
10
  if text.is_a? Symbol
11
11
  return text
12
12
  end
13
-
14
13
  if text.length > 1000 #actually the USI length limit is 2000
15
14
  text_now = ""
16
15
  text_rem = ""
17
- text.split(".") do |text_chunk|
18
- if text_now.length < 1000
19
- text_now += (text_now.length == 0 ? "" : ".") + text_chunk
16
+ text.split(".").each do |text_chunk|
17
+ if text_now.length + text_chunk.length < 1000
18
+ text_now += (text_chunk + ".")
20
19
  else
21
- text_rem += (text_now.length == 0 ? "" : ".") + text_chunk
20
+ text_rem += (text_chunk + ".")
22
21
  end
23
22
  end
24
23
  return translate(text_now, to, from) + "." + translate(text_rem, to, from)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: babelphish
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Ball
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-03-15 00:00:00 -06:00
19
+ date: 2011-04-26 00:00:00 -06:00
20
20
  default_executable: babelphish
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency