peek-vars 1.0.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: efd6014169bb0049da336900490d4fdd8c40da7e
4
+ data.tar.gz: ec8f5663a3b413a1c4086cf02733a371aa4e47be
5
+ SHA512:
6
+ metadata.gz: 4ca39ba6f225d2182db38f1ae9d2bf96198eaed468138f497e55446faa1e3d6ac7b44a0259f6b6dc40bb7c5e8004c0a1773e628d3e27c1a09b5265649434ce52
7
+ data.tar.gz: 55a86e687ac3bb25dba81d1ed3c31c538184f59eb38e9a6464293926b4fe74114091d540c9d614302ea0dceabf696509b8cb6f16a20b8b2d831ed449e4d56519
@@ -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
2
+
3
+ - Initial release
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,33 @@
1
+ # Peek::Vars
2
+
3
+ Take a peek into the custom vars of your Rails application.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'peek-vars'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install peek-vars
18
+
19
+ ## Usage
20
+
21
+ Add the following to your `config/initializers/peek.rb`:
22
+
23
+ ```ruby
24
+ Peek.into Peek::Views::Vars var1: 123, var2: -> { Time.current }
25
+ ```
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,10 @@
1
+ <% view.vars.each do |k, v| %>
2
+ <div class="bucket">
3
+ <span class="css-truncate expandable">
4
+ <span class="css-truncate-target">
5
+ <strong><%= k %></strong>: <%= v %>
6
+ </span>
7
+ </span>
8
+ </div>
9
+ <% end %>
10
+ vars
@@ -0,0 +1,3 @@
1
+ require 'peek/views/vars'
2
+ require 'peek-vars/version'
3
+ require 'peek-vars/railtie'
@@ -0,0 +1,6 @@
1
+ module Peek
2
+ module Vars
3
+ class Railtie < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Peek
2
+ module Vars
3
+ VERSION = '1.0.0'
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ module Peek
2
+ module Views
3
+ class Vars < View
4
+ def initialize(options = {})
5
+ @vars = options
6
+ end
7
+
8
+ def vars
9
+ Hash[@vars.map { |k, v| [k, v.respond_to?(:call) ? v.call : v ] }]
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'peek-vars/version'
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = 'peek-vars'
7
+ gem.version = Peek::Vars::VERSION
8
+ gem.authors = ['Stanislav Fesenko']
9
+ gem.email = ['iamdeuterium@gmail.com']
10
+ gem.description = 'Take a peek into the custom vars of your Rails application.'
11
+ gem.summary = 'Take a peek into the custom vars of your Rails application.'
12
+ gem.homepage = 'https://github.com/iamdeuterium/peek-vars'
13
+
14
+ gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
15
+ gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
16
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
+ gem.require_paths = ['lib']
18
+
19
+ gem.add_dependency 'peek'
20
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: peek-vars
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Stanislav Fesenko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-20 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
+ description: Take a peek into the custom vars of your Rails application.
28
+ email:
29
+ - iamdeuterium@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - CHANGELOG.md
36
+ - Gemfile
37
+ - LICENSE.txt
38
+ - README.md
39
+ - Rakefile
40
+ - app/views/peek/views/_vars.html.erb
41
+ - lib/peek-vars.rb
42
+ - lib/peek-vars/railtie.rb
43
+ - lib/peek-vars/version.rb
44
+ - lib/peek/views/vars.rb
45
+ - peek-vars.gemspec
46
+ homepage: https://github.com/iamdeuterium/peek-vars
47
+ licenses: []
48
+ metadata: {}
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubyforge_project:
65
+ rubygems_version: 2.6.4
66
+ signing_key:
67
+ specification_version: 4
68
+ summary: Take a peek into the custom vars of your Rails application.
69
+ test_files: []
70
+ has_rdoc: