dm-rails-gae 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/dm-rails-gae.gemspec +6 -2
- data/lib/dm-rails-gae.rb +1 -1
- data/lib/generators/data_mapper/USAGE +8 -0
- data/lib/generators/data_mapper/model/model_generator.rb +38 -0
- data/lib/generators/data_mapper/model/templates/model.rb +8 -0
- data/lib/generators/data_mapper/templates/model.rb +8 -0
- metadata +6 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/dm-rails-gae.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dm-rails-gae}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["joshsmoore"]
|
12
|
-
s.date = %q{2009-12-
|
12
|
+
s.date = %q{2009-12-19}
|
13
13
|
s.description = %q{Integrate datamapper to rails3 for the Google App Engine}
|
14
14
|
s.email = %q{joshsmoore@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -30,6 +30,10 @@ Gem::Specification.new do |s|
|
|
30
30
|
"generators/data_mapper/templates/model.rb",
|
31
31
|
"lib/USAGE",
|
32
32
|
"lib/dm-rails-gae.rb",
|
33
|
+
"lib/generators/data_mapper/USAGE",
|
34
|
+
"lib/generators/data_mapper/model/model_generator.rb",
|
35
|
+
"lib/generators/data_mapper/model/templates/model.rb",
|
36
|
+
"lib/generators/data_mapper/templates/model.rb",
|
33
37
|
"test/helper.rb",
|
34
38
|
"test/test_dm-rails-gae.rb"
|
35
39
|
]
|
data/lib/dm-rails-gae.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
#puts File.expand_path(__FILE__)
|
2
|
-
require '../generators/data_mapper/model/model_generator'
|
2
|
+
#require '../generators/data_mapper/model/model_generator'
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#require 'data_mapper/data_mapper_generator'
|
2
|
+
require 'rails/generators/named_base'
|
3
|
+
|
4
|
+
module DataMapper
|
5
|
+
module Generators
|
6
|
+
class ModelGenerator < Rails::Generators::NamedBase #DataMapperGenerator
|
7
|
+
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
|
8
|
+
|
9
|
+
check_class_collision
|
10
|
+
|
11
|
+
#class_option :migration, :type => :boolean
|
12
|
+
class_option :timestamps, :type => :boolean
|
13
|
+
#class_option :parent, :type => :string, :desc => "The parent class for the generated model"
|
14
|
+
|
15
|
+
#def create_migration_file
|
16
|
+
# return unless options[:migration] && options[:parent].nil?
|
17
|
+
# migration_template "migration.rb", "db/migrate/create_#{table_name}.rb"
|
18
|
+
#end
|
19
|
+
|
20
|
+
def create_model_file
|
21
|
+
puts "I am creating a datamapper model"
|
22
|
+
template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
|
23
|
+
end
|
24
|
+
|
25
|
+
#hook_for :test_framework
|
26
|
+
|
27
|
+
#protected
|
28
|
+
|
29
|
+
#def parent_class_name
|
30
|
+
# options[:parent] || "ActiveRecord::Base"
|
31
|
+
#end
|
32
|
+
def self.source_root
|
33
|
+
puts File.expand_path('../templates', __FILE__)
|
34
|
+
@source_root ||= File.expand_path('../templates', __FILE__)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-rails-gae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joshsmoore
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-19 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -45,6 +45,10 @@ files:
|
|
45
45
|
- generators/data_mapper/templates/model.rb
|
46
46
|
- lib/USAGE
|
47
47
|
- lib/dm-rails-gae.rb
|
48
|
+
- lib/generators/data_mapper/USAGE
|
49
|
+
- lib/generators/data_mapper/model/model_generator.rb
|
50
|
+
- lib/generators/data_mapper/model/templates/model.rb
|
51
|
+
- lib/generators/data_mapper/templates/model.rb
|
48
52
|
- test/helper.rb
|
49
53
|
- test/test_dm-rails-gae.rb
|
50
54
|
has_rdoc: true
|