rubynew 1.0.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -6
- data/bin/rubynew +29 -6
- data/lib/rubynew/project.rb +2 -3
- data/lib/rubynew/version.rb +1 -1
- data/rubynew.gemspec +4 -0
- data/template/Gemfile +7 -0
- data/template/LICENSE +8 -0
- data/template/README.md +20 -0
- data/template/Rakefile +2 -0
- data/template/bin/app +5 -1
- data/template/lib/app.rb +9 -0
- data/template/lib/app/version.rb +1 -1
- data/template/test/app_test.rb +4 -1
- data/template/test/test_helper.rb +6 -0
- data/test/rubynew_test.rb +15 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6063f5baba77f1be01af65181e27d24e40feb84
|
4
|
+
data.tar.gz: 41664657d14639f6d299873b6b51d32c9064c0c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2941e817ff57c3852d80bdaf89654994c4772aa21e54fbb75aa966c1ddd58d90f93fa12de414285c9c66b54f64eff03fa81b1d3d874641566f5fc481d962cbe8
|
7
|
+
data.tar.gz: c099b1c63f3c16c6aaa683993488f77375fdcf5db4a80723d99b9ae868983ed7e41d5c5d26989f6b13b6638895518c97578d28ccc4c63e32e00898f6881ebd85
|
data/README.md
CHANGED
@@ -21,11 +21,14 @@ Bundler works when creating a gem.
|
|
21
21
|
$ rubynew tip_calculator
|
22
22
|
```
|
23
23
|
|
24
|
-
It creates the following structure:
|
24
|
+
It creates the following structure and files:
|
25
25
|
|
26
26
|
```
|
27
27
|
tip_calculator/
|
28
|
+
├── Gemfile
|
28
29
|
├── Rakefile
|
30
|
+
├── README.md
|
31
|
+
├── LICENSE
|
29
32
|
├── bin
|
30
33
|
│ └── tip_calculator
|
31
34
|
├── lib
|
@@ -33,6 +36,7 @@ tip_calculator/
|
|
33
36
|
│ │ └── version.rb
|
34
37
|
│ └── tip_calculator.rb
|
35
38
|
└── test
|
39
|
+
└── test_helper.rb
|
36
40
|
└── tip_calculator_test.rb
|
37
41
|
```
|
38
42
|
|
@@ -50,18 +54,27 @@ To contribute:
|
|
50
54
|
4. Push to the branch (`git push origin my-new-feature`)
|
51
55
|
5. Create a new Pull Request
|
52
56
|
|
53
|
-
## License
|
54
|
-
|
55
|
-
MIT. See LICENSE.txt.
|
56
57
|
|
57
58
|
## History
|
58
59
|
|
59
|
-
2016-
|
60
|
+
2016-08-21 v1.1
|
61
|
+
|
62
|
+
* Added `README.md`, `LICENSE`, and `Gemfile`
|
63
|
+
* Added `test/test_helper.rb` for tests to use as their setup instead of directly loading `minitest/autorun`
|
64
|
+
* Added `minitest/reporters` gem and added configuration to `test_helper` so test reports are colorized.
|
65
|
+
* `bin` program now displays name and version
|
66
|
+
* More detailed help message for `rubynew` when no options are passed
|
67
|
+
* `rubynew` no longer crashes when you use a folder that already exists. This behavior is no longer allowed.
|
68
|
+
|
69
|
+
|
70
|
+
2016-03-05 v1.0.0
|
60
71
|
|
61
72
|
* Added `bin` folder and default bin file.
|
62
|
-
* 1.0.0 version
|
63
73
|
|
64
74
|
2015-08-23
|
65
75
|
|
66
76
|
* Initial version
|
67
77
|
|
78
|
+
## License
|
79
|
+
|
80
|
+
MIT. See LICENSE.txt.
|
data/bin/rubynew
CHANGED
@@ -4,12 +4,35 @@ require "rubynew"
|
|
4
4
|
|
5
5
|
folder = ARGV[0]
|
6
6
|
|
7
|
+
def banner
|
8
|
+
puts "rubynew v#{Rubynew::VERSION} (C) 2015-2016 Brian P Hogan"
|
9
|
+
end
|
10
|
+
|
11
|
+
banner
|
12
|
+
|
7
13
|
if folder.nil?
|
8
|
-
puts
|
14
|
+
puts %Q{
|
15
|
+
Specify a folder and I'll create a Ruby project in that folder with
|
16
|
+
|
17
|
+
* A lib/ folder with version.rb and a main Ruby file
|
18
|
+
* A test/ folder with a test_helpr file and example test
|
19
|
+
* A Rakefile
|
20
|
+
* A Gemfile
|
21
|
+
* A bin/ folder with everything wired up.
|
22
|
+
|
23
|
+
Example:
|
24
|
+
|
25
|
+
rubynew awesome_project
|
26
|
+
}
|
9
27
|
else
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
28
|
+
if File.exists?(folder)
|
29
|
+
puts "This folder already exists. Please specify a folder that doesn't exist."
|
30
|
+
else
|
31
|
+
project = Rubynew::Project.new(folder)
|
32
|
+
project.create
|
33
|
+
puts "\nCreated new Ruby project in #{folder}.\n\n"
|
34
|
+
puts "To use this project, type: \n\n\tcd #{folder}\n\nInstall dependencies with\n\n\tbundle install\n\nand run tests with\n\n\trake test\n\n"
|
35
|
+
puts "Run the program with \n\n\truby bin/#{folder}\n\n"
|
36
|
+
|
37
|
+
end
|
15
38
|
end
|
data/lib/rubynew/project.rb
CHANGED
@@ -28,11 +28,10 @@ module Rubynew
|
|
28
28
|
File.join(@name, "bin", @underscored_name),
|
29
29
|
File.join(@name, "lib", "#{@underscored_name}.rb"),
|
30
30
|
File.join(@name, "lib", @underscored_name, "version.rb"),
|
31
|
-
File.join(@name, "test", "#{@underscored_name}_test.rb")
|
31
|
+
File.join(@name, "test", "#{@underscored_name}_test.rb"),
|
32
|
+
File.join(@name, "README.md")
|
32
33
|
].each { |file| render_template_to_file file, binding }
|
33
34
|
|
34
|
-
|
35
|
-
|
36
35
|
end
|
37
36
|
|
38
37
|
private
|
data/lib/rubynew/version.rb
CHANGED
data/rubynew.gemspec
CHANGED
@@ -23,6 +23,10 @@ Gem::Specification.new do |spec|
|
|
23
23
|
"template/lib/app/version.rb",
|
24
24
|
"template/lib/app.rb",
|
25
25
|
"template/test/app_test.rb",
|
26
|
+
"template/test/test_helper.rb",
|
27
|
+
"template/Gemfile",
|
28
|
+
"template/README.md",
|
29
|
+
"template/LICENSE",
|
26
30
|
"test/rubynew_test.rb",
|
27
31
|
"Rakefile",
|
28
32
|
"Gemfile",
|
data/template/Gemfile
ADDED
data/template/LICENSE
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
Copyright (c) <year> <copyright holders>
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
5
|
+
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
7
|
+
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/template/README.md
ADDED
data/template/Rakefile
CHANGED
data/template/bin/app
CHANGED
data/template/lib/app.rb
CHANGED
@@ -1,5 +1,14 @@
|
|
1
|
+
# Load Bundler and load all your gems
|
2
|
+
require "bundler/setup"
|
3
|
+
|
4
|
+
# Explicitly load any gems you need.
|
5
|
+
|
1
6
|
require "<%= @underscored_name %>/version"
|
2
7
|
|
3
8
|
module <%= @constant_name %>
|
4
9
|
# Your code goes here...
|
10
|
+
# Good place for your main application logic if this is a library.
|
11
|
+
#
|
12
|
+
# Create classes in the <%= @underscored_name %> folder and
|
13
|
+
# be sure to create unit tests for them too.
|
5
14
|
end
|
data/template/lib/app/version.rb
CHANGED
data/template/test/app_test.rb
CHANGED
data/test/rubynew_test.rb
CHANGED
@@ -19,6 +19,9 @@ class RubynewTest < MiniTest::Test
|
|
19
19
|
Rubynew::Project.new(@folder).create
|
20
20
|
|
21
21
|
assert File.exist?(File.join(@folder, "Rakefile"))
|
22
|
+
assert File.exist?(File.join(@folder, "Gemfile"))
|
23
|
+
assert File.exist?(File.join(@folder, "README.md"))
|
24
|
+
assert File.exist?(File.join(@folder, "LICENSE"))
|
22
25
|
assert File.exist?(File.join(@folder, "lib", "#{@folder}.rb"))
|
23
26
|
assert File.exist?(File.join(@folder, "lib", @folder, "version.rb"))
|
24
27
|
assert File.exist?(File.join(@folder, "test", "#{@folder}_test.rb"))
|
@@ -76,11 +79,22 @@ class RubynewTest < MiniTest::Test
|
|
76
79
|
end
|
77
80
|
|
78
81
|
def test_has_bin
|
79
|
-
|
80
82
|
Rubynew::Project.new(@folder).create
|
81
83
|
|
82
84
|
file = Pathname.new(File.join(@folder, "bin", @folder))
|
83
85
|
assert file.read.include?("$LOAD_PATH")
|
84
86
|
assert file.read.include?("require 'tmpproject'")
|
85
87
|
end
|
88
|
+
|
89
|
+
def test_bin_displays_name_and_version
|
90
|
+
Rubynew::Project.new(@folder).create
|
91
|
+
file = Pathname.new(File.join(@folder, "bin", @folder))
|
92
|
+
assert file.read.include?('tmpproject v#{Tmpproject::VERSION}')
|
93
|
+
end
|
94
|
+
|
95
|
+
def readme_has_project_name_as_header
|
96
|
+
Rubynew::Project.new(@folder).create
|
97
|
+
file = Pathname.new(File.join(@folder, "README.md"))
|
98
|
+
assert file.read.include?("# tmpproject\n")
|
99
|
+
end
|
86
100
|
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: 1.
|
4
|
+
version: '1.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Hogan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,11 +70,15 @@ files:
|
|
70
70
|
- lib/rubynew/project.rb
|
71
71
|
- lib/rubynew/version.rb
|
72
72
|
- rubynew.gemspec
|
73
|
+
- template/Gemfile
|
74
|
+
- template/LICENSE
|
75
|
+
- template/README.md
|
73
76
|
- template/Rakefile
|
74
77
|
- template/bin/app
|
75
78
|
- template/lib/app.rb
|
76
79
|
- template/lib/app/version.rb
|
77
80
|
- template/test/app_test.rb
|
81
|
+
- template/test/test_helper.rb
|
78
82
|
- test/rubynew_test.rb
|
79
83
|
homepage: http://github.com/napcs/rubynew
|
80
84
|
licenses:
|
@@ -96,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
100
|
version: '0'
|
97
101
|
requirements: []
|
98
102
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
103
|
+
rubygems_version: 2.5.1
|
100
104
|
signing_key:
|
101
105
|
specification_version: 4
|
102
106
|
summary: Generate new Ruby projects with tests.
|