foodish 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -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,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in foodie.gemspec
4
+ gemspec
5
+
6
+ group :test do
7
+ gem 'cucumber-rails', :require => false
8
+ # database_cleaner is not required, but highly recommended
9
+ gem 'database_cleaner'
10
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Bobby Mazzotti
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 ADDED
@@ -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 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/foodie ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require 'foodie/cli'
3
+ 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,20 @@
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
+
8
+ When I run 'foodie recipe dinner steak'
9
+
10
+ Then the following files should exist: | dinner/steak.txt |
11
+
12
+ Then the file 'dinner/steak.txt' should contain:
13
+ """
14
+ ##### Ingredients #####
15
+ Ingredients for delicious steak go here.
16
+
17
+
18
+ ##### Instructions #####
19
+ Tips on how to make delicious steak go here.
20
+ """
@@ -0,0 +1 @@
1
+ require 'aruba/cucumber'
data/foodie.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'foodie/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "foodish"
8
+ s.version = Foodie::VERSION
9
+ s.authors = ["Bobby Mazzotti"]
10
+ s.email = ["robert.mazzotti@gmail.com"]
11
+ s.description = %q{Leverages foodie API}
12
+ s.summary = %q{Creates a call to the foodie API hooks}
13
+ s.homepage = ""
14
+ s.license = "MIT"
15
+
16
+ s.files = `git ls-files`.split($/)
17
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ s.test_files = s.files.grep(%r{^(test|s|features)/})
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_development_dependency "bundler", "~> 1.3"
22
+ s.add_development_dependency "rake"
23
+ s.add_development_dependency "rspec", "~> 2.14.1"
24
+ s.add_development_dependency "cucumber"
25
+ s.add_development_dependency "aruba"
26
+
27
+ s.add_dependency "activesupport", "~> 4.0.1"
28
+ s.add_dependency "thor"
29
+ end
data/lib/foodie.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "foodie/version"
2
+ require 'foodie/food'
3
+
4
+ module Foodie
5
+ # Your code goes here...
6
+ end
data/lib/foodie/cli.rb ADDED
@@ -0,0 +1,26 @@
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
+
16
+ def pluralize
17
+ puts Foodie::Food.pluralize(options[:word])
18
+
19
+ end
20
+
21
+ desc 'recipe', 'Generates a recipe scaffold'
22
+ def recipe(group, name)
23
+ Foodie::Generators::Recipe.start([group, name])
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,18 @@
1
+ require "foodie/version"
2
+ require 'foodie/food'
3
+ require 'active_support/inflector'
4
+
5
+ module Foodie
6
+ class Food
7
+ def self.portray(food)
8
+ if food.downcase == "broccoli"
9
+ "Gross!"
10
+ else
11
+ "Delicious!"
12
+ end
13
+ end
14
+ def self.pluralize(word)
15
+ word.pluralize
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ require 'thor/group'
2
+ module Foodie
3
+ module Generators
4
+ class Recipe < Thor::Group
5
+ include Thor::Actions
6
+
7
+ def create_group
8
+ empty_directory(group)
9
+ end
10
+
11
+ def copy_recipe
12
+ template("recipe.txt", "#{group}/#{name}.txt")
13
+ end
14
+
15
+ argument :group, :type => :string
16
+ argument :name, :type => :string
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,3 @@
1
+ module Foodie
2
+ VERSION = "0.0.1"
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 "pluralizes a word" do
9
+ Foodie::Food.pluralize("Tomato").should eql("Tomatoes")
10
+ end
11
+
12
+ it "anything else is delicious" do
13
+ Foodie::Food.portray("Not Broccoli").should eql("Delicious!")
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,178 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: foodish
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Bobby Mazzotti
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-11-25 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.3'
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: '1.3'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rspec
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 2.14.1
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: 2.14.1
62
+ - !ruby/object:Gem::Dependency
63
+ name: cucumber
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: aruba
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
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
+ - !ruby/object:Gem::Dependency
95
+ name: activesupport
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 4.0.1
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 4.0.1
110
+ - !ruby/object:Gem::Dependency
111
+ name: thor
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ description: Leverages foodie API
127
+ email:
128
+ - robert.mazzotti@gmail.com
129
+ executables:
130
+ - foodie
131
+ extensions: []
132
+ extra_rdoc_files: []
133
+ files:
134
+ - .gitignore
135
+ - Gemfile
136
+ - LICENSE.txt
137
+ - README.md
138
+ - Rakefile
139
+ - bin/foodie
140
+ - features/food.feature
141
+ - features/generator.feature
142
+ - features/support/setup.rb
143
+ - foodie.gemspec
144
+ - lib/foodie.rb
145
+ - lib/foodie/cli.rb
146
+ - lib/foodie/food.rb
147
+ - lib/foodie/generators/recipe.rb
148
+ - lib/foodie/version.rb
149
+ - spec/foodie_spec.rb
150
+ homepage: ''
151
+ licenses:
152
+ - MIT
153
+ post_install_message:
154
+ rdoc_options: []
155
+ require_paths:
156
+ - lib
157
+ required_ruby_version: !ruby/object:Gem::Requirement
158
+ none: false
159
+ requirements:
160
+ - - ! '>='
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ required_rubygems_version: !ruby/object:Gem::Requirement
164
+ none: false
165
+ requirements:
166
+ - - ! '>='
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ requirements: []
170
+ rubyforge_project:
171
+ rubygems_version: 1.8.23
172
+ signing_key:
173
+ specification_version: 3
174
+ summary: Creates a call to the foodie API hooks
175
+ test_files:
176
+ - features/food.feature
177
+ - features/generator.feature
178
+ - features/support/setup.rb