ruby_chopped 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
 
@@ -1,3 +1,3 @@
1
1
  module RubyChopped
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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=2)
61
+ def random_gems(limit)
62
62
  gems = fetch_gems
63
63
  gems = pick_gems(gems, limit)
64
64
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mark McSpadden