service_jynx 0.0.1 → 0.0.2
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/.travis.yml +9 -0
- data/Gemfile +2 -0
- data/README.md +17 -10
- data/Rakefile +10 -0
- data/lib/service_jynx/version.rb +1 -1
- data/lib/service_jynx.rb +1 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c009a39d4d2e7c6cc7def699c51e36dbf5c3afd
|
4
|
+
data.tar.gz: 17f338eda74d45838774899c5091e96dfb07e579
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 847b210f597317a88396ce42468b4c313c6b9207dedfe1f94888fa05e31aa2431f7496b528d2f52e319d14c06ddf482f09f4bd1749bd9f7c20943ca262e1201d
|
7
|
+
data.tar.gz: 0f98d7d2ed5d9a1068c66856d51779b8f8b4119753a8bd30418b56c0ab6d035bb84ec294a2fbfe26d458f24fb365032007087b725140705c4c338087f5d56703
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# Service-Jynx
|
2
|
+
[](http://travis-ci.org/AvnerCohen/service-jynx)
|
2
3
|
|
3
4
|
Eurasian Wryneck - ***Jynx torquilla***
|
4
5
|
|
@@ -6,21 +7,27 @@ Eurasian Wryneck - ***Jynx torquilla***
|
|
6
7
|
|
7
8
|
**Jinx** - ***A condition or period of bad luck that appears to have been caused by a specific person or thing.***
|
8
9
|
|
9
|
-
A simple
|
10
|
+
A simple solution, to allow a Ruby application to manage automatic failover and block calls to an external service and return a stubbed data when service is reported as down.
|
10
11
|
|
11
|
-
The code is MRI depended and is not thread safe, is is also designed specifically to run on a single VM and manage in memory hashes of data, though it can very well be executed with an external shared persistance counters such as, say, Redis.
|
12
|
+
The code is MRI depended and is not thread safe(!), is is also designed specifically to run on a single VM and manage in memory hashes of data, though it can very well be executed with an external shared persistance counters such as, say, Redis.
|
12
13
|
|
13
14
|
|
14
15
|
````ruby
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
17
|
+
def index
|
18
|
+
begin
|
19
|
+
response = {countery: "Israel"}
|
20
|
+
if ServiceJynx.alive?("inbox")
|
21
|
+
response = {countery: HTTParty.get("https://api.github.com/users/AvnerCohen", :timeout => 20)["location"]}
|
22
|
+
else
|
23
|
+
response.merge!({error: "service down ! #{__method__}"})
|
24
|
+
end
|
25
|
+
rescue Exception => e
|
26
|
+
ServiceJynx.failure!("inbox")
|
27
|
+
response.merge!({error: "exception occured, #{__method__}"})
|
28
|
+
ensure
|
29
|
+
render json: response.to_json and return
|
30
|
+
end
|
24
31
|
end
|
25
32
|
|
26
33
|
````
|
data/Rakefile
ADDED
data/lib/service_jynx/version.rb
CHANGED
data/lib/service_jynx.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: service_jynx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Avner Cohen
|
@@ -21,9 +21,11 @@ files:
|
|
21
21
|
- .gitignore
|
22
22
|
- .ruby-gemset
|
23
23
|
- .ruby-version
|
24
|
+
- .travis.yml
|
24
25
|
- Gemfile
|
25
26
|
- LICENSE.txt
|
26
27
|
- README.md
|
28
|
+
- Rakefile
|
27
29
|
- jynx.jpg
|
28
30
|
- lib/logger_jynx.rb
|
29
31
|
- lib/service_jynx.rb
|