web_translate_it 1.8.1.2 → 1.8.1.3

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/history.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 1.8.1.3 / 2011-06-24
2
+
3
+ * `wti` now falls back to non-verified SSL connections if SSL verification cannot be done.
4
+
1
5
  ## Version 1.8.1.2 / 2011-06-20
2
6
 
3
7
  * Bug fix: Disable colors when running under MS Windows. #58
@@ -30,18 +30,20 @@ module WebTranslateIt
30
30
  proxy = ENV['http_proxy'] ? URI.parse(ENV['http_proxy']) : OpenStruct.new
31
31
  http = Net::HTTP::Proxy(proxy.host, proxy.port, proxy.user, proxy.password).new('webtranslateit.com', 443)
32
32
  http.use_ssl = true
33
- if RUBY_PLATFORM.downcase.include?("mingw32") # Don’t verify SSL cert for Windows
34
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
35
- else
33
+ http.open_timeout = http.read_timeout = 30
34
+ begin
36
35
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
37
36
  if File.exists?('/etc/ssl/certs') # Ubuntu
38
37
  http.ca_path = '/etc/ssl/certs'
39
38
  else
40
39
  http.ca_file = File.expand_path('cacert.pem', __FILE__)
41
40
  end
41
+ yield http.start
42
+ rescue OpenSSL::SSL::SSLError
43
+ puts "Unable to verify SSL certificate."
44
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
45
+ yield http.start
42
46
  end
43
- http.open_timeout = http.read_timeout = 30
44
- yield http.start
45
47
  end
46
48
 
47
49
  def self.calculate_percentage(processed, total)
data/version.yml CHANGED
@@ -2,4 +2,4 @@
2
2
  :major: 1
3
3
  :minor: 8
4
4
  :tiny: 1
5
- :patch: 2
5
+ :patch: 3
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_translate_it
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 29
4
5
  prerelease: false
5
6
  segments:
6
7
  - 1
7
8
  - 8
8
9
  - 1
9
- - 2
10
- version: 1.8.1.2
10
+ - 3
11
+ version: 1.8.1.3
11
12
  platform: ruby
12
13
  authors:
13
14
  - "\xC3\x89douard Bri\xC3\xA8re"
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2011-06-20 00:00:00 +02:00
19
+ date: 2011-06-24 00:00:00 +02:00
19
20
  default_executable: wti
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
@@ -26,6 +27,7 @@ dependencies:
26
27
  requirements:
27
28
  - - ~>
28
29
  - !ruby/object:Gem::Version
30
+ hash: 23
29
31
  segments:
30
32
  - 1
31
33
  - 1
@@ -41,6 +43,7 @@ dependencies:
41
43
  requirements:
42
44
  - - ~>
43
45
  - !ruby/object:Gem::Version
46
+ hash: 83
44
47
  segments:
45
48
  - 1
46
49
  - 16
@@ -56,6 +59,7 @@ dependencies:
56
59
  requirements:
57
60
  - - ~>
58
61
  - !ruby/object:Gem::Version
62
+ hash: 19
59
63
  segments:
60
64
  - 1
61
65
  - 2
@@ -71,6 +75,7 @@ dependencies:
71
75
  requirements:
72
76
  - - ~>
73
77
  - !ruby/object:Gem::Version
78
+ hash: 21
74
79
  segments:
75
80
  - 1
76
81
  - 2
@@ -86,6 +91,7 @@ dependencies:
86
91
  requirements:
87
92
  - - ">="
88
93
  - !ruby/object:Gem::Version
94
+ hash: 23
89
95
  segments:
90
96
  - 2
91
97
  - 6
@@ -107,7 +113,6 @@ files:
107
113
  - licence
108
114
  - readme.md
109
115
  - version.yml
110
- - examples/en.yml
111
116
  - examples/locale.rb
112
117
  - examples/translation.yml
113
118
  - lib/web_translate_it/auto_fetch.rb
@@ -150,6 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
155
  requirements:
151
156
  - - ">="
152
157
  - !ruby/object:Gem::Version
158
+ hash: 3
153
159
  segments:
154
160
  - 0
155
161
  version: "0"
@@ -158,6 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
164
  requirements:
159
165
  - - ">="
160
166
  - !ruby/object:Gem::Version
167
+ hash: 3
161
168
  segments:
162
169
  - 0
163
170
  version: "0"
data/examples/en.yml DELETED
@@ -1,43 +0,0 @@
1
- fr:
2
- activerecord:
3
- errors:
4
- models:
5
- invitation:
6
- attributes:
7
- email:
8
- user_already_invited: "This user has already been invited"
9
- user_already_member: "This user is already a member"
10
- project_file:
11
- attributes:
12
- file:
13
- file_format_not_supported: "Sorry, we currenly support only Gettext .pot/.po, .yml/.yaml and .strings"
14
- templates:
15
- header:
16
- body: "there were problems with the following fields:"
17
- messages:
18
- accepted: "must be accepted"
19
- blank: "can't be blank"
20
- confirmation: "doesn't match confirmation"
21
- empty: "can't be empty"
22
- equal_to: "must be equal to {{count}}"
23
- even: "must be even"
24
- exclusion: "is reserved"
25
- greater_than: "must be greater than {{count}}"
26
- greater_than_or_equal_to: "must be greater than or equal to {{count}}"
27
- inclusion: "is not included in the list"
28
- invalid: "is invalid"
29
- less_than: "must be less than {{count}}"
30
- less_than_or_equal_to: "must be less than or equal to {{count}}"
31
- not_a_number: "is not a number"
32
- odd: "must be odd"
33
- taken: "is already taken"
34
- too_long: "is too long (maximum is {{count}} characters)"
35
- too_short: "is too short (minimum is {{count}} characters)"
36
- wrong_length: "is the wrong length (should be {{count}} characters)"
37
- one: "1 error prohibited this {{model}} from being saved"
38
- other: "{{count}} errors prohibited this {{model}} from being saved"
39
- another_one: dskjdks
40
- another_string: "this is another string"
41
- hello: "Hello world!!"
42
- new_string: hehe
43
- test: " & & "