agape-red-recipes 0.0.4 → 0.0.5

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d270b6f797cf029c49ba3aa13e96cdb190fed249
4
+ data.tar.gz: 29cadc875f9b81886507a97a2ed54d560551ecd9
5
+ SHA512:
6
+ metadata.gz: fa16e04200b3f55760b2676a249f594e2ee34fbeb6019ba2029c9b51dca97b155a13e1924c551d690bbbae925305c513bfea255e8d27d50cfa68ff3987adf838
7
+ data.tar.gz: c335280ab1081cbfce62aa5934d670c93facabf19ad10ec0675c14acd2007136a97388d6e4c5810b01c934fd9889e685ec3c9cdcf5a5b433c09ed92cd2da2680
metadata CHANGED
@@ -1,89 +1,72 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agape-red-recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - David Kerber
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-30 00:00:00.000000000 Z
11
+ date: 2014-07-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.3'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.3'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
- description: ! 'Allows you to run various recipes against your rails apps. '
41
+ description: 'Allows you to run various recipes against your rails apps. '
47
42
  email:
48
43
  - dave@agapered.com
49
44
  executables: []
50
45
  extensions: []
51
46
  extra_rdoc_files: []
52
- files:
53
- - .gitignore
54
- - Gemfile
55
- - LICENSE.txt
56
- - README.md
57
- - Rakefile
58
- - agape-red-recipes.gemspec
59
- - lib/agape-red-recipes/modules/bundler.rb
60
- - lib/agape-red-recipes/modules/gemfile.rb
61
- - lib/agape-red-recipes/recipes.rb
62
- - lib/agape-red-recipes/version.rb
63
- - lib/generators/recipe_generator.rb
47
+ files: []
64
48
  homepage: https://github.com/agaperedrecipes/agape-red-recipes
65
49
  licenses:
66
50
  - MIT
51
+ metadata: {}
67
52
  post_install_message:
68
53
  rdoc_options: []
69
54
  require_paths:
70
55
  - lib
71
56
  required_ruby_version: !ruby/object:Gem::Requirement
72
- none: false
73
57
  requirements:
74
- - - ! '>='
58
+ - - ">="
75
59
  - !ruby/object:Gem::Version
76
60
  version: '0'
77
61
  required_rubygems_version: !ruby/object:Gem::Requirement
78
- none: false
79
62
  requirements:
80
- - - ! '>='
63
+ - - ">="
81
64
  - !ruby/object:Gem::Version
82
65
  version: '0'
83
66
  requirements: []
84
67
  rubyforge_project:
85
- rubygems_version: 1.8.25
68
+ rubygems_version: 2.2.2
86
69
  signing_key:
87
- specification_version: 3
70
+ specification_version: 4
88
71
  summary: Automates installing various add ons and plugins for your app.
89
72
  test_files: []
