thor_template 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 584d7fe13f8296ed7a0d8c8531600b762567c0bc
|
4
|
+
data.tar.gz: c7853d032960135539476d542901c63a7819a022
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aba061fa571a435c39450fefd77d5efdff672bd0aa4e6c7672a8585a1955bc1a48a55c1d4e952a6647a1af127edd8a98a400a6a14d0a3abbdc6d74c92f92562a
|
7
|
+
data.tar.gz: 21c60b09d5ccd58ac030f0cfc2b4e0c3ae80a5f28b5e2d354f776d98a6b3281e04ddfcc5e035ed9b12a9fc5fa1cd773053d8b6213457392894435c1d2d4ea006
|
@@ -1,12 +1,19 @@
|
|
1
|
-
guard "
|
2
|
-
watch(%r{^spec/.+_spec\.rb$})
|
3
|
-
watch(%r{^lib/(.+)\.rb$}) { "spec/thor_template_spec.rb" }
|
4
|
-
watch(%r{^lib/thor_template/(.+)\.rb$}) { "spec/thor_template_spec.rb" }
|
5
|
-
watch("spec/spec_helper.rb") { "spec/thor_template_spec.rb" }
|
6
|
-
watch(%r{^lib/thor_template/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
|
-
end
|
8
|
-
|
9
|
-
guard "bundler" do
|
1
|
+
guard "bundler", cmd: "bundle" do
|
10
2
|
watch("Gemfile")
|
11
3
|
watch(/^.+\.gemspec/)
|
12
4
|
end
|
5
|
+
|
6
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
7
|
+
require "guard/rspec/dsl"
|
8
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
9
|
+
|
10
|
+
# RSpec files
|
11
|
+
rspec = dsl.rspec
|
12
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
13
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
14
|
+
watch(rspec.spec_files)
|
15
|
+
|
16
|
+
# Ruby files
|
17
|
+
ruby = dsl.ruby
|
18
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
19
|
+
end
|
@@ -12,28 +12,26 @@ TODO: Write a gem description
|
|
12
12
|
|
13
13
|
Add this line to your application's Gemfile:
|
14
14
|
|
15
|
-
|
15
|
+
```sh
|
16
|
+
gem "thor_template"
|
17
|
+
```
|
16
18
|
|
17
19
|
And then execute:
|
18
20
|
|
19
|
-
|
21
|
+
```sh
|
22
|
+
$ bundle
|
23
|
+
```
|
20
24
|
|
21
25
|
Or install it yourself as:
|
22
26
|
|
23
|
-
|
24
|
-
|
27
|
+
```sh
|
28
|
+
$ gem install thor_template
|
29
|
+
```
|
25
30
|
## Usage
|
26
31
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
cd <project_name>
|
31
|
-
rake rename
|
32
|
-
rm -rf .git
|
33
|
-
git init
|
34
|
-
git add .
|
35
|
-
git commit -m "init commit"
|
36
|
-
</pre>
|
32
|
+
```sh
|
33
|
+
bin/thor_template hello yourname
|
34
|
+
```
|
37
35
|
|
38
36
|
## Contributing
|
39
37
|
|
@@ -22,7 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_dependency "hashie"
|
23
23
|
spec.add_dependency "colorize"
|
24
24
|
|
25
|
-
spec.add_development_dependency "bundler"
|
25
|
+
spec.add_development_dependency "bundler"
|
26
|
+
spec.add_development_dependency "byebug"
|
26
27
|
spec.add_development_dependency "rake"
|
27
28
|
spec.add_development_dependency "guard"
|
28
29
|
spec.add_development_dependency "guard-bundler"
|
@@ -53,11 +53,15 @@ module ThorTemplate
|
|
53
53
|
# Thanks https://stackoverflow.com/users/123094/db
|
54
54
|
# https://stackoverflow.com/questions/1290670/ruby-how-do-i-recursively-find-and-remove-empty-directories
|
55
55
|
def remove_empty_directories
|
56
|
+
until empty_directories.empty?
|
57
|
+
empty_directories.each { |d| Dir.rmdir(d) }
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def empty_directories
|
56
62
|
Dir['**/*'].
|
57
63
|
select { |d| File.directory? d }.
|
58
|
-
select { |d| (Dir.entries(d) - %w[ . .. ]).empty? }.
|
59
|
-
each { |d| Dir.rmdir d }
|
64
|
+
select { |d| (Dir.entries(d) - %w[ . .. ]).empty? }.to_a
|
60
65
|
end
|
61
|
-
|
62
66
|
end
|
63
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thor_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
227
227
|
version: '0'
|
228
228
|
requirements: []
|
229
229
|
rubyforge_project:
|
230
|
-
rubygems_version: 2.6.
|
230
|
+
rubygems_version: 2.6.13
|
231
231
|
signing_key:
|
232
232
|
specification_version: 4
|
233
233
|
summary: Generates starter cli tool project.
|