cf_light_api 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sinatra/cf_light_api.rb +11 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55007b1bca390e4d2ee89d8afd70ab07afac0198
4
- data.tar.gz: 5985fa004f7a49c1a72b9ee119206e871ecab1e7
3
+ metadata.gz: 5bcd3166f605b10f0496e667048307fb34ce2cb7
4
+ data.tar.gz: b0c320842105320be24776c457e45b43247cb935
5
5
  SHA512:
6
- metadata.gz: a78ea8ca53b2774edbd4bede5264a408088c3a514c81e5114386c1b52b7adf613568c514f94ef978d2c6a90797083769229d2ba5c7f1975c470de86abaa45f69
7
- data.tar.gz: cd31210e3cffc3b61cafbca46afb4312225a177f9575b03623118e6d66a73ba71160a7fd35a65f6906d3a7c931ef9aa72f58b0ebb5c79d878b307e89ab981a54
6
+ metadata.gz: 3ff4ea5b937391e1d671316f1baeffb63ba99f8f2405b9634d55c5e4a388dab6405f8e06ac9463dd7dc5ec2529e7a1cfe1d63d76ed56180e3ce4d4cb02f6a314
7
+ data.tar.gz: 18bdd4b0ea8563b7ee1916bcc8f398cd5f1f6e9c7cdaaa1c73916802459f7ee1ae2b21bdc1cc22b035fd657f2c47a9eb7431d6b96f8caffccc64ce4fda925591
@@ -1,10 +1,19 @@
1
+ require 'json'
2
+
1
3
  module Sinatra
2
4
  module CfLightAPI
3
5
 
4
6
  def self.registered(app)
5
- app.get '/v1/apps/?' do
7
+ app.get '/v1/apps/?:org?' do
8
+ all_apps = JSON.parse(REDIS.get("#{ENV['REDIS_KEY_PREFIX']}:apps"))
9
+
6
10
  content_type :json
7
- REDIS.get "#{ENV['REDIS_KEY_PREFIX']}:apps"
11
+
12
+ if params[:org]
13
+ return all_apps.select{|an_app| an_app['org'] == params[:org]}.to_json
14
+ end
15
+
16
+ return all_apps.to_json
8
17
  end
9
18
 
10
19
  app.get '/v1/orgs/?' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf_light_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Springer Platform Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-10 00:00:00.000000000 Z
11
+ date: 2015-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cfoundry