trim_blobs 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e11ea5ed491afc8e73252376b8e92684a120d883
4
+ data.tar.gz: 8924903030d0984640cc5b27f8421384e6ec4a56
5
+ SHA512:
6
+ metadata.gz: b7252a565e70bb7bc93ed93ef6ee3898096f65f24c89895df5de74562588061e5264f6cdb8eebe4ff9718ae1b6bf6a34bbde55e10d3f24473f56ae3120b2a4f6
7
+ data.tar.gz: a891348e83e796980ccabb79abca3adc512e2a40df8acfca1169dd28ee4266565b0bd90c4e2eae3448941002dde77aabadd7e3d6963b11617e58dafbf643e71e
data/README.md CHANGED
@@ -6,9 +6,11 @@ The gem has been updated and some bugs have been fixed along the way.
6
6
 
7
7
  ## Requirements
8
8
 
9
- Currently it is working with Rails >= 3.2 and ruby version >= 1.9, if
10
- you need this gem for another set of version, please let me know, and
11
- I will gladly implement it for you
9
+ Currently it is working with Rails >= 3.2 and ruby version >= 1.9.
10
+
11
+ **If you need this gem for another combination of versions, please
12
+ [create an issue](https://github.com/softace/trim_blobs/issues/new)
13
+ specifying which version combination you are intereested in.**
12
14
 
13
15
  ## Installation
14
16
 
@@ -28,7 +30,7 @@ Or install it yourself as:
28
30
 
29
31
  There is basically no usage. The result of using this gem can be seen in the log files where long lines of hexadecimal number have been replaced with a text like
30
32
 
31
- \x89504e470d0a1a0a0000000d49484452... (TRIMMED 34924 characters)
33
+ \x89504e470d0a1a0a0000000d49484452... (TRIMMED 34924 hexadecimal digits)
32
34
 
33
35
  ## Contributing
34
36
 
@@ -2,13 +2,17 @@ module TrimBlobs
2
2
  module ActiveRecord
3
3
  module ConnectionAdapters
4
4
  module AbstractAdapter
5
- def log_with_blobs_trimmed(sql, name = "SQL", binds = [])
5
+ def log_with_blobs_trimmed(sql, name = "SQL", binds = [], statement_name = nil)
6
6
  if sql
7
7
  sql = sql.gsub(/'\\x((?:[0-9a-f]{2})+)'/) do |blob|
8
8
  (blob.size > 32) ? "'\\x#{$1[0,32]}... (TRIMMED #{blob.size} hexadecimal digits)'" : $&
9
9
  end
10
10
  end
11
- log_without_blobs_trimmed(sql, name, binds){ yield }
11
+ if statement_name
12
+ log_without_blobs_trimmed(sql, name, binds, statement_name){ yield }
13
+ else
14
+ log_without_blobs_trimmed(sql, name, binds){ yield }
15
+ end
12
16
  end
13
17
  end
14
18
  end
@@ -1,3 +1,3 @@
1
1
  module TrimBlobs
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,78 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trim_blobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jarl Friis
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-10-10 00:00:00.000000000 Z
11
+ date: 2014-08-16 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activerecord
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.2.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 3.2.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: bundler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: appraisal
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ~>
59
+ - - "~>"
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0.4'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ~>
66
+ - - "~>"
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0.4'
78
69
  description: Trims all database logging of BLOBS
@@ -82,7 +73,7 @@ executables: []
82
73
  extensions: []
83
74
  extra_rdoc_files: []
84
75
  files:
85
- - .gitignore
76
+ - ".gitignore"
86
77
  - Gemfile
87
78
  - LICENSE.txt
88
79
  - README.md
@@ -93,29 +84,25 @@ files:
93
84
  - trim_blobs.gemspec
94
85
  homepage: https://github.com/softace/trim_blobs
95
86
  licenses: []
87
+ metadata: {}
96
88
  post_install_message:
97
89
  rdoc_options: []
98
90
  require_paths:
99
91
  - lib
100
92
  required_ruby_version: !ruby/object:Gem::Requirement
101
- none: false
102
93
  requirements:
103
- - - ! '>='
94
+ - - ">="
104
95
  - !ruby/object:Gem::Version
105
96
  version: 1.9.0
106
97
  required_rubygems_version: !ruby/object:Gem::Requirement
107
- none: false
108
98
  requirements:
109
- - - ! '>='
99
+ - - ">="
110
100
  - !ruby/object:Gem::Version
111
101
  version: '0'
112
- segments:
113
- - 0
114
- hash: 4279536245219545500
115
102
  requirements: []
116
103
  rubyforge_project:
117
- rubygems_version: 1.8.24
104
+ rubygems_version: 2.2.2
118
105
  signing_key:
119
- specification_version: 3
106
+ specification_version: 4
120
107
  summary: Trims all database logging of BLOBS
121
108
  test_files: []