begin 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +1 -0
- data/.rubocop.yml +20 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +61 -0
- data/LICENSE.txt +20 -0
- data/README.md +37 -0
- data/Rakefile +35 -0
- data/begin.gemspec +29 -0
- data/bin/begin +5 -0
- data/features/begin.feature +20 -0
- data/features/step_definitions/begin_steps.rb +34 -0
- data/features/support/env.rb +20 -0
- data/lib/begin/generator.rb +62 -0
- data/lib/begin/version.rb +3 -0
- data/lib/templates/.blam.tt +4 -0
- data/lib/templates/.gitignore.tt +20 -0
- data/lib/templates/.rspec.tt +6 -0
- data/lib/templates/.rubocop.yml.tt +19 -0
- data/lib/templates/.ruby-gemset.tt +1 -0
- data/lib/templates/.ruby-version.tt +1 -0
- data/lib/templates/.travis.yml.tt +4 -0
- data/lib/templates/Gemfile.tt +21 -0
- data/lib/templates/Guardfile.tt +26 -0
- data/lib/templates/README.md.tt +15 -0
- data/lib/templates/Rakefile.tt +36 -0
- data/lib/templates/spec/spec_helper.rb.tt +35 -0
- data/spec/spec_helper.rb +12 -0
- metadata +195 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7f16105ca4911047e6049174ed93c6f4db252bfb
|
4
|
+
data.tar.gz: ffc86b7013ebf3198db70600cc12da748399fda0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3b8709304a91ded70c26fa1c102d14f6ce6edf0caed07f9a5075884a765c364f348777868ceee51787aa85a9318b74996a748bbcb436515c5103f88914560111
|
7
|
+
data.tar.gz: 39d1c7e16f1b5486f59658e7fbbd06071c24062a7805b7bd65c66d1f716993c9509ef45106cb9eab8cd5fdadb1379a52a0b30c1059eb3487e5a684a1d169d389
|
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
LineLength:
|
2
|
+
Enabled: false
|
3
|
+
|
4
|
+
MethodLength:
|
5
|
+
Max: 30
|
6
|
+
|
7
|
+
Documentation:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
CyclomaticComplexity:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
AllCops:
|
14
|
+
Includes:
|
15
|
+
- Rakefile
|
16
|
+
- Gemfile
|
17
|
+
- config.ru
|
18
|
+
Excludes:
|
19
|
+
- lib/public/**
|
20
|
+
- build/**
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
begin
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.0.0-p353
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
begin (0.0.1)
|
5
|
+
thor
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
aruba (0.5.3)
|
11
|
+
childprocess (>= 0.3.6)
|
12
|
+
cucumber (>= 1.1.1)
|
13
|
+
rspec-expectations (>= 2.7.0)
|
14
|
+
ast (1.1.0)
|
15
|
+
builder (3.2.2)
|
16
|
+
childprocess (0.3.9)
|
17
|
+
ffi (~> 1.0, >= 1.0.11)
|
18
|
+
cucumber (1.3.10)
|
19
|
+
builder (>= 2.1.2)
|
20
|
+
diff-lcs (>= 1.1.3)
|
21
|
+
gherkin (~> 2.12)
|
22
|
+
multi_json (>= 1.7.5, < 2.0)
|
23
|
+
multi_test (>= 0.0.2)
|
24
|
+
diff-lcs (1.1.3)
|
25
|
+
ffi (1.9.3)
|
26
|
+
gherkin (2.12.2)
|
27
|
+
multi_json (~> 1.3)
|
28
|
+
multi_json (1.8.2)
|
29
|
+
multi_test (0.0.2)
|
30
|
+
parser (2.1.1)
|
31
|
+
ast (~> 1.1)
|
32
|
+
slop (~> 3.4, >= 3.4.5)
|
33
|
+
powerpack (0.0.9)
|
34
|
+
rainbow (1.99.1)
|
35
|
+
rake (10.1.1)
|
36
|
+
rspec (2.8.0)
|
37
|
+
rspec-core (~> 2.8.0)
|
38
|
+
rspec-expectations (~> 2.8.0)
|
39
|
+
rspec-mocks (~> 2.8.0)
|
40
|
+
rspec-core (2.8.0)
|
41
|
+
rspec-expectations (2.8.0)
|
42
|
+
diff-lcs (~> 1.1.2)
|
43
|
+
rspec-mocks (2.8.0)
|
44
|
+
rubocop (0.16.0)
|
45
|
+
parser (~> 2.1)
|
46
|
+
powerpack (~> 0.0.6)
|
47
|
+
rainbow (>= 1.1.4)
|
48
|
+
slop (3.4.7)
|
49
|
+
thor (0.18.1)
|
50
|
+
|
51
|
+
PLATFORMS
|
52
|
+
ruby
|
53
|
+
|
54
|
+
DEPENDENCIES
|
55
|
+
aruba
|
56
|
+
begin!
|
57
|
+
bundler (~> 1.0)
|
58
|
+
cucumber
|
59
|
+
rake
|
60
|
+
rspec (~> 2.8.0)
|
61
|
+
rubocop
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2013 Jason Fox
|
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,37 @@
|
|
1
|
+
#Begin
|
2
|
+
|
3
|
+
> **Given** I want to start writing some code.
|
4
|
+
>
|
5
|
+
> **And** I want it to be clean.
|
6
|
+
>
|
7
|
+
> **When** I type `begin my-package`.
|
8
|
+
>
|
9
|
+
> **And** install the dependencies.
|
10
|
+
>
|
11
|
+
> **Then** I can immediately start writing tests.
|
12
|
+
|
13
|
+
###Why?
|
14
|
+
I don't want a single thing preventing me from starting off (even the smallest) library without a good infrastructure to support TDD and clean coding standards. I got tired of reconfiguring the same tools in basically the same way every time. With this one command you can set up a library, fire up Guard, and jump right into the TDD loop: Red, Green, Refactor.
|
15
|
+
|
16
|
+
That's all there is too it, right now these are included and configured:
|
17
|
+
|
18
|
+
- RSpec (unit and integration tests)
|
19
|
+
- Blam (file generation)
|
20
|
+
- Travis
|
21
|
+
- Coveralls
|
22
|
+
- Code Climate
|
23
|
+
- Rake
|
24
|
+
- gitignore
|
25
|
+
- README
|
26
|
+
- Gemfile
|
27
|
+
- Rubocop
|
28
|
+
- Reek
|
29
|
+
- Flay
|
30
|
+
- Guard
|
31
|
+
- RVM
|
32
|
+
|
33
|
+
###Options
|
34
|
+
|
35
|
+
These options are available:
|
36
|
+
|
37
|
+
- `--github_user` - Set this to the user for which you will commit this code, this will turn on the readme widgets (coveralls, travis, code climate). You will still have to enable the repo and set up hooks with these services.
|
data/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts 'Run `bundle install` to install missing gems'
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
task default: :build
|
14
|
+
|
15
|
+
task build: [:quality, :system]
|
16
|
+
|
17
|
+
require 'rspec/core'
|
18
|
+
require 'rspec/core/rake_task'
|
19
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
20
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
21
|
+
end
|
22
|
+
|
23
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
24
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
25
|
+
spec.rcov = true
|
26
|
+
end
|
27
|
+
|
28
|
+
desc 'Runs quality checks.'
|
29
|
+
task quality: [:rubocop]
|
30
|
+
|
31
|
+
require 'rubocop/rake_task'
|
32
|
+
Rubocop::RakeTask.new
|
33
|
+
|
34
|
+
require 'cucumber/rake/task'
|
35
|
+
Cucumber::Rake::Task.new(:system)
|
data/begin.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'begin/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'begin'
|
8
|
+
spec.version = Begin::VERSION
|
9
|
+
spec.authors = ['Jason Fox']
|
10
|
+
spec.email = ['jasonrobertfox@gmail.com']
|
11
|
+
spec.summary = 'Quickly create a basic ruby package with clean coding tools.'
|
12
|
+
spec.description = 'I don\'t want a single thing preventing me from starting off (even the smallest) library without a good infrastructure to support TDD and clean coding standards. I got tired of reconfiguring the same tools in basically the same way every time. With this one command you can set up a library, fire up Guard, and jump right into the TDD loop: Red, Green, Refactor.'
|
13
|
+
spec.homepage = 'http://github.com/neverstopbuilding/begin'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
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.18.1'
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.5'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.1.1'
|
24
|
+
spec.add_development_dependency 'aruba', '~> 0.5.3'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 2.8.0'
|
26
|
+
spec.add_development_dependency 'cucumber', '>= 0'
|
27
|
+
spec.add_development_dependency 'bundler', '~> 1.0'
|
28
|
+
spec.add_development_dependency 'rubocop', '~> 0.16.0'
|
29
|
+
end
|
data/bin/begin
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
@announce
|
2
|
+
Feature: Create default package
|
3
|
+
In order start the TDD cycle immediately
|
4
|
+
As a clean coder
|
5
|
+
I want to quickly create a package to support good development practices
|
6
|
+
|
7
|
+
Scenario: Create package
|
8
|
+
Given I run `bundle exec begin mypackage`
|
9
|
+
Then a directory named "mypackage" should exist
|
10
|
+
And "mypackage" should contain the correct files
|
11
|
+
And the file "mypackage/.ruby-gemset" should contain "mypackage"
|
12
|
+
And the file "mypackage/.ruby-version" should contain "2.0.0"
|
13
|
+
And the file "mypackage/.travis.yml" should contain "2.0.0"
|
14
|
+
And the file "mypackage/Gemfile" should contain "2.0.0"
|
15
|
+
And the file "mypackage/README.md" should contain "Mypackage Documentation"
|
16
|
+
And the file "mypackage/README.md" should not contain "Build Status"
|
17
|
+
|
18
|
+
Scenario: Create package with readme icons
|
19
|
+
Given I run `bundle exec begin mypackage --github_user=myuser`
|
20
|
+
And the file "mypackage/README.md" should contain "Build Status"
|
@@ -0,0 +1,34 @@
|
|
1
|
+
Then(/^"(.*?)" should contain the correct files$/) do |package_directory|
|
2
|
+
assert_lib_files package_directory
|
3
|
+
assert_spec_files package_directory
|
4
|
+
assert_rvm_files package_directory
|
5
|
+
assert_support_files package_directory
|
6
|
+
end
|
7
|
+
|
8
|
+
def assert_lib_files(dir)
|
9
|
+
check_directory_presence(["#{dir}/lib"], true)
|
10
|
+
check_directory_presence(["#{dir}/lib/#{dir}"], true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def assert_spec_files(dir)
|
14
|
+
check_directory_presence(["#{dir}/spec/unit/lib/#{dir}"], true)
|
15
|
+
check_directory_presence(["#{dir}/spec/integration/lib/#{dir}"], true)
|
16
|
+
file_exists? dir, 'spec', 'spec_helper.rb'
|
17
|
+
file_exists? dir, '.rspec'
|
18
|
+
end
|
19
|
+
|
20
|
+
def assert_rvm_files(dir)
|
21
|
+
%w(.ruby-gemset .ruby-version).each do |file|
|
22
|
+
file_exists? dir, file
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def assert_support_files(dir)
|
27
|
+
%w(.gitignore .rubocop.yml Gemfile Rakefile README.md .travis.yml Guardfile .blam).each do |file|
|
28
|
+
file_exists? dir, file
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def file_exists?(*args)
|
33
|
+
check_file_presence([args.reduce { |base, file| File.join(base, file) }], true)
|
34
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
begin
|
3
|
+
Bundler.setup(:default, :development)
|
4
|
+
rescue Bundler::BundlerError => e
|
5
|
+
$stderr.puts e.message
|
6
|
+
$stderr.puts 'Run `bundle install` to install missing gems'
|
7
|
+
exit e.status_code
|
8
|
+
end
|
9
|
+
|
10
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
|
11
|
+
require 'begin/generator'
|
12
|
+
|
13
|
+
require 'rspec/expectations'
|
14
|
+
require 'aruba/cucumber'
|
15
|
+
|
16
|
+
Before do
|
17
|
+
dir = 'build/tmp'
|
18
|
+
FileUtils.rm_rf dir if File.directory?(dir)
|
19
|
+
@dirs = [dir]
|
20
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
module Begin
|
4
|
+
class Generator < Thor::Group
|
5
|
+
include Thor::Actions
|
6
|
+
|
7
|
+
argument :package_name
|
8
|
+
class_option :github_user, default: nil
|
9
|
+
|
10
|
+
def self.source_root
|
11
|
+
"#{File.dirname(__FILE__)}/../"
|
12
|
+
end
|
13
|
+
|
14
|
+
def create_package_directory
|
15
|
+
if File.exists?(package_name) || File.directory?(package_name)
|
16
|
+
say 'The directory #{package_name} already exists, aborting.', :red
|
17
|
+
exit 1
|
18
|
+
else
|
19
|
+
empty_directory package_name
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def create_lib_structure
|
24
|
+
empty_directory "#{package_name}/lib/#{package_name}"
|
25
|
+
end
|
26
|
+
|
27
|
+
def create_rspec_structure
|
28
|
+
empty_directory "#{package_name}/spec/unit/lib/#{package_name}"
|
29
|
+
empty_directory "#{package_name}/spec/integration/lib/#{package_name}"
|
30
|
+
create_file_from_template 'spec', 'spec_helper.rb'
|
31
|
+
create_file_from_template '.rspec'
|
32
|
+
end
|
33
|
+
|
34
|
+
def create_rvm_files
|
35
|
+
create_file_from_template '.ruby-version'
|
36
|
+
create_file_from_template '.ruby-gemset'
|
37
|
+
end
|
38
|
+
|
39
|
+
def create_support_files
|
40
|
+
@ruby_version = '2.0.0'
|
41
|
+
%w(.gitignore .rubocop.yml Gemfile Rakefile README.md .travis.yml Guardfile .blam).each do |file|
|
42
|
+
create_file_from_template file
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def create_file_from_template(*args)
|
49
|
+
path = args.reduce {|base, arg| File.join(base, arg) }
|
50
|
+
tt = File.join('templates', path) + '.tt'
|
51
|
+
file = File.join(package_name, path)
|
52
|
+
template tt, file, get_options
|
53
|
+
end
|
54
|
+
|
55
|
+
def get_options
|
56
|
+
|
57
|
+
|
58
|
+
{ruby_version: '2.0.0'}
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= package_name %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= config[:ruby_version] %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
ruby '<%= config[:ruby_version] %>'
|
5
|
+
|
6
|
+
# Dependencies
|
7
|
+
group :test do
|
8
|
+
gem 'rake'
|
9
|
+
gem 'rspec', '2.14.1'
|
10
|
+
gem 'rubocop'
|
11
|
+
gem 'coveralls'
|
12
|
+
end
|
13
|
+
|
14
|
+
group :development do
|
15
|
+
gem 'guard', '2.2.3'
|
16
|
+
gem 'guard-rspec'
|
17
|
+
gem 'guard-rubocop'
|
18
|
+
gem 'blam'
|
19
|
+
gem 'flay'
|
20
|
+
gem 'reek'
|
21
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
group :tests do
|
2
|
+
# Run code quality checks against all source
|
3
|
+
guard :rubocop, all_on_start: false do
|
4
|
+
watch(%r{^spec/.+\.rb$})
|
5
|
+
watch(%r{^lib/.+\.rb$})
|
6
|
+
watch(%r{^.+\.(rb|ru)$})
|
7
|
+
watch 'Gemfile'
|
8
|
+
watch 'Rakefile'
|
9
|
+
end
|
10
|
+
|
11
|
+
group :unit do
|
12
|
+
guard :rspec, failed_mode: :none do
|
13
|
+
watch(%r{^spec/unit/.+_spec\.rb$})
|
14
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/unit/lib/#{m[1]}_spec.rb" }
|
15
|
+
watch('spec/spec_helper.rb')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
group :integration do
|
20
|
+
guard :rspec do
|
21
|
+
watch(%r{^spec/integration/.+_spec\.rb$})
|
22
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/integration/lib/#{m[1]}_spec.rb" }
|
23
|
+
watch('spec/spec_helper.rb')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#<%= package_name.capitalize %> Documentation
|
2
|
+
<% if options[:github_user] %>
|
3
|
+
[![Build Status](https://travis-ci.org/<%= options[:github_user] %>/<%= package_name %>.png?branch=develop)](https://travis-ci.org/<%= options[:github_user] %>/<%= package_name %>) [![Coverage Status](https://coveralls.io/repos/<%= options[:github_user] %>/<%= package_name %>/badge.png)](https://coveralls.io/r/<%= options[:github_user] %>/<%= package_name %>) [![Code Climate](https://codeclimate.com/github/<%= options[:github_user] %>/<%= package_name %>.png)](https://codeclimate.com/github/<%= options[:github_user] %>/<%= package_name %>)
|
4
|
+
<% end %>
|
5
|
+
###Development
|
6
|
+
|
7
|
+
bundle exec guard
|
8
|
+
|
9
|
+
This will start guard watching and running the tests on change.
|
10
|
+
|
11
|
+
###Testing
|
12
|
+
|
13
|
+
- `rake` - Runs all of the tests.
|
14
|
+
- `rake build` - Runs a subset of build tests, as specified in the Rakefile.
|
15
|
+
- `rake quality` - Analysis of code quality with Rubocop.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
|
3
|
+
task default: :build_full
|
4
|
+
|
5
|
+
task build: [:clean, :prepare, :quality, :test]
|
6
|
+
|
7
|
+
desc 'Runs standard build activities.'
|
8
|
+
task build_full: [:build]
|
9
|
+
|
10
|
+
desc 'Runs quality checks.'
|
11
|
+
task quality: [:rubocop]
|
12
|
+
|
13
|
+
require 'rubocop/rake_task'
|
14
|
+
Rubocop::RakeTask.new
|
15
|
+
|
16
|
+
desc 'Removes the build directory.'
|
17
|
+
task :clean do
|
18
|
+
FileUtils.rm_rf 'build'
|
19
|
+
end
|
20
|
+
desc 'Creates a basic build directory.'
|
21
|
+
task :prepare do
|
22
|
+
FileUtils.mkdir_p('build/spec')
|
23
|
+
end
|
24
|
+
|
25
|
+
def get_rspec_flags(log_name, others = nil)
|
26
|
+
"--format documentation --out build/spec/#{log_name}.log --format html --out build/spec/#{log_name}.html --format progress #{others}"
|
27
|
+
end
|
28
|
+
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:test) do |t|
|
31
|
+
ENV['COVERAGE'] = 'true'
|
32
|
+
ENV['SYSTEM'] = 'false'
|
33
|
+
t.pattern = FileList['spec/unit/**/*_spec.rb', 'spec/integration/**/*_spec.rb']
|
34
|
+
t.rspec_opts = get_rspec_flags('unit_integration')
|
35
|
+
end
|
36
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
|
3
|
+
require 'rspec'
|
4
|
+
|
5
|
+
def configure_rspec_defaults
|
6
|
+
RSpec.configure do |config|
|
7
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
8
|
+
config.run_all_when_everything_filtered = true
|
9
|
+
config.filter_run_excluding skip: true
|
10
|
+
config.filter_run :focus
|
11
|
+
config.order = 'random'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def configure_coverage
|
16
|
+
require 'simplecov'
|
17
|
+
require 'coveralls'
|
18
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
19
|
+
SimpleCov::Formatter::HTMLFormatter,
|
20
|
+
Coveralls::SimpleCov::Formatter
|
21
|
+
]
|
22
|
+
SimpleCov.start do
|
23
|
+
add_filter 'spec'
|
24
|
+
coverage_dir 'build/coverage'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# Defaults
|
29
|
+
coverage = ENV['COVERAGE'] == 'true' ? true : false
|
30
|
+
|
31
|
+
# Configuration
|
32
|
+
configure_coverage if coverage
|
33
|
+
configure_rspec_defaults
|
34
|
+
|
35
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'begin'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,195 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: begin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jason Fox
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-31 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.18.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.18.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.5'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 10.1.1
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 10.1.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: aruba
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.5.3
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.5.3
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.8.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.8.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: cucumber
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: bundler
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.16.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.16.0
|
125
|
+
description: 'I don''t want a single thing preventing me from starting off (even the
|
126
|
+
smallest) library without a good infrastructure to support TDD and clean coding
|
127
|
+
standards. I got tired of reconfiguring the same tools in basically the same way
|
128
|
+
every time. With this one command you can set up a library, fire up Guard, and jump
|
129
|
+
right into the TDD loop: Red, Green, Refactor.'
|
130
|
+
email:
|
131
|
+
- jasonrobertfox@gmail.com
|
132
|
+
executables:
|
133
|
+
- begin
|
134
|
+
extensions: []
|
135
|
+
extra_rdoc_files: []
|
136
|
+
files:
|
137
|
+
- ".gitignore"
|
138
|
+
- ".rspec"
|
139
|
+
- ".rubocop.yml"
|
140
|
+
- ".ruby-gemset"
|
141
|
+
- ".ruby-version"
|
142
|
+
- Gemfile
|
143
|
+
- Gemfile.lock
|
144
|
+
- LICENSE.txt
|
145
|
+
- README.md
|
146
|
+
- Rakefile
|
147
|
+
- begin.gemspec
|
148
|
+
- bin/begin
|
149
|
+
- features/begin.feature
|
150
|
+
- features/step_definitions/begin_steps.rb
|
151
|
+
- features/support/env.rb
|
152
|
+
- lib/begin/generator.rb
|
153
|
+
- lib/begin/version.rb
|
154
|
+
- lib/templates/.blam.tt
|
155
|
+
- lib/templates/.gitignore.tt
|
156
|
+
- lib/templates/.rspec.tt
|
157
|
+
- lib/templates/.rubocop.yml.tt
|
158
|
+
- lib/templates/.ruby-gemset.tt
|
159
|
+
- lib/templates/.ruby-version.tt
|
160
|
+
- lib/templates/.travis.yml.tt
|
161
|
+
- lib/templates/Gemfile.tt
|
162
|
+
- lib/templates/Guardfile.tt
|
163
|
+
- lib/templates/README.md.tt
|
164
|
+
- lib/templates/Rakefile.tt
|
165
|
+
- lib/templates/spec/spec_helper.rb.tt
|
166
|
+
- spec/spec_helper.rb
|
167
|
+
homepage: http://github.com/neverstopbuilding/begin
|
168
|
+
licenses:
|
169
|
+
- MIT
|
170
|
+
metadata: {}
|
171
|
+
post_install_message:
|
172
|
+
rdoc_options: []
|
173
|
+
require_paths:
|
174
|
+
- lib
|
175
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
180
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '0'
|
185
|
+
requirements: []
|
186
|
+
rubyforge_project:
|
187
|
+
rubygems_version: 2.1.11
|
188
|
+
signing_key:
|
189
|
+
specification_version: 4
|
190
|
+
summary: Quickly create a basic ruby package with clean coding tools.
|
191
|
+
test_files:
|
192
|
+
- features/begin.feature
|
193
|
+
- features/step_definitions/begin_steps.rb
|
194
|
+
- features/support/env.rb
|
195
|
+
- spec/spec_helper.rb
|