peek-env_vars 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .ruby-version
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ### v1.0.0, Unreleased
4
+
5
+ Initial release
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+
3
+ gemspec
@@ -0,0 +1,40 @@
1
+ # Peek::Git
2
+
3
+ Take a peek into the ENV vars used by your Rails application.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'peek-env_vars'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install peek-env_Vars
18
+
19
+ ## Usage
20
+
21
+ Add the following to your `config/initializers/peek.rb`:
22
+
23
+ ```ruby
24
+ Peek.into Peek::Views::EnvVars
25
+ ```
26
+
27
+ You will need to list the ENV vars you wish to display.
28
+
29
+ ```ruby
30
+ # nwo - name with owner - owner/name
31
+ Peek.into Peek::Views::EnvVars, :names => %w(RAILS_ENV DB_HOST HOSTNAME)
32
+ ```
33
+
34
+ ## Contributing
35
+
36
+ 1. Fork it
37
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
38
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
39
+ 4. Push to the branch (`git push origin my-new-feature`)
40
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,3 @@
1
+ <div class="bucket">
2
+ <%= view %>
3
+ </div>
@@ -0,0 +1,3 @@
1
+ require 'peek/views/env_vars'
2
+ require 'peek-env_vars/version'
3
+ require 'peek-env_vars/railtie'
@@ -0,0 +1,6 @@
1
+ module Peek
2
+ module EnvVars
3
+ class Railtie < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Peek
2
+ module EnvVars
3
+ VERSION = '1.0.0'
4
+ end
5
+ end
@@ -0,0 +1,19 @@
1
+ module Peek
2
+ module Views
3
+ class EnvVars < View
4
+ def initialize(options = {})
5
+ @names = options.delete(:names) || %w(RAILS_ENV HOSTNAME)
6
+ @format = options.delete(:format) || "%{k}: %{v}"
7
+ @join = options.delete(:join) || ', '
8
+ end
9
+
10
+ def env_vars
11
+ @env_vars ||= ENV.reject { |k, v| !@names.include?(k) }
12
+ end
13
+
14
+ def to_s
15
+ @s ||= env_vars.map { |k, v| @format % {k: k, v: v} }.join(@join)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'peek-env_vars/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = 'peek-env_vars'
8
+ gem.version = Peek::EnvVars::VERSION
9
+ gem.authors = ['locochris']
10
+ gem.description = %q{Take a peek into the ENV vars of your Rails application.}
11
+ gem.summary = %q{Take a peek into the ENV vars of your Rails application.}
12
+ gem.homepage = 'https://github.com/locochris/peek-env_vars'
13
+
14
+ gem.files = `git ls-files`.split($/)
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,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: peek-env_vars
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - locochris
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-05-30 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: peek
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: Take a peek into the ENV vars of your Rails application.
31
+ email:
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - .gitignore
37
+ - CHANGELOG.md
38
+ - Gemfile
39
+ - README.md
40
+ - Rakefile
41
+ - app/views/peek/views/_env_vars.html.erb
42
+ - lib/peek-env_vars.rb
43
+ - lib/peek-env_vars/railtie.rb
44
+ - lib/peek-env_vars/version.rb
45
+ - lib/peek/views/env_vars.rb
46
+ - peek-env_vars.gemspec
47
+ homepage: https://github.com/locochris/peek-env_vars
48
+ licenses: []
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ segments:
60
+ - 0
61
+ hash: 2130601988048937263
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ segments:
69
+ - 0
70
+ hash: 2130601988048937263
71
+ requirements: []
72
+ rubyforge_project:
73
+ rubygems_version: 1.8.25
74
+ signing_key:
75
+ specification_version: 3
76
+ summary: Take a peek into the ENV vars of your Rails application.
77
+ test_files: []