merb_datamapper 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
1
  require "merb-core"
2
2
 
3
3
  require "dm-core"
4
+ require "dm-migrations"
4
5
  require "merb_datamapper/connection"
5
6
 
6
7
  Merb::Plugins.add_rakefiles "merb_datamapper" / "merbtasks"
@@ -51,13 +51,16 @@ namespace :db do
51
51
  desc "Create the database"
52
52
  task :create do
53
53
  config = Merb::Orms::DataMapper.config
54
- puts "Creating database '#{config[:database]}'"
54
+ puts "Creating database '%s'" % (config[:adapter] == 'sqlite3' ? config[:path] : config[:database])
55
55
  case config[:adapter]
56
56
  when 'postgres'
57
- `createdb -U #{config[:username]} #{config[:database]}`
57
+ system('createdb', "-U #{config[:username]}", config[:database].to_s)
58
58
  when 'mysql'
59
59
  user, password, database = config[:username], config[:password], config[:database]
60
- `mysql -u #{user} #{password ? "-p #{password}" : ''} -e "create database #{database}"`
60
+ args = ["--user=#{user}"]
61
+ args << "--password=#{password}" if password
62
+ args << "-e create database #{database}"
63
+ system('mysql', *args)
61
64
  when 'sqlite3'
62
65
  Rake::Task['rake:db:automigrate'].invoke
63
66
  else
@@ -71,10 +74,13 @@ namespace :db do
71
74
  puts "Dropping database '#{config[:database]}'"
72
75
  case config[:adapter]
73
76
  when 'postgres'
74
- `dropdb -U #{config[:username]} #{config[:database]}`
77
+ system('dropdb', "-U #{config[:username]}", config[:database].to_s)
75
78
  when 'mysql'
76
79
  user, password, database = config[:username], config[:password], config[:database]
77
- `mysql -u #{user} #{password ? "-p #{password}" : ''} -e "drop database #{database}"`
80
+ args = ["--user=#{user}"]
81
+ args << "--password=#{password}" if password
82
+ args << "-e drop database #{database}"
83
+ system('mysql', *args)
78
84
  else
79
85
  raise "Adapter #{config[:adapter]} not supported for dropping databases yet.\ntry db:automigrate"
80
86
  end
@@ -1,6 +1,6 @@
1
1
  module Merb
2
2
  module DataMapper
3
- VERSION = '1.1.2'.freeze
4
- DM_VERSION_REQUIREMENT = '>= 0.10.2'.freeze
3
+ VERSION = '1.1.3'.freeze
4
+ DM_VERSION_REQUIREMENT = '>= 1.0'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,162 +1,124 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: merb_datamapper
3
- version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 1
9
- - 2
10
- version: 1.1.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.3
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jason Toy
14
9
  - Jonathan Stott
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2010-07-03 00:00:00 +01:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
13
+ date: 2011-05-03 00:00:00.000000000Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
23
16
  name: merb-core
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &22072060 !ruby/object:Gem::Requirement
26
18
  none: false
27
- requirements:
19
+ requirements:
28
20
  - - ~>
29
- - !ruby/object:Gem::Version
30
- hash: 13
31
- segments:
32
- - 1
33
- - 1
34
- version: "1.1"
21
+ - !ruby/object:Gem::Version
22
+ version: '1.1'
35
23
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: dm-core
39
24
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *22072060
26
+ - !ruby/object:Gem::Dependency
27
+ name: dm-core
28
+ requirement: &22071580 !ruby/object:Gem::Requirement
41
29
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 51
46
- segments:
47
- - 0
48
- - 10
49
- - 2
50
- version: 0.10.2
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
51
34
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: dm-migrations
55
35
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *22071580
37
+ - !ruby/object:Gem::Dependency
38
+ name: dm-migrations
39
+ requirement: &22071120 !ruby/object:Gem::Requirement
57
40
  none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 51
62
- segments:
63
- - 0
64
- - 10
65
- - 2
66
- version: 0.10.2
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '1.0'
67
45
  type: :runtime
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: rspec
71
46
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
47
+ version_requirements: *22071120
48
+ - !ruby/object:Gem::Dependency
49
+ name: rspec
50
+ requirement: &22070680 !ruby/object:Gem::Requirement
73
51
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 13
78
- segments:
79
- - 1
80
- - 2
81
- - 9
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
82
55
  version: 1.2.9
