jrhicks-static-generators 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +3 -0
- data/Rakefile +1 -1
- data/rails_generators/static_authorization/USAGE +15 -0
- data/rails_generators/static_authorization/static_authorization_generator.rb +15 -0
- data/rails_generators/static_authorization/templates/migration.rb +27 -0
- data/static-generators.gemspec +3 -3
- metadata +5 -2
data/Manifest
CHANGED
@@ -8,6 +8,9 @@ rails_generators/static_app/templates/layout_helper.rb
|
|
8
8
|
rails_generators/static_app/templates/sorttable.js
|
9
9
|
rails_generators/static_app/templates/static_style.css
|
10
10
|
rails_generators/static_app/USAGE
|
11
|
+
rails_generators/static_authentication/static_authentication_generator.rb
|
12
|
+
rails_generators/static_authentication/templates/migration.rb
|
13
|
+
rails_generators/static_authentication/USAGE
|
11
14
|
rails_generators/static_gen_specs/static_gen_specs_generator.rb
|
12
15
|
rails_generators/static_gen_specs/templates/generator_specs.rb
|
13
16
|
rails_generators/static_gen_specs/templates/model_gen_specs.rb
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('static-generators', '0.1.
|
5
|
+
Echoe.new('static-generators', '0.1.7') do |p|
|
6
6
|
p.project = "staticgenerators"
|
7
7
|
p.description = "Generate attractive interfaces that are easy to edit."
|
8
8
|
p.url = "http://github.com/jrhicks/static-scaffolds"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
NAME
|
2
|
+
static_authentication - short description of the generator
|
3
|
+
|
4
|
+
SYNOPSIS
|
5
|
+
static_authentication [user model name]
|
6
|
+
|
7
|
+
DESCRIPTION
|
8
|
+
Generate tables and interfaces to manage controller_action_permissions, scoped_permissions, and roles.
|
9
|
+
Designed to be compatible with the :static_authentication option selected in the static_scaffold
|
10
|
+
|
11
|
+
|
12
|
+
EXAMPLE
|
13
|
+
./script/generate static_authentication
|
14
|
+
|
15
|
+
Result of the example
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class StaticAuthorizationGenerator < Rails::Generator::Base
|
2
|
+
def manifest
|
3
|
+
record do |m|
|
4
|
+
|
5
|
+
# Migration
|
6
|
+
m.template(
|
7
|
+
"migration.rb",
|
8
|
+
File.join('db','migrate',"#{Time.now.strftime("%Y%m%d%H%M%S")}_static_authorization.rb"))
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def user_foreign_key
|
13
|
+
# if they pass in Users as an option ... return user_id
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class StaticAuthorization < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def self.up
|
4
|
+
create_table :roles do |t|
|
5
|
+
t.string :name
|
6
|
+
t.boolean :is_super
|
7
|
+
end
|
8
|
+
|
9
|
+
create_table :permitted_actions do |t|
|
10
|
+
t.integer :role_id
|
11
|
+
t.string :controller, :action
|
12
|
+
end
|
13
|
+
|
14
|
+
create_table :permitted_scopes do |t|
|
15
|
+
t.integer :role_id
|
16
|
+
t.integer :model_name, :scope
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.down
|
22
|
+
drop_table :roles
|
23
|
+
drop_table :permitted_actions
|
24
|
+
drop_table :permitted_scopes
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
data/static-generators.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{static-generators}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.8"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Jeffrey Hicks"]
|
9
|
-
s.date = %q{2009-06
|
9
|
+
s.date = %q{2009-07-06}
|
10
10
|
s.description = %q{Generate attractive interfaces that are easy to edit.}
|
11
11
|
s.email = %q{jrhicks (at) gmail (dot) com}
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "lib/static_generators.rb", "LICENSE", "README.md", "tasks/deployment.rake", "TODO"]
|
13
|
-
s.files = ["CHANGELOG", "lib/static_generators.rb", "LICENSE", "rails_generators/static_app/static_app_generator.rb", "rails_generators/static_app/templates/application_helper.rb", "rails_generators/static_app/templates/layout.html.erb", "rails_generators/static_app/templates/layout_helper.rb", "rails_generators/static_app/templates/sorttable.js", "rails_generators/static_app/templates/static_style.css", "rails_generators/static_app/USAGE", "rails_generators/static_gen_specs/static_gen_specs_generator.rb", "rails_generators/static_gen_specs/templates/generator_specs.rb", "rails_generators/static_gen_specs/templates/model_gen_specs.rb", "rails_generators/static_gen_specs/USAGE", "rails_generators/static_scaffold/static_scaffold_generator.rb", "rails_generators/static_scaffold/templates/controller.rb", "rails_generators/static_scaffold/templates/functional_test.rb", "rails_generators/static_scaffold/templates/helper.rb", "rails_generators/static_scaffold/templates/helper_test.rb", "rails_generators/static_scaffold/templates/layout.html.erb", "rails_generators/static_scaffold/templates/model.rb", "rails_generators/static_scaffold/templates/view_edit.html.erb", "rails_generators/static_scaffold/templates/view_index.html.erb", "rails_generators/static_scaffold/templates/view_new.html.erb", "rails_generators/static_scaffold/templates/view_show.html.erb", "rails_generators/static_scaffold/USAGE", "Rakefile", "README.md", "tasks/deployment.rake", "TODO", "USAGE", "Manifest", "static-generators.gemspec"]
|
13
|
+
s.files = ["CHANGELOG", "lib/static_generators.rb", "LICENSE", "rails_generators/static_app/static_app_generator.rb", "rails_generators/static_app/templates/application_helper.rb", "rails_generators/static_app/templates/layout.html.erb", "rails_generators/static_app/templates/layout_helper.rb", "rails_generators/static_app/templates/sorttable.js", "rails_generators/static_app/templates/static_style.css", "rails_generators/static_app/USAGE", "rails_generators/static_authorization/static_authorization_generator.rb", "rails_generators/static_authorization/templates/migration.rb", "rails_generators/static_authorization/USAGE", "rails_generators/static_gen_specs/static_gen_specs_generator.rb", "rails_generators/static_gen_specs/templates/generator_specs.rb", "rails_generators/static_gen_specs/templates/model_gen_specs.rb", "rails_generators/static_gen_specs/USAGE", "rails_generators/static_scaffold/static_scaffold_generator.rb", "rails_generators/static_scaffold/templates/controller.rb", "rails_generators/static_scaffold/templates/functional_test.rb", "rails_generators/static_scaffold/templates/helper.rb", "rails_generators/static_scaffold/templates/helper_test.rb", "rails_generators/static_scaffold/templates/layout.html.erb", "rails_generators/static_scaffold/templates/model.rb", "rails_generators/static_scaffold/templates/view_edit.html.erb", "rails_generators/static_scaffold/templates/view_index.html.erb", "rails_generators/static_scaffold/templates/view_new.html.erb", "rails_generators/static_scaffold/templates/view_show.html.erb", "rails_generators/static_scaffold/USAGE", "Rakefile", "README.md", "tasks/deployment.rake", "TODO", "USAGE", "Manifest", "static-generators.gemspec"]
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.homepage = %q{http://github.com/jrhicks/static-scaffolds}
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Static-generators", "--main", "README.md"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jrhicks-static-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeffrey Hicks
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06
|
12
|
+
date: 2009-07-06 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -37,6 +37,9 @@ files:
|
|
37
37
|
- rails_generators/static_app/templates/sorttable.js
|
38
38
|
- rails_generators/static_app/templates/static_style.css
|
39
39
|
- rails_generators/static_app/USAGE
|
40
|
+
- rails_generators/static_authorization/static_authorization_generator.rb
|
41
|
+
- rails_generators/static_authorization/templates/migration.rb
|
42
|
+
- rails_generators/static_authorization/USAGE
|
40
43
|
- rails_generators/static_gen_specs/static_gen_specs_generator.rb
|
41
44
|
- rails_generators/static_gen_specs/templates/generator_specs.rb
|
42
45
|
- rails_generators/static_gen_specs/templates/model_gen_specs.rb
|