skeletal 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.md +17 -0
- data/Rakefile +57 -0
- data/VERSION +1 -0
- data/bin/appbones +16 -0
- data/features/appbones.feature +9 -0
- data/features/step_definitions/appbones_steps.rb +0 -0
- data/features/support/env.rb +4 -0
- data/lib/appbones.rb +27 -0
- data/lib/templates/app.erb +19 -0
- data/spec/appbones_spec.rb +8 -0
- data/spec/spec_helper.rb +9 -0
- metadata +173 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 BJ Neilsen
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# AppBones
|
2
|
+
|
3
|
+
Simple application structure generator
|
4
|
+
|
5
|
+
## Note on Patches/Pull Requests
|
6
|
+
|
7
|
+
* Fork the project.
|
8
|
+
* Make your feature addition or bug fix.
|
9
|
+
* Add tests for it. This is important so I don't break it in a
|
10
|
+
future version unintentionally.
|
11
|
+
* Commit, do not mess with rakefile, version, or history.
|
12
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
+
* Send me a pull request. Bonus points for topic branches.
|
14
|
+
|
15
|
+
## Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2010 BJ Neilsen. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'bundler'
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'jeweler'
|
7
|
+
Jeweler::Tasks.new do |gem|
|
8
|
+
gem.name = 'skeletal'
|
9
|
+
gem.summary = %Q{Application structure generator}
|
10
|
+
gem.description = %Q{A gem to handle generating application structures for non-rails applications. Currently supports only Sinatra.}
|
11
|
+
gem.email = 'bj.neilsen@gmail.com'
|
12
|
+
gem.homepage = 'http://github.com/localshred/skeletal'
|
13
|
+
gem.authors = ['BJ Neilsen']
|
14
|
+
gem.add_bundler_dependencies
|
15
|
+
end
|
16
|
+
Jeweler::GemcutterTasks.new
|
17
|
+
rescue LoadError
|
18
|
+
puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
|
19
|
+
end
|
20
|
+
|
21
|
+
require 'rspec/core/rake_task'
|
22
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
23
|
+
# spec.libs << 'lib' << 'spec'
|
24
|
+
# spec.spec_files = FileList['spec/**/*_spec.rb']
|
25
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
26
|
+
end
|
27
|
+
|
28
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
29
|
+
# spec.libs << 'lib' << 'spec'
|
30
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
31
|
+
spec.rcov = true
|
32
|
+
end
|
33
|
+
|
34
|
+
task :spec => :check_dependencies
|
35
|
+
|
36
|
+
begin
|
37
|
+
require 'cucumber/rake/task'
|
38
|
+
Cucumber::Rake::Task.new(:features)
|
39
|
+
|
40
|
+
task :features => :check_dependencies
|
41
|
+
rescue LoadError
|
42
|
+
task :features do
|
43
|
+
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
task :default => :spec
|
48
|
+
|
49
|
+
require 'rake/rdoctask'
|
50
|
+
Rake::RDocTask.new do |rdoc|
|
51
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
52
|
+
|
53
|
+
rdoc.rdoc_dir = 'rdoc'
|
54
|
+
rdoc.title = "appbones #{version}"
|
55
|
+
rdoc.rdoc_files.include('README*')
|
56
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
57
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
data/bin/appbones
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.join(File.expand_path(File.dirname(__FILE__)),'..', 'lib', 'appbones')
|
4
|
+
require 'optparse'
|
5
|
+
|
6
|
+
# options = {}
|
7
|
+
# OptionParser.new do |opts|
|
8
|
+
# opts.banner = "Usage: appbones [OPTIONS] app_name"
|
9
|
+
# opts.on("-d", "--directory", "Specify the base application directory") do |dir|
|
10
|
+
# options[:directory] = dir
|
11
|
+
# end
|
12
|
+
# end.parse!
|
13
|
+
|
14
|
+
raise "You must specify an app name" if ARGV.empty? || ARGV.first.strip.empty?
|
15
|
+
|
16
|
+
AppBones.create! ARGV.first.strip
|
File without changes
|
data/lib/appbones.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'erb'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
class AppBones
|
5
|
+
def self.create! app_name
|
6
|
+
# Create the initial directory
|
7
|
+
# FileUtils.mkpath(File.expand_path(directory))
|
8
|
+
|
9
|
+
@app_dir = File.expand_path(app_name)
|
10
|
+
puts @app_dir
|
11
|
+
|
12
|
+
# Create the basic folder structure
|
13
|
+
%w( app app/models app/helpers app/views app/views/layouts app/routes lib spec features features/step_definitions features/support config tmp tasks db db/migrations ).each do |dir|
|
14
|
+
puts dir
|
15
|
+
FileUtils.mkpath(File.join(@app_dir, dir))
|
16
|
+
end
|
17
|
+
|
18
|
+
# Create the application file
|
19
|
+
@app_file = File.join(File.expand_path(app_name), 'app', "#{name}.rb")
|
20
|
+
File.open(@app_file, 'w') do |file|
|
21
|
+
template = ERB.new 'templates/app.erb'
|
22
|
+
file.write(template.run(binding))
|
23
|
+
end
|
24
|
+
|
25
|
+
# Add everything to git
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'sinatra'
|
3
|
+
|
4
|
+
class <%= @name %> < Sinatra::Application
|
5
|
+
|
6
|
+
configure do
|
7
|
+
# Configuration here
|
8
|
+
end
|
9
|
+
|
10
|
+
helpers do
|
11
|
+
# Helper methods here
|
12
|
+
end
|
13
|
+
|
14
|
+
# Routes Here
|
15
|
+
get '/hi' do
|
16
|
+
"Hello World!"
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: skeletal
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
version: 0.0.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- BJ Neilsen
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-08-04 00:00:00 -06:00
|
18
|
+
default_executable: appbones
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rake
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :runtime
|
31
|
+
prerelease: false
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: bundler
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 0
|
42
|
+
version: "0"
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: *id002
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: jeweler
|
48
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
segments:
|
54
|
+
- 0
|
55
|
+
version: "0"
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *id003
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: autotest
|
61
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
segments:
|
67
|
+
- 0
|
68
|
+
version: "0"
|
69
|
+
type: :development
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: *id004
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: rspec
|
74
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - "="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
segments:
|
80
|
+
- 2
|
81
|
+
- 0
|
82
|
+
- 0
|
83
|
+
- beta
|
84
|
+
- 19
|
85
|
+
version: 2.0.0.beta.19
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: *id005
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rcov
|
91
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
segments:
|
97
|
+
- 0
|
98
|
+
version: "0"
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *id006
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: cucumber
|
104
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
version: "0"
|
112
|
+
type: :development
|
113
|
+
prerelease: false
|
114
|
+
version_requirements: *id007
|
115
|
+
description: A gem to handle generating application structures for non-rails applications. Currently supports only Sinatra.
|
116
|
+
email: bj.neilsen@gmail.com
|
117
|
+
executables:
|
118
|
+
- appbones
|
119
|
+
extensions: []
|
120
|
+
|
121
|
+
extra_rdoc_files:
|
122
|
+
- LICENSE
|
123
|
+
- README.md
|
124
|
+
files:
|
125
|
+
- .document
|
126
|
+
- .gitignore
|
127
|
+
- LICENSE
|
128
|
+
- README.md
|
129
|
+
- Rakefile
|
130
|
+
- VERSION
|
131
|
+
- bin/appbones
|
132
|
+
- features/appbones.feature
|
133
|
+
- features/step_definitions/appbones_steps.rb
|
134
|
+
- features/support/env.rb
|
135
|
+
- lib/appbones.rb
|
136
|
+
- lib/templates/app.erb
|
137
|
+
- spec/appbones_spec.rb
|
138
|
+
- spec/spec_helper.rb
|
139
|
+
has_rdoc: true
|
140
|
+
homepage: http://github.com/localshred/skeletal
|
141
|
+
licenses: []
|
142
|
+
|
143
|
+
post_install_message:
|
144
|
+
rdoc_options:
|
145
|
+
- --charset=UTF-8
|
146
|
+
require_paths:
|
147
|
+
- lib
|
148
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
segments:
|
154
|
+
- 0
|
155
|
+
version: "0"
|
156
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
|
+
none: false
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
segments:
|
162
|
+
- 0
|
163
|
+
version: "0"
|
164
|
+
requirements: []
|
165
|
+
|
166
|
+
rubyforge_project:
|
167
|
+
rubygems_version: 1.3.7
|
168
|
+
signing_key:
|
169
|
+
specification_version: 3
|
170
|
+
summary: Application structure generator
|
171
|
+
test_files:
|
172
|
+
- spec/appbones_spec.rb
|
173
|
+
- spec/spec_helper.rb
|