foodie2 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/bin/foodie2 +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/foodie2.gemspec +30 -0
- data/lib/foodie2/cli.rb +25 -0
- data/lib/foodie2/food.rb +17 -0
- data/lib/foodie2/generators/recipe/recipe.txt +8 -0
- data/lib/foodie2/generators/recipe.rb +24 -0
- data/lib/foodie2/version.rb +3 -0
- data/lib/foodie2.rb +7 -0
- data/spec/foodie2_spec.rb +15 -0
- metadata +168 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 63efa18e75b82b7df81d0d1c39d360091ccfde24
|
4
|
+
data.tar.gz: e8ae25d2f9eb06eb1585c2dcdd8c04ebfee0d279
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9eedd604fa5c7457c38b70d06cf60d76a30191056da967b5096dc31f3a9ae9a42b6f95fcd724f22f0f0c429476079edb272a8ba3254ede39e8084086ceb1dc91
|
7
|
+
data.tar.gz: 6c73754de34a39c8911fd0a493e173719e16fde0a65a38953daf21b008c7ca463217a24dc0d1ac875829345605e1ae54a0b6042e50e62f33c9e6cb0b5afd5693
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Juanito Fatas
|
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
|
+
# Foodie2
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'foodie2'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install foodie2
|
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/foodie2
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 "foodie2 portray broccoli"
|
8
|
+
Then the output should contain "Gross!"
|
9
|
+
|
10
|
+
Scenario: Tomato, or Tomato?
|
11
|
+
When I run "foodie2 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 foodie2 to hold my hand, tightly
|
5
|
+
|
6
|
+
Scenario: Recipes
|
7
|
+
When I run "foodie2 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'
|
data/foodie2.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'foodie2/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "foodie2"
|
8
|
+
spec.version = Foodie2::VERSION
|
9
|
+
spec.authors = ["Juanito Fatas"]
|
10
|
+
spec.email = ["katehuang0320@gmail.com"]
|
11
|
+
spec.description = %q{Handcraft gem example with bundler, covers RSpec, Cucumber, and CLI using thor by Ryan bigg.}
|
12
|
+
spec.summary = spec.description
|
13
|
+
spec.homepage = "https://github.com/JuanitoFatas/foodie2"
|
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_dependency "activesupport", "~> 4.0.0"
|
22
|
+
spec.add_dependency "thor", "~> 0.18.1"
|
23
|
+
|
24
|
+
|
25
|
+
spec.add_development_dependency "cucumber", "~> 1.3.6"
|
26
|
+
spec.add_development_dependency "aruba", "~> 0.5.3"
|
27
|
+
spec.add_development_dependency "rspec", "~> 2.14.1"
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.4.0.pre.1"
|
29
|
+
spec.add_development_dependency "rake", "10.1.0"
|
30
|
+
end
|
data/lib/foodie2/cli.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require_relative '../foodie2/food'
|
3
|
+
require_relative '../foodie2/generators/recipe'
|
4
|
+
|
5
|
+
module Foodie2
|
6
|
+
class CLI < Thor
|
7
|
+
desc "portray ITEM", "Determines if a piece of food is gross or delicious"
|
8
|
+
def portray(name)
|
9
|
+
puts Foodie2::Food.portray(name)
|
10
|
+
end
|
11
|
+
|
12
|
+
desc "pluralize", "Pluralizes a word"
|
13
|
+
method_option :word, :aliases => "-w"
|
14
|
+
def pluralize
|
15
|
+
puts Foodie2::Food.pluralize(options[:word])
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "recipe", "Generates a recipe scaffold"
|
19
|
+
def recipe(group, name)
|
20
|
+
Foodie2::Generators::Recipe.start([group, name])
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
data/lib/foodie2/food.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'thor/group'
|
2
|
+
|
3
|
+
module Foodie2
|
4
|
+
module Generators
|
5
|
+
class Recipe < Thor::Group
|
6
|
+
include Thor::Actions
|
7
|
+
|
8
|
+
argument :group, :type => :string
|
9
|
+
argument :name, :type => :string
|
10
|
+
|
11
|
+
def create_group
|
12
|
+
empty_directory(group)
|
13
|
+
end
|
14
|
+
|
15
|
+
def copy_recipe
|
16
|
+
template("recipe.txt", "#{group}/#{name}.txt")
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.source_root
|
20
|
+
"#{__dir__}/recipe"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/foodie2.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'foodie2'
|
2
|
+
|
3
|
+
describe Foodie2::Food do
|
4
|
+
it "broccoli is gross" do
|
5
|
+
Foodie2::Food.portray("Broccoli").should eql("Gross!")
|
6
|
+
end
|
7
|
+
|
8
|
+
it "anything else is delicious" do
|
9
|
+
Foodie2::Food.portray("Not Broccoli").should eql("Delicious!")
|
10
|
+
end
|
11
|
+
|
12
|
+
it "pluralizes a word" do
|
13
|
+
Foodie2::Food.pluralize("Tomato").should eql("Tomatoes")
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: foodie2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Juanito Fatas
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-08-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: thor
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.18.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.18.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: cucumber
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.3.6
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.3.6
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: aruba
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.5.3
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.5.3
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.14.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.14.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.4.0.pre.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.4.0.pre.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 10.1.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 10.1.0
|
111
|
+
description: Handcraft gem example with bundler, covers RSpec, Cucumber, and CLI using
|
112
|
+
thor by Ryan bigg.
|
113
|
+
email:
|
114
|
+
- katehuang0320@gmail.com
|
115
|
+
executables:
|
116
|
+
- foodie2
|
117
|
+
extensions: []
|
118
|
+
extra_rdoc_files: []
|
119
|
+
files:
|
120
|
+
- .gitignore
|
121
|
+
- Gemfile
|
122
|
+
- LICENSE
|
123
|
+
- README.md
|
124
|
+
- Rakefile
|
125
|
+
- bin/foodie2
|
126
|
+
- features/food.feature
|
127
|
+
- features/generator.feature
|
128
|
+
- features/step_definitions/aruba_ext_steps.rb
|
129
|
+
- features/support/setup.rb
|
130
|
+
- foodie2.gemspec
|
131
|
+
- lib/foodie2.rb
|
132
|
+
- lib/foodie2/cli.rb
|
133
|
+
- lib/foodie2/food.rb
|
134
|
+
- lib/foodie2/generators/recipe.rb
|
135
|
+
- lib/foodie2/generators/recipe/recipe.txt
|
136
|
+
- lib/foodie2/version.rb
|
137
|
+
- spec/foodie2_spec.rb
|
138
|
+
homepage: https://github.com/JuanitoFatas/foodie2
|
139
|
+
licenses:
|
140
|
+
- MIT
|
141
|
+
metadata: {}
|
142
|
+
post_install_message:
|
143
|
+
rdoc_options: []
|
144
|
+
require_paths:
|
145
|
+
- lib
|
146
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - '>='
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0'
|
156
|
+
requirements: []
|
157
|
+
rubyforge_project:
|
158
|
+
rubygems_version: 2.0.6
|
159
|
+
signing_key:
|
160
|
+
specification_version: 4
|
161
|
+
summary: Handcraft gem example with bundler, covers RSpec, Cucumber, and CLI using
|
162
|
+
thor by Ryan bigg.
|
163
|
+
test_files:
|
164
|
+
- features/food.feature
|
165
|
+
- features/generator.feature
|
166
|
+
- features/step_definitions/aruba_ext_steps.rb
|
167
|
+
- features/support/setup.rb
|
168
|
+
- spec/foodie2_spec.rb
|