schema_to_scaffold 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/scaffold +1 -1
- data/lib/schema_to_scaffold/path.rb +7 -2
- data/lib/schema_to_scaffold/version.rb +2 -2
- data/schema_to_scaffold.gemspec +1 -1
- metadata +3 -2
data/bin/scaffold
CHANGED
@@ -9,7 +9,8 @@ module SchemaToScaffold
|
|
9
9
|
class Path
|
10
10
|
|
11
11
|
def initialize(path)
|
12
|
-
|
12
|
+
#@search_path = ENV[PATH_NAMES.detect {|home| ENV[home] != nil}]
|
13
|
+
@search_path = Dir.pwd
|
13
14
|
@path = path
|
14
15
|
end
|
15
16
|
|
@@ -28,13 +29,17 @@ module SchemaToScaffold
|
|
28
29
|
check_directory
|
29
30
|
@schema_paths = Array.new
|
30
31
|
Find.find(@search_path) do |s_p|
|
31
|
-
@schema_paths<<s_p if s_p[/schema
|
32
|
+
@schema_paths<<s_p if s_p[/schema[^\/]*.rb$/]
|
32
33
|
end
|
33
34
|
end
|
34
35
|
|
35
36
|
##
|
36
37
|
# Return the chosen path
|
37
38
|
def choose
|
39
|
+
if @schema_paths.empty?
|
40
|
+
puts "\nSorry there is none /schema\S*\.rb$/ in the directory #{@search_path}"
|
41
|
+
exit
|
42
|
+
end
|
38
43
|
@schema_paths.each_with_index {|path,indx| puts "#{indx}. #{path}" }
|
39
44
|
begin
|
40
45
|
print "\nSelect a path to the target schema: "
|
data/schema_to_scaffold.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_to_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-02-11 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: ! ' Command line app which parses a schema.rb file obtained from your
|
16
16
|
rails repo or by running rake:schema:dump
|
@@ -63,3 +63,4 @@ signing_key:
|
|
63
63
|
specification_version: 3
|
64
64
|
summary: Generate rails scaffold script from a schema.rb file.
|
65
65
|
test_files: []
|
66
|
+
has_rdoc:
|