tralala 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/Rakefile +24 -0
- data/Readme.md +25 -0
- data/lib/tralala/version.rb +3 -0
- data/lib/tralala.rb +23 -0
- data/tralala.gemspec +23 -0
- metadata +101 -0
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 keikun17
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
require "rake"
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
task :default => :test
|
7
|
+
|
8
|
+
# Rake::TestTask.new(:test) do |test|
|
9
|
+
# test.libs << 'lib' << 'test'
|
10
|
+
# test.pattern = 'test/**/test_*.rb'
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
|
14
|
+
task :test do
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
desc 'Tags version, pushes to remote, and pushes gem, copied from mongomapper rakefile'
|
19
|
+
task :release => :build do
|
20
|
+
sh "git tag v#{Tralala::Version}"
|
21
|
+
sh "git push origin master"
|
22
|
+
sh "git push origin v#{Tralala::Version}"
|
23
|
+
sh "gem push mongo_mapper-#{Tralala::Version}.gem"
|
24
|
+
end
|
data/Readme.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Tralala
|
2
|
+
|
3
|
+
Mainly for speeding up Rails tests, A gem that exposes and marks the calls that
|
4
|
+
touches the database.
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
|
8
|
+
1. Put `gem 'tralala'` in your `Gemfile` under `:group => 'test'`.
|
9
|
+
2. Run Bundle.
|
10
|
+
3. Run tests.
|
11
|
+
4. ???
|
12
|
+
5. Profit.
|
13
|
+
|
14
|
+
### TODO
|
15
|
+
|
16
|
+
* gemspec
|
17
|
+
|
18
|
+
### Future Features (Readme driven development)
|
19
|
+
|
20
|
+
* Record total time for all `ActiveRecord::ConnectionAdapters` related calls
|
21
|
+
during test runs (maybe check how NewRelic does it)
|
22
|
+
|
23
|
+
---
|
24
|
+
|
25
|
+
Ladidadida-Copyright stuff and all that jazz
|
data/lib/tralala.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "tralala/version"
|
2
|
+
|
3
|
+
module Tralala
|
4
|
+
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
def dingdingdong
|
8
|
+
callstack = caller.reject{|cs| cs.include?('active_record')}
|
9
|
+
puts ""
|
10
|
+
puts "\e[34mIm You touched me tralala!\e[0m"
|
11
|
+
puts " -- #{callstack[1].split(' ').first}"
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def save(options={})
|
17
|
+
dingdingdong
|
18
|
+
super
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
ActiveRecord::Validations.send(:include, Tralala)
|
data/tralala.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/tralala/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["keikun17"]
|
6
|
+
gem.email = ["keikun17@gmail.com"]
|
7
|
+
gem.description = %q{A Rails test gem that exposes and marks the calls that
|
8
|
+
touches the database (to help you find tests that hit
|
9
|
+
the database)}
|
10
|
+
gem.summary = %q{A Rails gem that helps you find which tests hit the database}
|
11
|
+
gem.homepage = "https://github.com/keikun17/tralala"
|
12
|
+
|
13
|
+
gem.files = `git ls-files`.split($\)
|
14
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
15
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
|
+
gem.name = "tralala"
|
17
|
+
gem.require_paths = ["lib"]
|
18
|
+
gem.version = Tralala::VERSION
|
19
|
+
|
20
|
+
gem.add_dependency 'activesupport', '> 3.0'
|
21
|
+
gem.add_dependency 'activerecord', '> 3.0'
|
22
|
+
gem.add_dependency 'minitest'
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tralala
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- keikun17
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-02-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activesupport
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>'
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.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: '3.0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: activerecord
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>'
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '3.0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>'
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '3.0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: minitest
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: ! "A Rails test gem that exposes and marks the calls that\n touches
|
63
|
+
the database (to help you find tests that hit\n the database)"
|
64
|
+
email:
|
65
|
+
- keikun17@gmail.com
|
66
|
+
executables: []
|
67
|
+
extensions: []
|
68
|
+
extra_rdoc_files: []
|
69
|
+
files:
|
70
|
+
- Gemfile
|
71
|
+
- LICENSE
|
72
|
+
- Rakefile
|
73
|
+
- Readme.md
|
74
|
+
- lib/tralala.rb
|
75
|
+
- lib/tralala/version.rb
|
76
|
+
- tralala.gemspec
|
77
|
+
homepage: https://github.com/keikun17/tralala
|
78
|
+
licenses: []
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
requirements: []
|
96
|
+
rubyforge_project:
|
97
|
+
rubygems_version: 1.8.24
|
98
|
+
signing_key:
|
99
|
+
specification_version: 3
|
100
|
+
summary: A Rails gem that helps you find which tests hit the database
|
101
|
+
test_files: []
|