ruby_chopped 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README +6 -1
- data/bin/ruby_chopped +4 -0
- data/lib/ruby_chopped/version.rb +1 -1
- data/lib/ruby_chopped.rb +6 -6
- metadata +2 -2
data/README
CHANGED
@@ -10,6 +10,10 @@ then
|
|
10
10
|
|
11
11
|
ruby_chopped --name whyday_basket
|
12
12
|
|
13
|
+
or to get more than 2 gems (which is the default)
|
14
|
+
|
15
|
+
ruby_chopped -n whyday_basket2 --limit 4
|
16
|
+
|
13
17
|
or to view more options
|
14
18
|
|
15
19
|
ruby_chopped
|
@@ -20,4 +24,5 @@ Contributors
|
|
20
24
|
markmcspadden
|
21
25
|
|
22
26
|
badboy
|
23
|
-
agile
|
27
|
+
agile
|
28
|
+
smnickerson
|
data/bin/ruby_chopped
CHANGED
@@ -12,6 +12,10 @@ parser = OptionParser.new do |o|
|
|
12
12
|
o.on('-f', '--force', 'force overwriting existing project') do
|
13
13
|
@options[:force] = true
|
14
14
|
end
|
15
|
+
|
16
|
+
o.on('-l', '--limit [limit]', 'number of gems to add to the basket') do |l|
|
17
|
+
@options[:limit] = l
|
18
|
+
end
|
15
19
|
end
|
16
20
|
parser.parse!
|
17
21
|
|
data/lib/ruby_chopped/version.rb
CHANGED
data/lib/ruby_chopped.rb
CHANGED
@@ -20,7 +20,7 @@ module RubyChopped
|
|
20
20
|
File.open("#{folder}/lib/#{folder}.rb", "w") {|f| f.puts "# Where the magic happens!" }
|
21
21
|
|
22
22
|
File.open("#{folder}/Gemfile", "wb+") do |f|
|
23
|
-
f << RubyChopped.gemfile_string
|
23
|
+
f << RubyChopped.gemfile_string(opts[:limit] || 2)
|
24
24
|
end
|
25
25
|
|
26
26
|
puts ""
|
@@ -31,12 +31,12 @@ module RubyChopped
|
|
31
31
|
puts "Enjoy!"
|
32
32
|
end
|
33
33
|
|
34
|
-
def gemfile_array
|
34
|
+
def gemfile_array(limit)
|
35
35
|
gas = []
|
36
36
|
gas << "source \"http://rubygems.org\""
|
37
37
|
gas << ""
|
38
38
|
|
39
|
-
gems = random_gems
|
39
|
+
gems = random_gems(limit)
|
40
40
|
gems.each do |g|
|
41
41
|
# Janky way to pull the name
|
42
42
|
g = g.first
|
@@ -54,11 +54,11 @@ module RubyChopped
|
|
54
54
|
gas
|
55
55
|
end
|
56
56
|
|
57
|
-
def gemfile_string
|
58
|
-
gemfile_array.join("\n")
|
57
|
+
def gemfile_string(limit)
|
58
|
+
gemfile_array(limit).join("\n")
|
59
59
|
end
|
60
60
|
|
61
|
-
def random_gems(limit
|
61
|
+
def random_gems(limit)
|
62
62
|
gems = fetch_gems
|
63
63
|
gems = pick_gems(gems, limit)
|
64
64
|
end
|