imposter 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +0 -0
- data/.gitignore +0 -0
- data/LICENSE +0 -0
- data/README.rdoc +0 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/generators/imposter_generator.rb +9 -5
- data/id_rsa.pub +0 -0
- data/imposter.gemspec +1 -1
- data/lib/imposter/animal.rb +0 -0
- data/lib/imposter/csz.db +0 -0
- data/lib/imposter/mineral.rb +0 -0
- data/lib/imposter/minerals_short.lst +0 -0
- data/lib/imposter/noun.rb +0 -0
- data/lib/imposter/vegtable.rb +0 -0
- data/lib/imposter/verb.rb +0 -0
- data/lib/imposter.rb +0 -0
- data/lib/tasks/databases.rake +11 -8
- data/test/helper.rb +0 -0
- data/test/test_imposter.rb +0 -0
- metadata +1 -1
data/.document
CHANGED
File without changes
|
data/.gitignore
CHANGED
File without changes
|
data/LICENSE
CHANGED
File without changes
|
data/README.rdoc
CHANGED
File without changes
|
data/Rakefile
CHANGED
@@ -14,7 +14,7 @@ begin
|
|
14
14
|
gem.add_dependency "sqlite3-ruby", ">= 1.2.5"
|
15
15
|
gem.add_dependency "faker", ">= 0"
|
16
16
|
gem.add_dependency "fastercsv", ">= 0"
|
17
|
-
gem.files.include %w(lib/imposter/*.rb lib/imposter/*.db generators/**/*.rb)
|
17
|
+
gem.files.include %w(lib/imposter/*.rb lib/imposter/*.db generators/**/*.rb lib/tasks/**/*.rake)
|
18
18
|
gem.summary = %Q{Real fake data}
|
19
19
|
gem.description = %Q{Add generator and rake tasks via YAML based imposters for schema level data faking}
|
20
20
|
gem.email = "robert.hall@itatc.com"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'activerecord'
|
3
3
|
require 'pathname'
|
4
|
-
require 'activesupport'
|
5
|
-
|
4
|
+
require 'activesupport'
|
5
|
+
require 'ftools'
|
6
6
|
|
7
7
|
class ImposterGenerator < Rails::Generator::Base
|
8
8
|
dbc = YAML.load(File.read('config/database.yml'))
|
@@ -24,7 +24,7 @@ class ImposterGenerator < Rails::Generator::Base
|
|
24
24
|
end
|
25
25
|
|
26
26
|
|
27
|
-
def genmodel(model_name)
|
27
|
+
def genmodel(model_name)
|
28
28
|
mn = Pathname.new(model_name).basename.to_s.chomp(File.extname(model_name))
|
29
29
|
require model_name
|
30
30
|
puts " " + mn
|
@@ -75,12 +75,16 @@ class ImposterGenerator < Rails::Generator::Base
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def genmodels
|
78
|
-
|
78
|
+
create_rake_file
|
79
79
|
models_dir = Dir.glob("app/models/*.rb")
|
80
80
|
models_dir.each do |model_dir|
|
81
81
|
genmodel(model_dir)
|
82
82
|
end
|
83
83
|
end
|
84
|
-
|
84
|
+
|
85
|
+
def create_rake_file
|
86
|
+
puts "Creating lib/tasks/databases.rake"
|
87
|
+
File.copy( Pathname.new(__FILE__).dirname + "../lib/tasks/databases.rake", "lib/tasks/")
|
88
|
+
end
|
85
89
|
|
86
90
|
end
|
data/id_rsa.pub
CHANGED
File without changes
|
data/imposter.gemspec
CHANGED
data/lib/imposter/animal.rb
CHANGED
File without changes
|
data/lib/imposter/csz.db
CHANGED
File without changes
|
data/lib/imposter/mineral.rb
CHANGED
File without changes
|
File without changes
|
data/lib/imposter/noun.rb
CHANGED
File without changes
|
data/lib/imposter/vegtable.rb
CHANGED
File without changes
|
data/lib/imposter/verb.rb
CHANGED
File without changes
|
data/lib/imposter.rb
CHANGED
File without changes
|
data/lib/tasks/databases.rake
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
require 'imposter'
|
3
|
+
|
4
|
+
|
5
|
+
namespace :imposter do
|
6
|
+
desc "Build imposters into Fixtures. Load specific Imposters using Imposters=x,y."
|
7
|
+
task :load do
|
8
|
+
Imposter::genimposters
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
data/test/helper.rb
CHANGED
File without changes
|
data/test/test_imposter.rb
CHANGED
File without changes
|