schema_to_scaffold 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ test/version_tmp
17
17
  tmp
18
18
  .project
19
19
  /schema.rb
20
+ .idea
data/README.md CHANGED
@@ -5,7 +5,8 @@
5
5
  Generate rails scaffold pages based on a rails database schema you already have.
6
6
 
7
7
  Use your schema.rb file from `<rails_app>/db` or generated with `rake db:schema:dump`
8
-
8
+ You can rename schema.rb to schema_your_fav_name.rb that I will find it to. This will prevent schema.rb from being
9
+ overwritten when one run rake db:migrate.
9
10
 
10
11
  SchemaToScaffold will generate rails scaffolding scripts by table like this:
11
12
 
@@ -1,19 +1,18 @@
1
1
  require 'find'
2
2
  module SchemaToScaffold
3
3
 
4
- PATH_NAMES = ["HOME", "HOMEPATH", "USERPROFILE"]
5
-
6
4
  ##
7
5
  # Deal with the path argument
8
-
6
+
9
7
  class Path
10
8
 
11
9
  def initialize(path)
12
- #@search_path = ENV[PATH_NAMES.detect {|home| ENV[home] != nil}]
13
10
  @search_path = Dir.pwd
14
11
  @path = path
15
12
  end
16
-
13
+
14
+ ##
15
+ # Validate if a given path leads to a directory
17
16
  def check_directory
18
17
  unless File.directory?(@search_path)
19
18
  puts "\nSorry #{@search_path} is not a valid directory!"
@@ -23,7 +22,7 @@ module SchemaToScaffold
23
22
  end
24
23
 
25
24
  ##
26
- # Will search for schema.rb in the user directory
25
+ # Will search for /schema[^\/]*.rb$/ in the current directory
27
26
  def search_rb
28
27
  @search_path = @path.to_s unless @path.nil?
29
28
  check_directory
@@ -37,7 +36,7 @@ module SchemaToScaffold
37
36
  # Return the chosen path
38
37
  def choose
39
38
  if @schema_paths.empty?
40
- puts "\nSorry there is none /schema\S*\.rb$/ in the directory #{@search_path}"
39
+ puts "\nSorry there is none /schema[^\/]*.rb$/ in the directory #{@search_path}"
41
40
  exit
42
41
  end
43
42
  @schema_paths.each_with_index {|path,indx| puts "#{indx}. #{path}" }
@@ -47,7 +46,6 @@ module SchemaToScaffold
47
46
  @schema_paths[id]
48
47
  end
49
48
 
50
-
51
49
  end
52
50
 
53
51
  end
@@ -1,6 +1,6 @@
1
1
  module SchemaToScaffold
2
- REVISION = 0
3
- MINOR = 3
4
2
  MAJOR = 0
3
+ MINOR = 3
4
+ REVISION = 1
5
5
  VERSION = [MAJOR, MINOR, REVISION].join('.')
6
6
  end
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.3.0
4
+ version: 0.3.1
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-02-11 00:00:00.000000000 Z
13
+ date: 2013-02-13 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
@@ -58,9 +58,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  version: '0'
59
59
  requirements: []
60
60
  rubyforge_project:
61
- rubygems_version: 1.8.24
61
+ rubygems_version: 1.8.25
62
62
  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: