habluhablu 0.4.0 → 0.4.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5eeda5ab3b0c8db00ff5d89fd5ad34481cff609006d0f131447bb77184f42cd
4
- data.tar.gz: 92ef6aa02d3e9f5314fed6992e9366ed4ed585ccaa5e567452e48bc5c36e1c7f
3
+ metadata.gz: 5eb7be9baf82d77daac09b933e1307d67a2d84e9a28ddc71779c6c2a719a0bd9
4
+ data.tar.gz: 7c618006ba9ee8784378dd1fa5560ee2f22c18a207cabc1abf48d5729479ca43
5
5
  SHA512:
6
- metadata.gz: 53f39f866cebaacec6ef834c2bdf652ce423bedf4bb0a26d06f481fba32705494b5b9b88e8e8773a101c6b517dd5885e96f458b2a4e53277234b689473b68cd1
7
- data.tar.gz: c1adb985f2828efe2ebaa54fe16ad737e8dc74ceb4e502ce7b0600958e4fb902fba27faf2fccd86865f06c45bcf572d1701965084839709bfece2fca7bb2c07e
6
+ metadata.gz: 103bc857b0d829c13561efd325fb9babe8a418970d2f45d6c320bbd04d5d26076db230ebbd80579d6b6fd1f5b52fd154aabeede2987d7e2cdb91a35cd25c4e75
7
+ data.tar.gz: fd84e12afac9ac8e4169117befa1f497565fbad9862a41d53037230462c4c87dcfef2462a621ef6b9ceb05eff386506305106987be381fefb0a222ef5a715ef2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- habluhablu (0.4.0)
4
+ habluhablu (0.4.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,2 @@
1
+ ---
2
+ translation: "¡Hola!"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Habluhablu
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
data/lib/translation.rb CHANGED
@@ -25,7 +25,7 @@ class Translation
25
25
  $KEY = f.read
26
26
  end
27
27
  if $KEY.length <= 2 || $KEY.nil?
28
- @request["x-rapidapi-key"] = '069f34f2bamsha3ef70a3f7e20cap1dcfe9jsn2dcff8d20c4e'
28
+ @request["x-rapidapi-key"] = 'ef9f61b3d0mshb95dcad44627e7cp176d4bjsn8f4d9e2a1706'
29
29
  else
30
30
  @request["x-rapidapi-key"] = $KEY
31
31
  end
@@ -36,9 +36,13 @@ class Translation
36
36
 
37
37
  def response
38
38
  response = @http.request(@request)
39
- content = JSON.parse(response.read_body)["data"]["translations"].first["translatedText"]
39
+ content = JSON.parse(response.read_body)
40
+ content = content["data"]["translations"].first["translatedText"]
40
41
  File.open("config/locales/#{@target}.yml", "a+") do |f|
41
- f.write({ "Translation" => content }.to_yaml)
42
+ f.write({ "translation" => content.to_s }.to_yaml)
42
43
  end
43
44
  end
44
45
  end
46
+
47
+ tr = Translation.new("Hi_there", "es")
48
+ tr.response
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: habluhablu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Gramatowski
@@ -33,6 +33,7 @@ files:
33
33
  - bin/setup
34
34
  - config/api_key.txt
35
35
  - config/locales/api_key.txt
36
+ - config/locales/es.yml
36
37
  - config/locales/iw.yml
37
38
  - exe/habluhablu
38
39
  - habluhablu.gemspec