foodie 0.0.1
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/.gitignore +3 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +53 -0
- data/Rakefile +2 -0
- data/bin/foodie +3 -0
- data/features/food.feature +12 -0
- data/features/generator.feature +18 -0
- data/features/step_definitions/aruba_ext_steps.rb +3 -0
- data/features/support/setup.rb +1 -0
- data/foodie.gemspec +28 -0
- data/lib/foodie.rb +3 -0
- data/lib/foodie/cli.rb +24 -0
- data/lib/foodie/food.rb +17 -0
- data/lib/foodie/generators/recipe.rb +23 -0
- data/lib/foodie/generators/recipe/recipe.txt +6 -0
- data/lib/foodie/version.rb +3 -0
- data/spec/foodie_spec.rb +15 -0
- metadata +175 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
foodie (0.0.1)
|
5
|
+
activesupport
|
6
|
+
thor
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activesupport (3.0.0)
|
12
|
+
aruba (0.2.3)
|
13
|
+
background_process
|
14
|
+
cucumber (~> 0.9.0)
|
15
|
+
background_process (1.2)
|
16
|
+
builder (2.1.2)
|
17
|
+
cucumber (0.9.1)
|
18
|
+
builder (~> 2.1.2)
|
19
|
+
diff-lcs (~> 1.1.2)
|
20
|
+
gherkin (~> 2.2.5)
|
21
|
+
json (~> 1.4.6)
|
22
|
+
term-ansicolor (~> 1.0.5)
|
23
|
+
diff-lcs (1.1.2)
|
24
|
+
gherkin (2.2.5)
|
25
|
+
json (~> 1.4.6)
|
26
|
+
term-ansicolor (~> 1.0.5)
|
27
|
+
trollop (~> 1.16.2)
|
28
|
+
json (1.4.6)
|
29
|
+
rspec (2.0.0.beta.22)
|
30
|
+
rspec-core (= 2.0.0.beta.22)
|
31
|
+
rspec-expectations (= 2.0.0.beta.22)
|
32
|
+
rspec-mocks (= 2.0.0.beta.22)
|
33
|
+
rspec-core (2.0.0.beta.22)
|
34
|
+
rspec-expectations (2.0.0.beta.22)
|
35
|
+
diff-lcs (>= 1.1.2)
|
36
|
+
rspec-mocks (2.0.0.beta.22)
|
37
|
+
rspec-core (= 2.0.0.beta.22)
|
38
|
+
rspec-expectations (= 2.0.0.beta.22)
|
39
|
+
term-ansicolor (1.0.5)
|
40
|
+
thor (0.14.2)
|
41
|
+
trollop (1.16.2)
|
42
|
+
|
43
|
+
PLATFORMS
|
44
|
+
ruby
|
45
|
+
|
46
|
+
DEPENDENCIES
|
47
|
+
activesupport
|
48
|
+
aruba
|
49
|
+
bundler (>= 1.0.0)
|
50
|
+
cucumber
|
51
|
+
foodie!
|
52
|
+
rspec (~> 2.0.0.beta.22)
|
53
|
+
thor
|
data/Rakefile
ADDED
data/bin/foodie
ADDED
@@ -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 gem_name 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'
|
data/foodie.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path("../lib/foodie/version", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "foodie"
|
6
|
+
s.version = Foodie::VERSION
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.authors = []
|
9
|
+
s.email = []
|
10
|
+
s.homepage = "http://rubygems.org/gems/foodie"
|
11
|
+
s.summary = "For food"
|
12
|
+
s.description = "For food"
|
13
|
+
|
14
|
+
s.required_rubygems_version = ">= 1.3.6"
|
15
|
+
s.rubyforge_project = "foodie"
|
16
|
+
|
17
|
+
s.add_development_dependency "bundler", ">= 1.0.0"
|
18
|
+
s.add_development_dependency "rspec", "~> 2.0.0.beta.22"
|
19
|
+
s.add_development_dependency "cucumber"
|
20
|
+
s.add_development_dependency "aruba"
|
21
|
+
|
22
|
+
s.add_dependency "activesupport"
|
23
|
+
s.add_dependency "thor"
|
24
|
+
|
25
|
+
s.files = `git ls-files`.split("\n")
|
26
|
+
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
27
|
+
s.require_path = 'lib'
|
28
|
+
end
|
data/lib/foodie.rb
ADDED
data/lib/foodie/cli.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'foodie/food'
|
3
|
+
|
4
|
+
require 'foodie/generators/recipe'
|
5
|
+
|
6
|
+
module Foodie
|
7
|
+
class CLI < Thor
|
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 => :word
|
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
|
data/lib/foodie/food.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'thor/group'
|
2
|
+
|
3
|
+
module Foodie
|
4
|
+
module Generators
|
5
|
+
class Recipe < Thor::Group
|
6
|
+
argument :group, :type => :string
|
7
|
+
argument :name, :type => :string
|
8
|
+
include Thor::Actions
|
9
|
+
|
10
|
+
def self.source_root
|
11
|
+
File.dirname(__FILE__) + "/recipe"
|
12
|
+
end
|
13
|
+
|
14
|
+
def create_group
|
15
|
+
empty_directory(group)
|
16
|
+
end
|
17
|
+
|
18
|
+
def copy_recipe
|
19
|
+
template("recipe.txt", "#{group}/#{name}.txt")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/spec/foodie_spec.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'foodie/food'
|
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,175 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: foodie
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors: []
|
13
|
+
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-10-16 00:00:00 +11:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: bundler
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 23
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 1.0.0
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rspec
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 62196431
|
46
|
+
segments:
|
47
|
+
- 2
|
48
|
+
- 0
|
49
|
+
- 0
|
50
|
+
- beta
|
51
|
+
- 22
|
52
|
+
version: 2.0.0.beta.22
|
53
|
+
type: :development
|
54
|
+
version_requirements: *id002
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: cucumber
|
57
|
+
prerelease: false
|
58
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
hash: 3
|
64
|
+
segments:
|
65
|
+
- 0
|
66
|
+
version: "0"
|
67
|
+
type: :development
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: aruba
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 3
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
version: "0"
|
81
|
+
type: :development
|
82
|
+
version_requirements: *id004
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activesupport
|
85
|
+
prerelease: false
|
86
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
hash: 3
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
version: "0"
|
95
|
+
type: :runtime
|
96
|
+
version_requirements: *id005
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: thor
|
99
|
+
prerelease: false
|
100
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 3
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
109
|
+
type: :runtime
|
110
|
+
version_requirements: *id006
|
111
|
+
description: For food
|
112
|
+
email: []
|
113
|
+
|
114
|
+
executables:
|
115
|
+
- foodie
|
116
|
+
extensions: []
|
117
|
+
|
118
|
+
extra_rdoc_files: []
|
119
|
+
|
120
|
+
files:
|
121
|
+
- .gitignore
|
122
|
+
- Gemfile
|
123
|
+
- Gemfile.lock
|
124
|
+
- Rakefile
|
125
|
+
- bin/foodie
|
126
|
+
- features/food.feature
|
127
|
+
- features/generator.feature
|
128
|
+
- features/step_definitions/aruba_ext_steps.rb
|
129
|
+
- features/support/setup.rb
|
130
|
+
- foodie.gemspec
|
131
|
+
- lib/foodie.rb
|
132
|
+
- lib/foodie/cli.rb
|
133
|
+
- lib/foodie/food.rb
|
134
|
+
- lib/foodie/generators/recipe.rb
|
135
|
+
- lib/foodie/generators/recipe/recipe.txt
|
136
|
+
- lib/foodie/version.rb
|
137
|
+
- spec/foodie_spec.rb
|
138
|
+
has_rdoc: true
|
139
|
+
homepage: http://rubygems.org/gems/foodie
|
140
|
+
licenses: []
|
141
|
+
|
142
|
+
post_install_message:
|
143
|
+
rdoc_options: []
|
144
|
+
|
145
|
+
require_paths:
|
146
|
+
- lib
|
147
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
148
|
+
none: false
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
hash: 3
|
153
|
+
segments:
|
154
|
+
- 0
|
155
|
+
version: "0"
|
156
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
|
+
none: false
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
hash: 23
|
162
|
+
segments:
|
163
|
+
- 1
|
164
|
+
- 3
|
165
|
+
- 6
|
166
|
+
version: 1.3.6
|
167
|
+
requirements: []
|
168
|
+
|
169
|
+
rubyforge_project: foodie
|
170
|
+
rubygems_version: 1.3.7
|
171
|
+
signing_key:
|
172
|
+
specification_version: 3
|
173
|
+
summary: For food
|
174
|
+
test_files: []
|
175
|
+
|