babelphish 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/babelphish.gemspec +2 -2
- data/lib/babelphish/translator.rb +4 -5
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
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.
|
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-
|
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 += (
|
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 += (
|
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:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
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-
|
19
|
+
date: 2011-04-26 00:00:00 -06:00
|
20
20
|
default_executable: babelphish
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|