revans-sleeve 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/changelog.rdoc +8 -2
- data/lib/sleeve/extensions/string.rb +18 -0
- data/lib/sleeve/generate.rb +4 -19
- data/lib/sleeve.rb +2 -1
- data/readme.markdown +20 -1
- metadata +2 -1
data/changelog.rdoc
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
Version 0.1.0
|
3
3
|
* Initial creation of Sleeve
|
4
4
|
* A Generator for a Gem Sleeve
|
5
5
|
* An Option Parser
|
6
6
|
* Creates a GemSpec file
|
7
|
-
* Specs are none existent :(
|
7
|
+
* Specs are none existent :(
|
8
|
+
|
9
|
+
Version 0.2.0
|
10
|
+
* Added an extension for the String class
|
11
|
+
* Fixed some bugs
|
12
|
+
* Added specs for the String extension
|
13
|
+
* Changed how Version is setup in the base file
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class String
|
2
|
+
|
3
|
+
# change a pharse ('test it now') or ("test_it_now") to a classname ('TestItNow')
|
4
|
+
def classify
|
5
|
+
clean.split(' ').each { |word| word.capitalize! }.join('')
|
6
|
+
end
|
7
|
+
|
8
|
+
# change a phrase ('testing now') to an instance variable name ('testing_now')
|
9
|
+
def instantify
|
10
|
+
clean.gsub(/\s+/, '_').downcase
|
11
|
+
end
|
12
|
+
|
13
|
+
# clean a string of unwanted characters before we turn into a class or variable name
|
14
|
+
def clean
|
15
|
+
gsub(/[^\w\s\-\—]/,'').gsub(/[^\w]|[\_]/,' ').split.join(' ')
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/lib/sleeve/generate.rb
CHANGED
@@ -41,19 +41,14 @@ module Sleeve
|
|
41
41
|
def generate_lib_file
|
42
42
|
File.open(File.join(@options.gem_lib, "#{@options.name}.rb"), "w+") do |f|
|
43
43
|
f.puts <<-EX
|
44
|
-
module #{
|
45
|
-
|
46
|
-
Major = '0'
|
47
|
-
Minor = '1'
|
48
|
-
Tweak = '0'
|
49
|
-
String = [Major, Minor, Tweak].join('.')
|
50
|
-
end
|
44
|
+
module #{@options.name.classify}
|
45
|
+
Version = "0.1.0"
|
51
46
|
end
|
52
47
|
|
53
48
|
# Required Gems
|
54
49
|
|
55
50
|
# Gem specific Requires
|
56
|
-
# require "
|
51
|
+
# require File.dirname(__FILE__) + "/#{@options.name}/"
|
57
52
|
EX
|
58
53
|
end
|
59
54
|
end
|
@@ -169,16 +164,6 @@ end
|
|
169
164
|
def exit_message
|
170
165
|
puts "\nYour new Gem, #{@options.name}, has been created.\n"
|
171
166
|
end
|
172
|
-
|
173
|
-
private
|
174
|
-
|
175
|
-
# Camel Case
|
176
|
-
def camel_case(word)
|
177
|
-
word = word.gsub(/[^a-zA-Z_\- ]/," ")
|
178
|
-
word = word.gsub(/_/, " ")
|
179
|
-
word = " " + word.split.join(" ")
|
180
|
-
word.gsub(/ (.)/) { $1.upcase }
|
181
|
-
end
|
182
|
-
|
167
|
+
|
183
168
|
end
|
184
169
|
end
|
data/lib/sleeve.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Sleeve
|
2
|
-
Version = "0.
|
2
|
+
Version = "0.2.0"
|
3
3
|
class GemNameRequired < StandardError; end
|
4
4
|
end
|
5
5
|
|
@@ -7,5 +7,6 @@ end
|
|
7
7
|
%w[optparse ostruct fileutils].each { |library| require library }
|
8
8
|
|
9
9
|
# Gem specific Requires
|
10
|
+
require File.dirname(__FILE__) + "/sleeve/extensions/string"
|
10
11
|
require File.dirname(__FILE__) + "/sleeve/parser"
|
11
12
|
require File.dirname(__FILE__) + "/sleeve/generate"
|
data/readme.markdown
CHANGED
@@ -1,3 +1,22 @@
|
|
1
1
|
# Sleeve
|
2
2
|
|
3
|
-
Sleeve is a very simple Gem Generator that creates a gemspec that can be used by RubyGems and Github to build your Gems. Sleeve does not require additional gems like newgem does and is much lighter.
|
3
|
+
Sleeve is a very simple Gem Generator that creates a gemspec that can be used by RubyGems and Github to build your Gems. Sleeve does not require additional gems like newgem does and is much lighter.
|
4
|
+
|
5
|
+
## Installing from Github
|
6
|
+
|
7
|
+
sudo gem install revans-sleeve
|
8
|
+
|
9
|
+
## Cloning
|
10
|
+
|
11
|
+
git clone git://github.com/revans/sleeve.git
|
12
|
+
cd sleeve
|
13
|
+
gem build sleeve.gemspec
|
14
|
+
sudo gem install sleeve-0.1.1.gem
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
sleeve --name gem_name --path /Users/rrevans/Desktop
|
19
|
+
|
20
|
+
--name is required and is used as the name of your Gem
|
21
|
+
|
22
|
+
--path is optional. If not specific it will use your current directory.
|
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Evans
|
@@ -32,6 +32,7 @@ files:
|
|
32
32
|
- lib/sleeve.rb
|
33
33
|
- lib/sleeve/generate.rb
|
34
34
|
- lib/sleeve/parser.rb
|
35
|
+
- lib/sleeve/extensions/string.rb
|
35
36
|
has_rdoc: true
|
36
37
|
homepage: http://robertrevans.com
|
37
38
|
post_install_message:
|