termit 2.0.7 → 2.0.8

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
  SHA1:
3
- metadata.gz: d4becac03cd5e109044a37c71df52b8e39d4a4d9
4
- data.tar.gz: 4b95288ab909020a7b9c7ff7eee0c532a559b9b5
3
+ metadata.gz: 44368384e1b8390999961489ef0583787eee15d6
4
+ data.tar.gz: 14f6149d0e2b337739ffb2f91cb21ef5d2fded7b
5
5
  SHA512:
6
- metadata.gz: a8c5561b329efce00848eb9297023509f2c0a6b5cb7941ac0a68fcfaae3c3ae6a9235c176e330c94ec55f2020a00a0a163fc2b93d525a26feaf4a1de754a95b2
7
- data.tar.gz: afef69c8a1675e489bf84c56ccb705e4796a566da8c56bc702024430cd759fd13286d41090a1af820826fe54b50ce1ac29c48c087677c10ae5fa654352fbfeae
6
+ metadata.gz: 030786d93bf26c4053a1fd2c7b9fd3390f305af1c736fac622ae3771660963758068650f9e25f13f94be4cb8cea68f97c7182d54dbce903bdeb28dff1632ee35
7
+ data.tar.gz: 23ac51c985d5932e53a76e54b3d913eee478513177cda6addf02043066d468a04b11a10120a42cbd522e862c55e284eae3feef5e59370c957013de6b6e58930b
data/.gitignore CHANGED
@@ -2,3 +2,4 @@ Gemfile.lock
2
2
  .ruby-version
3
3
  pkg/
4
4
  *.gem
5
+ coverage/
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- #Termit [![Build Status](https://travis-ci.org/pawurb/termit.png)](https://travis-ci.org/pawurb/termit) [![Gem Version](https://badge.fury.io/rb/termit.png)](http://badge.fury.io/rb/termit)
1
+ #Termit [![Build Status](https://travis-ci.org/pawurb/termit.png)](https://travis-ci.org/pawurb/termit) [![Gem Version](https://badge.fury.io/rb/termit.png)](http://badge.fury.io/rb/termit) [![Coverage Status](https://coveralls.io/repos/pawurb/termit/badge.png)](https://coveralls.io/r/pawurb/termit)
2
2
 
3
3
 
4
4
  Termit is an easy way to use Google Translate in your terminal.
@@ -78,9 +78,10 @@ For MacOSX:
78
78
 
79
79
  This is my first open-source project for people to use. Any feedback will be appreciated.
80
80
 
81
+ Currently I am available for hire as a rails developer and willing to relocate.
82
+
81
83
  You can contact me on: p.urbanek89@gmail.com
82
84
 
83
- Btw. I am looking for a job as a rails developer now and I am willing to relocate.
84
85
 
85
86
 
86
87
 
data/bin/termit CHANGED
@@ -5,7 +5,12 @@ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib') unless $LOAD_PATH.include
5
5
 
6
6
  require 'termit'
7
7
 
8
- options = Termit::UserInputParser.new(ARGV).options
9
- Termit::Main.new(options).translate
8
+ begin
9
+ options = Termit::UserInputParser.new(ARGV).options
10
+ Termit::Main.new(options).translate
11
+ rescue Interrupt
12
+ STDERR.puts "\nTermit: exiting due to user request"
13
+ exit 130
14
+ end
10
15
 
11
16
 
@@ -2,7 +2,7 @@
2
2
  module Termit
3
3
  class OutputManager
4
4
  def display_error_info_and_quit
5
- puts "TERMIT: Wrong data. Example: 'termit en es the cowboy ' => 'el vaquero'"
5
+ puts "TERMIT: Wrong data. Example: 'termit en es the cowboy' => 'el vaquero'"
6
6
  exit
7
7
  end
8
8
 
@@ -26,7 +26,7 @@ module Termit
26
26
  def extract_synonyms
27
27
  synonyms_data = @text.split("[[")[2].split("[")[1]
28
28
  length = synonyms_data.length
29
- if synonyms_data[0] == '4' # my code works i have no idea why ..
29
+ if synonyms_data[0] == '4' #there are no synonyms
30
30
  " ---"
31
31
  else
32
32
  synonyms_data[0..(length-3)].delete("\"").gsub(/(,)/, ", ")
@@ -1,3 +1,3 @@
1
1
  module Termit
2
- VERSION = "2.0.7"
2
+ VERSION = "2.0.8"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -2,6 +2,8 @@ require 'rubygems'
2
2
  require 'bundler/setup'
3
3
  require 'vcr'
4
4
  require 'webmock/rspec'
5
+ require 'coveralls'
6
+ Coveralls.wear!
5
7
 
6
8
  require_relative '../lib/termit'
7
9
 
@@ -3,10 +3,13 @@ require 'spec_helper'
3
3
 
4
4
  describe Termit::SoundResponseHandler do
5
5
  describe "call method" do
6
- it "should save the sound file" do
7
- end
6
+ subject { Termit::SoundResponseHandler.new('tralala') }
7
+ let(:location) { "#{File.expand_path('~')}/.termit" }
8
8
 
9
- it "should play the file" do
9
+ it "saves and plays the sound file the sound file" do
10
+ File.should_receive(:open).with("#{location}/sound_response.mpeg", "wb")
11
+ Object.any_instance.should_receive(:system).with("mpg123 -q #{location}/sound_response.mpeg")
12
+ subject.call
10
13
  end
11
14
  end
12
15
  end
data/termit.gemspec CHANGED
@@ -20,4 +20,5 @@ Gem::Specification.new do |gem|
20
20
  gem.add_development_dependency "vcr", '~> 2.5.0'
21
21
  gem.add_development_dependency "webmock", '~> 1.12.0'
22
22
  gem.add_development_dependency "rake"
23
+ gem.add_development_dependency "coveralls"
23
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-26 00:00:00.000000000 Z
11
+ date: 2013-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: ' Termit is an easy way to use all the Google Translate goodies straight
70
84
  from your terminal. '
71
85
  email: