begin 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.travis.yml +3 -0
- data/README.md +15 -2
- data/features/step_definitions/begin_steps.rb +1 -1
- data/lib/begin/generator.rb +12 -16
- data/lib/begin/version.rb +1 -1
- data/lib/templates/.gitignore.tt +0 -1
- data/lib/templates/Rakefile.tt +0 -1
- data/lib/templates/spec/spec_helper.rb.tt +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ca563a2cd55aa409afc6686ad471f8a66d91c33
|
4
|
+
data.tar.gz: fb4b2175ad9c51d80aad13f25a523b6ac6be1b6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f5f667a8df01e35ac34fd84d7a24d2313e12bf8df1ed612f20a6dda031ccecd9bd962abff73b783b5d6ca019d55c7f238a315a8ae9ccfcf2f781f817725aeff
|
7
|
+
data.tar.gz: bfb8707a793ee4040d4511e7280e434215f940b9d15c5e1db2be72284757eba54aff31b59e7fcf7318588d92400fbed6ceb46bd56034dd7367dbab3076433831
|
data/.rubocop.yml
CHANGED
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
#Begin
|
2
|
+
[![Build Status](https://travis-ci.org/neverstopbuilding/begin.png)](https://travis-ci.org/neverstopbuilding/begin) [![Code Climate](https://codeclimate.com/github/neverstopbuilding/begin.png)](https://codeclimate.com/github/neverstopbuilding/begin) [![Gem Version](https://badge.fury.io/rb/begin.png)](http://badge.fury.io/rb/begin)
|
2
3
|
|
3
4
|
> **Given** I want to start writing some code.
|
4
5
|
>
|
5
6
|
> **And** I want it to be clean.
|
6
7
|
>
|
7
|
-
> **When** I type `begin
|
8
|
+
> **When** I type `begin my_package`.
|
8
9
|
>
|
9
10
|
> **And** install the dependencies.
|
10
11
|
>
|
@@ -30,8 +31,20 @@ That's all there is too it, right now these are included and configured:
|
|
30
31
|
- Guard
|
31
32
|
- RVM
|
32
33
|
|
33
|
-
###
|
34
|
+
###Setup and Configuration
|
34
35
|
|
35
36
|
These options are available:
|
36
37
|
|
37
38
|
- `--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.
|
39
|
+
|
40
|
+
|
41
|
+
To set everything up fastest do this:
|
42
|
+
|
43
|
+
1. Begin your project: `begin myproject --github_user=myuser`
|
44
|
+
2. Create a new repository for the code on github
|
45
|
+
3. Initialize a git repository locally and commit everything, push master
|
46
|
+
4. Import your project to Code Climate
|
47
|
+
5. Import your project to Coveralls
|
48
|
+
6. Turn on your project in TravisCI
|
49
|
+
|
50
|
+
The next time you push your code, it will kick off a Travis build and update coveralls as a result.
|
data/lib/begin/generator.rb
CHANGED
@@ -12,21 +12,21 @@ module Begin
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def create_package_directory
|
15
|
-
if File.exists?(
|
16
|
-
say 'The directory #{
|
15
|
+
if File.exists?(clean_package_name) || File.directory?(clean_package_name)
|
16
|
+
say 'The directory #{clean_package_name} already exists, aborting.', :red
|
17
17
|
exit 1
|
18
18
|
else
|
19
|
-
empty_directory
|
19
|
+
empty_directory clean_package_name
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
def create_lib_structure
|
24
|
-
empty_directory "#{
|
24
|
+
empty_directory "#{clean_package_name}/lib/#{clean_package_name}"
|
25
25
|
end
|
26
26
|
|
27
27
|
def create_rspec_structure
|
28
|
-
empty_directory "#{
|
29
|
-
empty_directory "#{
|
28
|
+
empty_directory "#{clean_package_name}/spec/unit/lib/#{clean_package_name}"
|
29
|
+
empty_directory "#{clean_package_name}/spec/integration/lib/#{clean_package_name}"
|
30
30
|
create_file_from_template 'spec', 'spec_helper.rb'
|
31
31
|
create_file_from_template '.rspec'
|
32
32
|
end
|
@@ -37,7 +37,6 @@ module Begin
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def create_support_files
|
40
|
-
@ruby_version = '2.0.0'
|
41
40
|
%w(.gitignore .rubocop.yml Gemfile Rakefile README.md .travis.yml Guardfile .blam).each do |file|
|
42
41
|
create_file_from_template file
|
43
42
|
end
|
@@ -46,21 +45,18 @@ module Begin
|
|
46
45
|
private
|
47
46
|
|
48
47
|
def create_file_from_template(*args)
|
49
|
-
path = args.reduce {|
|
48
|
+
path = args.reduce { |a, e| File.join(a, e) }
|
50
49
|
tt = File.join('templates', path) + '.tt'
|
51
|
-
file = File.join(
|
52
|
-
template tt, file,
|
50
|
+
file = File.join(clean_package_name, path)
|
51
|
+
template tt, file, template_options
|
53
52
|
end
|
54
53
|
|
55
|
-
def
|
54
|
+
def clean_package_name
|
56
55
|
package_name.downcase.gsub(/[-\s]/, '_')
|
57
56
|
end
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
{ruby_version: '2.0.0', package: get_package_name}
|
58
|
+
def template_options
|
59
|
+
{ ruby_version: '2.0.0', package: clean_package_name }
|
63
60
|
end
|
64
|
-
|
65
61
|
end
|
66
62
|
end
|
data/lib/begin/version.rb
CHANGED
data/lib/templates/.gitignore.tt
CHANGED
data/lib/templates/Rakefile.tt
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: begin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Fox
|
@@ -139,8 +139,8 @@ files:
|
|
139
139
|
- ".rubocop.yml"
|
140
140
|
- ".ruby-gemset"
|
141
141
|
- ".ruby-version"
|
142
|
+
- ".travis.yml"
|
142
143
|
- Gemfile
|
143
|
-
- Gemfile.lock
|
144
144
|
- LICENSE.txt
|
145
145
|
- README.md
|
146
146
|
- Rakefile
|