remnant 0.9.5 → 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 +4 -4
- data/.gitignore +18 -0
- data/lib/remnant/base.rb +5 -1
- data/lib/remnant/discover.rb +3 -2
- data/lib/remnant/rails.rb +6 -5
- data/lib/remnant/template.rb +2 -2
- data/lib/remnant/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a2165d25b8bb67a075175f74c7d99fc28ffe1d4
|
4
|
+
data.tar.gz: 753f46de7670e4c63c64c0ba59a6338705f7647c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a2352efcfe46bc784cd24fb49f22501311f24a357fd017f1af27323d9cb14a17d64d49b5ac96b0d4bd8ae9d4139dc54d6799fc6d39e03a1f258b489cacfed4
|
7
|
+
data.tar.gz: cf343aebc4b72e69d30d97d76dce6468aef48888b4f8135abebc31794aa44ccb42cd4f76a3d793bc362856556b5bed4a1afd00209ec9c8418c619384aea0501f
|
data/.gitignore
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Ignore bundler config.
|
8
|
+
/.bundle
|
9
|
+
|
10
|
+
# Ignore all logfiles and tempfiles.
|
11
|
+
/log/*.log
|
12
|
+
/tmp
|
13
|
+
|
14
|
+
# Ignore bundled gems.
|
15
|
+
/vendor/bundle
|
16
|
+
|
17
|
+
# Ignore OSX files.
|
18
|
+
*.DS_Store
|
data/lib/remnant/base.rb
CHANGED
@@ -116,7 +116,11 @@ class Remnant
|
|
116
116
|
|
117
117
|
# run hook if given for all environments
|
118
118
|
unless Remnant.configuration.custom_hook.nil?
|
119
|
-
|
119
|
+
begin
|
120
|
+
Remnant.configuration.custom_hook.call(Remnant::Discover.results)
|
121
|
+
rescue => e
|
122
|
+
::Rails.logger.error "Failed to run hook: #{e.message}"
|
123
|
+
end
|
120
124
|
end
|
121
125
|
|
122
126
|
Remnant::Database.reset
|
data/lib/remnant/discover.rb
CHANGED
@@ -9,13 +9,14 @@ class Remnant
|
|
9
9
|
def _inject(key, klass, method, instance)
|
10
10
|
klass.class_eval <<-EOL, __FILE__, __LINE__
|
11
11
|
#{"class << self" unless instance}
|
12
|
-
|
12
|
+
alias_method :#{method}_without_remnant, :#{method}
|
13
|
+
|
14
|
+
def #{method}(*args, &block)
|
13
15
|
::Remnant::Discover.measure(#{key.inspect}) do
|
14
16
|
#{method}_without_remnant(*args, &block)
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
18
|
-
alias_method_chain :#{method}, :remnant
|
19
20
|
#{"end" unless instance}
|
20
21
|
EOL
|
21
22
|
end
|
data/lib/remnant/rails.rb
CHANGED
@@ -17,12 +17,13 @@ class Remnant
|
|
17
17
|
# hook into dependency unloading
|
18
18
|
::ActiveSupport::Dependencies.class_eval do
|
19
19
|
class << self
|
20
|
-
|
20
|
+
alias_method :clear_without_remnant_rediscover, :clear
|
21
|
+
|
22
|
+
def clear(*args, &block)
|
21
23
|
clear_without_remnant_rediscover(*args, &block).tap do
|
22
24
|
Remnant::Discover.rediscover!
|
23
25
|
end
|
24
26
|
end
|
25
|
-
alias_method_chain :clear, :remnant_rediscover
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
@@ -46,13 +47,13 @@ class Remnant
|
|
46
47
|
if defined?(ActionView) && defined?(ActionView::Template)
|
47
48
|
Remnant::Discover.find_with(ActionView::Template) do
|
48
49
|
ActionView::Template.class_eval do
|
49
|
-
|
50
|
+
alias_method :render_without_remnant, :render
|
51
|
+
|
52
|
+
def render(*args, &block)
|
50
53
|
::Remnant::Template.record(@virtual_path) do
|
51
54
|
render_without_remnant(*args, &block)
|
52
55
|
end
|
53
56
|
end
|
54
|
-
|
55
|
-
alias_method_chain :render, :remnant
|
56
57
|
end
|
57
58
|
end
|
58
59
|
end
|
data/lib/remnant/template.rb
CHANGED
data/lib/remnant/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remnant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John 'asceth' Long
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: statsd-ruby
|
@@ -38,6 +38,7 @@ executables: []
|
|
38
38
|
extensions: []
|
39
39
|
extra_rdoc_files: []
|
40
40
|
files:
|
41
|
+
- ".gitignore"
|
41
42
|
- ".rvmrc"
|
42
43
|
- Gemfile
|
43
44
|
- Gemfile.lock
|
@@ -89,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
90
|
version: '0'
|
90
91
|
requirements: []
|
91
92
|
rubyforge_project: remnant
|
92
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.5.1
|
93
94
|
signing_key:
|
94
95
|
specification_version: 4
|
95
96
|
summary: Rails statistical discoverer
|