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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce879aa2ccb1c26f3c594c5a1491469aa0d53efe
4
- data.tar.gz: 066aa7e8ecbc2f812c9110e6588864d7de7c0c13
3
+ metadata.gz: 109bef4359c5185cba4e3dd9fee61ba6c50b3cc8
4
+ data.tar.gz: 4493e7837fa58c48745dbf197b2d796561d5dd82
5
5
  SHA512:
6
- metadata.gz: 3850a0bab57d66cb9aadd4decc954ffac0a68eeec00c56ed8e89c7a69e415ba684e365da2fd6a7baad2e50a0b0d1c71fc740a54627f08c75b25b9324ba71cfc0
7
- data.tar.gz: 50a7d6ab776a60409ff20f30059ed5e93e873a70f1256ab45006ec04af5eccdb1b98475c375d60a3a9b1f4834c8e10045db2bbb517c170fb2b58135760b10817
6
+ metadata.gz: 8d100bb9ea1fdd577bb8d73fd56cb47b910d3b04329f5636976b62b096fc47dfcd48c3e915b6bda1a59b752e1fcccb666feab744845287df88d41017ddf73d3e
7
+ data.tar.gz: 9050d835d6c6686c56f7a3e94b3b16059a1b0a5e1fa19fb2b8f809da4d6cc8e24aad5b37093fdafc2132edb28ff2cff5d0ac837ce91778b7d1eec73710f90728
data/README.md CHANGED
@@ -1,11 +1,30 @@
1
1
  # CreateProj
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/createproj.svg)](http://badge.fury.io/rb/createproj)
4
+ [![Build Status](https://travis-ci.org/mattjmcnaughton/createproj.svg?branch=master)](https://travis-ci.org/mattjmcnaughton/createproj)
5
+ [![Code Climate](https://codeclimate.com/github/mattjmcnaughton/createproj/badges/gpa.svg)](https://codeclimate.com/github/mattjmcnaughton/createproj)
6
+ [![Coverage Status](https://img.shields.io/coveralls/mattjmcnaughton/createproj.svg)](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
@@ -1,5 +1,5 @@
1
1
  # Namespace for CreateProj
2
2
  module CreateProj
3
3
  # Version number for the gem - make it only load once
4
- VERSION ||= '0.0.5'
4
+ VERSION ||= '0.1.0'
5
5
  end
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.5
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.19.1
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.19.1
152
+ version: 0.18.1
139
153
  description: Simple project creation gem.
140
154
  email:
141
155
  - mattjmcnaughton@gmail.com