83
56
  type: :development
84
- version_requirements: *id004
57
+ prerelease: false
58
+ version_requirements: *22070680
85
59
  description: Merb plugin that provides support for datamapper
86
60
  email: jonathan.stott@gmail.com
87
61
  executables: []
88
-
89
62
  extensions: []
90
-
91
- extra_rdoc_files:
63
+ extra_rdoc_files:
92
64
  - README
93
65
  - LICENSE
94
66
  - TODO
95
- files:
67
+ files:
96
68
  - Generators
97
69
  - Rakefile
98
- - lib/merb_datamapper.rb
99
- - lib/generators/data_mapper_resource_controller.rb
70
+ - lib/generators/data_mapper_migration.rb
100
71
  - lib/generators/data_mapper_model.rb
101
- - lib/generators/templates/views/index.html.erb
102
- - lib/generators/templates/views/new.html.erb
103
- - lib/generators/templates/views/show.html.erb
104
- - lib/generators/templates/views/edit.html.erb
72
+ - lib/generators/data_mapper_resource_controller.rb
105
73
  - lib/generators/templates/migration.rb
106
74
  - lib/generators/templates/model.rb
107
75
  - lib/generators/templates/model_migration.rb
108
76
  - lib/generators/templates/resource_controller.rb
109
- - lib/generators/data_mapper_migration.rb
77
+ - lib/generators/templates/views/edit.html.erb
78
+ - lib/generators/templates/views/index.html.erb
79
+ - lib/generators/templates/views/new.html.erb
80
+ - lib/generators/templates/views/show.html.erb
81
+ - lib/merb_datamapper.rb
82
+ - lib/merb_datamapper/connection.rb
110
83
  - lib/merb_datamapper/data_mapper_session.rb
84
+ - lib/merb_datamapper/database.yml.sample
111
85
  - lib/merb_datamapper/merbtasks.rb
112
- - lib/merb_datamapper/connection.rb
113
86
  - lib/merb_datamapper/version.rb
114
- - lib/merb_datamapper/database.yml.sample
115
- - spec/session_store_spec.rb
116
- - spec/spec.opts
117
87
  - spec/connection_spec.rb
118
- - spec/identity_map_spec.rb
119
- - spec/spec_helper.rb
120
88
  - spec/datamapper_id_map_controller.rb
121
- - spec/session_spec.rb
122
- - spec/datamapper_session_controller.rb
123
89
  - spec/datamapper_model.rb
90
+ - spec/datamapper_session_controller.rb
91
+ - spec/identity_map_spec.rb
92
+ - spec/session_spec.rb
93
+ - spec/session_store_spec.rb
94
+ - spec/spec_helper.rb
95
+ - spec/spec.opts
124
96
  - README
125
97
  - LICENSE
126
98
  - TODO
127
- has_rdoc: true
128
99
  homepage: http://github.com/merb/merb_datamapper
129
100
  licenses: []
130
-
131
101
  post_install_message:
132
102
  rdoc_options: []
133
-
134
- require_paths:
103
+ require_paths:
135
104
  - lib
136
- required_ruby_version: !ruby/object:Gem::Requirement
105
+ required_ruby_version: !ruby/object:Gem::Requirement
137
106
  none: false
138
- requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- hash: 3
142
- segments:
143
- - 0
144
- version: "0"
145
- required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
112
  none: false
147
- requirements:
148
- - - ">="
149
- - !ruby/object:Gem::Version
150
- hash: 3
151
- segments:
152
- - 0
153
- version: "0"
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
154
117
  requirements: []
155
-
156
118
  rubyforge_project:
157
- rubygems_version: 1.3.7
119
+ rubygems_version: 1.7.2
158
120
  signing_key:
159
121
  specification_version: 3
160
122
  summary: Merb plugin that allows you to use datamapper with your merb app
161
123
  test_files: []
162
-
124
+ has_rdoc: true