data/.gitignore DELETED
@@ -1,18 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- .idea
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in agape-red-recipes-red-recipes.gemspec
4
- gemspec
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2014 Agape Red, Inc
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md DELETED
@@ -1,33 +0,0 @@
1
- # Agape Red Recipes
2
-
3
- This gem will allow you to run various recipes in your rails apps.
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- gem 'agape-red-recipes'
10
-
11
- And then execute:
12
-
13
- $ bundle
14
-
15
- ## Usage
16
-
17
- Once the gem is installed you can install recipes by running
18
-
19
- rails g recipe recipe_name [options]
20
-
21
- `recipe_name` can be the name of any repo under the organization AgapeRedRecipes.
22
-
23
- `options` are space seperated key:value args
24
-
25
- rails g recipe_name key1:value1 key2:value2
26
-
27
- ## Contributing
28
-
29
- 1. Fork it
30
- 2. Create your feature branch (`git checkout -b my-new-feature`)
31
- 3. Commit your changes (`git commit -am 'Add some feature'`)
32
- 4. Push to the branch (`git push origin my-new-feature`)
33
- 5. Create new Pull Request
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require "bundler/gem_tasks"
@@ -1,23 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'agape-red-recipes/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "agape-red-recipes"
8
- spec.version = AgapeRedRecipes::VERSION
9
- spec.authors = ["David Kerber"]
10
- spec.email = ["dave@agapered.com"]
11
- spec.description = %q{Allows you to run various recipes against your rails apps. }
12
- spec.summary = %q{Automates installing various add ons and plugins for your app.}
13
- spec.homepage = "https://github.com/agaperedrecipes/agape-red-recipes"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files`.split($/)
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake"
23
- end
@@ -1,12 +0,0 @@
1
- module AgapeRedRecipes
2
- module Bundler
3
- # Generic bundle command
4
- # Defaults to "install"
5
- def bundle(command = nil)
6
- command ||= "install"
7
- ::Bundler.with_clean_env do
8
- run "bundle #{command}"
9
- end
10
- end
11
- end
12
- end
@@ -1,80 +0,0 @@
1
- module AgapeRedRecipes
2
- module Gemfile
3
- def gem_group_exists?(*names)
4
- name = names.map(&:inspect).join(", ")
5
-
6
- File.open("Gemfile") do |file|
7
- file.read.include? "\ngroup #{name} do"
8
- end
9
- end
10
-
11
- def gem_group(*names, &block)
12
- name = names.map(&:inspect).join(", ")
13
-
14
- if gem_group_exists?(*names)
15
- @in_group = true
16
- @current_group = name
17
- instance_eval(&block)
18
- @current_group = nil
19
- @in_group = false
20
- else
21
- super(*names, &block)
22
- end
23
- end
24
-
25
- def gem(*args)
26
- options = args.extract_options!
27
- name, version = args
28
-
29
- # Set the message to be shown in logs. Uses the git repo if one is given,
30
- # otherwise use name (version).
31
- parts, message = [ name.inspect ], name
32
- if version ||= options.delete(:version)
33
- parts << version.inspect
34
- message << " (#{version})"
35
- end
36
- message = options[:git] if options[:git]
37
-
38
- log :gemfile, message
39
-
40
- options.each do |option, value|
41
- parts << "#{option}: #{value.inspect}"
42
- end
43
-
44
- @@installed_gem_names ||= Gem::Specification.map &:name
45
- return if @@installed_gem_names.include? name
46
-
47
- in_root do
48
- str = "gem#{parts.join(", ")}"
49
- str = " " + str if @in_group
50
- str = "\n" + str
51
-
52
- if @current_group
53
- insert_at_end_of_line_containing 'Gemfile', str, "group #{@current_group} do"
54
- else
55
- append_file 'Gemfile', str, verbose: false
56
- end
57
-
58
- end
59
- end
60
-
61
- def insert_at_end_of_line_containing(file_name, insert, contents)
62
- open(file_name, 'r+') do |file|
63
-
64
- while !file.eof?
65
- break if file.readline.include? contents
66
- end
67
-
68
- # Move back to the end of the previous line
69
- file.seek file.pos - 1
70
-
71
- position = file.pos
72
- rest_of_file = file.read
73
- file.seek position
74
-
75
- file.write insert
76
- file.write rest_of_file
77
- end
78
- end
79
- end
80
- end
@@ -1,4 +0,0 @@
1
- module AgapeRedRecipes
2
- class Engine < Rails::Engine
3
- end
4
- end
@@ -1,3 +0,0 @@
1
- module AgapeRedRecipes
2
- VERSION = "0.0.4"
3
- end
@@ -1,48 +0,0 @@
1
- require 'agape-red-recipes/modules/bundler'
2
- require 'agape-red-recipes/modules/gemfile'
3
-
4
- class RecipeGenerator < Rails::Generators::Base
5
- include AgapeRedRecipes::Bundler
6
- include AgapeRedRecipes::Gemfile
7
-
8
- argument :recipe_name, type: :string, default: 'list'
9
- argument :settings, type: :array, default: []
10
-
11
- def generate_recipe
12
- the_options = {}
13
- settings.each{|s| data = s.split(':'); the_options[data[0]] = data[1] }
14
-
15
- if recipe_name == 'list'
16
- list_repos
17
- else
18
- apply_recipe recipe_name, the_options
19
- end
20
- end
21
-
22
- private
23
- def list_repos
24
- require 'net/http'
25
- require 'uri'
26
-
27
- def open(url)
28
- Net::HTTP.get(URI.parse(url))
29
- end
30
-
31
- page_content = JSON.parse(open('https://api.github.com/users/AgapeRedRecipes/repos'))
32
- repos = page_content.map{|repo| repo['name']}.select{|repo| repo != 'agape-red-recipes'}
33
- puts "You can apply the following recipes using `rails g recipe [recipe_name] [options]`"
34
- repos.each{|r| puts " #{r.downcase}" }
35
- end
36
-
37
- def apply_recipe the_recipe, the_options
38
- if the_recipe.include?('.')
39
- RecipeGenerator.source_root(Rails.root)
40
- apply the_recipe, the_options
41
- elsif the_recipe.starts_with?('http')
42
- apply the_recipe, the_options
43
- else
44
- apply "https://raw.github.com/AgapeRedRecipes/#{the_recipe}/master/recipe.rb", the_options
45
- end
46
- end
47
-
48
- end