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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8f4d982355c0e4abc963aebf2443a2f99718bac
4
- data.tar.gz: 77129393c5bc6d6fc3519019f1f9eec7917eaa5e
3
+ metadata.gz: 3a2165d25b8bb67a075175f74c7d99fc28ffe1d4
4
+ data.tar.gz: 753f46de7670e4c63c64c0ba59a6338705f7647c
5
5
  SHA512:
6
- metadata.gz: 4df8dfe02f00cf272b6f97fc20592409afac28aa429943c8772990182f2ea0d8638715148d51fe7675ef4fb71f1df83c729d6816fd836c693922d6d70e8967a2
7
- data.tar.gz: 816ef033bc2041be2fe0b581838904353942c56bb547f9c44feb1dc2a6d63bfd0f634f0bc6621827b6eb523f2ebc7aed19437a314d80223e6474000fa494fed9
6
+ metadata.gz: d7a2352efcfe46bc784cd24fb49f22501311f24a357fd017f1af27323d9cb14a17d64d49b5ac96b0d4bd8ae9d4139dc54d6799fc6d39e03a1f258b489cacfed4
7
+ data.tar.gz: cf343aebc4b72e69d30d97d76dce6468aef48888b4f8135abebc31794aa44ccb42cd4f76a3d793bc362856556b5bed4a1afd00209ec9c8418c619384aea0501f
@@ -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
@@ -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
- Remnant.configuration.custom_hook.call(Remnant::Discover.results)
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
@@ -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
- def #{method}_with_remnant(*args, &block)
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
@@ -17,12 +17,13 @@ class Remnant
17
17
  # hook into dependency unloading
18
18
  ::ActiveSupport::Dependencies.class_eval do
19
19
  class << self
20
- def clear_with_remnant_rediscover(*args, &block)
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
- def render_with_remnant(*args, &block)
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
@@ -19,11 +19,11 @@ class Remnant
19
19
 
20
20
  trace.start(template)
21
21
  begin
22
- result = yield
22
+ @result = yield
23
23
  ensure
24
24
  trace.finished(template)
25
25
  end
26
- return result
26
+ return @result
27
27
  end
28
28
 
29
29
  def reset
@@ -1,3 +1,3 @@
1
1
  class Remnant
2
- VERSION = "0.9.5"
2
+ VERSION = "1.0.0"
3
3
  end
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.9.5
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: 2014-11-13 00:00:00.000000000 Z
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.2.2
93
+ rubygems_version: 2.5.1
93
94
  signing_key:
94
95
  specification_version: 4
95
96
  summary: Rails statistical discoverer