txgh 5.0.0 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fefc92295bf9e5460cce6c06f8f849f79efd567f
4
- data.tar.gz: 92bce889063a906f1a462c5cef402fbd52892802
3
+ metadata.gz: 165b2501e313014a2fd9e0103d08a3ebd4799673
4
+ data.tar.gz: 0a44161e943e917a9a100515e6f4b4bfb2336df8
5
5
  SHA512:
6
- metadata.gz: f633fc680b9e5b37676b0cb5e3b9c0425fd3f7f45eb6a666f9d2f9d97d89d4047ae5712f1c9612e41cfcf1b067e022d23e68bbc9a2d02987d20e5722fcd068ae
7
- data.tar.gz: e79103fdac87e6ba1a03172932c988acafddb8b4f11060a0e25d19a3df7985f65f9a77d72074a1029e9a2a2c0c2159f7ffc19cedfbf80cab6131194072db6436
6
+ metadata.gz: f6e04ae04fd22e0007a272821f7a7a861678117c2ec19cc6402ffad054d1ede439511608bee093c0d39e9d2c4a9e353be14840773b59bd0ee35346d066b667ba
7
+ data.tar.gz: 658d4e3a4c6cfe4ef831895e9e0c9568b1f123d7212e324cd14e27a2928e3bcad11b2af7b2ecfa504f05699d9b120126b6dcc66e1085c7730422229692674106
data/lib/txgh/app.rb CHANGED
@@ -12,7 +12,12 @@ module Txgh
12
12
  response.headers.merge!(resp.headers)
13
13
 
14
14
  stream do |out|
15
- resp.write_to(out)
15
+ begin
16
+ resp.write_to(out)
17
+ rescue => e
18
+ Txgh.events.publish_error(e)
19
+ raise e
20
+ end
16
21
  end
17
22
  else
18
23
  status resp.status
@@ -1,4 +1,3 @@
1
- require 'erb'
2
1
  require 'etc'
3
2
  require 'yaml'
4
3
 
@@ -26,6 +25,14 @@ module Txgh
26
25
  ConfigPair.new(project_config, repo_config)
27
26
  end
28
27
 
28
+ def project_names
29
+ base_config['transifex']['projects'].keys
30
+ end
31
+
32
+ def repo_names
33
+ base_config['github']['repos'].keys
34
+ end
35
+
29
36
  private
30
37
 
31
38
  def raw_config
data/lib/txgh/events.rb CHANGED
@@ -24,8 +24,6 @@ module Txgh
24
24
  channel_hash.keys
25
25
  end
26
26
 
27
- private
28
-
29
27
  def publish_error(e)
30
28
  # if nobody has subscribed to error events, raise original error
31
29
  callbacks = channel_hash.fetch(ERROR_CHANNEL) { raise e }
data/lib/txgh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Txgh
2
- VERSION = '5.0.0'
2
+ VERSION = '5.1.0'
3
3
  end
@@ -79,4 +79,16 @@ describe KeyManager do
79
79
  expect(config.repo_config).to eq(repo_config)
80
80
  end
81
81
  end
82
+
83
+ describe '#project_names' do
84
+ it "gets an array of all the configured project's names" do
85
+ expect(KeyManager.project_names).to eq([project_name])
86
+ end
87
+ end
88
+
89
+ describe '#repo_names' do
90
+ it "gets an array of all the configured repo's names" do
91
+ expect(KeyManager.repo_names).to eq([repo_name])
92
+ end
93
+ end
82
94
  end
data/spec/events_spec.rb CHANGED
@@ -42,4 +42,14 @@ describe Events do
42
42
  expect { events.publish('foo.bar') }.to raise_error('jelly beans')
43
43
  end
44
44
  end
45
+
46
+ describe '#publish_error' do
47
+ it 'publishes the given error over the error channel' do
48
+ errors = []
49
+ events.subscribe('errors') { |e| errors << e }
50
+ events.publish_error(begin; raise 'foo'; rescue => e; e; end)
51
+ expect(errors.size).to eq(1)
52
+ expect(errors.first.message).to eq('foo')
53
+ end
54
+ end
45
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txgh
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Jackowski
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-08 00:00:00.000000000 Z
12
+ date: 2016-06-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: abroad