gemstone 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +4 -0
- data/Gemfile +3 -0
- data/LICENSE +20 -0
- data/README.md +54 -0
- data/Rakefile +11 -0
- data/lib/gemstone.rb +106 -0
- data/test/options_test.rb +30 -0
- data/test/results_test.rb +249 -0
- data/test/sandbox/Changelog.md +3 -0
- data/test/sandbox/Gemfile +3 -0
- data/test/sandbox/LICENSE +20 -0
- data/test/sandbox/README.md +9 -0
- data/test/sandbox/RakeFile +11 -0
- data/test/sandbox/bin/my_gem +2 -0
- data/test/sandbox/lib/my_gem.rb +5 -0
- data/test/sandbox/my_gem.gemspec +22 -0
- data/test/sandbox/test/my_gem_test.rb +9 -0
- data/test/sandbox/test/test_helper.rb +3 -0
- data/test/test_helper.rb +21 -0
- metadata +97 -0
data/Changelog.md
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Raul Murciano <raul@murciano.net>
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# GemStone
|
2
|
+
|
3
|
+
Generates a skeleton to start coding your next ruby gem.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
gemstone
|
8
|
+
|
9
|
+
> Hi, I'll need some data about your next ruby gem, please answer all questions:
|
10
|
+
|
11
|
+
> gem name?
|
12
|
+
zombie
|
13
|
+
|
14
|
+
> gem author?
|
15
|
+
Raul Murciano
|
16
|
+
|
17
|
+
> author email?
|
18
|
+
raul@murciano.net
|
19
|
+
|
20
|
+
> gem summary? (be brief)
|
21
|
+
Resurrects dead bodies
|
22
|
+
|
23
|
+
> summary?
|
24
|
+
Braaains, braaaaains...
|
25
|
+
|
26
|
+
> homepage URL?
|
27
|
+
http://github.com/raul/zombie
|
28
|
+
|
29
|
+
> will include an executable? (y/n)
|
30
|
+
y
|
31
|
+
|
32
|
+
The following files will be generated:
|
33
|
+
|
34
|
+
- `bin/your_gem`: an executable ruby script will be generated if you answered `y` to the `will include an executable?` question
|
35
|
+
- `Changelog.md`: update it before releasing each new version
|
36
|
+
- `Gemfile`: help to manage dependencies, will rely in your `.gemspec` file
|
37
|
+
- `your_gem.gemspec`: all the relevant data about your new gem goes here
|
38
|
+
- `lib/your_gem.rb`: grow your awesome code here
|
39
|
+
- `LICENSE`: MIT license FTW
|
40
|
+
- `Rakefile`: will run your tests by default
|
41
|
+
- `README.md`: please always document your gems so it will make them easier to use
|
42
|
+
- `test/test_helper.rb`: will load `MiniTest` and your gem code to bootstrap your tests
|
43
|
+
- `test/your_gem_test.rb`: sample test
|
44
|
+
|
45
|
+
|
46
|
+
## Opinions
|
47
|
+
|
48
|
+
I prefer a light approach for testing so I use MiniTest (contributions to add RSpec suppport are welcome, but should be tested themselves with MiniTest).
|
49
|
+
|
50
|
+
## License
|
51
|
+
See the LICENSE file included in the distribution.
|
52
|
+
|
53
|
+
## Copyright
|
54
|
+
Copyright (C) 2011 Raul Murciano <raul@murciano.net>.
|
data/Rakefile
ADDED
data/lib/gemstone.rb
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
require 'erb'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module GemStone
|
5
|
+
|
6
|
+
VERSION = '0.1'
|
7
|
+
|
8
|
+
class MissingOption < Exception; end
|
9
|
+
|
10
|
+
class CLI
|
11
|
+
|
12
|
+
def self.ask_options
|
13
|
+
options = {}
|
14
|
+
while options.empty? do
|
15
|
+
puts "Hi, I'll need some data about your next ruby gem, please answer all questions"
|
16
|
+
questions = [
|
17
|
+
[:name , 'gem name?'],
|
18
|
+
[:author , 'gem author?'],
|
19
|
+
[:email , 'author email?'],
|
20
|
+
[:summary , 'gem summary? (be brief)'],
|
21
|
+
[:description , 'gem description? (not so brief)'],
|
22
|
+
[:homepage , 'gem homepage URL?'],
|
23
|
+
[:executable , 'will the gem include an executable? (y/n)']
|
24
|
+
]
|
25
|
+
|
26
|
+
questions.each do |option, question|
|
27
|
+
puts question
|
28
|
+
options[option] = gets.chomp
|
29
|
+
end
|
30
|
+
options[:executable] = options[:executable].downcase.include?('y')
|
31
|
+
|
32
|
+
begin
|
33
|
+
OptionsValidator.validate!(options)
|
34
|
+
rescue MissingOption => e
|
35
|
+
puts "Please answer all questions."
|
36
|
+
options = {}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
options
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
class OptionsValidator
|
45
|
+
|
46
|
+
REQUIRED_OPTIONS = [:name, :author, :email, :description, :summary, :homepage, :executable]
|
47
|
+
|
48
|
+
def self.validate!(options)
|
49
|
+
REQUIRED_OPTIONS.each do |option|
|
50
|
+
raise MissingOption, "'#{option}' option required" unless present?(options[option])
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.present?(value)
|
55
|
+
!value.nil? && !value.to_s.strip.empty?
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
class Generator
|
61
|
+
|
62
|
+
def initialize(options = nil)
|
63
|
+
cli_mode = options.nil?
|
64
|
+
options ||= CLI.ask_options
|
65
|
+
@options = options
|
66
|
+
OptionsValidator.validate!(@options)
|
67
|
+
@options[:gem_file_name] = underscore(@options[:name])
|
68
|
+
@options[:gem_class_name] = classify(@options[:name])
|
69
|
+
@options[:gem_path] ||= "./#{options[:gem_file_name]}"
|
70
|
+
%w{ README.md Changelog.md Gemfile RakeFile LICENSE test/test_helper.rb }.each{ |path| render_file path }
|
71
|
+
render_file 'sample.gemspec', "#{@options[:gem_file_name]}.gemspec"
|
72
|
+
render_file 'test/sample_test.rb', "test/#{@options[:gem_file_name]}_test.rb"
|
73
|
+
render_file 'lib/sample.rb', "lib/#{@options[:gem_file_name]}.rb"
|
74
|
+
if @options[:executable]
|
75
|
+
render_file('bin/sample', "bin/#{@options[:gem_file_name]}")
|
76
|
+
exec_path = result_path "bin/#{@options[:gem_file_name]}"
|
77
|
+
`chmod +x #{exec_path}`
|
78
|
+
end
|
79
|
+
puts "Your gem is ready at #{@options[:gem_path]}, start coding!" if cli_mode
|
80
|
+
end
|
81
|
+
|
82
|
+
# 'My gem' => 'my_gem'
|
83
|
+
def underscore(gem_name)
|
84
|
+
gem_name.strip.downcase.gsub(' ', '_')
|
85
|
+
end
|
86
|
+
|
87
|
+
# 'My gem' => 'MyGem'
|
88
|
+
def classify(gem_name)
|
89
|
+
gem_name.strip.split.map{ |word| word.capitalize}.join.gsub(' ', '')
|
90
|
+
end
|
91
|
+
|
92
|
+
def render_file(path, result_file_path = path)
|
93
|
+
source_path = File.join 'template', path
|
94
|
+
result_file_path = result_path(result_file_path)
|
95
|
+
FileUtils.mkdir_p File.dirname(result_file_path)
|
96
|
+
result = ERB.new(File.read(source_path)).result(binding)
|
97
|
+
File.open(result_file_path, 'w') {|f| f.write(result) }
|
98
|
+
end
|
99
|
+
|
100
|
+
def result_path(source_path)
|
101
|
+
File.join @options[:gem_path], source_path
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require './test/test_helper'
|
2
|
+
|
3
|
+
class OptionsTest < GemStoneTest
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@valid_options = {
|
7
|
+
:name => 'My gem',
|
8
|
+
:author => 'Raul Murciano',
|
9
|
+
:email => 'raul@murciano.net',
|
10
|
+
:homepage => 'http://github.com/raul/my_gem',
|
11
|
+
:description => 'A short description goes here',
|
12
|
+
:summary => 'Lorem ipsum and so on',
|
13
|
+
:executable => true
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_version
|
18
|
+
assert_equal '0.1', GemStone::VERSION
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_required_options_are_checked
|
22
|
+
GemStone::OptionsValidator::REQUIRED_OPTIONS.each do |option|
|
23
|
+
@valid_options.delete(option)
|
24
|
+
assert_raises GemStone::MissingOption do
|
25
|
+
GemStone::Generator.new @valid_options
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,249 @@
|
|
1
|
+
require './test/test_helper'
|
2
|
+
|
3
|
+
class ResultsTest < GemStoneTest
|
4
|
+
|
5
|
+
def setup
|
6
|
+
reset_sandbox
|
7
|
+
@valid_options = {
|
8
|
+
:name => 'My gem',
|
9
|
+
:author => 'Raul Murciano',
|
10
|
+
:email => 'raul@murciano.net',
|
11
|
+
:homepage => 'http://github.com/raul/my_gem',
|
12
|
+
:description => 'A short description goes here',
|
13
|
+
:summary => 'Lorem ipsum and so on',
|
14
|
+
:executable => true,
|
15
|
+
:gem_path => './test/sandbox'
|
16
|
+
}
|
17
|
+
GemStone::Generator.new @valid_options
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
## Changelog.md
|
22
|
+
|
23
|
+
def test_creates_changelog
|
24
|
+
assert_file_created 'Changelog.md'
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_changelog_includes_gem_name_in_title
|
28
|
+
assert_file_includes 'Changelog.md', '# My gem changelog'
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_changelog_includes_v_0_1
|
32
|
+
assert_file_includes 'Changelog.md', '## v0.1'
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
## Gemfile
|
37
|
+
|
38
|
+
def test_creates_gemfile
|
39
|
+
assert_file_created 'Gemfile'
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_gemfile_remains_identical
|
43
|
+
assert_file_equals_template 'Gemfile'
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
# my_gem.gemspec
|
48
|
+
|
49
|
+
def test_creates_gemspec
|
50
|
+
assert_file_created 'my_gem.gemspec'
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_gemspec_requires_lib
|
54
|
+
assert_file_includes 'my_gem.gemspec', 'require File.expand_path("./lib/my_gem")'
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_gemspec_includes_name
|
58
|
+
assert_file_includes 'my_gem.gemspec', 's.name = "My gem"'
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_gemspec_includes_authors
|
62
|
+
assert_file_includes 'my_gem.gemspec', 's.authors = ["Raul Murciano"]'
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_gemspec_includes_email
|
66
|
+
assert_file_includes 'my_gem.gemspec', 's.email = ["raul@murciano.net"]'
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_gemspec_includes_version
|
70
|
+
assert_file_includes 'my_gem.gemspec', 's.version = MyGem::VERSION'
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_gemspec_includes_platform
|
74
|
+
assert_file_includes 'my_gem.gemspec', 's.platform = Gem::Platform::RUBY'
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_gemspec_includes_rubyforge_project
|
78
|
+
assert_file_includes 'my_gem.gemspec', 's.rubyforge_project = "my_gem"'
|
79
|
+
end
|
80
|
+
|
81
|
+
def test_gemspec_includes_summary
|
82
|
+
assert_file_includes 'my_gem.gemspec', 's.summary = "Lorem ipsum and so on"'
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_gemspec_includes_homepage
|
86
|
+
assert_file_includes 'my_gem.gemspec', 's.homepage = "http://github.com/raul/my_gem"'
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_gemspec_includes_description
|
90
|
+
assert_file_includes 'my_gem.gemspec', 's.description = "A short description goes here"'
|
91
|
+
end
|
92
|
+
|
93
|
+
|
94
|
+
## README.md
|
95
|
+
|
96
|
+
def test_creates_readme
|
97
|
+
assert_file_created 'README.md'
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_readme_includes_gem_name_as_title
|
101
|
+
assert_file_includes 'README.md', '# My gem'
|
102
|
+
end
|
103
|
+
|
104
|
+
def test_readme_includes_dummy_doc
|
105
|
+
assert_file_includes 'README.md', 'This documentation needs more love from Raul Murciano'
|
106
|
+
end
|
107
|
+
|
108
|
+
def test_readme_includes_copyright
|
109
|
+
assert_file_includes 'README.md', "Copyright (C) #{Time.now.year} Raul Murciano <raul@murciano.net>"
|
110
|
+
end
|
111
|
+
|
112
|
+
def test_readme_mentions_license
|
113
|
+
assert_file_includes 'README.md', 'See the LICENSE file included in the distribution.'
|
114
|
+
end
|
115
|
+
|
116
|
+
|
117
|
+
## lib/my_gem.rb
|
118
|
+
|
119
|
+
def test_creates_lib_file
|
120
|
+
assert_file_created 'lib/my_gem.rb'
|
121
|
+
end
|
122
|
+
|
123
|
+
def test_lib_file_includes_class
|
124
|
+
assert_file_includes 'lib/my_gem.rb', 'class MyGem'
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_lib_file_includes_version
|
128
|
+
assert_file_includes 'lib/my_gem.rb', "VERSION = '0.1'"
|
129
|
+
end
|
130
|
+
|
131
|
+
|
132
|
+
## LICENSE
|
133
|
+
|
134
|
+
def test_creates_license
|
135
|
+
assert_file_created 'LICENSE'
|
136
|
+
end
|
137
|
+
|
138
|
+
def test_license_includes_author
|
139
|
+
assert_file_includes 'LICENSE', 'Raul Murciano'
|
140
|
+
end
|
141
|
+
|
142
|
+
def test_license_includes_email
|
143
|
+
assert_file_includes 'LICENSE', 'raul@murciano.net'
|
144
|
+
end
|
145
|
+
|
146
|
+
|
147
|
+
## Rakefile
|
148
|
+
|
149
|
+
def test_creates_rakefile
|
150
|
+
assert_file_created 'Rakefile'
|
151
|
+
end
|
152
|
+
|
153
|
+
def test_rakefile_remains_identical
|
154
|
+
assert_file_equals_template 'Rakefile'
|
155
|
+
end
|
156
|
+
|
157
|
+
|
158
|
+
## test/test_helper.rb
|
159
|
+
|
160
|
+
def test_creates_test_helper
|
161
|
+
assert_file_created 'test/test_helper.rb'
|
162
|
+
end
|
163
|
+
|
164
|
+
def test_test_helper_requires_rubygems
|
165
|
+
assert_file_includes 'test/test_helper.rb', "require 'rubygems'"
|
166
|
+
end
|
167
|
+
|
168
|
+
def test_test_helper_requires_minitest
|
169
|
+
assert_file_includes 'test/test_helper.rb', "require 'minitest/autorun'"
|
170
|
+
end
|
171
|
+
|
172
|
+
def test_test_helper_requires_gem_lib
|
173
|
+
assert_file_includes 'test/test_helper.rb', "require './lib/my_gem'"
|
174
|
+
end
|
175
|
+
|
176
|
+
|
177
|
+
## test/my_gem_test.rb
|
178
|
+
|
179
|
+
def test_creates_test_file
|
180
|
+
assert_file_created 'test/my_gem_test.rb'
|
181
|
+
end
|
182
|
+
|
183
|
+
def test_test_file_requires_test_helper
|
184
|
+
assert_file_includes 'test/my_gem_test.rb', "require './test/test_helper'"
|
185
|
+
end
|
186
|
+
|
187
|
+
def test_test_file_includes_test_class
|
188
|
+
assert_file_includes 'test/my_gem_test.rb', 'class MyGemTest < MiniTest::Unit::TestCase'
|
189
|
+
end
|
190
|
+
|
191
|
+
|
192
|
+
## bin/my_gem
|
193
|
+
|
194
|
+
def test_doesnt_create_executable_if_not_selected
|
195
|
+
@valid_options[:executable] = false
|
196
|
+
reset_sandbox
|
197
|
+
GemStone::Generator.new @valid_options
|
198
|
+
assert_file_not_created 'bin/my_gem'
|
199
|
+
end
|
200
|
+
|
201
|
+
def test_creates_executable_if_selected
|
202
|
+
assert_file_created 'bin/my_gem'
|
203
|
+
end
|
204
|
+
|
205
|
+
def test_executable_includes_ruby_shebang
|
206
|
+
assert_file_includes 'bin/my_gem', "#!/usr/bin/env ruby"
|
207
|
+
end
|
208
|
+
|
209
|
+
def test_executable_includes_dummy_code
|
210
|
+
assert_file_includes 'bin/my_gem', 'puts "This executable needs more love from Raul Murciano"'
|
211
|
+
end
|
212
|
+
|
213
|
+
def test_executable_is_executable
|
214
|
+
assert_executable_file 'bin/my_gem'
|
215
|
+
end
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
protected
|
220
|
+
|
221
|
+
## test helpers
|
222
|
+
|
223
|
+
def assert_file_includes(file_path, content)
|
224
|
+
path = sandboxed_path file_path
|
225
|
+
assert File.file?(path) && File.read(path).include?(content), "String '#{content}' not found in #{path}"
|
226
|
+
end
|
227
|
+
|
228
|
+
def assert_file_created(file_path)
|
229
|
+
path = sandboxed_path file_path
|
230
|
+
assert File.file?(path), "#{path} file not found"
|
231
|
+
end
|
232
|
+
|
233
|
+
def assert_file_not_created(file_path)
|
234
|
+
path = sandboxed_path file_path
|
235
|
+
assert !File.file?(path), "#{path} file found, and should not exist"
|
236
|
+
end
|
237
|
+
|
238
|
+
def assert_file_equals_template(file_path)
|
239
|
+
templates_path = './template'
|
240
|
+
template_path = File.join templates_path, file_path
|
241
|
+
assert FileUtils.compare_file(template_path, sandboxed_path(file_path))
|
242
|
+
end
|
243
|
+
|
244
|
+
def assert_executable_file(file_path)
|
245
|
+
path = sandboxed_path file_path
|
246
|
+
assert `ls -la #{path}`.include?('-rwxr-xr-x'), "#{file_path} is not executable"
|
247
|
+
end
|
248
|
+
|
249
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Raul Murciano raul@murciano.net
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
$:.unshift Dir.pwd
|
2
|
+
require File.expand_path("./lib/my_gem")
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "My gem"
|
6
|
+
s.version = MyGem::VERSION
|
7
|
+
s.authors = ["Raul Murciano"]
|
8
|
+
s.email = ["raul@murciano.net"]
|
9
|
+
s.homepage = "http://github.com/raul/my_gem"
|
10
|
+
s.summary = "Lorem ipsum and so on"
|
11
|
+
s.description = "A short description goes here"
|
12
|
+
|
13
|
+
# s.executables = ["newgem"]
|
14
|
+
s.files = Dir["{lib,test}/**/*", "[A-Z]*", "init.rb"] - ["Gemfile.lock"]
|
15
|
+
s.require_path = 'lib'
|
16
|
+
|
17
|
+
# s.add_dependency "another_gem", "0.1"
|
18
|
+
s.add_development_dependency 'minitest', '>2.0'
|
19
|
+
|
20
|
+
s.rubyforge_project = "my_gem"
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'minitest/autorun'
|
3
|
+
require 'fileutils'
|
4
|
+
require './lib/gemstone'
|
5
|
+
|
6
|
+
class GemStoneTest < MiniTest::Unit::TestCase
|
7
|
+
|
8
|
+
SANDBOX_PATH = './test/sandbox'
|
9
|
+
|
10
|
+
## Helpers
|
11
|
+
|
12
|
+
def sandboxed_path(file_path)
|
13
|
+
sandboxed_path = File.join SANDBOX_PATH, file_path
|
14
|
+
end
|
15
|
+
|
16
|
+
def reset_sandbox
|
17
|
+
FileUtils.rm_rf SANDBOX_PATH
|
18
|
+
FileUtils.mkdir SANDBOX_PATH
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gemstone
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
version: "0.1"
|
9
|
+
platform: ruby
|
10
|
+
authors:
|
11
|
+
- Raul Murciano
|
12
|
+
autorequire:
|
13
|
+
bindir: bin
|
14
|
+
cert_chain: []
|
15
|
+
|
16
|
+
date: 2011-03-08 00:00:00 +01:00
|
17
|
+
default_executable:
|
18
|
+
dependencies:
|
19
|
+
- !ruby/object:Gem::Dependency
|
20
|
+
name: minitest
|
21
|
+
prerelease: false
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 0
|
30
|
+
version: "2.0"
|
31
|
+
type: :development
|
32
|
+
version_requirements: *id001
|
33
|
+
description: A new gem generator. Nothing more, nothing less.
|
34
|
+
email:
|
35
|
+
- raul@murciano.net
|
36
|
+
executables: []
|
37
|
+
|
38
|
+
extensions: []
|
39
|
+
|
40
|
+
extra_rdoc_files: []
|
41
|
+
|
42
|
+
files:
|
43
|
+
- lib/gemstone.rb
|
44
|
+
- test/options_test.rb
|
45
|
+
- test/results_test.rb
|
46
|
+
- test/sandbox/bin/my_gem
|
47
|
+
- test/sandbox/Changelog.md
|
48
|
+
- test/sandbox/Gemfile
|
49
|
+
- test/sandbox/lib/my_gem.rb
|
50
|
+
- test/sandbox/LICENSE
|
51
|
+
- test/sandbox/my_gem.gemspec
|
52
|
+
- test/sandbox/RakeFile
|
53
|
+
- test/sandbox/README.md
|
54
|
+
- test/sandbox/test/my_gem_test.rb
|
55
|
+
- test/sandbox/test/test_helper.rb
|
56
|
+
- test/test_helper.rb
|
57
|
+
- Changelog.md
|
58
|
+
- Gemfile
|
59
|
+
- LICENSE
|
60
|
+
- Rakefile
|
61
|
+
- README.md
|
62
|
+
has_rdoc: true
|
63
|
+
homepage: http://github.com/raul/gemstone
|
64
|
+
licenses: []
|
65
|
+
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
version: "0"
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
segments:
|
85
|
+
- 1
|
86
|
+
- 3
|
87
|
+
- 4
|
88
|
+
version: 1.3.4
|
89
|
+
requirements: []
|
90
|
+
|
91
|
+
rubyforge_project: gemstone
|
92
|
+
rubygems_version: 1.3.7
|
93
|
+
signing_key:
|
94
|
+
specification_version: 3
|
95
|
+
summary: Generates a skeleton to start coding your next ruby gem
|
96
|
+
test_files: []
|
97
|
+
|