skellington 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bb5e9473127a2b2599ce62803a607be9cc662491
4
+ data.tar.gz: adde90372e7c6061d5397d2361731c1b7727e6ad
5
+ SHA512:
6
+ metadata.gz: fe4cf9231c8a5d2425b309ed5b893125ca72e3f8eedca0e8aff90e1cbf7718b48792c81c399e41d87755fb4fc950d6aa3d16d5453faa8c0ed4cb1190e641d56b
7
+ data.tar.gz: 1d6ff3d2f35c34db4bbdde3545580d05bf2721764742bf64d99d826421ab4804c7c2f4411e389944c5b88e8d9fdadf6d3955787fcafa2f373dbac49472834dba
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in skellington.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,86 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec feature)
6
+
7
+ ## Uncomment to clear the screen before every task
8
+ # clearing :on
9
+
10
+ ## Guard internally checks for changes in the Guardfile and exits.
11
+ ## If you want Guard to automatically start up again, run guard in a
12
+ ## shell loop, e.g.:
13
+ ##
14
+ ## $ while bundle exec guard; do echo "Restarting Guard..."; done
15
+ ##
16
+ ## Note: if you are using the `directories` clause above and you are not
17
+ ## watching the project directory ('.'), the you will want to move the Guardfile
18
+ ## to a watched dir and symlink it back, e.g.
19
+ #
20
+ # $ mkdir config
21
+ # $ mv Guardfile config/
22
+ # $ ln -s config/Guardfile .
23
+ #
24
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
25
+
26
+ # Note: The cmd option is now required due to the increasing number of ways
27
+ # rspec may be run, below are examples of the most common uses.
28
+ # * bundler: 'bundle exec rspec'
29
+ # * bundler binstubs: 'bin/rspec'
30
+ # * spring: 'bin/rspec' (This will use spring if running and you have
31
+ # installed the spring binstubs per the docs)
32
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
33
+ # * 'just' rspec: 'rspec'
34
+
35
+ guard :rspec, cmd: "bundle exec rspec" do
36
+ require "guard/rspec/dsl"
37
+ dsl = Guard::RSpec::Dsl.new(self)
38
+
39
+ # Feel free to open issues for suggestions and improvements
40
+
41
+ # RSpec files
42
+ rspec = dsl.rspec
43
+ watch(rspec.spec_helper) { rspec.spec_dir }
44
+ watch(rspec.spec_support) { rspec.spec_dir }
45
+ watch(rspec.spec_files)
46
+
47
+ # Ruby files
48
+ ruby = dsl.ruby
49
+ dsl.watch_spec_files_for(ruby.lib_files)
50
+
51
+ # Rails files
52
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
53
+ dsl.watch_spec_files_for(rails.app_files)
54
+ dsl.watch_spec_files_for(rails.views)
55
+
56
+ watch(rails.controllers) do |m|
57
+ [
58
+ rspec.spec.("routing/#{m[1]}_routing"),
59
+ rspec.spec.("controllers/#{m[1]}_controller"),
60
+ rspec.spec.("acceptance/#{m[1]}")
61
+ ]
62
+ end
63
+
64
+ # Rails config changes
65
+ watch(rails.spec_helper) { rspec.spec_dir }
66
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
67
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
68
+
69
+ # Capybara features specs
70
+ watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
71
+
72
+ # Turnip features and steps
73
+ watch(%r{^spec/acceptance/(.+)\.feature$})
74
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
75
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
76
+ end
77
+ end
78
+
79
+ guard "cucumber" do
80
+ watch(%r{^features/.+\.feature$})
81
+ watch(%r{^features/support/.+$}) { "features" }
82
+
83
+ watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m|
84
+ Dir[File.join("**/#{m[1]}.feature")][0] || "features"
85
+ end
86
+ end
data/LICENSE.md ADDED
@@ -0,0 +1,22 @@
1
+ ##Copyright (c) 2015 Sam Pikesley
2
+
3
+ #MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 pikesley
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Skellington
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'skellington'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install skellington
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/skellington/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/skellington ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'skellington'
4
+ Skellington::CLI.start
@@ -0,0 +1,13 @@
1
+ gems:
2
+ production:
3
+ - sinatra
4
+ - thin
5
+ - rake
6
+
7
+ test:
8
+ - cucumber
9
+ - capybara
10
+ - guard-cucumber
11
+
12
+ test_require_false:
13
+ - cucumber-api-steps
@@ -0,0 +1,25 @@
1
+ Feature: Generate skellington
2
+
3
+ Scenario: generate Gemfile
4
+ When I successfully run `skellington generate dummy_gem`
5
+ Then a file named "dummy_gem/Gemfile" should exist
6
+ And the file "dummy_gem/Gemfile" should contain:
7
+ """
8
+ source 'https://rubygems.org'
9
+
10
+ ruby
11
+ """
12
+
13
+ And the file "dummy_gem/Gemfile" should contain:
14
+ """
15
+ gem 'sinatra'
16
+ gem 'thin'
17
+ gem 'rake'
18
+
19
+ group :test do
20
+ gem 'cucumber'
21
+ gem 'capybara'
22
+ gem 'guard-cucumber'
23
+ gem 'cucumber-api-steps', require: false
24
+ end
25
+ """
@@ -0,0 +1,9 @@
1
+ Feature: Generate skellington
2
+
3
+ Scenario: generate Procfile
4
+ When I successfully run `skellington generate dummy_gem`
5
+ Then a file named "dummy_gem/Procfile" should exist
6
+ And the file "dummy_gem/Procfile" should contain:
7
+ """
8
+ web: bundle exec ruby lib/dummy_gem.rb
9
+ """
@@ -0,0 +1,18 @@
1
+ Feature: Generate skellington
2
+
3
+ Scenario: generate Rakefile
4
+ When I successfully run `skellington generate dummy_gem`
5
+ Then a file named "dummy_gem/Rakefile" should exist
6
+ And the file "dummy_gem/Rakefile" should contain:
7
+ """
8
+ require File.join(File.dirname(__FILE__), 'lib/dummy_gem.rb')
9
+
10
+ unless ENV['RACK_ENV'] == 'production'
11
+ require 'rspec/core/rake_task'
12
+ require 'cucumber/rake/task'
13
+
14
+ Cucumber::Rake::Task.new
15
+
16
+ task :default => [:cucumber]
17
+ end
18
+ """
@@ -0,0 +1,3 @@
1
+ require 'aruba/cucumber'
2
+
3
+ require 'skellington'
@@ -0,0 +1,7 @@
1
+ require 'thor'
2
+ require 'yaml'
3
+ require 'erubis'
4
+
5
+ require 'skellington/version'
6
+ require 'skellington/generator'
7
+ require 'skellington/cli'
@@ -0,0 +1,8 @@
1
+ module Skellington
2
+ class CLI < Thor
3
+ desc 'generate', 'Generate a skeleton Sinatra app'
4
+ def generate path
5
+ @g = Generator.new path
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,36 @@
1
+ module Skellington
2
+ class Generator
3
+ def initialize path
4
+ @path = path
5
+ FileUtils.mkdir_p @path
6
+
7
+ @config = YAML.load File.read(File.open(File.join(File.dirname(__FILE__), '..', '..', 'config/config.yaml')))
8
+ gemfile
9
+ rakefile
10
+ procfile
11
+ end
12
+
13
+ def gemfile
14
+ template 'Gemfile', config: @config
15
+ end
16
+
17
+ def rakefile
18
+ template 'Rakefile', camel_case_name: @path
19
+ end
20
+
21
+ def procfile
22
+ template 'Procfile', camel_case_name: @path
23
+ end
24
+
25
+ def templates_dir
26
+ File.join(File.dirname(__FILE__), '..', 'templates')
27
+ end
28
+
29
+ def template name, params = {}
30
+ t = File.read(File.open("#{templates_dir}/#{name}.eruby"))
31
+ f = File.open "#{@path}/#{name}", 'w'
32
+ f.write Erubis::Eruby.new(t).result(params)
33
+ f.close
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,3 @@
1
+ module Skellington
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+
3
+ ruby <%= RUBY_VERSION %>
4
+
5
+ <% for gem in config['gems']['production'] %>
6
+ gem '<%= gem %>'
7
+ <% end %>
8
+
9
+ group :test do
10
+ <% for gem in config['gems']['test'] %>
11
+ gem '<%= gem %>'
12
+ <% end %>
13
+ <% for gem in config['gems']['test_require_false'] %>
14
+ gem '<%= gem %>', require: false
15
+ <% end %>
16
+ end
@@ -0,0 +1 @@
1
+ web: bundle exec ruby lib/<%= camel_case_name %>.rb
@@ -0,0 +1,10 @@
1
+ require File.join(File.dirname(__FILE__), 'lib/<%= camel_case_name %>.rb')
2
+
3
+ unless ENV['RACK_ENV'] == 'production'
4
+ require 'rspec/core/rake_task'
5
+ require 'cucumber/rake/task'
6
+
7
+ Cucumber::Rake::Task.new
8
+
9
+ task :default => [:cucumber]
10
+ end
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'skellington/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'skellington'
8
+ spec.version = Skellington::VERSION
9
+ spec.authors = ['pikesley']
10
+ spec.email = ['github@orgraphone.org']
11
+ spec.summary = %q{Opinionated boilerplate skeleton for a cuked Sinatra app}
12
+ spec.description = %q{}
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'thor', '~> 0.19'
22
+ spec.add_dependency 'erubis', '~> 2.7'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.7'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'cucumber', '~> 1.3'
27
+ spec.add_development_dependency 'rspec', '~> 3.1'
28
+ spec.add_development_dependency 'guard-rspec', '~> 4.5'
29
+ spec.add_development_dependency 'guard-cucumber', '~> 1.5'
30
+ spec.add_development_dependency 'aruba', '~> 0.6'
31
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ module Skellington
4
+ describe Generator do
5
+ before :each do
6
+ @g = Generator.new 'tmp/project'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ require 'skellington'
2
+
3
+ RSpec.configure do |config|
4
+ config.expect_with :rspec do |expectations|
5
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
6
+ end
7
+
8
+ config.mock_with :rspec do |mocks|
9
+ mocks.verify_partial_doubles = true
10
+ end
11
+
12
+ config.filter_run :focus
13
+ config.run_all_when_everything_filtered = true
14
+ config.order = :random
15
+ end
metadata ADDED
@@ -0,0 +1,201 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: skellington
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - pikesley
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.19'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.19'
27
+ - !ruby/object:Gem::Dependency
28
+ name: erubis
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.7'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.7'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: cucumber
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.3'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.1'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard-rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '4.5'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '4.5'
111
+ - !ruby/object:Gem::Dependency
112
+ name: guard-cucumber
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.5'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.5'
125
+ - !ruby/object:Gem::Dependency
126
+ name: aruba
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.6'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.6'
139
+ description: ''
140
+ email:
141
+ - github@orgraphone.org
142
+ executables:
143
+ - skellington
144
+ extensions: []
145
+ extra_rdoc_files: []
146
+ files:
147
+ - ".gitignore"
148
+ - ".rspec"
149
+ - Gemfile
150
+ - Guardfile
151
+ - LICENSE.md
152
+ - LICENSE.txt
153
+ - README.md
154
+ - Rakefile
155
+ - bin/skellington
156
+ - config/config.yaml
157
+ - features/gemfile.feature
158
+ - features/procfile.feature
159
+ - features/rakefile.feature
160
+ - features/support/env.rb
161
+ - lib/skellington.rb
162
+ - lib/skellington/cli.rb
163
+ - lib/skellington/generator.rb
164
+ - lib/skellington/version.rb
165
+ - lib/templates/Gemfile.eruby
166
+ - lib/templates/Procfile.eruby
167
+ - lib/templates/Rakefile.eruby
168
+ - skellington.gemspec
169
+ - spec/skellington_spec.rb
170
+ - spec/spec_helper.rb
171
+ homepage: ''
172
+ licenses:
173
+ - MIT
174
+ metadata: {}
175
+ post_install_message:
176
+ rdoc_options: []
177
+ require_paths:
178
+ - lib
179
+ required_ruby_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ required_rubygems_version: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ requirements: []
190
+ rubyforge_project:
191
+ rubygems_version: 2.4.5
192
+ signing_key:
193
+ specification_version: 4
194
+ summary: Opinionated boilerplate skeleton for a cuked Sinatra app
195
+ test_files:
196
+ - features/gemfile.feature
197
+ - features/procfile.feature
198
+ - features/rakefile.feature
199
+ - features/support/env.rb
200
+ - spec/skellington_spec.rb
201
+ - spec/spec_helper.rb