thor_template 1.0.0 → 1.0.1

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: fc5ca84c6260eede4acbb985f1779da5c13e3269
4
- data.tar.gz: 4de37c9e5c4083d1193dfa2e47804381b06f9df1
3
+ metadata.gz: 44d85a7deb099da700004cc428aef7ed734df492
4
+ data.tar.gz: ddd667d6c802e10439166ef320aba8745cceecb6
5
5
  SHA512:
6
- metadata.gz: eb79144bb5ef0b1caf736130a48e6f30573059745ef6d1cb26050fc089dcc5241725361d64888696dcbb784e7e36c3a3b4a0c31c1bed1d45da6758c7b9fa3d9f
7
- data.tar.gz: 239212eea5d063db0bb48480d206d491db2b6cc444296f202bc60209f59c4833769d63fbb44b3a05b5559172c8e7c5d6bd35d94653523c4d66b2d7d44933aeb5
6
+ metadata.gz: 515e6f2b5530463b3a58e09fbd74a0267d16e325b33894cc9c2163b952171e0c12be86970c7e1194732d466a4c81011b55b877fa158ef52f2da1197847b6f18a
7
+ data.tar.gz: fda470e98ee5156d51dccb747d4853037a1d1f1f0f7683c021e47b7e786e51c39c5e7f83cb49506ced328a29a50e9205cf5b4e8d10dcd532198b0057234290b1
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.0.1]
7
+
8
+ - require "fileutils" fix
9
+
6
10
  ## [1.0.0]
7
11
 
8
12
  - allow --help or -h at the end of the command
data/README.md CHANGED
@@ -3,23 +3,35 @@
3
3
  [![Build Status](https://travis-ci.org/tongueroo/thor_template.svg?branch=generator)](https://travis-ci.org/tongueroo/thor_template)
4
4
  [![Code Climate](https://codeclimate.com/github/tongueroo/thor_template.png)](https://codeclimate.com/github/tongueroo/thor_template)
5
5
 
6
- Generator that builds a starter cli project which is based on thor.
6
+ This is a generator tool that builds a starter cli project based on thor.
7
7
 
8
8
  ## Installation
9
9
 
10
- <pre>
11
- $ gem install thor_template
12
- </pre>
10
+ ```sh
11
+ gem install thor_template
12
+ ```
13
13
 
14
14
  ## Usage
15
15
 
16
- <pre>
17
- $ thor_template new foo
18
- $ cd foo
19
- $ bin/foo hello world
20
- </pre>
16
+ ```sh
17
+ thor_template new foo
18
+ cd foo
19
+ bin/foo hello world
20
+ ```
21
+
22
+ The above generated a starter cli project called foo with a working hello command. The generated project also has starter specs for you 😁
21
23
 
22
- This generates a starter cli project called foo with a working hello command.
24
+ ```sh
25
+ $ rake
26
+ rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
27
+ Foo::CLI
28
+ foo
29
+ should hello world
30
+
31
+ Finished in 0.09672 seconds (files took 0.20945 seconds to load)
32
+ 1 example, 0 failures
33
+ $
34
+ ```
23
35
 
24
36
  ## Dashes Problem
25
37
 
@@ -29,17 +41,17 @@ Names with dashes don't work quite right with this tool. For example:
29
41
  thor_template new my-project
30
42
  ```
31
43
 
32
- This results in a some the files and text not being renamed properly.
33
-
34
- I usually work around this by creating a project with the underscore name first:
44
+ This results in some the files and text not being renamed correctly. I usually work around this by creating a project with the underscored name first:
35
45
 
36
46
  ```
37
47
  thor_template new my_project
38
48
  ```
39
49
 
40
- Then then I rename 3 spots:
50
+ Then I rename things 3 spots:
41
51
 
42
52
  * my_project.gemspec - Change the name from my_project to my-project. So the gem name has a dash.
43
- * bin/my_project - Change the name from bin/my_project to bin/my-project. So the binary has a dash. The require in the file also.
53
+ * bin/my_project - Change the name from bin/my_project to bin/my-project. So the binary has a dash. The require in the file also needs to be fixed.
44
54
  * lib/my_project.rb - Change the name from lib/my_project.rb to lib/my-project.rb. So if the project is required it is `require my-project`.
45
55
  * spec/spec_helper.rb - Change the require lib/my_project.rb to lib/my-project.rb. And spec/lib/cli_spec. So the test passes.
56
+
57
+ Hope to fix this one day! Also, pull request are appreciated!
@@ -1,5 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ # Trap ^C
4
+ Signal.trap("INT") {
5
+ puts "\nCtrl-C detected. Exiting..."
6
+ sleep 1
7
+ exit
8
+ }
9
+
3
10
  $:.unshift(File.expand_path('../../lib', __FILE__))
4
11
  require 'thor_template'
5
12
  require 'thor_template/cli'
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  module ThorTemplate
2
4
  class Generator
3
5
  attr_reader :options
@@ -54,4 +56,4 @@ private
54
56
  FileUtils.cp("#{templates}/#{src}", "#{@name}/#{dest}")
55
57
  end
56
58
  end
57
- end
59
+ end
@@ -1,3 +1,3 @@
1
1
  module ThorTemplate
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
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: 1.0.0
4
+ version: 1.0.1
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-06-01 00:00:00.000000000 Z
11
+ date: 2017-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor