ruby-app 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.md +2 -1
- data/bin/ruby-app +5 -17
- data/generator/Rakefile +2 -3
- data/generator/bin/dummy +3 -3
- data/generator/config/boot.rb +10 -0
- data/generator/config/environment.rb +2 -9
- data/generator/lib/{application.rb → application.rb.tt} +1 -1
- data/generator/spec/{spec1_spec.rb → spec1_spec.rb.tt} +1 -1
- data/lib/ruby-app/application.rb +1 -1
- data/lib/ruby-app/boot.rb +6 -0
- data/lib/ruby-app/environment.rb +5 -5
- data/lib/ruby-app/{tasks.rb → tasks.rake} +5 -3
- data/lib/ruby-app/version.rb +1 -1
- data/ruby-app.gemspec +1 -1
- data/spec/test_app/config/boot.rb +10 -0
- data/spec/test_app/config/environment.rb +1 -7
- metadata +105 -107
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
RubyApp
|
2
2
|
=======
|
3
3
|
|
4
|
-
Little ruby application template. For light ruby apps (daemons, EventMachine-apps, ...)
|
4
|
+
Little ruby application template. For creates light ruby apps (daemons, EventMachine-apps, ...).
|
5
|
+
Supports bundler, environments, rails dirs tree.
|
5
6
|
|
6
7
|
```ruby
|
7
8
|
gem install ruby-app
|
data/bin/ruby-app
CHANGED
@@ -10,12 +10,7 @@ class RubyAppGenerator < Thor::Group
|
|
10
10
|
argument :name
|
11
11
|
|
12
12
|
def copy_tree
|
13
|
-
|
14
|
-
Dir["#{source_root}/**/*"].each{|f| cp_file f }
|
15
|
-
end
|
16
|
-
|
17
|
-
def template_app
|
18
|
-
template("#{source_root}/lib/application.rb", "#{name}/lib/application.rb", true)
|
13
|
+
directory('./', "#{name}/")
|
19
14
|
end
|
20
15
|
|
21
16
|
def chmod_example_bin
|
@@ -23,22 +18,15 @@ class RubyAppGenerator < Thor::Group
|
|
23
18
|
end
|
24
19
|
|
25
20
|
private
|
26
|
-
def cp_file(filename)
|
27
|
-
if File.exists?(filename) && !File.directory?(filename)
|
28
|
-
return if File.basename(filename) == 'application.rb'
|
29
|
-
to = "#{name}#{filename.sub(source_root, '')}"
|
30
|
-
copy_file(filename, to)
|
31
|
-
end
|
32
|
-
end
|
33
21
|
|
34
|
-
def source_root
|
35
|
-
File.join(File.dirname(__FILE__), %w{.. generator})
|
36
|
-
end
|
37
|
-
|
38
22
|
def self.source_root
|
39
23
|
File.join(File.dirname(__FILE__), %w{.. generator})
|
40
24
|
end
|
41
25
|
|
26
|
+
def base_name
|
27
|
+
File.basename(name)
|
28
|
+
end
|
29
|
+
|
42
30
|
end
|
43
31
|
|
44
32
|
RubyAppGenerator.start
|
data/generator/Rakefile
CHANGED
data/generator/bin/dummy
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
|
3
3
|
require File.join(File.dirname(__FILE__), %w{.. config environment})
|
4
4
|
|
5
|
-
App.logger.info "root
|
6
|
-
App.logger.info "env
|
7
|
-
App.logger.info "name
|
5
|
+
App.logger.info "root: '#{App.root}'"
|
6
|
+
App.logger.info "env: '#{App.env}'"
|
7
|
+
App.logger.info "name: '#{App.name}'"
|
@@ -1,13 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
require '
|
3
|
-
require 'bundler/setup'
|
2
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
4
3
|
|
5
|
-
# ENV['APP_ENV'] = 'production' # uncomment if
|
6
|
-
|
7
|
-
class Application
|
8
|
-
def self.root
|
9
|
-
File.join(File.dirname(__FILE__), %w(..))
|
10
|
-
end
|
11
|
-
end
|
4
|
+
# ENV['APP_ENV'] = 'production' # uncomment if need forced env
|
12
5
|
|
13
6
|
require 'ruby-app/environment'
|
data/lib/ruby-app/application.rb
CHANGED
data/lib/ruby-app/environment.rb
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
$KCODE='u' if RUBY_VERSION < '1.9'
|
4
|
-
|
5
3
|
#require 'yaml'
|
6
4
|
|
7
5
|
local_root = File.dirname(__FILE__)
|
8
6
|
|
9
7
|
# app from gem
|
10
|
-
require File.join(local_root, '
|
8
|
+
require File.join(local_root, 'boot')
|
11
9
|
|
12
10
|
# config from gem
|
13
11
|
require File.join(local_root, 'common_config')
|
@@ -31,7 +29,9 @@ require 'active_support/core_ext/object/blank'
|
|
31
29
|
# load application app
|
32
30
|
require File.join(App.root, %w{lib application})
|
33
31
|
|
34
|
-
|
32
|
+
unless defined?(Rake)
|
33
|
+
App.logger.info "Loading #{App.name}[#{App.env}] ..."
|
34
|
+
end
|
35
35
|
|
36
36
|
# default config from app
|
37
37
|
require File.join(App.root, %w{config config})
|
@@ -44,7 +44,7 @@ rescue LoadError
|
|
44
44
|
end
|
45
45
|
|
46
46
|
# unshift lib app
|
47
|
-
$:.unshift(File.join(App.root, 'lib'))
|
47
|
+
# $:.unshift(File.join(App.root, 'lib'))
|
48
48
|
|
49
49
|
ActiveSupport::Dependencies::autoload_paths << File.join(App.root, 'lib')
|
50
50
|
|
@@ -1,14 +1,16 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
task :environment do
|
3
|
+
require File.join(App.root, %w{config environment})
|
4
|
+
end
|
3
5
|
|
6
|
+
# load gem rakes
|
4
7
|
Dir["#{File.dirname(__FILE__)}/tasks/*.{rb,rake}"].each do |f|
|
5
8
|
load f
|
6
9
|
end
|
7
10
|
|
8
|
-
|
9
11
|
# load app rakes
|
10
12
|
if defined?(App)
|
11
13
|
Dir["#{App.root}/lib/rake_tasks/*.{rb,rake}"].each do |f|
|
12
14
|
load f
|
13
15
|
end
|
14
|
-
end
|
16
|
+
end
|
data/lib/ruby-app/version.rb
CHANGED
data/ruby-app.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
|
8
8
|
s.authors = ["Makarchev Konstantin"]
|
9
9
|
|
10
|
-
s.description = %q{Little ruby application template. For light ruby apps (daemons,
|
10
|
+
s.description = %q{Little ruby application template. For creates light ruby apps (daemons, EventMachine-apps, ...). Supports bundler, environments, rails dirs tree.}
|
11
11
|
s.summary = %q{Ruby application template}
|
12
12
|
|
13
13
|
s.email = %q{kostya27@gmail.com}
|
@@ -1,14 +1,8 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
require
|
2
|
+
require File.join(File.dirname(__FILE__), %w{ boot })
|
3
3
|
|
4
4
|
ENV['APP_ENV'] = 'test3'
|
5
5
|
|
6
|
-
class Application
|
7
|
-
def self.root
|
8
|
-
File.join(File.dirname(__FILE__), %w(..))
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
6
|
$:.unshift(File.join(File.dirname(__FILE__), %w{.. .. .. lib}))
|
13
7
|
require 'ruby-app/environment'
|
14
8
|
|
metadata
CHANGED
@@ -1,115 +1,120 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-app
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 1
|
10
|
-
version: 0.1.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Makarchev Konstantin
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-06-20 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: activesupport
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
32
22
|
type: :runtime
|
33
|
-
version_requirements: *id001
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: rake
|
36
23
|
prerelease: false
|
37
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
25
|
none: false
|
39
|
-
requirements:
|
40
|
-
- -
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
46
38
|
type: :runtime
|
47
|
-
version_requirements: *id002
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: thor
|
50
39
|
prerelease: false
|
51
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
41
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: thor
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
60
54
|
type: :runtime
|
61
|
-
version_requirements: *id003
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: bundler
|
64
55
|
prerelease: false
|
65
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: bundler
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
66
65
|
none: false
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
|
71
|
-
segments:
|
72
|
-
- 0
|
73
|
-
version: "0"
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
74
70
|
type: :runtime
|
75
|
-
version_requirements: *id004
|
76
|
-
- !ruby/object:Gem::Dependency
|
77
|
-
name: rspec
|
78
71
|
prerelease: false
|
79
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
73
|
none: false
|
81
|
-
requirements:
|
82
|
-
- -
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rspec
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
88
86
|
type: :development
|
89
|
-
version_requirements: *id005
|
90
|
-
- !ruby/object:Gem::Dependency
|
91
|
-
name: rake
|
92
87
|
prerelease: false
|
93
|
-
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
89
|
none: false
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rake
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
102
|
type: :development
|
103
|
-
|
104
|
-
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
description: Little ruby application template. For creates light ruby apps (daemons,
|
111
|
+
EventMachine-apps, ...). Supports bundler, environments, rails dirs tree.
|
105
112
|
email: kostya27@gmail.com
|
106
|
-
executables:
|
113
|
+
executables:
|
107
114
|
- ruby-app
|
108
115
|
extensions: []
|
109
|
-
|
110
116
|
extra_rdoc_files: []
|
111
|
-
|
112
|
-
files:
|
117
|
+
files:
|
113
118
|
- .gitignore
|
114
119
|
- Gemfile
|
115
120
|
- LICENSE
|
@@ -121,22 +126,24 @@ files:
|
|
121
126
|
- generator/Rakefile
|
122
127
|
- generator/app/models/.gitkeep
|
123
128
|
- generator/bin/dummy
|
129
|
+
- generator/config/boot.rb
|
124
130
|
- generator/config/config.rb
|
125
131
|
- generator/config/environment.rb
|
126
132
|
- generator/config/environments/development.rb
|
127
133
|
- generator/config/environments/production.rb
|
128
134
|
- generator/config/environments/test.rb
|
129
135
|
- generator/config/initializers/.gitkeep
|
130
|
-
- generator/lib/application.rb
|
136
|
+
- generator/lib/application.rb.tt
|
131
137
|
- generator/lib/rake_tasks/.gitkeep
|
132
|
-
- generator/spec/spec1_spec.rb
|
138
|
+
- generator/spec/spec1_spec.rb.tt
|
133
139
|
- generator/spec/spec_helper.rb
|
134
140
|
- lib/ruby-app/application.rb
|
141
|
+
- lib/ruby-app/boot.rb
|
135
142
|
- lib/ruby-app/common_config.rb
|
136
143
|
- lib/ruby-app/default_config.rb
|
137
144
|
- lib/ruby-app/environment.rb
|
138
145
|
- lib/ruby-app/local_logger.rb
|
139
|
-
- lib/ruby-app/tasks.
|
146
|
+
- lib/ruby-app/tasks.rake
|
140
147
|
- lib/ruby-app/tasks/rspec.rake
|
141
148
|
- lib/ruby-app/version.rb
|
142
149
|
- ruby-app.gemspec
|
@@ -147,6 +154,7 @@ files:
|
|
147
154
|
- spec/test_app/app/models/2.rb
|
148
155
|
- spec/test_app/app/models/3.rb
|
149
156
|
- spec/test_app/bin/.gitkeep
|
157
|
+
- spec/test_app/config/boot.rb
|
150
158
|
- spec/test_app/config/config.rb
|
151
159
|
- spec/test_app/config/environment.rb
|
152
160
|
- spec/test_app/config/environments/development.rb
|
@@ -160,36 +168,26 @@ files:
|
|
160
168
|
- spec/test_app/lib/application.rb
|
161
169
|
homepage: http://github.com/kostya/ruby-app
|
162
170
|
licenses: []
|
163
|
-
|
164
171
|
post_install_message:
|
165
172
|
rdoc_options: []
|
166
|
-
|
167
|
-
require_paths:
|
173
|
+
require_paths:
|
168
174
|
- lib
|
169
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
175
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
170
176
|
none: false
|
171
|
-
requirements:
|
172
|
-
- -
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
|
175
|
-
|
176
|
-
- 0
|
177
|
-
version: "0"
|
178
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ! '>='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
182
|
none: false
|
180
|
-
requirements:
|
181
|
-
- -
|
182
|
-
- !ruby/object:Gem::Version
|
183
|
-
|
184
|
-
segments:
|
185
|
-
- 0
|
186
|
-
version: "0"
|
183
|
+
requirements:
|
184
|
+
- - ! '>='
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0'
|
187
187
|
requirements: []
|
188
|
-
|
189
188
|
rubyforge_project:
|
190
189
|
rubygems_version: 1.8.24
|
191
190
|
signing_key:
|
192
191
|
specification_version: 3
|
193
192
|
summary: Ruby application template
|
194
193
|
test_files: []
|
195
|
-
|