peek-flexirest 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 669d3d02abcffe47ce5ad77f63e72aabc8832035
4
+ data.tar.gz: 2b5da766daaf1140249cea866dcbe58950dcf4ae
5
+ SHA512:
6
+ metadata.gz: 611622f123d17d9967d951a1c3fd0f2f9aa812374d666fd997dc5717c514bbffa4cf0686ac90ed4fdcf17657f733f6c89d249ec16b8120683df55844b6a8b1e2
7
+ data.tar.gz: d8d2f73b88e2d018add72d57470f88ef9b14e4a33e23047e10b28a514c61d5d2ae49b55ae2338adb56d1e3767067bb6734c3f5bcec574c56fda899f76d3df141
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -0,0 +1,3 @@
1
+ # 1.0.0
2
+
3
+ - Initial release.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in peek-flexirest.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Garrett Bjerkhoel
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,53 @@
1
+ # Peek::Flexirest
2
+
3
+ Take a peek into the Flexirest API calls made during your application's requests.
4
+
5
+ Things this peek view provides:
6
+
7
+ - Total number of API commands called during the request
8
+ - The duration of the commands made during the request
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ gem 'peek-flexirest'
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install peek-flexirest
23
+
24
+ ## Usage
25
+
26
+ Add the following to your `config/initializers/peek.rb`:
27
+
28
+ ```ruby
29
+ Peek.into Peek::Views::Flexirest
30
+ ```
31
+
32
+ There is an additional JavaScript file peek-flexirest provides that gives
33
+ additional information about the requests Flexirest makes during the request:
34
+
35
+ - Reads
36
+ - Misses
37
+ - Writes
38
+ # TODO: What can be here?
39
+
40
+ Include the `peek/views/flexirest` JavaScript file in your application:
41
+
42
+ ```coffeescript
43
+ #= require peek
44
+ #= require peek/views/flexirest
45
+ ```
46
+
47
+ ## Contributing
48
+
49
+ 1. Fork it
50
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
51
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
52
+ 4. Push to the branch (`git push origin my-new-feature`)
53
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,12 @@
1
+ $(document).on 'peek:render', (event, requestId, data) ->
2
+ title = []
3
+ title.push("Reads: #{data.context.flexirest.reads}")
4
+ title.push("Misses: #{data.context.flexirest.misses}")
5
+ title.push("Writes: #{data.context.flexirest.writes}")
6
+ title.push("Other: #{data.context.flexirest.others}")
7
+
8
+ $('#peek-flexirest-tooltip')
9
+ .attr('title', title.join('<br>'))
10
+ .tipsy
11
+ html: true
12
+ gravity: $.fn.tipsy.autoNS
@@ -0,0 +1,5 @@
1
+ <strong>
2
+ <span id="peek-flexirest-tooltip">
3
+ <span data-defer-to="<%= view.defer_key %>-duration">...</span> / <span data-defer-to="<%= view.defer_key %>-calls">...</span>
4
+ </span>
5
+ </strong> flexirest
@@ -0,0 +1,3 @@
1
+ require 'peek-flexirest/version'
2
+ require 'peek/views/flexirest'
3
+ require 'peek-flexirest/railtie'
@@ -0,0 +1,6 @@
1
+ module Peek
2
+ module Flexirest
3
+ class Railtie < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Peek
2
+ module Flexirest
3
+ VERSION = '1.0.0'
4
+ end
5
+ end
@@ -0,0 +1,24 @@
1
+ require 'flexirest'
2
+
3
+ module Peek
4
+ module Views
5
+ class Flexirest < View
6
+ def initialize(options = {})
7
+ # Nothing needing doing...
8
+ end
9
+
10
+ def formatted_duration
11
+ ms = ::Flexirest::Instrumentation.time_spent
12
+ "%.0fms" % ms
13
+ end
14
+
15
+ def results
16
+ {
17
+ :duration => formatted_duration,
18
+ :calls => ::Flexirest::Instrumentation.calls_made,
19
+ }
20
+ end
21
+
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'peek-flexirest/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = 'peek-flexirest'
8
+ gem.version = Peek::Flexirest::VERSION
9
+ gem.authors = ['Andy Jeffries']
10
+ gem.email = ['andy@andyjeffries.co.uk']
11
+ gem.description = %q{Take a peek into the Flexirest API calls made during your application's requests.}
12
+ gem.summary = %q{Take a peek into the Flexirest API calls made during your application's requests.}
13
+ gem.homepage = 'https://github.com/andyjeffries/peek-flexirest'
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ['lib']
19
+
20
+ gem.add_dependency 'peek'
21
+ gem.add_dependency 'flexirest'
22
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: peek-flexirest
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Andy Jeffries
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: peek
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: flexirest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Take a peek into the Flexirest API calls made during your application's
42
+ requests.
43
+ email:
44
+ - andy@andyjeffries.co.uk
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - CHANGELOG.md
51
+ - Gemfile
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - app/assets/javascripts/peek/views/flexirest.coffee
56
+ - app/views/peek/views/_flexirest.html.erb
57
+ - lib/peek-flexirest.rb
58
+ - lib/peek-flexirest/railtie.rb
59
+ - lib/peek-flexirest/version.rb
60
+ - lib/peek/views/flexirest.rb
61
+ - peek-flexirest.gemspec
62
+ homepage: https://github.com/andyjeffries/peek-flexirest
63
+ licenses: []
64
+ metadata: {}
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 2.5.1
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: Take a peek into the Flexirest API calls made during your application's requests.
85
+ test_files: []