merb-admin 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +34 -0
- data/Rakefile +3 -4
- data/lib/abstract_model.rb +1 -1
- data/lib/merb-admin/slicetasks.rb +10 -9
- data/lib/merb-admin.rb +1 -1
- metadata +4 -14
- data/README.markdown +0 -58
data/README.rdoc
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
= MerbAdmin
|
2
|
+
==== MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data.
|
3
|
+
It currently offers the features listed here[http://sferik.tadalist.com/lists/1352791/public].
|
4
|
+
|
5
|
+
The status of the current build can be seen here[http://runcoderun.com/sferik/merb-admin].
|
6
|
+
== Installtion
|
7
|
+
$ gem install merb-admin -s http://gemcutter.org
|
8
|
+
In your app, add the following dependency to <tt>config/dependencies.rb</tt>:
|
9
|
+
dependency "merb-admin", "0.5.6"
|
10
|
+
Add the following route to <tt>config/router.rb</tt>:
|
11
|
+
add_slice(:merb_admin, :path_prefix => "admin")
|
12
|
+
Then, run the following rake task:
|
13
|
+
$ rake slices:merb-admin:install
|
14
|
+
== Configuration (optional)
|
15
|
+
If you're feeling crafty, you can set a couple configuration options in <tt>config/init.rb</tt>:
|
16
|
+
Merb::BootLoader.before_app_loads do
|
17
|
+
Merb::Slices::config[:merb_admin][:app_name] = "My App"
|
18
|
+
Merb::Slices::config[:merb_admin][:per_page] = 100
|
19
|
+
end
|
20
|
+
== Usage
|
21
|
+
Start the server:
|
22
|
+
$ merb
|
23
|
+
You should now be able to administer your site at http://localhost:4000/admin.
|
24
|
+
== Contact
|
25
|
+
Please report any problems you encounter to mailto:sferik@gmail.com or {@sferik}[http://twitter.com/sferik] on Twitter.
|
26
|
+
== WARNING
|
27
|
+
MerbAdmin does not implement any authorization scheme. Make sure to apply authorization logic before deploying to production!
|
28
|
+
== Credits
|
29
|
+
Many thanks to:
|
30
|
+
* {Wilson Miner}[http://www.wilsonminer.com] for contributing the stylesheets and javascripts from Django[http://www.djangoproject.com]
|
31
|
+
* {Aaron Wheeler}[http://fightinjoe.com/] for contributing libraries from {Merb AutoScaffold}[http://github.com/fightinjoe/merb-autoscaffold]
|
32
|
+
* {Lori Holden}[http://loriholden.com/] for contributing the merb-pagination[http://github.com/lholden/merb-pagination] helper
|
33
|
+
* {Jacques Crocker}[http://merbjedi.com] for adding support for {namespaced models}[http://github.com/merbjedi/merb-admin/commit/8139e2241038baf9b72452056fcdc7c340d79275]
|
34
|
+
Also, thanks to beer[http://www.21st-amendment.com].
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ AUTHOR = "Erik Michaels-Ober"
|
|
9
9
|
EMAIL = "sferik@gmail.com"
|
10
10
|
HOMEPAGE = "http://github.com/sferik/merb-admin"
|
11
11
|
SUMMARY = "MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data."
|
12
|
-
GEM_VERSION = "0.5.
|
12
|
+
GEM_VERSION = "0.5.6"
|
13
13
|
|
14
14
|
spec = Gem::Specification.new do |s|
|
15
15
|
s.rubyforge_project = "merb"
|
@@ -17,7 +17,7 @@ spec = Gem::Specification.new do |s|
|
|
17
17
|
s.version = GEM_VERSION
|
18
18
|
s.platform = Gem::Platform::RUBY
|
19
19
|
s.has_rdoc = false
|
20
|
-
s.extra_rdoc_files = ["README.
|
20
|
+
s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
|
21
21
|
s.summary = SUMMARY
|
22
22
|
s.description = s.summary
|
23
23
|
s.author = AUTHOR
|
@@ -25,9 +25,8 @@ spec = Gem::Specification.new do |s|
|
|
25
25
|
s.homepage = HOMEPAGE
|
26
26
|
s.add_dependency("merb-slices", ">= 1.0.12")
|
27
27
|
s.add_dependency("builder", ">= 2.1.2")
|
28
|
-
s.add_dependency("mlb", ">= 0.0.3")
|
29
28
|
s.require_path = "lib"
|
30
|
-
s.files = %w(LICENSE README.
|
29
|
+
s.files = %w(LICENSE README.rdoc Rakefile) + Dir.glob("{app,lib,public,schema,spec,stubs}/**/*")
|
31
30
|
s.post_install_message = <<-POST_INSTALL_MESSAGE
|
32
31
|
#{"*" * 80}
|
33
32
|
|
data/lib/abstract_model.rb
CHANGED
@@ -34,7 +34,7 @@ module MerbAdmin
|
|
34
34
|
# Given a symbol +model_name+, finds the corresponding model class
|
35
35
|
def self.lookup(model_name)
|
36
36
|
begin
|
37
|
-
model =
|
37
|
+
model = Object.full_const_get(model_name.to_s)
|
38
38
|
rescue NameError
|
39
39
|
raise "MerbAdmin could not find model #{model_name}"
|
40
40
|
end
|
@@ -1,11 +1,8 @@
|
|
1
1
|
require 'abstract_model'
|
2
|
-
require 'mlb'
|
3
2
|
|
4
3
|
namespace :slices do
|
5
4
|
namespace :"merb-admin" do
|
6
5
|
|
7
|
-
# add your own merb-admin tasks here
|
8
|
-
|
9
6
|
# # Uncomment the following lines and edit the pre defined tasks
|
10
7
|
#
|
11
8
|
# # implement this to test for structural/code dependencies
|
@@ -20,9 +17,8 @@ namespace :slices do
|
|
20
17
|
# end
|
21
18
|
|
22
19
|
namespace :activerecord do
|
23
|
-
|
24
20
|
desc "Loads sample ActiveRecord models and data"
|
25
|
-
task :load_sample => ["load_sample:
|
21
|
+
task :load_sample => ["activerecord:load_sample:models", "activerecord:load_sample:data"]
|
26
22
|
namespace :load_sample do
|
27
23
|
desc "Loads sample ActiveRecord models"
|
28
24
|
task :models do
|
@@ -37,13 +33,11 @@ namespace :slices do
|
|
37
33
|
load_data
|
38
34
|
end
|
39
35
|
end
|
40
|
-
|
41
36
|
end
|
42
37
|
|
43
38
|
namespace :datamapper do
|
44
|
-
|
45
39
|
desc "Loads sample DataMapper models and data"
|
46
|
-
task :load_sample => ["load_sample:
|
40
|
+
task :load_sample => ["datamapper:load_sample:models", "datamapper:load_sample:data"]
|
47
41
|
namespace :load_sample do
|
48
42
|
desc "Loads sample DataMapper models"
|
49
43
|
task :models do
|
@@ -57,7 +51,6 @@ namespace :slices do
|
|
57
51
|
load_data
|
58
52
|
end
|
59
53
|
end
|
60
|
-
|
61
54
|
end
|
62
55
|
|
63
56
|
end
|
@@ -66,6 +59,14 @@ end
|
|
66
59
|
private
|
67
60
|
|
68
61
|
def load_data
|
62
|
+
begin
|
63
|
+
require "mlb"
|
64
|
+
rescue LoadError => e
|
65
|
+
puts "LoadError: #{e}"
|
66
|
+
puts "gem install mlb -s http://gemcutter.org"
|
67
|
+
return
|
68
|
+
end
|
69
|
+
|
69
70
|
puts "Loading current MLB leagues, divisions, teams, and players"
|
70
71
|
MLB.teams.each do |mlb_team|
|
71
72
|
unless league = MerbAdmin::AbstractModel.new("League").first(:conditions => ["name = ?", mlb_team.league])
|
data/lib/merb-admin.rb
CHANGED
@@ -23,7 +23,7 @@ if defined?(Merb::Plugins)
|
|
23
23
|
|
24
24
|
# Slice metadata
|
25
25
|
self.description = "MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data."
|
26
|
-
self.version = "0.5.
|
26
|
+
self.version = "0.5.6"
|
27
27
|
self.author = "Erik Michaels-Ober"
|
28
28
|
|
29
29
|
# Stub classes loaded hook - runs before LoadClasses BootLoader
|
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.5.
|
4
|
+
version: 0.5.6
|
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-10-
|
12
|
+
date: 2009-10-18 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -32,16 +32,6 @@ dependencies:
|
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.1.2
|
34
34
|
version:
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: mlb
|
37
|
-
type: :runtime
|
38
|
-
version_requirement:
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 0.0.3
|
44
|
-
version:
|
45
35
|
description: MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data.
|
46
36
|
email: sferik@gmail.com
|
47
37
|
executables: []
|
@@ -49,11 +39,11 @@ executables: []
|
|
49
39
|
extensions: []
|
50
40
|
|
51
41
|
extra_rdoc_files:
|
52
|
-
- README.
|
42
|
+
- README.rdoc
|
53
43
|
- LICENSE
|
54
44
|
files:
|
55
45
|
- LICENSE
|
56
|
-
- README.
|
46
|
+
- README.rdoc
|
57
47
|
- Rakefile
|
58
48
|
- app/controllers/application.rb
|
59
49
|
- app/controllers/main.rb
|
data/README.markdown
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
# MerbAdmin
|
2
|
-
|
3
|
-
**MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data.**
|
4
|
-
|
5
|
-
It currently offers the features listed [here](http://sferik.tadalist.com/lists/1352791/public).
|
6
|
-
|
7
|
-
## Get it
|
8
|
-
|
9
|
-
At the command prompt, type:
|
10
|
-
|
11
|
-
sudo gem install merb-admin -s http://gemcutter.org
|
12
|
-
|
13
|
-
## Install it
|
14
|
-
|
15
|
-
In your app, add the following dependency to `config/dependencies.rb`:
|
16
|
-
|
17
|
-
dependency "merb-admin", "0.5.5"
|
18
|
-
|
19
|
-
Add the following route to `config/router.rb`:
|
20
|
-
|
21
|
-
add_slice(:merb_admin, :path_prefix => "admin")
|
22
|
-
|
23
|
-
Then, run the following rake task:
|
24
|
-
|
25
|
-
rake slices:merb-admin:install
|
26
|
-
|
27
|
-
## Configure it (optional)
|
28
|
-
|
29
|
-
If you're feeling crafty, you can set a couple configuration options in `config/init.rb`:
|
30
|
-
|
31
|
-
Merb::BootLoader.before_app_loads do
|
32
|
-
Merb::Slices::config[:merb_admin][:app_name] = "My App"
|
33
|
-
Merb::Slices::config[:merb_admin][:per_page] = 100
|
34
|
-
end
|
35
|
-
|
36
|
-
## Run it
|
37
|
-
|
38
|
-
Start the server:
|
39
|
-
|
40
|
-
merb
|
41
|
-
|
42
|
-
You should now be able to administer your site at [http://localhost:4000/admin](http://localhost:4000/admin).
|
43
|
-
|
44
|
-
Please report any problems you encounter to <sferik@gmail.com> or [@sferik](http://twitter.com/home/?status=@sferik%20) on Twitter.
|
45
|
-
|
46
|
-
## WARNING
|
47
|
-
|
48
|
-
MerbAdmin does not implement any authorization scheme. Make sure to apply authorization logic before deploying to production!
|
49
|
-
|
50
|
-
## Acknowledgements
|
51
|
-
|
52
|
-
Many thanks to:
|
53
|
-
|
54
|
-
* [Wilson Miner](http://www.wilsonminer.com) for contributing the stylesheets and javascripts from [Django](http://www.djangoproject.com)
|
55
|
-
* [Aaron Wheeler](http://fightinjoe.com/) for contributing libraries from [Merb AutoScaffold](http://github.com/fightinjoe/merb-autoscaffold)
|
56
|
-
* [Lori Holden](http://loriholden.com/) for contributing the [merb-pagination](http://github.com/lholden/merb-pagination) helper
|
57
|
-
|
58
|
-
Also, thanks to [beer](http://www.21st-amendment.com).
|