agape-red-recipes 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.md CHANGED
@@ -16,10 +16,14 @@ And then execute:
16
16
 
17
17
  Once the gem is installed you can install recipes by running
18
18
 
19
- rails g recipe recipe_name
19
+ rails g recipe recipe_name [options]
20
20
 
21
21
  `recipe_name` can be the name of any repo under the organization AgapeRedRecipes.
22
22
 
23
+ `options` are space seperated key:value args
24
+
25
+ rails g recipe_name key1:value1 key2:value2
26
+
23
27
  ## Contributing
24
28
 
25
29
  1. Fork it
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["dave@agapered.com"]
11
11
  spec.description = %q{Allows you to run various recipes against your rails apps. }
12
12
  spec.summary = %q{Automates installing various add ons and plugins for your app.}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/agaperedrecipes/agape-red-recipes"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -1,3 +1,3 @@
1
1
  module AgapeRedRecipes
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -6,12 +6,16 @@ class RecipeGenerator < Rails::Generators::Base
6
6
  include AgapeRedRecipes::Gemfile
7
7
 
8
8
  argument :recipe_name, type: :string, default: 'list'
9
+ argument :settings, type: :array, default: []
9
10
 
10
11
  def generate_recipe
12
+ the_options = {}
13
+ settings.each{|s| data = s.split(':'); the_options[data[0]] = data[1] }
14
+
11
15
  if recipe_name == 'list'
12
16
  list_repos
13
17
  else
14
- apply_recipe recipe_name
18
+ apply_recipe recipe_name, the_options
15
19
  end
16
20
  end
17
21
 
@@ -26,18 +30,18 @@ class RecipeGenerator < Rails::Generators::Base
26
30
 
27
31
  page_content = JSON.parse(open('https://api.github.com/users/AgapeRedRecipes/repos'))
28
32
  repos = page_content.map{|repo| repo['name']}.select{|repo| repo != 'agape-red-recipes'}
29
- puts "You can apply the following recipes using `rails g recipe [recipe_name]`"
33
+ puts "You can apply the following recipes using `rails g recipe [recipe_name] [options]`"
30
34
  repos.each{|r| puts " #{r.downcase}" }
31
35
  end
32
36
 
33
- def apply_recipe the_recipe
37
+ def apply_recipe the_recipe, the_options
34
38
  if the_recipe.include?('.')
35
39
  RecipeGenerator.source_root(Rails.root)
36
- apply the_recipe
40
+ apply the_recipe, the_options
37
41
  elsif the_recipe.starts_with?('http')
38
- apply the_recipe
42
+ apply the_recipe, the_options
39
43
  else
40
- apply "https://raw.github.com/AgapeRedRecipes/#{the_recipe}/master/recipe.rb"
44
+ apply "https://raw.github.com/AgapeRedRecipes/#{the_recipe}/master/recipe.rb", the_options
41
45
  end
42
46
  end
43
47
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agape-red-recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-24 00:00:00.000000000 Z
12
+ date: 2014-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -61,7 +61,7 @@ files:
61
61
  - lib/agape-red-recipes/recipes.rb
62
62
  - lib/agape-red-recipes/version.rb
63
63
  - lib/generators/recipe_generator.rb
64
- homepage: ''
64
+ homepage: https://github.com/agaperedrecipes/agape-red-recipes
65
65
  licenses:
66
66
  - MIT
67
67
  post_install_message: