rmap 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rmap/database.rb CHANGED
@@ -2,8 +2,11 @@
2
2
  module Rmap
3
3
  class Database
4
4
 
5
- def initialize(conf={:username => 'root'})
5
+ def initialize(conf={:username => 'root'}, &block)
6
6
  @conf = conf
7
+ if !block.nil?
8
+ instance_eval(&block)
9
+ end
7
10
  end
8
11
 
9
12
  def client
@@ -41,8 +44,13 @@ module Rmap
41
44
  binding
42
45
  end
43
46
 
44
- def run(file_path)
45
- instance_eval(::File.open(file_path).read, file_path)
47
+ def run(file_path = nil, &block)
48
+ if !file_path.nil?
49
+ instance_eval(::File.open(file_path).read, file_path)
50
+ end
51
+ if !block.nil?
52
+ instance_eval(&block)
53
+ end
46
54
  end
47
55
 
48
56
  def table?(name)
data/lib/rmap/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rmap
2
- VERSION = "0.2.3"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-14 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mysql2
16
- requirement: &78471470 !ruby/object:Gem::Requirement
16
+ requirement: &82061450 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *78471470
24
+ version_requirements: *82061450
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &78471220 !ruby/object:Gem::Requirement
27
+ requirement: &82061200 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *78471220
35
+ version_requirements: *82061200
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ripl
38
- requirement: &78470990 !ruby/object:Gem::Requirement
38
+ requirement: &82060970 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *78470990
46
+ version_requirements: *82060970
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: ripl-multi_line
49
- requirement: &78470760 !ruby/object:Gem::Requirement
49
+ requirement: &82060740 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *78470760
57
+ version_requirements: *82060740
58
58
  description:
59
59
  email:
60
60
  - jody@jodysalt.com