createproj 0.0.5 → 0.1.0
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/README.md +20 -1
- data/lib/createproj/creator/creator.rb +22 -14
- data/lib/createproj/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 109bef4359c5185cba4e3dd9fee61ba6c50b3cc8
|
4
|
+
data.tar.gz: 4493e7837fa58c48745dbf197b2d796561d5dd82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d100bb9ea1fdd577bb8d73fd56cb47b910d3b04329f5636976b62b096fc47dfcd48c3e915b6bda1a59b752e1fcccb666feab744845287df88d41017ddf73d3e
|
7
|
+
data.tar.gz: 9050d835d6c6686c56f7a3e94b3b16059a1b0a5e1fa19fb2b8f809da4d6cc8e24aad5b37093fdafc2132edb28ff2cff5d0ac837ce91778b7d1eec73710f90728
|
data/README.md
CHANGED
@@ -1,11 +1,30 @@
|
|
1
1
|
# CreateProj
|
2
2
|
|
3
|
+
[](http://badge.fury.io/rb/createproj)
|
4
|
+
[](https://travis-ci.org/mattjmcnaughton/createproj)
|
5
|
+
[](https://codeclimate.com/github/mattjmcnaughton/createproj)
|
6
|
+
[](https://coveralls.io/r/mattjmcnaughton/createproj)
|
7
|
+
|
3
8
|
## Description
|
4
9
|
Quickly create a new project with git respotitory, post commit hooks, and dependencies indended to be included for all projects.
|
5
10
|
|
6
11
|
Read more on my [blog](http://mattjmcnaughton.com/createproject).
|
7
12
|
|
8
|
-
##
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
Download the gem with `gem install createproj`
|
16
|
+
|
17
|
+
To create proj, run `createproj [ruby|haskell] PROJ_NAME` in the directory you want your project created.
|
18
|
+
|
19
|
+
Remember, as of now, createproj assumes that you have both rvm and cabal installed.
|
20
|
+
|
21
|
+
Once run, createproj will:
|
22
|
+
- Create the project directory
|
23
|
+
- Initialize a git repository with a language specified .gitignore and language specified git pre-commit hook (right now both are linters)
|
24
|
+
- Create a sandbox
|
25
|
+
- rvm gemset for ruby, cabal sandbox for haskell
|
26
|
+
- Install default dependencies in the sandbox
|
27
|
+
- rubocop, yard, rspec for ruby and happy, hlint for haskell
|
9
28
|
|
10
29
|
## Steps for building/publish gem
|
11
30
|
- From `createproj` directory, run:
|
@@ -14,7 +14,7 @@ module CreateProj
|
|
14
14
|
# @param [Hash] options command line options for the project
|
15
15
|
#
|
16
16
|
# @return instance of Creator
|
17
|
-
def initialize(name, options)
|
17
|
+
def initialize(name, options = {})
|
18
18
|
@name = name
|
19
19
|
@options = options
|
20
20
|
@precommit_template = ''
|
@@ -70,8 +70,29 @@ module CreateProj
|
|
70
70
|
Git.init
|
71
71
|
end
|
72
72
|
|
73
|
+
# Add a list of files from @gitignore_files
|
74
|
+
#
|
75
|
+
# @param [Array] ignore_files array of file_names to write to .gitignore
|
76
|
+
#
|
77
|
+
# @example Gitignore files to haskell
|
78
|
+
# gitignore(['cabal.sandbox.config']) #=> writes .gitignore file
|
79
|
+
#
|
80
|
+
# @return nothing
|
81
|
+
def gitignore(ignore_files)
|
82
|
+
return if ignore_files.empty?
|
83
|
+
|
84
|
+
File.open('.gitignore', 'w+') do |f|
|
85
|
+
ignore_files.each do |gf|
|
86
|
+
f.write("#{gf}\n")
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
73
91
|
# Add a precommit hook based on a template
|
74
92
|
#
|
93
|
+
# @param [String] template name of the template file
|
94
|
+
# @param [Hash] options hash to fill in the template
|
95
|
+
#
|
75
96
|
# @example Add a linting pre commit hook
|
76
97
|
# add_pre_commit_hook('lint-pre-commit',
|
77
98
|
# { linter: 'rubocop', file_ext: '.rb'} )
|
@@ -102,19 +123,6 @@ module CreateProj
|
|
102
123
|
def install_dependencies
|
103
124
|
end
|
104
125
|
|
105
|
-
# Add a list of files from @gitignore_files
|
106
|
-
#
|
107
|
-
# @example
|
108
|
-
def gitignore(ignore_files)
|
109
|
-
return if ignore_files.empty?
|
110
|
-
|
111
|
-
File.open('.gitignore', 'w+') do |f|
|
112
|
-
ignore_files.each do |gf|
|
113
|
-
f.write("#{gf}\n")
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
126
|
# intended to be overwritten per class
|
119
127
|
def extra_setup
|
120
128
|
end
|
data/lib/createproj/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: createproj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt McNaughton
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.8'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.7.2
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.7.2
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: git
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +142,14 @@ dependencies:
|
|
128
142
|
requirements:
|
129
143
|
- - ~>
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
145
|
+
version: 0.18.1
|
132
146
|
type: :runtime
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - ~>
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.
|
152
|
+
version: 0.18.1
|
139
153
|
description: Simple project creation gem.
|
140
154
|
email:
|
141
155
|
- mattjmcnaughton@gmail.com
|