revans-sleeve 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/sleeve CHANGED
@@ -4,4 +4,4 @@ require 'rubygems'
4
4
  require 'sleeve'
5
5
 
6
6
  options = Sleeve::Options.parse(ARGV)
7
- Sleeve::Generate.new(options)
7
+ Sleeve::Generate.gem(options)
data/changelog.rdoc CHANGED
@@ -1,13 +1,18 @@
1
1
 
2
- Version 0.1.0
3
- * Initial creation of Sleeve
4
- * A Generator for a Gem Sleeve
5
- * An Option Parser
6
- * Creates a GemSpec file
7
- * Specs are none existent :(
2
+ Version 0.2.2
3
+ * Added additional text for the changelog and readme
4
+ * Removed short options -n and -p
5
+ * Added class method for Sleeve::Generate (Sleeve::Generate.gem(options) )
8
6
 
9
7
  Version 0.2.0
10
8
  * Added an extension for the String class
11
9
  * Fixed some bugs
12
10
  * Added specs for the String extension
13
- * Changed how Version is setup in the base file
11
+ * Changed how Version is setup in the base file
12
+
13
+ Version 0.1.0
14
+ * Initial creation of Sleeve
15
+ * A Generator for a Gem Sleeve
16
+ * An Option Parser
17
+ * Creates a GemSpec file
18
+ * Specs are none existent :(
@@ -14,7 +14,12 @@ module Sleeve
14
14
  @options.gem_lib = File.join(@options.gem_path, 'lib')
15
15
  @options.gem_spec = File.join(@options.gem_path, 'spec')
16
16
  @options.gem_lib_folder = File.join(@options.gem_lib, @options.name)
17
- files
17
+ end
18
+
19
+
20
+ def self.gem(options)
21
+ gen = new(options)
22
+ gen.files
18
23
  end
19
24
 
20
25
 
@@ -37,6 +42,39 @@ module Sleeve
37
42
  end
38
43
 
39
44
 
45
+ # Generate our Base Files
46
+ def gen_base_files
47
+ File.new(File.join(@options.gem_path, "Rakefile"), "w+")
48
+ generate_readme_file
49
+ generate_changelog_file
50
+ generate_license
51
+ generate_gemspec
52
+ end
53
+
54
+
55
+ # Changelog
56
+ #
57
+ def generate_changelog_file
58
+ File.open(File.join(@options.gem_path, "CHANGELOG.rdoc"), "w+") do |f|
59
+ f.puts <<-EX
60
+ Version #{Sleeve::Version}
61
+ * Initial Creation
62
+ EX
63
+ end
64
+ end
65
+
66
+
67
+ # Readme
68
+ #
69
+ def generate_readme_file
70
+ File.open(File.join(@options.gem_path, "README.markdown"), "w+") do |f|
71
+ f.puts <<-EX
72
+ # #{@options.name.capitalize}
73
+ EX
74
+ end
75
+ end
76
+
77
+
40
78
  # Generate a basic lib file
41
79
  def generate_lib_file
42
80
  File.open(File.join(@options.gem_lib, "#{@options.name}.rb"), "w+") do |f|
@@ -86,16 +124,6 @@ require '#{@options.name}'
86
124
  end
87
125
 
88
126
 
89
- # Generate our Base Files
90
- def gen_base_files
91
- File.new(File.join(@options.gem_path, "README.markdown"), "w+")
92
- File.new(File.join(@options.gem_path, "ChangeLog.rdoc"), "w+")
93
- File.new(File.join(@options.gem_path, "Rakefile"), "w+")
94
- generate_license
95
- generate_gemspec
96
- end
97
-
98
-
99
127
  # Generate the License
100
128
  def generate_license
101
129
  File.open(File.join(@options.gem_path, "LICENSE"), "w+") do |f|
data/lib/sleeve/parser.rb CHANGED
@@ -11,13 +11,13 @@ module Sleeve
11
11
  opts.separator "Specific Options:"
12
12
 
13
13
  # Required Arguments
14
- opts.on("-n", "--name NAME", "The Name of the Gem") do |ext|
14
+ opts.on("--name NAME", "The Name of the Gem") do |ext|
15
15
  options.name = ext
16
16
  options.name.sub!(/(\s+)/, "-")
17
17
  end
18
18
 
19
19
  # Optional Arguments
20
- opts.on("-p", "--path PATH", "The path of where you want your Gem to live. If not supplied, it will create the gem in the current Directory.") do |ext|
20
+ opts.on("--path PATH", "The path of where you want your Gem to live. If not supplied, it will create the gem in the current Directory.") do |ext|
21
21
  options.path = ext || Dir.pwd
22
22
  end
23
23
 
data/lib/sleeve.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Sleeve
2
- Version = "0.2.0"
2
+ Version = "0.2.2"
3
3
  class GemNameRequired < StandardError; end
4
4
  end
5
5
 
data/readme.markdown CHANGED
@@ -11,7 +11,7 @@ Sleeve is a very simple Gem Generator that creates a gemspec that can be used by
11
11
  git clone git://github.com/revans/sleeve.git
12
12
  cd sleeve
13
13
  gem build sleeve.gemspec
14
- sudo gem install sleeve-0.1.1.gem
14
+ sudo gem install sleeve-0.2.0.gem
15
15
 
16
16
  ## Usage
17
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revans-sleeve
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Evans