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: a3a90702e97814da4a0bf247f80d48f6ebc03e04
4
- data.tar.gz: 7865ec7d16a21dabda72c03f5e0a632e650fac6f
3
+ metadata.gz: 584d7fe13f8296ed7a0d8c8531600b762567c0bc
4
+ data.tar.gz: c7853d032960135539476d542901c63a7819a022
5
5
  SHA512:
6
- metadata.gz: 0b3561eb3b6d1a0213c56d560192e79ad9df2d44cc493c4f567faab74a3f0bbbed3ff7a1ffc246a2f88fb7c0634eb9d0eae94f5f3dd7efbd3d0533a178713d91
7
- data.tar.gz: 256c250654382f05a20fbcf5921e0be1560fe7bfeabfbdf42a8384dd846733c3d71be37a3333a271ed843278556597c0e1a0e138f379382063b39ddbbe88639f
6
+ metadata.gz: aba061fa571a435c39450fefd77d5efdff672bd0aa4e6c7672a8585a1955bc1a48a55c1d4e952a6647a1af127edd8a98a400a6a14d0a3abbdc6d74c92f92562a
7
+ data.tar.gz: 21c60b09d5ccd58ac030f0cfc2b4e0c3ae80a5f28b5e2d354f776d98a6b3281e04ddfcc5e035ed9b12a9fc5fa1cd773053d8b6213457392894435c1d2d4ea006
@@ -1,12 +1,19 @@
1
- guard "rspec" do
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
- gem "thor_template"
15
+ ```sh
16
+ gem "thor_template"
17
+ ```
16
18
 
17
19
  And then execute:
18
20
 
19
- $ bundle
21
+ ```sh
22
+ $ bundle
23
+ ```
20
24
 
21
25
  Or install it yourself as:
22
26
 
23
- $ gem install thor_template
24
-
27
+ ```sh
28
+ $ gem install thor_template
29
+ ```
25
30
  ## Usage
26
31
 
27
- <pre>
28
- git clone https://github.com/tongueroo/thor_template.git
29
- mv thor_template <project_name>
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", "~> 1.3"
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"
@@ -1,7 +1,6 @@
1
1
  require 'fileutils'
2
2
  require 'colorize'
3
3
  require 'active_support/core_ext/string'
4
- require "byebug"
5
4
 
6
5
  module ThorTemplate
7
6
  class Generator
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ThorTemplate
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  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.1
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-09-20 00:00:00.000000000 Z
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.11
230
+ rubygems_version: 2.6.13
231
231
  signing_key:
232
232
  specification_version: 4
233
233
  summary: Generates starter cli tool project.