vatcher 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bd8b0990155d729617562626d085c480e36ad9238c814b3401e5c1f1c1e5145e
4
+ data.tar.gz: a21ee731939f6116b812060c494f213dd06f263cdfd51cf7faeefd29a6716a84
5
+ SHA512:
6
+ metadata.gz: fd413990b2e5a77daa4bc856a684098c3fe5b62a66494a9c833e039e7e13ecb8d9d8aff4ab413bd39b9e899d35d7eb091c681770308a337dbbe5f010115157fa
7
+ data.tar.gz: 5952754b7c79e08442b71b9d452472b147d825a35252541be3aafd6d8ce3fe0ed3a8a5e675172e7a94c4a3ea734f58a660d449783d71f9aa82a1cc9431e1f32b
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in vatcher.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Vytautas Narkevicius
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # Vatcher
2
+
3
+ ## Description
4
+
5
+ Super simple variable watcher for rails apps. Useful for quick look of expression values without stopping runtime. Just type:
6
+
7
+ ```ruby
8
+ vatch! interesting_variable_to_watch, another_one, and_another, and_so_on
9
+ ```
10
+
11
+ anywhere in your app and you will get entry with timestamp and location of your call in `log/vatcher.log` made for you.
12
+
13
+ ## Installation
14
+
15
+ Add it to `Gemfile` of you Rails app:
16
+
17
+ ```ruby
18
+ group :development, :test do
19
+ gem 'vatcher'
20
+ end
21
+ ```
22
+
23
+ and run `bundle`.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/lib/vatcher.rb ADDED
@@ -0,0 +1,16 @@
1
+ Object.class_eval do
2
+
3
+ def vatch!(*args)
4
+ trace = "...#{/.*(\/.*).*(\/.*):in.*/.match(caller.first).captures.join}"
5
+ info_str = "[#{Time.now.strftime("%F %T")}] #{trace}"
6
+
7
+ open("#{Rails.root.to_s}/log/vatcher.log", 'a') do |file|
8
+ file.puts info_str
9
+ file.puts args
10
+ end
11
+
12
+ rescue
13
+ "No variable watching possible here"
14
+ end
15
+
16
+ end
@@ -0,0 +1,3 @@
1
+ module Vatcher
2
+ VERSION = "1.0.0"
3
+ end
data/vatcher.gemspec ADDED
@@ -0,0 +1,39 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "vatcher/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vatcher"
8
+ spec.version = Vatcher::VERSION
9
+ spec.authors = ["Vytautas Narkevicius"]
10
+ spec.email = ["narkevicius.vytautas@gmail.com"]
11
+
12
+ spec.summary = "Super simple variable watcher for rails apps"
13
+ spec.homepage = "https://github.com/narkevicius/vatcher"
14
+ spec.license = "MIT"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ if spec.respond_to?(:metadata)
19
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
20
+
21
+ spec.metadata["homepage_uri"] = spec.homepage
22
+ spec.metadata["source_code_uri"] = "https://github.com/narkevicius/vatcher"
23
+ else
24
+ raise "RubyGems 2.0 or newer is required to protect against " \
25
+ "public gem pushes."
26
+ end
27
+
28
+ # Specify which files should be added to the gem when it is released.
29
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
31
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
+ end
33
+ spec.bindir = "exe"
34
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
+ spec.require_paths = ["lib"]
36
+
37
+ spec.add_development_dependency "bundler", "~> 2.0"
38
+ spec.add_development_dependency "rake", "~> 10.0"
39
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vatcher
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Vytautas Narkevicius
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-02-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description:
42
+ email:
43
+ - narkevicius.vytautas@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - lib/vatcher.rb
54
+ - lib/vatcher/version.rb
55
+ - vatcher.gemspec
56
+ homepage: https://github.com/narkevicius/vatcher
57
+ licenses:
58
+ - MIT
59
+ metadata:
60
+ allowed_push_host: https://rubygems.org
61
+ homepage_uri: https://github.com/narkevicius/vatcher
62
+ source_code_uri: https://github.com/narkevicius/vatcher
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.7.6
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: Super simple variable watcher for rails apps
83
+ test_files: []