termit 2.11.2 → 2.12.0
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 +4 -4
- data/README.md +20 -3
- data/lib/termit/data_fetcher.rb +4 -0
- data/lib/termit/suppress_warnings.rb +9 -0
- data/lib/termit/version.rb +1 -1
- data/lib/termit.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e075ba37fe770128b167d0abd852d14aee4e02e6
|
4
|
+
data.tar.gz: d2dbc52fb9bf43d989b10a4d7a29dc5803b9e465
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30383a79af0f3f5f3c68a8c18369491900ef52f0b2e44459443d6f55e996e85ead16ac6cbc6669d4ec986285a05bf00a71e3539291410433ea99e52929b5075a
|
7
|
+
data.tar.gz: a8b8902566927731f1e548d0efc867f7d38ac8ee58b7cd487862f910f28949521e57810fe60ba0626ea37463b32d2fb9bd7220a8823025b2668afb21538a0f51
|
data/README.md
CHANGED
@@ -52,19 +52,36 @@ termit es en muchacho -s
|
|
52
52
|
=> Synonyms: boy, lad, youngster, laddie, cully
|
53
53
|
```
|
54
54
|
|
55
|
-
#### Learning language when committing to git
|
56
|
-
|
55
|
+
#### Learning language when committing to git
|
56
|
+
|
57
|
+
Idea by [Nedomas](https://news.ycombinator.com/item?id=7545747). See and hear your messages translated to target lang every time you commit. You can do this two ways: overriding the `git` command, and using a post-commit hook in git.
|
58
|
+
|
59
|
+
##### Override the `git` command (zsh only)
|
57
60
|
|
58
61
|
In **~/.zshrc**
|
59
|
-
|
62
|
+
|
63
|
+
``` bash
|
60
64
|
export LANG=es
|
61
65
|
git(){[[ "$@" = commit\ -m* ]]&&termit en $LANG ${${@:$#}//./} -t;command git $@}
|
62
66
|
```
|
63
67
|
|
64
68
|
I am no shell ninja so if you know how to make it work in bash then please submit a PR.
|
65
69
|
|
70
|
+
##### Using a post-commit hook
|
71
|
+
|
72
|
+
Add a file named `post-commit` to your project's `.git/hooks` directory, with this in it:
|
73
|
+
|
74
|
+
```bash
|
75
|
+
termit en es "`git log -1 --pretty=format:'%s'`" -t
|
76
|
+
```
|
77
|
+
|
78
|
+
Remember to switch the languages according to your preference.
|
79
|
+
|
80
|
+
If you want this to be in every one of your git repositories, see [this Stack Overflow answer](http://stackoverflow.com/a/8842663/249801).
|
81
|
+
|
66
82
|
|
67
83
|
## Language codes:
|
84
|
+
|
68
85
|
* english - en
|
69
86
|
* polish - pl
|
70
87
|
* french - fr
|
data/lib/termit/data_fetcher.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
#encoding: UTF-8
|
2
2
|
require 'net/http'
|
3
3
|
require 'uri'
|
4
|
+
require 'openssl'
|
4
5
|
|
5
6
|
module Termit
|
6
7
|
class DataFetcher
|
7
8
|
include CanOutput
|
8
9
|
delegate :display_no_internet_msg, to: :output_manager
|
10
|
+
silence_warnings do
|
11
|
+
::OpenSSL::SSL::VERIFY_PEER = ::OpenSSL::SSL::VERIFY_NONE
|
12
|
+
end
|
9
13
|
|
10
14
|
def initialize url, text
|
11
15
|
@url = url
|
data/lib/termit/version.rb
CHANGED
data/lib/termit.rb
CHANGED
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.
|
4
|
+
version: 2.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: delegate_it
|
@@ -132,6 +132,7 @@ files:
|
|
132
132
|
- lib/termit/output_manager.rb
|
133
133
|
- lib/termit/sound_response_handler.rb
|
134
134
|
- lib/termit/speech_synthesizer.rb
|
135
|
+
- lib/termit/suppress_warnings.rb
|
135
136
|
- lib/termit/text_response_handler.rb
|
136
137
|
- lib/termit/text_translator.rb
|
137
138
|
- lib/termit/url_constructor.rb
|