fragment_client 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/fragment_client.rb +5 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1c1d458d625afad36e7931d2bda171aa6064d3d
4
- data.tar.gz: 81c9be211e144ddb2a07d520de834a9bac7964d1
3
+ metadata.gz: cdc59ddf16fbdaceca9a66c33b7720698fe20e20
4
+ data.tar.gz: bcd39fa7e8dc09fd03f66c1bba682ca6a3364c92
5
5
  SHA512:
6
- metadata.gz: 64835b4471eeaf7c32871b8ee4ab40801114f7215fd2c707cc18fe54754c3a2e2c0e16da0f6b68627f884c5dab01264ee99df7d97f8cd4f14d2c6aa6f17a596c
7
- data.tar.gz: 8cdb8051c830a46a872c19fef5ade1d72b22d00acfe1b63ec458cf2f5ee49c3c65331b9c5de253f4da0d09ccab90c52cc6228e5db3e29e977dbe597651e7d799
6
+ metadata.gz: 4b5b240fe1aa2d962bfcc686624a86df2ef38ad39475f86a598504e77d4e0785d48b9e509babb9ee4c75a6db5777d38360dcb3a2c612d2edb7384f1336f7ac41
7
+ data.tar.gz: f9f559cc1c0567ee902a4af051917ec77ce7374d334fc4abcd92cc9c6ed23d637adb913c06b19415bfd103a507ba03dcb8a75fc19b00014b3f6b3f522638f3e8
data/README.md CHANGED
@@ -5,7 +5,7 @@ A Ruby gem that provides an interface to the fragment_server for easy use in web
5
5
  The fragment client provides an easy method to fetch snippets of markup from the fragment server. E.G.
6
6
 
7
7
  ```ruby
8
- client = FragmentClient.new
8
+ client = FragmentClient.new('app_name')
9
9
  client.fetch('footer')
10
10
  client.fetch('navigation', options)
11
11
  ```
@@ -24,4 +24,4 @@ client.fetch('navigation', options)
24
24
 
25
25
  ##Caching
26
26
 
27
- Caching is achieved by The fragment client attempts to cache responses wherever possible.
27
+ The fragment client attempts to cache responses wherever possible.
@@ -3,10 +3,12 @@ require 'memory_cache'
3
3
  require 'net/http'
4
4
 
5
5
  class FragmentClient
6
- attr_accessor :fragment_server_url, :option_params, :cache, :logger
6
+ attr_accessor :app_name, :fragment_server_url, :option_params, :cache, :logger
7
+
7
8
  DEFAULT_URL = 'http://test-eva-fragment-server.herokuapp.com/fragments/full.json?'
8
9
 
9
- def initialize(fragment_server_url=DEFAULT_URL, cache=MemoryCache.new, logger=default_logger)
10
+ def initialize(app_name, fragment_server_url=DEFAULT_URL, cache=MemoryCache.new, logger=default_logger)
11
+ self.app_name = app_name
10
12
  self.fragment_server_url = fragment_server_url
11
13
  self.cache = cache
12
14
  self.logger = logger
@@ -37,7 +39,7 @@ class FragmentClient
37
39
  end
38
40
 
39
41
  def default_options
40
- { has_login: true, logged_in: false, logo: 'red'}
42
+ { has_login: true, logged_in: false, logo: 'red', app:app_name}
41
43
  end
42
44
 
43
45
  def request
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fragment_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Atkinson