itrigga-param_fu 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/Gemfile +3 -7
- data/Gemfile.lock +7 -4
- data/VERSION +1 -1
- data/itrigga-param_fu.gemspec +59 -0
- data/lib/trigga/param_fu/param_fu.rb +1 -1
- data/spec/param_fu_spec.rb +4 -0
- metadata +18 -62
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use ruby-1.9.2@itrigga-param_fu
|
data/Gemfile
CHANGED
@@ -5,18 +5,14 @@ source "http://rubygems.org"
|
|
5
5
|
|
6
6
|
# Add dependencies to develop your gem here.
|
7
7
|
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
gem 'itrigga-core_ext',"~> 0.4.1", :require=>'core_ext', :git => "git://itrigga-is1.dyndns-ip.com/gems/itrigga-core_ext.git"
|
9
|
+
gem "bundler", "~> 1.0.0"
|
10
|
+
|
8
11
|
group :development do
|
9
|
-
gem "rspec", "1.3.0"
|
10
|
-
gem "rspec-rails", "1.3.2"
|
11
|
-
gem "bundler", "~> 1.0.0"
|
12
12
|
gem "jeweler", "~> 1.6.4"
|
13
|
-
gem "rcov", ">= 0"
|
14
|
-
gem "itrigga-core_ext", ">=0.2.4"
|
15
13
|
end
|
16
14
|
|
17
15
|
group :test do
|
18
16
|
gem "rspec", "1.3.0"
|
19
17
|
gem "rspec-rails", "1.3.2"
|
20
|
-
gem "bundler", "~> 1.0.0"
|
21
|
-
gem "rcov", ">= 0"
|
22
18
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,19 @@
|
|
1
|
+
GIT
|
2
|
+
remote: git://itrigga-is1.dyndns-ip.com/gems/itrigga-core_ext.git
|
3
|
+
revision: 34d9abfb1694bab47a5715c081cd3587d4bae78f
|
4
|
+
specs:
|
5
|
+
itrigga-core_ext (0.4.1)
|
6
|
+
|
1
7
|
GEM
|
2
8
|
remote: http://rubygems.org/
|
3
9
|
specs:
|
4
10
|
git (1.2.5)
|
5
|
-
itrigga-core_ext (0.2.4)
|
6
11
|
jeweler (1.6.4)
|
7
12
|
bundler (~> 1.0)
|
8
13
|
git (>= 1.2.5)
|
9
14
|
rake
|
10
15
|
rack (1.1.0)
|
11
16
|
rake (0.8.7)
|
12
|
-
rcov (0.9.9)
|
13
17
|
rspec (1.3.0)
|
14
18
|
rspec-rails (1.3.2)
|
15
19
|
rack (>= 1.0.0)
|
@@ -20,8 +24,7 @@ PLATFORMS
|
|
20
24
|
|
21
25
|
DEPENDENCIES
|
22
26
|
bundler (~> 1.0.0)
|
23
|
-
itrigga-core_ext (
|
27
|
+
itrigga-core_ext (~> 0.4.1)!
|
24
28
|
jeweler (~> 1.6.4)
|
25
|
-
rcov
|
26
29
|
rspec (= 1.3.0)
|
27
30
|
rspec-rails (= 1.3.2)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{itrigga-param_fu}
|
8
|
+
s.version = "0.4.3"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Al Davidson", "Anson Kelly"]
|
12
|
+
s.date = %q{2011-12-02}
|
13
|
+
s.description = %q{Validates parameters to methods are present and are the required types}
|
14
|
+
s.email = %q{support@itrigga.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rvmrc",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"itrigga-param_fu.gemspec",
|
29
|
+
"lib/trigga/param_fu.rb",
|
30
|
+
"lib/trigga/param_fu/param_fu.rb",
|
31
|
+
"spec/param_fu_spec.rb",
|
32
|
+
"spec/spec.opts",
|
33
|
+
"spec/spec_helper.rb"
|
34
|
+
]
|
35
|
+
s.homepage = %q{http://gemcutter.com/itrigga-param_fu}
|
36
|
+
s.licenses = ["MIT"]
|
37
|
+
s.require_paths = ["lib"]
|
38
|
+
s.rubygems_version = %q{1.4.2}
|
39
|
+
s.summary = %q{Validates parameters to methods}
|
40
|
+
|
41
|
+
if s.respond_to? :specification_version then
|
42
|
+
s.specification_version = 3
|
43
|
+
|
44
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
45
|
+
s.add_runtime_dependency(%q<itrigga-core_ext>, ["~> 0.4.1"])
|
46
|
+
s.add_runtime_dependency(%q<bundler>, ["~> 1.0.0"])
|
47
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
48
|
+
else
|
49
|
+
s.add_dependency(%q<itrigga-core_ext>, ["~> 0.4.1"])
|
50
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
51
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
52
|
+
end
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<itrigga-core_ext>, ["~> 0.4.1"])
|
55
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
56
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
@@ -149,7 +149,7 @@ module Trigga
|
|
149
149
|
clause = "( " + ors.join(' OR ') + " )"
|
150
150
|
# "( #{ scoped_field_name( model_class, (definition[:field_name] || param_name.to_s) ) } #{definition[:operator] || '='} (?) )"
|
151
151
|
c[:where] << clause
|
152
|
-
c[:values] << ( definition[:operator] =~ /\blike\b/i ? opts[param_name].to_active_record_condition : opts[param_name] )
|
152
|
+
ors.size.times{ |i| c[:values] << ( definition[:operator] =~ /\blike\b/i ? opts[param_name].to_active_record_condition : opts[param_name] ) }
|
153
153
|
end
|
154
154
|
end
|
155
155
|
c
|
data/spec/param_fu_spec.rb
CHANGED
@@ -250,6 +250,10 @@ describe ::Trigga::ParamFu do
|
|
250
250
|
it "should join the fieldname conditions together with OR" do
|
251
251
|
Tester.parse_field_definition( @params, @model_class, @param_name, @definition )[:where][0].should == "( model_class_table_name.field_name_1 = (?) OR other_table.field_name_2 = (?) )"
|
252
252
|
end
|
253
|
+
|
254
|
+
it "should add the value to the :values clause once for each element of the array" do
|
255
|
+
Tester.parse_field_definition( @params, @model_class, @param_name, @definition )[:values].size.should == 2
|
256
|
+
end
|
253
257
|
end
|
254
258
|
|
255
259
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itrigga-param_fu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 3
|
10
|
+
version: 0.4.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Al Davidson
|
@@ -20,42 +20,25 @@ date: 2011-12-02 00:00:00 +00:00
|
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
|
+
name: itrigga-core_ext
|
23
24
|
prerelease: false
|
24
|
-
name: rspec
|
25
|
-
type: :development
|
26
25
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
27
26
|
none: false
|
28
27
|
requirements:
|
29
|
-
- -
|
28
|
+
- - ~>
|
30
29
|
- !ruby/object:Gem::Version
|
31
|
-
hash:
|
30
|
+
hash: 13
|
32
31
|
segments:
|
33
|
-
- 1
|
34
|
-
- 3
|
35
32
|
- 0
|
36
|
-
|
33
|
+
- 4
|
34
|
+
- 1
|
35
|
+
version: 0.4.1
|
37
36
|
requirement: *id001
|
37
|
+
type: :runtime
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
|
+
name: bundler
|
39
40
|
prerelease: false
|
40
|
-
name: rspec-rails
|
41
|
-
type: :development
|
42
41
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
|
-
requirements:
|
45
|
-
- - "="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
hash: 31
|
48
|
-
segments:
|
49
|
-
- 1
|
50
|
-
- 3
|
51
|
-
- 2
|
52
|
-
version: 1.3.2
|
53
|
-
requirement: *id002
|
54
|
-
- !ruby/object:Gem::Dependency
|
55
|
-
prerelease: false
|
56
|
-
name: bundler
|
57
|
-
type: :development
|
58
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
59
42
|
none: false
|
60
43
|
requirements:
|
61
44
|
- - ~>
|
@@ -66,12 +49,12 @@ dependencies:
|
|
66
49
|
- 0
|
67
50
|
- 0
|
68
51
|
version: 1.0.0
|
69
|
-
requirement: *
|
52
|
+
requirement: *id002
|
53
|
+
type: :runtime
|
70
54
|
- !ruby/object:Gem::Dependency
|
71
|
-
prerelease: false
|
72
55
|
name: jeweler
|
73
|
-
|
74
|
-
version_requirements: &
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
75
58
|
none: false
|
76
59
|
requirements:
|
77
60
|
- - ~>
|
@@ -82,37 +65,8 @@ dependencies:
|
|
82
65
|
- 6
|
83
66
|
- 4
|
84
67
|
version: 1.6.4
|
85
|
-
requirement: *
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
prerelease: false
|
88
|
-
name: rcov
|
89
|
-
type: :development
|
90
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
91
|
-
none: false
|
92
|
-
requirements:
|
93
|
-
- - ">="
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
hash: 3
|
96
|
-
segments:
|
97
|
-
- 0
|
98
|
-
version: "0"
|
99
|
-
requirement: *id005
|
100
|
-
- !ruby/object:Gem::Dependency
|
101
|
-
prerelease: false
|
102
|
-
name: itrigga-core_ext
|
68
|
+
requirement: *id003
|
103
69
|
type: :development
|
104
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ">="
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
hash: 31
|
110
|
-
segments:
|
111
|
-
- 0
|
112
|
-
- 2
|
113
|
-
- 4
|
114
|
-
version: 0.2.4
|
115
|
-
requirement: *id006
|
116
70
|
description: Validates parameters to methods are present and are the required types
|
117
71
|
email: support@itrigga.com
|
118
72
|
executables: []
|
@@ -124,12 +78,14 @@ extra_rdoc_files:
|
|
124
78
|
- README.rdoc
|
125
79
|
files:
|
126
80
|
- .document
|
81
|
+
- .rvmrc
|
127
82
|
- Gemfile
|
128
83
|
- Gemfile.lock
|
129
84
|
- LICENSE.txt
|
130
85
|
- README.rdoc
|
131
86
|
- Rakefile
|
132
87
|
- VERSION
|
88
|
+
- itrigga-param_fu.gemspec
|
133
89
|
- lib/trigga/param_fu.rb
|
134
90
|
- lib/trigga/param_fu/param_fu.rb
|
135
91
|
- spec/param_fu_spec.rb
|