talltorp_foodie 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e26ea572a16026914842a48e6468dcab1439f72c
4
+ data.tar.gz: 7c477f2db1df63df020b610a8f77f36759471bbd
5
+ SHA512:
6
+ metadata.gz: f56772a5045f0f70a6b635e37bf3bc235d4b3890884f569528db8b08c5c9abe811a636a8e6a2fc703d47af3b59aa98a1206fb1bf7f8364a61b41e6ede5022d99
7
+ data.tar.gz: e8ee495e2f32249d03084d5249a2b8fcdb7b72bee0ba95d8b07a7ba3bc81aac829d265a781a1bb1510eac1e9ec7a97319b1b034ac3f9c7b32682bce2c3e200ac
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,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in talltorp_foodie.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Tobias Talltorp
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
+ # TalltorpFoodie
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'talltorp_foodie'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install talltorp_foodie
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( http://github.com/<my-github-username>/talltorp_foodie/fork )
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"
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require 'talltorp_foodie/cli'
3
+ TalltorpFoodie::CLI.start
data/dinner/steak.txt ADDED
@@ -0,0 +1,6 @@
1
+ ##### Ingredients #####
2
+ Ingredients for delicious steak go here.
3
+
4
+
5
+ ##### Instructions #####
6
+ Tips on how to make delicious steak go here.
@@ -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 `talltorp_foodie portray broccoli`
8
+ Then the output should contain "Gross!"
9
+
10
+ Scenario: Tomato, or Tomato?
11
+ When I run `talltorp_foodie pluralize --word Tomato`
12
+ Then the output should contain "Tomatoes"fe
@@ -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 `talltorp_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,6 @@
1
+ require "talltorp_foodie/version"
2
+ require "talltorp_foodie/foodie"
3
+
4
+ module TalltorpFoodie
5
+ # Your code goes here...
6
+ end
@@ -0,0 +1,24 @@
1
+ require 'thor'
2
+ require "talltorp_foodie/foodie"
3
+ require 'talltorp_foodie/generators/recipe'
4
+
5
+ module TalltorpFoodie
6
+ class CLI < Thor
7
+ desc "portray ITEM", "Determines if a piece of food is gross or delicious"
8
+ def portray(name)
9
+ puts name
10
+ puts TalltorpFoodie::Foodie.portray(name)
11
+ end
12
+
13
+ desc "pluralize", "Pluralizes a word"
14
+ method_option :word, :aliases => "-w"
15
+ def pluralize
16
+ puts TalltorpFoodie::Foodie.pluralize(options[:word])
17
+ end
18
+
19
+ desc "recipe", "Generates a recipe scaffold"
20
+ def recipe(group, name)
21
+ TalltorpFoodie::Generators::Recipe.start([group, name])
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,17 @@
1
+ require 'active_support/inflector'
2
+
3
+ module TalltorpFoodie
4
+ class Foodie
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(food)
14
+ food.pluralize
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,23 @@
1
+ require 'thor/group'
2
+ module TalltorpFoodie
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 TalltorpFoodie
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,15 @@
1
+ require 'talltorp_foodie'
2
+
3
+ describe TalltorpFoodie::Foodie do
4
+ it "broccoli is gross" do
5
+ expect(TalltorpFoodie::Foodie.portray("Broccoli")).to eql("Gross!")
6
+ end
7
+
8
+ it "anything else is delicious" do
9
+ expect(TalltorpFoodie::Foodie.portray("Not Broccoli")).to eql("Delicious!")
10
+ end
11
+
12
+ it "pluralizes a word" do
13
+ expect(TalltorpFoodie::Foodie.pluralize("Tomatoe")).to eql("Tomatoes")
14
+ end
15
+ end
@@ -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 'talltorp_foodie/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "talltorp_foodie"
8
+ spec.version = TalltorpFoodie::VERSION
9
+ spec.authors = ["Tobias Talltorp"]
10
+ spec.email = ["tobias@talltorp.se"]
11
+ spec.summary = "first version of a gem"
12
+ spec.description = "broccoli is bleh"
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
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"
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.5"
25
+ spec.add_development_dependency "rake"
26
+ spec.add_development_dependency "rspec", "~> 3.0"
27
+ spec.add_development_dependency "cucumber"
28
+ spec.add_development_dependency "aruba"
29
+ end
metadata ADDED
@@ -0,0 +1,165 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: talltorp_foodie
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Tobias Talltorp
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-19 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'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: cucumber
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: aruba
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: broccoli is bleh
112
+ email:
113
+ - tobias@talltorp.se
114
+ executables:
115
+ - talltorp_foodie
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - ".gitignore"
120
+ - Gemfile
121
+ - LICENSE.txt
122
+ - README.md
123
+ - Rakefile
124
+ - bin/talltorp_foodie
125
+ - dinner/steak.txt
126
+ - features/food.feature
127
+ - features/generator.feature
128
+ - features/support/setup.rb
129
+ - lib/talltorp_foodie.rb
130
+ - lib/talltorp_foodie/cli.rb
131
+ - lib/talltorp_foodie/foodie.rb
132
+ - lib/talltorp_foodie/generators/recipe.rb
133
+ - lib/talltorp_foodie/generators/recipe/recipe.txt
134
+ - lib/talltorp_foodie/version.rb
135
+ - spec/talltorp_foodie_spec.rb
136
+ - talltorp_foodie.gemspec
137
+ homepage: ''
138
+ licenses:
139
+ - MIT
140
+ metadata: {}
141
+ post_install_message:
142
+ rdoc_options: []
143
+ require_paths:
144
+ - lib
145
+ required_ruby_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ required_rubygems_version: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
155
+ requirements: []
156
+ rubyforge_project:
157
+ rubygems_version: 2.2.0
158
+ signing_key:
159
+ specification_version: 4
160
+ summary: first version of a gem
161
+ test_files:
162
+ - features/food.feature
163
+ - features/generator.feature
164
+ - features/support/setup.rb
165
+ - spec/talltorp_foodie_spec.rb