merb-admin 0.7.4 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/lib/abstract_model.rb +4 -4
- data/lib/{activerecord_support.rb → active_record_support.rb} +1 -1
- data/lib/merb-admin.rb +1 -1
- data/lib/merb-admin/slicetasks.rb +4 -4
- data/merb-admin.gemspec +23 -23
- data/spec/migrations/{activerecord → active_record}/001_create_divisions_migration.rb +0 -0
- data/spec/migrations/{activerecord → active_record}/002_create_drafts_migration.rb +0 -0
- data/spec/migrations/{activerecord → active_record}/003_create_leagues_migration.rb +0 -0
- data/spec/migrations/{activerecord → active_record}/004_create_players_migration.rb +0 -0
- data/spec/migrations/{activerecord → active_record}/005_create_teams_migration.rb +0 -0
- data/spec/models/{activerecord → active_record}/division.rb +0 -0
- data/spec/models/{activerecord → active_record}/draft.rb +0 -0
- data/spec/models/{activerecord → active_record}/league.rb +0 -0
- data/spec/models/{activerecord → active_record}/player.rb +0 -0
- data/spec/models/{activerecord → active_record}/team.rb +0 -0
- data/spec/spec_helper.rb +8 -8
- metadata +23 -23
data/README.rdoc
CHANGED
@@ -13,7 +13,7 @@ http://github.com/sferik/merb-admin/raw/master/screenshots/edit.png
|
|
13
13
|
== Installation
|
14
14
|
$ gem install merb-admin -s http://gemcutter.org
|
15
15
|
In your app, add the following dependency to <tt>config/dependencies.rb</tt>:
|
16
|
-
dependency "merb-admin", "0.7.
|
16
|
+
dependency "merb-admin", "0.7.5"
|
17
17
|
Add the following route to <tt>config/router.rb</tt>:
|
18
18
|
add_slice(:merb_admin, :path_prefix => "admin")
|
19
19
|
Then, run the following rake task:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.5
|
data/lib/abstract_model.rb
CHANGED
@@ -7,7 +7,7 @@ module MerbAdmin
|
|
7
7
|
@models = []
|
8
8
|
orm = Merb.orm
|
9
9
|
case orm
|
10
|
-
when :
|
10
|
+
when :active_record, :sequel
|
11
11
|
Dir.glob(Merb.dir_for(:model) / Merb.glob_for(:model)).each do |filename|
|
12
12
|
File.read(filename).scan(/class ([\w\d_\-:]+)/).flatten.each do |model_name|
|
13
13
|
add_model(model_name)
|
@@ -38,7 +38,7 @@ module MerbAdmin
|
|
38
38
|
end
|
39
39
|
|
40
40
|
case Merb.orm
|
41
|
-
when :
|
41
|
+
when :active_record
|
42
42
|
model if superclasses(model).include?(ActiveRecord::Base)
|
43
43
|
when :datamapper
|
44
44
|
model if model.include?(DataMapper::Resource)
|
@@ -57,8 +57,8 @@ module MerbAdmin
|
|
57
57
|
@model = model
|
58
58
|
self.extend(GenericSupport)
|
59
59
|
case orm
|
60
|
-
when :
|
61
|
-
require '
|
60
|
+
when :active_record
|
61
|
+
require 'active_record_support'
|
62
62
|
self.extend(ActiverecordSupport)
|
63
63
|
when :datamapper
|
64
64
|
require 'datamapper_support'
|
data/lib/merb-admin.rb
CHANGED
@@ -24,7 +24,7 @@ if defined?(Merb::Plugins)
|
|
24
24
|
|
25
25
|
# Slice metadata
|
26
26
|
self.description = "MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data."
|
27
|
-
self.version = "0.7.
|
27
|
+
self.version = "0.7.5"
|
28
28
|
self.author = "Erik Michaels-Ober"
|
29
29
|
|
30
30
|
# Stub classes loaded hook - runs before LoadClasses BootLoader
|
@@ -17,16 +17,16 @@ namespace :slices do
|
|
17
17
|
# end
|
18
18
|
|
19
19
|
desc "Copies sample models, copies and runs sample migrations, and loads sample data into your app"
|
20
|
-
task :
|
21
|
-
namespace :
|
20
|
+
task :active_record => ["active_record:copy_sample_models", "active_record:copy_sample_migrations", "active_record:migrate", "load_sample_data"]
|
21
|
+
namespace :active_record do
|
22
22
|
desc "Copies sample models into your app"
|
23
23
|
task :copy_sample_models do
|
24
|
-
copy_models(:
|
24
|
+
copy_models(:active_record)
|
25
25
|
end
|
26
26
|
|
27
27
|
desc "Copies sample migrations into your app"
|
28
28
|
task :copy_sample_migrations do
|
29
|
-
copy_migrations(:
|
29
|
+
copy_migrations(:active_record)
|
30
30
|
end
|
31
31
|
|
32
32
|
desc "Migrate the database to the latest version"
|
data/merb-admin.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{merb-admin}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Erik Michaels-Ober"]
|
12
|
-
s.date = %q{2009-12-
|
12
|
+
s.date = %q{2009-12-14}
|
13
13
|
s.description = %q{MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data.}
|
14
14
|
s.email = %q{sferik@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -50,7 +50,7 @@ Gem::Specification.new do |s|
|
|
50
50
|
"app/views/main/list.html.erb",
|
51
51
|
"app/views/main/new.html.erb",
|
52
52
|
"lib/abstract_model.rb",
|
53
|
-
"lib/
|
53
|
+
"lib/active_record_support.rb",
|
54
54
|
"lib/datamapper_support.rb",
|
55
55
|
"lib/generic_support.rb",
|
56
56
|
"lib/merb-admin.rb",
|
@@ -132,21 +132,21 @@ Gem::Specification.new do |s|
|
|
132
132
|
"public/stylesheets/rtl.css",
|
133
133
|
"public/stylesheets/widgets.css",
|
134
134
|
"spec/controllers/main_spec.rb",
|
135
|
-
"spec/migrations/
|
136
|
-
"spec/migrations/
|
137
|
-
"spec/migrations/
|
138
|
-
"spec/migrations/
|
139
|
-
"spec/migrations/
|
135
|
+
"spec/migrations/active_record/001_create_divisions_migration.rb",
|
136
|
+
"spec/migrations/active_record/002_create_drafts_migration.rb",
|
137
|
+
"spec/migrations/active_record/003_create_leagues_migration.rb",
|
138
|
+
"spec/migrations/active_record/004_create_players_migration.rb",
|
139
|
+
"spec/migrations/active_record/005_create_teams_migration.rb",
|
140
140
|
"spec/migrations/sequel/001_create_divisions_migration.rb",
|
141
141
|
"spec/migrations/sequel/002_create_drafts_migration.rb",
|
142
142
|
"spec/migrations/sequel/003_create_leagues_migration.rb",
|
143
143
|
"spec/migrations/sequel/004_create_players_migration.rb",
|
144
144
|
"spec/migrations/sequel/005_create_teams_migration.rb",
|
145
|
-
"spec/models/
|
146
|
-
"spec/models/
|
147
|
-
"spec/models/
|
148
|
-
"spec/models/
|
149
|
-
"spec/models/
|
145
|
+
"spec/models/active_record/division.rb",
|
146
|
+
"spec/models/active_record/draft.rb",
|
147
|
+
"spec/models/active_record/league.rb",
|
148
|
+
"spec/models/active_record/player.rb",
|
149
|
+
"spec/models/active_record/team.rb",
|
150
150
|
"spec/models/datamapper/division.rb",
|
151
151
|
"spec/models/datamapper/draft.rb",
|
152
152
|
"spec/models/datamapper/league.rb",
|
@@ -174,21 +174,21 @@ Gem::Specification.new do |s|
|
|
174
174
|
s.summary = %q{MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data.}
|
175
175
|
s.test_files = [
|
176
176
|
"spec/controllers/main_spec.rb",
|
177
|
-
"spec/migrations/
|
178
|
-
"spec/migrations/
|
179
|
-
"spec/migrations/
|
180
|
-
"spec/migrations/
|
181
|
-
"spec/migrations/
|
177
|
+
"spec/migrations/active_record/001_create_divisions_migration.rb",
|
178
|
+
"spec/migrations/active_record/002_create_drafts_migration.rb",
|
179
|
+
"spec/migrations/active_record/003_create_leagues_migration.rb",
|
180
|
+
"spec/migrations/active_record/004_create_players_migration.rb",
|
181
|
+
"spec/migrations/active_record/005_create_teams_migration.rb",
|
182
182
|
"spec/migrations/sequel/001_create_divisions_migration.rb",
|
183
183
|
"spec/migrations/sequel/002_create_drafts_migration.rb",
|
184
184
|
"spec/migrations/sequel/003_create_leagues_migration.rb",
|
185
185
|
"spec/migrations/sequel/004_create_players_migration.rb",
|
186
186
|
"spec/migrations/sequel/005_create_teams_migration.rb",
|
187
|
-
"spec/models/
|
188
|
-
"spec/models/
|
189
|
-
"spec/models/
|
190
|
-
"spec/models/
|
191
|
-
"spec/models/
|
187
|
+
"spec/models/active_record/division.rb",
|
188
|
+
"spec/models/active_record/draft.rb",
|
189
|
+
"spec/models/active_record/league.rb",
|
190
|
+
"spec/models/active_record/player.rb",
|
191
|
+
"spec/models/active_record/team.rb",
|
192
192
|
"spec/models/datamapper/division.rb",
|
193
193
|
"spec/models/datamapper/draft.rb",
|
194
194
|
"spec/models/datamapper/league.rb",
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/spec_helper.rb
CHANGED
@@ -41,17 +41,17 @@ module Merb
|
|
41
41
|
orm = set_orm(orm)
|
42
42
|
orm = orm.to_s.downcase.to_sym
|
43
43
|
case orm
|
44
|
-
when :
|
45
|
-
require '
|
44
|
+
when :active_record
|
45
|
+
require 'active_record'
|
46
46
|
require_models(orm)
|
47
47
|
unless ActiveRecord::Base.connected?
|
48
48
|
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
|
49
49
|
ActiveRecord::Migration.verbose = false
|
50
|
-
ActiveRecord::Migrator.run(:up, File.join(File.dirname(__FILE__), "migrations", "
|
51
|
-
ActiveRecord::Migrator.run(:up, File.join(File.dirname(__FILE__), "migrations", "
|
52
|
-
ActiveRecord::Migrator.run(:up, File.join(File.dirname(__FILE__), "migrations", "
|
53
|
-
ActiveRecord::Migrator.run(:up, File.join(File.dirname(__FILE__), "migrations", "
|
54
|
-
ActiveRecord::Migrator.run(:up, File.join(File.dirname(__FILE__), "migrations", "
|
50
|
+
ActiveRecord::Migrator.run(:up, File.join(File.dirname(__FILE__), "migrations", "active_record"), 1)
|
51
|
+
ActiveRecord::Migrator.run(:up, File.join(File.dirname(__FILE__), "migrations", "active_record"), 2)
|
52
|
+
ActiveRecord::Migrator.run(:up, File.join(File.dirname(__FILE__), "migrations", "active_record"), 3)
|
53
|
+
ActiveRecord::Migrator.run(:up, File.join(File.dirname(__FILE__), "migrations", "active_record"), 4)
|
54
|
+
ActiveRecord::Migrator.run(:up, File.join(File.dirname(__FILE__), "migrations", "active_record"), 5)
|
55
55
|
end
|
56
56
|
when :datamapper
|
57
57
|
require 'dm-core'
|
@@ -83,7 +83,7 @@ module Merb
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def set_orm(orm = nil)
|
86
|
-
orm || ENV['MERB_ORM'] || (Merb.orm != :none ? Merb.orm : nil) || :
|
86
|
+
orm || ENV['MERB_ORM'] || (Merb.orm != :none ? Merb.orm : nil) || :active_record
|
87
87
|
end
|
88
88
|
|
89
89
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merb-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Michaels-Ober
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-14 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -105,7 +105,7 @@ files:
|
|
105
105
|
- app/views/main/list.html.erb
|
106
106
|
- app/views/main/new.html.erb
|
107
107
|
- lib/abstract_model.rb
|
108
|
-
- lib/
|
108
|
+
- lib/active_record_support.rb
|
109
109
|
- lib/datamapper_support.rb
|
110
110
|
- lib/generic_support.rb
|
111
111
|
- lib/merb-admin.rb
|
@@ -187,21 +187,21 @@ files:
|
|
187
187
|
- public/stylesheets/rtl.css
|
188
188
|
- public/stylesheets/widgets.css
|
189
189
|
- spec/controllers/main_spec.rb
|
190
|
-
- spec/migrations/
|
191
|
-
- spec/migrations/
|
192
|
-
- spec/migrations/
|
193
|
-
- spec/migrations/
|
194
|
-
- spec/migrations/
|
190
|
+
- spec/migrations/active_record/001_create_divisions_migration.rb
|
191
|
+
- spec/migrations/active_record/002_create_drafts_migration.rb
|
192
|
+
- spec/migrations/active_record/003_create_leagues_migration.rb
|
193
|
+
- spec/migrations/active_record/004_create_players_migration.rb
|
194
|
+
- spec/migrations/active_record/005_create_teams_migration.rb
|
195
195
|
- spec/migrations/sequel/001_create_divisions_migration.rb
|
196
196
|
- spec/migrations/sequel/002_create_drafts_migration.rb
|
197
197
|
- spec/migrations/sequel/003_create_leagues_migration.rb
|
198
198
|
- spec/migrations/sequel/004_create_players_migration.rb
|
199
199
|
- spec/migrations/sequel/005_create_teams_migration.rb
|
200
|
-
- spec/models/
|
201
|
-
- spec/models/
|
202
|
-
- spec/models/
|
203
|
-
- spec/models/
|
204
|
-
- spec/models/
|
200
|
+
- spec/models/active_record/division.rb
|
201
|
+
- spec/models/active_record/draft.rb
|
202
|
+
- spec/models/active_record/league.rb
|
203
|
+
- spec/models/active_record/player.rb
|
204
|
+
- spec/models/active_record/team.rb
|
205
205
|
- spec/models/datamapper/division.rb
|
206
206
|
- spec/models/datamapper/draft.rb
|
207
207
|
- spec/models/datamapper/league.rb
|
@@ -251,21 +251,21 @@ specification_version: 3
|
|
251
251
|
summary: MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data.
|
252
252
|
test_files:
|
253
253
|
- spec/controllers/main_spec.rb
|
254
|
-
- spec/migrations/
|
255
|
-
- spec/migrations/
|
256
|
-
- spec/migrations/
|
257
|
-
- spec/migrations/
|
258
|
-
- spec/migrations/
|
254
|
+
- spec/migrations/active_record/001_create_divisions_migration.rb
|
255
|
+
- spec/migrations/active_record/002_create_drafts_migration.rb
|
256
|
+
- spec/migrations/active_record/003_create_leagues_migration.rb
|
257
|
+
- spec/migrations/active_record/004_create_players_migration.rb
|
258
|
+
- spec/migrations/active_record/005_create_teams_migration.rb
|
259
259
|
- spec/migrations/sequel/001_create_divisions_migration.rb
|
260
260
|
- spec/migrations/sequel/002_create_drafts_migration.rb
|
261
261
|
- spec/migrations/sequel/003_create_leagues_migration.rb
|
262
262
|
- spec/migrations/sequel/004_create_players_migration.rb
|
263
263
|
- spec/migrations/sequel/005_create_teams_migration.rb
|
264
|
-
- spec/models/
|
265
|
-
- spec/models/
|
266
|
-
- spec/models/
|
267
|
-
- spec/models/
|
268
|
-
- spec/models/
|
264
|
+
- spec/models/active_record/division.rb
|
265
|
+
- spec/models/active_record/draft.rb
|
266
|
+
- spec/models/active_record/league.rb
|
267
|
+
- spec/models/active_record/player.rb
|
268
|
+
- spec/models/active_record/team.rb
|
269
269
|
- spec/models/datamapper/division.rb
|
270
270
|
- spec/models/datamapper/draft.rb
|
271
271
|
- spec/models/datamapper/league.rb
|