ruby-app 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -14,4 +14,9 @@ Run like:
14
14
 
15
15
  $ ./bin/example
16
16
  $ APP_ENV=production ./bin/example
17
-
17
+
18
+
19
+ Generate app with ActiveRecord support:
20
+
21
+ $ ruby-app new_app --ar
22
+
data/bin/ruby-app CHANGED
@@ -8,11 +8,17 @@ class RubyAppGenerator < Thor::Group
8
8
 
9
9
  # Define arguments and options
10
10
  argument :name
11
+ class_option :ar, :default => false
11
12
 
12
13
  def copy_tree
13
- directory('', "#{name}/")
14
+ directory('project', "#{name}/")
14
15
  empty_directory("#{name}/log")
15
16
  empty_directory("#{name}/tmp")
17
+
18
+ if ar
19
+ copy_file("database.yml", "#{name}/config/database.yml")
20
+ empty_directory("#{name}/db/migrate")
21
+ end
16
22
  end
17
23
 
18
24
  def chmod_example_bin
@@ -23,13 +29,17 @@ class RubyAppGenerator < Thor::Group
23
29
  private
24
30
 
25
31
  def self.source_root
26
- File.join(File.dirname(__FILE__), %w{.. generator})
32
+ File.join(File.dirname(__FILE__), %w{.. generator })
27
33
  end
28
34
 
29
35
  def base_name
30
36
  File.basename(name)
31
37
  end
32
38
 
39
+ def ar
40
+ options[:ar]
41
+ end
42
+
33
43
  end
34
44
 
35
45
  RubyAppGenerator.start
@@ -0,0 +1,12 @@
1
+ development:
2
+ adapter: sqlite3
3
+ database: <%= App.root %>/db/development.db
4
+
5
+ test:
6
+ adapter: sqlite3
7
+ database: <%= App.root %>/db/test.db
8
+
9
+ production:
10
+ adapter: sqlite3
11
+ database: /some/path/production.db
12
+
@@ -4,3 +4,4 @@ log/*
4
4
  !log/.gitkeep
5
5
  tmp/*
6
6
  !tmp/.gitkeep
7
+ <%= "db/schema.rb\n*.db\n*.sqlite" if ar %>
@@ -2,6 +2,10 @@ source :rubygems
2
2
 
3
3
  gem 'rake', :require => false
4
4
  gem 'ruby-app'
5
+ <%= "gem 'ruby-app-ar'" if ar %>
6
+ <%= "gem 'sqlite3'" if ar %>
7
+
8
+
5
9
 
6
10
 
7
11
 
@@ -15,6 +19,5 @@ group :development do
15
19
  end
16
20
 
17
21
  group :test do
18
-
19
22
  gem 'rspec', '~>2'
20
23
  end
@@ -1,3 +1,4 @@
1
1
  require File.join(File.dirname(__FILE__), %w{config boot})
2
2
 
3
3
  load "ruby-app/tasks.rake"
4
+ <%= 'load "ruby-app-ar/tasks.rake"' if ar %>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module RubyApp
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-app
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Makarchev Konstantin
@@ -116,23 +116,24 @@ files:
116
116
  - README.md
117
117
  - Rakefile
118
118
  - bin/ruby-app
119
- - generator/.gitignore
120
- - generator/Gemfile
121
- - generator/Rakefile
122
- - generator/app/models/.gitkeep
123
- - generator/bin/console
124
- - generator/bin/example
125
- - generator/config/boot.rb
126
- - generator/config/config.rb
127
- - generator/config/environment.rb
128
- - generator/config/environments/development.rb
129
- - generator/config/environments/production.rb
130
- - generator/config/environments/test.rb
131
- - generator/config/initializers/.gitkeep
132
- - generator/lib/application.rb.tt
133
- - generator/lib/rake_tasks/.gitkeep
134
- - generator/spec/spec1_spec.rb.tt
135
- - generator/spec/spec_helper.rb
119
+ - generator/database.yml
120
+ - generator/project/.gitignore.tt
121
+ - generator/project/Gemfile.tt
122
+ - generator/project/Rakefile.tt
123
+ - generator/project/app/models/.gitkeep
124
+ - generator/project/bin/console
125
+ - generator/project/bin/example
126
+ - generator/project/config/boot.rb
127
+ - generator/project/config/config.rb
128
+ - generator/project/config/environment.rb
129
+ - generator/project/config/environments/development.rb
130
+ - generator/project/config/environments/production.rb
131
+ - generator/project/config/environments/test.rb
132
+ - generator/project/config/initializers/.gitkeep
133
+ - generator/project/lib/application.rb.tt
134
+ - generator/project/lib/rake_tasks/.gitkeep
135
+ - generator/project/spec/spec1_spec.rb.tt
136
+ - generator/project/spec/spec_helper.rb
136
137
  - lib/ruby-app/application.rb
137
138
  - lib/ruby-app/boot.rb
138
139
  - lib/ruby-app/common_config.rb