skellington 0.4.0 → 0.4.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.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.rspec +1 -0
- data/Guardfile +1 -1
- data/README.md +44 -24
- data/Rakefile +1 -3
- data/config/config.yaml +28 -4
- data/files +24 -0
- data/lib/skellington/template.rb +1 -1
- data/lib/skellington/version.rb +1 -1
- data/lib/templates/.rspec.eruby +3 -0
- data/lib/templates/Rakefile.eruby +6 -1
- data/lib/templates/config.ru.eruby +1 -2
- data/lib/templates/features/json.feature.eruby +9 -0
- data/lib/templates/features/support/env.rb.eruby +2 -1
- data/lib/templates/lib/app.rb.eruby +28 -8
- data/lib/templates/lib/app/helpers.rb.eruby +4 -0
- data/lib/templates/lib/app/racks.rb.eruby +24 -0
- data/lib/templates/public/assets/favicon.ico.eruby +0 -0
- data/lib/templates/public/css/styles.css.eruby +0 -0
- data/lib/templates/public/js/app.js.eruby +0 -0
- data/lib/templates/spec/app/app_spec.rb.eruby +7 -0
- data/lib/templates/spec/javascripts/appSpec.js.eruby +5 -0
- data/lib/templates/spec/javascripts/support/jasmine.yml.eruby +15 -0
- data/lib/templates/spec/javascripts/support/jasmine_helper.rb.eruby +0 -0
- data/lib/templates/spec/spec_helper.rb.eruby +16 -0
- data/lib/templates/views/default.erb.eruby +15 -0
- data/lib/templates/views/includes/header.erb.eruby +22 -0
- data/lib/templates/{lib/views → views}/index.erb.eruby +0 -0
- data/skellington.gemspec +0 -3
- data/spec/cli/app_spec.rb +85 -0
- data/{features/bootstrap.feature → spec/cli/bootstrap_spec.rb} +41 -27
- data/spec/cli/config_ru_spec.rb +18 -0
- data/spec/cli/cukes_spec.rb +66 -0
- data/spec/cli/gemfile_spec.rb +38 -0
- data/spec/cli/git_spec.rb +12 -0
- data/spec/cli/javascript_spec.rb +42 -0
- data/spec/cli/non_local_path_spec.rb +55 -0
- data/spec/cli/procfile_spec.rb +16 -0
- data/spec/cli/public_spec.rb +14 -0
- data/spec/cli/rakefile_spec.rb +30 -0
- data/spec/cli/rbenv_spec.rb +17 -0
- data/spec/cli/spec_spec.rb +51 -0
- data/spec/cli_spec.rb +32 -0
- data/spec/hyphens_spec.rb +36 -0
- data/spec/spec_helper.rb +39 -0
- metadata +49 -78
- data/features/app.feature +0 -21
- data/features/cli.feature +0 -29
- data/features/config.ru.feature +0 -12
- data/features/cukes.feature +0 -50
- data/features/gemfile.feature +0 -27
- data/features/git.feature +0 -5
- data/features/guardfile.feature +0 -16
- data/features/hyphens.feature +0 -27
- data/features/naming.feature +0 -6
- data/features/non-local-path.feature +0 -29
- data/features/procfile.feature +0 -9
- data/features/rakefile.feature +0 -18
- data/features/rbenv.feature +0 -6
- data/features/support/env.rb +0 -6
- data/lib/templates/Guardfile.eruby +0 -8
- data/lib/templates/lib/views/default.erb.eruby +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9cfadd02678c94f3e7086f19738dfe59a1942b7
|
4
|
+
data.tar.gz: 1a636831eaa0cf82be43debf681db927273e2058
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed3f2ec26f7ef88dc1a99449313a2dfad7401bf938424b8b8f8fd1d41c2a91bb1ace5300e1fef6582038d21a9bcb7a0cb163037d46362183ab50a200ce5debf7
|
7
|
+
data.tar.gz: 0061d7fd850e8686a9fb7fb091c2f4e11a9982e3564381acd9c1a4a600e4ae60eade81fd4eafcf7cf1fb917c9cd08b2ebcad0c273c1ddf447669ff3d46b07280
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
data/Guardfile
CHANGED
data/README.md
CHANGED
@@ -8,41 +8,61 @@
|
|
8
8
|
|
9
9
|
# Skellington
|
10
10
|
|
11
|
-
Generate
|
11
|
+
Generate a [Sinatra](http://www.sinatrarb.com/) app skeleton. Sets up
|
12
|
+
|
13
|
+
* [Cucumber](https://cucumber.io/)
|
14
|
+
* with [cucumber-api-steps](https://github.com/jayzes/cucumber-api-steps)
|
15
|
+
* [Rspec](http://rspec.info/)
|
16
|
+
* [Jasmine](http://jasmine.github.io/2.0/introduction.html)
|
17
|
+
* [Bootstrap](http://getbootstrap.com/)
|
18
|
+
|
19
|
+
Should work fine for both RVM- and rbenv-based setups
|
12
20
|
|
13
21
|
$ gem install skellington
|
14
22
|
$ skellington generate naming-things-is-hard
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
Generating naming_things_is_hard/Gemfile...done
|
24
|
+
Generating naming_things_is_hard/Rakefile...done
|
25
|
+
Generating naming_things_is_hard/Procfile...done
|
26
|
+
Generating naming_things_is_hard/.ruby-version...done
|
27
|
+
Generating naming_things_is_hard/.rspec...done
|
28
|
+
Generating naming_things_is_hard/config.ru...done
|
29
|
+
Generating naming_things_is_hard/features/naming_things_is_hard.feature...done
|
30
|
+
Generating naming_things_is_hard/features/json.feature...done
|
31
|
+
Generating naming_things_is_hard/features/step_definitions/naming_things_is_hard_steps.rb...done
|
32
|
+
Generating naming_things_is_hard/features/support/env.rb...done
|
33
|
+
Generating naming_things_is_hard/lib/naming_things_is_hard.rb...done
|
34
|
+
Generating naming_things_is_hard/lib/naming_things_is_hard/racks.rb...done
|
35
|
+
Generating naming_things_is_hard/lib/naming_things_is_hard/helpers.rb...done
|
36
|
+
Generating naming_things_is_hard/views/default.erb...done
|
37
|
+
Generating naming_things_is_hard/views/index.erb...done
|
38
|
+
Generating naming_things_is_hard/views/includes/header.erb...done
|
39
|
+
Generating naming_things_is_hard/spec/spec_helper.rb...done
|
40
|
+
Generating naming_things_is_hard/spec/naming_things_is_hard/naming_things_is_hard_spec.rb...done
|
41
|
+
Generating naming_things_is_hard/spec/javascripts/support/jasmine.yml...done
|
42
|
+
Generating naming_things_is_hard/spec/javascripts/support/jasmine_helper.rb...done
|
43
|
+
Generating naming_things_is_hard/spec/javascripts/naming_things_is_hardSpec.js...done
|
44
|
+
Generating naming_things_is_hard/public/assets/favicon.ico...done
|
45
|
+
Generating naming_things_is_hard/public/css/styles.css...done
|
46
|
+
Generating naming_things_is_hard/public/js/naming_things_is_hard.js...done
|
27
47
|
|
28
|
-
|
48
|
+
Your new Sinatra app NamingThingsIsHard has been created
|
29
49
|
|
30
|
-
|
50
|
+
(Note that 'naming-things-is-hard' has been changed to 'naming_things_is_hard' because Ruby finds '-'s troubling)
|
31
51
|
|
32
|
-
|
52
|
+
Now do
|
33
53
|
|
34
|
-
|
35
|
-
|
36
|
-
|
54
|
+
cd naming_things_is_hard
|
55
|
+
bundle
|
56
|
+
rake
|
37
57
|
|
38
|
-
|
58
|
+
And presuming that passes OK
|
39
59
|
|
40
|
-
|
41
|
-
|
60
|
+
git add .
|
61
|
+
git commit -m 'First commit'
|
42
62
|
|
43
|
-
|
63
|
+
You can run the app with
|
44
64
|
|
45
|
-
|
65
|
+
rackup
|
46
66
|
|
47
67
|
This assumes a bunch of things, at least:
|
48
68
|
|
data/Rakefile
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
require 'rspec/core/rake_task'
|
3
|
-
require 'cucumber/rake/task'
|
4
3
|
require 'coveralls/rake/task'
|
5
4
|
|
6
5
|
Coveralls::RakeTask.new
|
7
6
|
RSpec::Core::RakeTask.new
|
8
|
-
Cucumber::Rake::Task.new
|
9
7
|
|
10
|
-
task :default => [:spec,
|
8
|
+
task :default => [:spec, 'coveralls:push']
|
data/config/config.yaml
CHANGED
@@ -1,15 +1,22 @@
|
|
1
1
|
gems:
|
2
2
|
production:
|
3
3
|
- sinatra
|
4
|
-
-
|
4
|
+
- puma
|
5
5
|
- rake
|
6
|
+
- rack-conneg
|
6
7
|
|
7
8
|
test:
|
8
9
|
- cucumber
|
9
10
|
- capybara
|
11
|
+
- coveralls
|
12
|
+
- jasmine
|
13
|
+
- rspec
|
14
|
+
- guard-rspec
|
15
|
+
- guard-jasmine
|
10
16
|
- guard
|
11
17
|
- guard-cucumber
|
12
18
|
- pry
|
19
|
+
- actionpack
|
13
20
|
|
14
21
|
test_require_false:
|
15
22
|
- cucumber-api-steps
|
@@ -18,18 +25,35 @@ files:
|
|
18
25
|
Gemfile:
|
19
26
|
Rakefile:
|
20
27
|
Procfile:
|
21
|
-
Guardfile:
|
22
28
|
.ruby-version:
|
29
|
+
.rspec:
|
23
30
|
config.ru:
|
24
31
|
# the template has this name
|
25
32
|
features/first.feature:
|
26
33
|
# but the output file substitutes it like this, where wormname is an attribute
|
27
34
|
# on the Generator object
|
28
35
|
outpath: first/wormname
|
36
|
+
features/json.feature:
|
29
37
|
features/step_definitions/app_steps.rb:
|
30
38
|
outpath: app/wormname
|
31
39
|
features/support/env.rb:
|
32
40
|
lib/app.rb:
|
33
41
|
outpath: app/wormname
|
34
|
-
lib/
|
35
|
-
|
42
|
+
lib/app/racks.rb:
|
43
|
+
outpath: app/wormname/racks
|
44
|
+
lib/app/helpers.rb:
|
45
|
+
outpath: app/wormname/helpers
|
46
|
+
views/default.erb:
|
47
|
+
views/index.erb:
|
48
|
+
views/includes/header.erb:
|
49
|
+
spec/spec_helper.rb:
|
50
|
+
spec/app/app_spec.rb:
|
51
|
+
outpath: app/wormname
|
52
|
+
spec/javascripts/support/jasmine.yml:
|
53
|
+
spec/javascripts/support/jasmine_helper.rb:
|
54
|
+
spec/javascripts/appSpec.js:
|
55
|
+
outpath: app/wormname
|
56
|
+
public/assets/favicon.ico:
|
57
|
+
public/css/styles.css:
|
58
|
+
public/js/app.js:
|
59
|
+
outpath: app/wormname
|
data/files
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
./.rspec <
|
2
|
+
./.ruby-version <
|
3
|
+
./config.ru <
|
4
|
+
./features/json.feature <
|
5
|
+
./features/step_definitions/template_steps.rb <
|
6
|
+
./features/support/env.rb <
|
7
|
+
./features/template.feature <
|
8
|
+
./Gemfile <
|
9
|
+
./lib/template/helpers.rb <
|
10
|
+
./lib/template/racks.rb <
|
11
|
+
./lib/template.rb <
|
12
|
+
./Procfile <
|
13
|
+
./public/assets/favicon.ico <
|
14
|
+
./public/css/styles.css <
|
15
|
+
./public/js/template.js <
|
16
|
+
./Rakefile <
|
17
|
+
./spec/javascripts/support/jasmine.yml <
|
18
|
+
./spec/javascripts/support/jasmine_helper.rb <
|
19
|
+
./spec/javascripts/templateSpec.js <
|
20
|
+
./spec/spec_helper.rb <
|
21
|
+
./spec/template/template_spec.rb <
|
22
|
+
./views/default.erb
|
23
|
+
./views/includes/header.erb
|
24
|
+
./views/index.erb
|
data/lib/skellington/template.rb
CHANGED
@@ -8,7 +8,7 @@ module Skellington
|
|
8
8
|
def outpath
|
9
9
|
@outpath ||= begin
|
10
10
|
subs = @generator.files[@name]['outpath'].split '/'
|
11
|
-
@outpath = "#{@generator.path}/#{@generator.send(subs[1].to_sym)}/#{@name.
|
11
|
+
@outpath = "#{@generator.path}/#{@generator.send(subs[1].to_sym)}/#{@name.gsub(subs[0], @generator.send(subs[1].to_sym))}"
|
12
12
|
rescue NoMethodError
|
13
13
|
@outpath = "#{@generator.path}/#{@generator.wormname}/#{@name}"
|
14
14
|
end
|
data/lib/skellington/version.rb
CHANGED
@@ -3,8 +3,13 @@ require File.join(File.dirname(__FILE__), 'lib/<%= @gen.wormname %>.rb')
|
|
3
3
|
unless ENV['RACK_ENV'] == 'production'
|
4
4
|
require 'rspec/core/rake_task'
|
5
5
|
require 'cucumber/rake/task'
|
6
|
+
require 'coveralls/rake/task'
|
7
|
+
require 'jasmine'
|
8
|
+
load 'jasmine/tasks/jasmine.rake'
|
6
9
|
|
7
10
|
Cucumber::Rake::Task.new
|
11
|
+
RSpec::Core::RakeTask.new
|
12
|
+
Coveralls::RakeTask.new
|
8
13
|
|
9
|
-
task :default => [:cucumber]
|
14
|
+
task :default => [:cucumber, :spec, 'jasmine:ci', 'coveralls:push']
|
10
15
|
end
|
@@ -6,6 +6,7 @@ require 'capybara'
|
|
6
6
|
require 'capybara/cucumber'
|
7
7
|
require 'rspec'
|
8
8
|
require 'cucumber/api_steps'
|
9
|
+
require 'active_support/core_ext/object/blank'
|
9
10
|
|
10
11
|
Capybara.app = <%= @gen.camelname %>
|
11
12
|
|
@@ -15,7 +16,7 @@ class <%= @gen.camelname %>World
|
|
15
16
|
include RSpec::Matchers
|
16
17
|
|
17
18
|
def app
|
18
|
-
<%= @gen.camelname
|
19
|
+
<%= @gen.camelname %>::App
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
@@ -1,12 +1,32 @@
|
|
1
1
|
require 'sinatra/base'
|
2
|
+
require 'tilt/erubis'
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
require_relative '<%= @gen.wormname %>/racks'
|
5
|
+
require_relative '<%= @gen.wormname %>/helpers'
|
6
|
+
|
7
|
+
module <%= @gen.camelname %>
|
8
|
+
class App < Sinatra::Base
|
9
|
+
helpers do
|
10
|
+
include <%= @gen.camelname %>::Helpers
|
11
|
+
end
|
12
|
+
|
13
|
+
get '/' do
|
14
|
+
respond_to do |wants|
|
15
|
+
wants.html do
|
16
|
+
@content = '<h1>Hello from <%= @gen.camelname %></h1>'
|
17
|
+
@title = '<%= @gen.camelname %>'
|
18
|
+
erb :index, layout: :default
|
19
|
+
end
|
9
20
|
|
10
|
-
|
11
|
-
|
21
|
+
wants.json do
|
22
|
+
{
|
23
|
+
app: '<%= @gen.camelname %>'
|
24
|
+
}.to_json
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# start the server if ruby file executed directly
|
30
|
+
run! if app_file == $0
|
31
|
+
end
|
12
32
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'rack/conneg'
|
2
|
+
|
3
|
+
module <%= @gen.camelname %>
|
4
|
+
class App < Sinatra::Base
|
5
|
+
set :public_folder, 'public'
|
6
|
+
set :views, 'views'
|
7
|
+
|
8
|
+
use Rack::Conneg do |conneg|
|
9
|
+
conneg.set :accept_all_extensions, false
|
10
|
+
conneg.set :fallback, :html
|
11
|
+
conneg.ignore_contents_of 'public'
|
12
|
+
conneg.provide [
|
13
|
+
:html,
|
14
|
+
:json
|
15
|
+
]
|
16
|
+
end
|
17
|
+
|
18
|
+
before do
|
19
|
+
if negotiated?
|
20
|
+
content_type negotiated_type
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
src_files:
|
2
|
+
- public/js/**/*.js
|
3
|
+
stylesheets:
|
4
|
+
- stylesheets/**/*.css
|
5
|
+
helpers:
|
6
|
+
- helpers/**/*.js
|
7
|
+
spec_files:
|
8
|
+
- '**/*[sS]pec.js'
|
9
|
+
src_dir:
|
10
|
+
spec_dir:
|
11
|
+
spec_helper: spec/javascripts/support/jasmine_helper.rb
|
12
|
+
boot_dir:
|
13
|
+
boot_files:
|
14
|
+
server: 'puma'
|
15
|
+
random: true
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'coveralls'
|
2
|
+
Coveralls.wear_merged!
|
3
|
+
|
4
|
+
require '<%= @gen.wormname %>'
|
5
|
+
|
6
|
+
RSpec.configure do |config|
|
7
|
+
config.expect_with :rspec do |expectations|
|
8
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
9
|
+
end
|
10
|
+
|
11
|
+
config.mock_with :rspec do |mocks|
|
12
|
+
mocks.verify_partial_doubles = true
|
13
|
+
end
|
14
|
+
|
15
|
+
config.order = :random
|
16
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang='en'>
|
3
|
+
<%%= erb :'includes/header' %>
|
4
|
+
<body>
|
5
|
+
<div class='container'>
|
6
|
+
<div class='row'>
|
7
|
+
<div class='col-md-2'></div>
|
8
|
+
<div class='col-md-8'>
|
9
|
+
<%%= yield %>
|
10
|
+
</div>
|
11
|
+
<div class='col-md-2'></div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<head>
|
2
|
+
<meta charset='utf-8' />
|
3
|
+
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
|
4
|
+
<meta name='viewport' content='width=device-width, initial-scale=1' />
|
5
|
+
|
6
|
+
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
7
|
+
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
8
|
+
<!--[if lt IE 9]>
|
9
|
+
<script src='https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js'></script>
|
10
|
+
<script src='https://oss.maxcdn.com/respond/1.4.2/respond.min.js'></script>
|
11
|
+
<![endif]-->
|
12
|
+
|
13
|
+
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
14
|
+
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
|
15
|
+
<!-- Include all compiled plugins (below), or include individual files as needed -->
|
16
|
+
<script src='//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js'></script>
|
17
|
+
<link rel='stylesheet' href='//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css' type='text/css' />
|
18
|
+
<link rel='icon' type='image/png' href='/assets/favicon.ico' />
|
19
|
+
<link rel='stylesheet' href='/css/styles.css' />
|
20
|
+
<script src='/js/template.js'></script>
|
21
|
+
<title><%%= @title %></title>
|
22
|
+
</head>
|