mind_reader 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +9 -9
- metadata +48 -25
data/README.rdoc
CHANGED
@@ -75,17 +75,17 @@ unless you say you want all objects:
|
|
75
75
|
|
76
76
|
mind_reader supports converters for incoming data. For sake of example, imagine
|
77
77
|
you have to enter a date in a different format (here, dd/mm/yyyy), and you want
|
78
|
-
to convert it to default yyyy-mm-dd
|
78
|
+
to convert it to default yyyy-mm-dd:
|
79
79
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
80
|
+
def convert_to_default(br_date)
|
81
|
+
br_date =~ /(\d+)\/(\d+)\/(\d+)/
|
82
|
+
"%s-%s-%s" % [$3, $2, $1]
|
83
|
+
end
|
84
84
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
85
|
+
reader = MindReader.new(SuperHero) do |r|
|
86
|
+
r.date_of_heroic_birth :range => :from_date..:to_date, :converter => lambda {|d| convert_to_default(d) }
|
87
|
+
end
|
88
|
+
reader.execute('from_date' => '01/04/2010', 'to_date' => '30/04/2010').should == [@batman]
|
89
89
|
|
90
90
|
|
91
91
|
== How to install
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mind_reader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,64 +9,88 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
13
|
-
default_executable:
|
12
|
+
date: 2011-11-08 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: activerecord
|
17
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
19
|
- - ~>
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version: 3.0
|
21
|
+
version: '3.0'
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.0'
|
26
30
|
- !ruby/object:Gem::Dependency
|
27
31
|
name: rspec
|
28
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
29
33
|
none: false
|
30
34
|
requirements:
|
31
35
|
- - ~>
|
32
36
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.0
|
37
|
+
version: '2.0'
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
|
-
version_requirements:
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: steak
|
39
|
-
requirement: &13368940 !ruby/object:Gem::Requirement
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
41
42
|
requirements:
|
42
43
|
- - ~>
|
43
44
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
45
|
+
version: '2.0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: capybara
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
45
54
|
type: :development
|
46
55
|
prerelease: false
|
47
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
48
62
|
- !ruby/object:Gem::Dependency
|
49
|
-
name: sqlite3
|
50
|
-
requirement:
|
63
|
+
name: sqlite3
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
51
65
|
none: false
|
52
66
|
requirements:
|
53
|
-
- -
|
67
|
+
- - ! '>='
|
54
68
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
69
|
+
version: '0'
|
56
70
|
type: :development
|
57
71
|
prerelease: false
|
58
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
59
78
|
- !ruby/object:Gem::Dependency
|
60
79
|
name: database_cleaner
|
61
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
62
81
|
none: false
|
63
82
|
requirements:
|
64
|
-
- -
|
83
|
+
- - ! '>='
|
65
84
|
- !ruby/object:Gem::Version
|
66
|
-
version: 0
|
85
|
+
version: '0'
|
67
86
|
type: :development
|
68
87
|
prerelease: false
|
69
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
70
94
|
description: Easy searching for ActiveRecord applications
|
71
95
|
email: rmanhaes@gmail.com
|
72
96
|
executables: []
|
@@ -76,7 +100,6 @@ files:
|
|
76
100
|
- lib/mind_reader.rb
|
77
101
|
- README.rdoc
|
78
102
|
- LICENSE.txt
|
79
|
-
has_rdoc: true
|
80
103
|
homepage: http://github.com/rodrigomanhaes/mind_reader
|
81
104
|
licenses: []
|
82
105
|
post_install_message:
|
@@ -98,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
121
|
version: '0'
|
99
122
|
requirements: []
|
100
123
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.
|
124
|
+
rubygems_version: 1.8.23
|
102
125
|
signing_key:
|
103
126
|
specification_version: 3
|
104
127
|
summary: Easy searching for ActiveRecord applications
|