ryoung-foodie 0.0.3

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.
@@ -0,0 +1,17 @@
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
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in foodie.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Richard Young
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.
@@ -0,0 +1,29 @@
1
+ # Foodie
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'foodie'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install foodie
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'foodie/cli'
4
+ Foodie::CLI.start
@@ -0,0 +1,12 @@
1
+ Feature: Food
2
+ In order to portray or pluralize food
3
+ As a CLI
4
+ I want to be as objective as possible
5
+
6
+ Scenario: Broccoli is gross
7
+ When I run "foodie portray broccoli"
8
+ Then the output should contain "Gross!"
9
+
10
+ Scenario: Tomato, or Tomato?
11
+ When I run "foodie pluralize --word Tomato"
12
+ Then the output should contain "Tomatoes"
@@ -0,0 +1,18 @@
1
+ Feature: Generating things
2
+ In order to generate many a thing
3
+ As a CLI newbie
4
+ I want foodie to hold my hand, tightly
5
+
6
+ Scenario: Recipes
7
+ When I run "foodie recipe dinner steak"
8
+ Then the following files should exist:
9
+ | dinner/steak.txt |
10
+ Then the file "dinner/steak.txt" should contain:
11
+ """
12
+ ##### Ingredients #####
13
+ Ingredients for delicious steak go here.
14
+
15
+
16
+ ##### Instructions #####
17
+ Tips on how to make delicious steak go here.
18
+ """
@@ -0,0 +1 @@
1
+ require 'aruba/cucumber'
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/foodie/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Richard Young"]
6
+ gem.email = ["ryoung@connamara.com"]
7
+ gem.description = "SUPER DESCRIPTION"
8
+ gem.summary = "SUPER SUMMARY"
9
+ gem.homepage = ""
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "ryoung-foodie"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Foodie::VERSION
17
+
18
+ gem.add_development_dependency "rspec", "~> 2.14"
19
+ gem.add_dependency "activesupport", "~> 4.0.0"
20
+ gem.add_development_dependency "cucumber"
21
+ gem.add_development_dependency "aruba"
22
+ gem.add_dependency "thor"
23
+ end
@@ -0,0 +1,6 @@
1
+ require 'foodie/food'
2
+ require "foodie/version"
3
+
4
+ module Foodie
5
+ # Your code goes here...
6
+ end
@@ -0,0 +1,24 @@
1
+ require 'thor'
2
+ require 'foodie'
3
+ require 'foodie/generators/recipe'
4
+
5
+ module Foodie
6
+ class CLI < Thor
7
+
8
+ desc "portray ITEM", "Determines if a piece of food is gross or delicious"
9
+ def portray(name)
10
+ puts Foodie::Food.portray(name)
11
+ end
12
+
13
+ desc "pluralize", "Pluralizes a word"
14
+ method_option :word, :aliases => "-w"
15
+ def pluralize
16
+ puts Foodie::Food.pluralize(options[:word])
17
+ end
18
+
19
+ desc "recipe", "Generates a recipe scaffold"
20
+ def recipe(group, name)
21
+ Foodie::Generators::Recipe.start([group, name])
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,18 @@
1
+ require 'active_support/inflector'
2
+
3
+ module Foodie
4
+ class Food
5
+ def self.portray(food)
6
+ if food.downcase == "broccoli"
7
+ "Gross!"
8
+ else
9
+ "Delicious!"
10
+ end
11
+ end
12
+
13
+ def self.pluralize(word)
14
+ word.pluralize
15
+ end
16
+ end
17
+ end
18
+
@@ -0,0 +1,23 @@
1
+ require 'thor/group'
2
+ module Foodie
3
+ module Generators
4
+ class Recipe < Thor::Group
5
+ include Thor::Actions
6
+
7
+ argument :group, :type => :string
8
+ argument :name, :type => :string
9
+
10
+ def create_group
11
+ empty_directory(group)
12
+ end
13
+
14
+ def copy_recipe
15
+ template("recipe.txt", "#{group}/#{name}.txt")
16
+ end
17
+
18
+ def self.source_root
19
+ File.dirname(__FILE__) + "/recipe"
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,6 @@
1
+ ##### Ingredients #####
2
+ Ingredients for delicious <%= name %> go here.
3
+
4
+
5
+ ##### Instructions #####
6
+ Tips on how to make delicious <%= name %> go here.
@@ -0,0 +1,3 @@
1
+ module Foodie
2
+ VERSION = "0.0.3"
3
+ end
@@ -0,0 +1,15 @@
1
+ require 'foodie'
2
+
3
+ describe Foodie::Food do
4
+ it "broccoli is gross" do
5
+ Foodie::Food.portray("Broccoli").should eql("Gross!")
6
+ end
7
+
8
+ it "anything else is delicious" do
9
+ Foodie::Food.portray("Not Broccoli").should eql("Delicious!")
10
+ end
11
+
12
+ it "pluralizes a word" do
13
+ Foodie::Food.pluralize("Tomato").should eql("Tomatoes")
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,149 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ryoung-foodie
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Richard Young
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-09-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '2.14'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '2.14'
30
+ - !ruby/object:Gem::Dependency
31
+ name: activesupport
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 4.0.0
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 4.0.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: cucumber
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: aruba
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: thor
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ description: SUPER DESCRIPTION
95
+ email:
96
+ - ryoung@connamara.com
97
+ executables:
98
+ - foodie
99
+ extensions: []
100
+ extra_rdoc_files: []
101
+ files:
102
+ - .gitignore
103
+ - Gemfile
104
+ - LICENSE
105
+ - README.md
106
+ - Rakefile
107
+ - bin/foodie
108
+ - features/food.feature
109
+ - features/generator.feature
110
+ - features/setup.rb
111
+ - features/step_definitions/aruba_ext_steps.rb
112
+ - foodie.gemspec
113
+ - lib/foodie.rb
114
+ - lib/foodie/cli.rb
115
+ - lib/foodie/food.rb
116
+ - lib/foodie/generators/recipe.rb
117
+ - lib/foodie/generators/recipe/recipe.txt
118
+ - lib/foodie/version.rb
119
+ - spec/foodie_spec.rb
120
+ homepage: ''
121
+ licenses: []
122
+ post_install_message:
123
+ rdoc_options: []
124
+ require_paths:
125
+ - lib
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ required_rubygems_version: !ruby/object:Gem::Requirement
133
+ none: false
134
+ requirements:
135
+ - - ! '>='
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ requirements: []
139
+ rubyforge_project:
140
+ rubygems_version: 1.8.24
141
+ signing_key:
142
+ specification_version: 3
143
+ summary: SUPER SUMMARY
144
+ test_files:
145
+ - features/food.feature
146
+ - features/generator.feature
147
+ - features/setup.rb
148
+ - features/step_definitions/aruba_ext_steps.rb
149
+ - spec/foodie_spec.rb