rubynew 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -2
- data/bin/rubynew +1 -0
- data/lib/rubynew/project.rb +2 -0
- data/lib/rubynew/version.rb +1 -1
- data/rubynew.gemspec +2 -1
- data/template/bin/app +6 -0
- data/template/lib/app/version.rb +1 -1
- data/test/rubynew_test.rb +11 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69431f4a2d406cc85339e4406e7df9869c542424
|
4
|
+
data.tar.gz: e84baa2941b14073dde56ce538fdc03a8079146f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05d092b8df397bbd70559af098cada1ee857e44ed5333bd255e290c40bd93c293b2dd87dd0d8bd29136cddacb0411ad0cf3041b9fbf15ce03656adb419c9eb76
|
7
|
+
data.tar.gz: 2c8c8335966289162e6eb47ab27a00f6e7749f28d7ecb8e5c51a9ee3ba858b1e0aca47c1c30695a9d6020ca72320cc4a44fcbcc9278450bc314bddbb7659c9fa
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Rubynew
|
2
2
|
|
3
|
-
|
3
|
+
A simple command-line utility for creating new projects in Ruby. Creates a `bin` folder and stub, a `lib` folder with a module
|
4
|
+
and a `version.rb` file, and a `test` folder with a default test. It also creates a Rakefile set up to run tests with Minitest.
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
@@ -20,9 +21,26 @@ Bundler works when creating a gem.
|
|
20
21
|
$ rubynew tip_calculator
|
21
22
|
```
|
22
23
|
|
24
|
+
It creates the following structure:
|
25
|
+
|
26
|
+
```
|
27
|
+
tip_calculator/
|
28
|
+
├── Rakefile
|
29
|
+
├── bin
|
30
|
+
│ └── tip_calculator
|
31
|
+
├── lib
|
32
|
+
│ ├── tip_calculator
|
33
|
+
│ │ └── version.rb
|
34
|
+
│ └── tip_calculator.rb
|
35
|
+
└── test
|
36
|
+
└── tip_calculator_test.rb
|
37
|
+
```
|
38
|
+
|
39
|
+
If you don't need the `bin` folder, simply delete it.
|
40
|
+
|
23
41
|
## Contributing
|
24
42
|
|
25
|
-
Please contribute. I'm interested in discussing features, such as providing
|
43
|
+
Please contribute. I'm interested in discussing features, such as providing options for alternative frameworks for testing. However, the default will always be what Ruby's default is. I want this to be simple for beginners, so the defaults will do whatever Ruby does by default. Right now that's Rake and Minitest.
|
26
44
|
|
27
45
|
To contribute:
|
28
46
|
|
@@ -38,6 +56,11 @@ MIT. See LICENSE.txt.
|
|
38
56
|
|
39
57
|
## History
|
40
58
|
|
59
|
+
2016-03-05
|
60
|
+
|
61
|
+
* Added `bin` folder and default bin file.
|
62
|
+
* 1.0.0 version
|
63
|
+
|
41
64
|
2015-08-23
|
42
65
|
|
43
66
|
* Initial version
|
data/bin/rubynew
CHANGED
data/lib/rubynew/project.rb
CHANGED
@@ -21,9 +21,11 @@ module Rubynew
|
|
21
21
|
FileUtils.mv File.join(@name, "lib", "app"), File.join(@name, "lib", @underscored_name)
|
22
22
|
FileUtils.mv File.join(@name, "lib", "app.rb"), File.join(@name, "lib", "#{@underscored_name}.rb")
|
23
23
|
FileUtils.mv File.join(@name, "test", "app_test.rb"), File.join(@name, "test", "#{@underscored_name}_test.rb")
|
24
|
+
FileUtils.mv File.join(@name, "bin", "app"), File.join(@name, "bin", @underscored_name)
|
24
25
|
|
25
26
|
# apply templates
|
26
27
|
[
|
28
|
+
File.join(@name, "bin", @underscored_name),
|
27
29
|
File.join(@name, "lib", "#{@underscored_name}.rb"),
|
28
30
|
File.join(@name, "lib", @underscored_name, "version.rb"),
|
29
31
|
File.join(@name, "test", "#{@underscored_name}_test.rb")
|
data/lib/rubynew/version.rb
CHANGED
data/rubynew.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Brian Hogan"]
|
10
10
|
spec.email = ["brianhogan@napcs.com"]
|
11
11
|
spec.summary = %q{Generate new Ruby projects with tests.}
|
12
|
-
spec.description = %q{Ruby project generator. Creates lib/ and test/ folders with a module and a Rakefile so you can quickly develop an app with tests.}
|
12
|
+
spec.description = %q{Ruby project generator. Creates bin/, lib/ and test/ folders with a module and a Rakefile so you can quickly develop an app with tests.}
|
13
13
|
spec.homepage = "http://github.com/napcs/rubynew"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
"lib/rubynew/version.rb",
|
20
20
|
"lib/rubynew/project.rb",
|
21
21
|
"template/Rakefile",
|
22
|
+
"template/bin/app",
|
22
23
|
"template/lib/app/version.rb",
|
23
24
|
"template/lib/app.rb",
|
24
25
|
"template/test/app_test.rb",
|
data/template/bin/app
ADDED
data/template/lib/app/version.rb
CHANGED
data/test/rubynew_test.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'minitest/autorun'
|
2
2
|
require 'rubynew/project'
|
3
3
|
|
4
|
+
require 'pathname'
|
4
5
|
# Not really a unit test - more of an integration test.
|
5
6
|
class RubynewTest < MiniTest::Test
|
6
7
|
|
@@ -21,6 +22,7 @@ class RubynewTest < MiniTest::Test
|
|
21
22
|
assert File.exist?(File.join(@folder, "lib", "#{@folder}.rb"))
|
22
23
|
assert File.exist?(File.join(@folder, "lib", @folder, "version.rb"))
|
23
24
|
assert File.exist?(File.join(@folder, "test", "#{@folder}_test.rb"))
|
25
|
+
assert File.exist?(File.join(@folder, "bin", "#{@folder}"))
|
24
26
|
|
25
27
|
end
|
26
28
|
|
@@ -72,4 +74,13 @@ class RubynewTest < MiniTest::Test
|
|
72
74
|
file = Pathname.new(File.join(@folder, "test", "#{@folder}_test.rb"))
|
73
75
|
assert file.read.include?("class TmpprojectTest < Minitest::Test")
|
74
76
|
end
|
77
|
+
|
78
|
+
def test_has_bin
|
79
|
+
|
80
|
+
Rubynew::Project.new(@folder).create
|
81
|
+
|
82
|
+
file = Pathname.new(File.join(@folder, "bin", @folder))
|
83
|
+
assert file.read.include?("$LOAD_PATH")
|
84
|
+
assert file.read.include?("require 'tmpproject'")
|
85
|
+
end
|
75
86
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubynew
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Hogan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description: Ruby project generator. Creates lib/ and test/ folders with a module
|
55
|
+
description: Ruby project generator. Creates bin/, lib/ and test/ folders with a module
|
56
56
|
and a Rakefile so you can quickly develop an app with tests.
|
57
57
|
email:
|
58
58
|
- brianhogan@napcs.com
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- lib/rubynew/version.rb
|
72
72
|
- rubynew.gemspec
|
73
73
|
- template/Rakefile
|
74
|
+
- template/bin/app
|
74
75
|
- template/lib/app.rb
|
75
76
|
- template/lib/app/version.rb
|
76
77
|
- template/test/app_test.rb
|
@@ -95,9 +96,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
96
|
version: '0'
|
96
97
|
requirements: []
|
97
98
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
99
|
+
rubygems_version: 2.4.6
|
99
100
|
signing_key:
|
100
101
|
specification_version: 4
|
101
102
|
summary: Generate new Ruby projects with tests.
|
102
103
|
test_files:
|
103
104
|
- test/rubynew_test.rb
|
105
|
+
has_rdoc:
|