javy_foodie 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,18 @@
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
18
+ *.swp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in foodie.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 qmliu
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 ( http://github.com/<my-github-username>/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
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
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,20 @@
1
+ Feature: Generating things
2
+ In order to generate many a then
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
+
17
+ #### Instructions ####
18
+ Tips on how to make delicious steak go here.
19
+ """
20
+
@@ -0,0 +1 @@
1
+ require "aruba/cucumber"
@@ -0,0 +1,28 @@
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 |spec|
7
+ spec.name = "javy_foodie"
8
+ spec.version = Foodie::VERSION
9
+ spec.authors = ["javy_liu"]
10
+ spec.email = ["javy_liu@163.com"]
11
+ spec.summary = %q{test create ruby gems with bundle}
12
+ spec.description = %q{Test again to create rubygems width bundle.}
13
+ spec.homepage = "https://github.com/javyliu/foodie"
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency "activesupport"
21
+ spec.add_dependency "thor"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.5"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "rspec","~>2.6"
26
+ spec.add_development_dependency "cucumber"
27
+ spec.add_development_dependency "aruba"
28
+ end
@@ -0,0 +1,7 @@
1
+ require "foodie/version"
2
+ require "foodie/food"
3
+
4
+ module Foodie
5
+ # Your code goes here...
6
+ end
7
+
@@ -0,0 +1,23 @@
1
+ require "thor"
2
+ require "foodie"
3
+ require "foodie/generators/recipe"
4
+ module Foodie
5
+ class CLI < Thor
6
+ desc "portray ITEM","Determines if a piece of food is gross or delicious"
7
+ def portray(name)
8
+ puts Foodie::Food.portray(name)
9
+ end
10
+
11
+ desc "pluralize","Pluralizes a word"
12
+ method_option :word,aliases: "-w"
13
+ def pluralize
14
+ puts Foodie::Food.pluralize(options[:word])
15
+ end
16
+
17
+ desc "recipe","Generates a recipe scaffold"
18
+ def recipe(group,name)
19
+ Foodie::Generators::Recipe.start([group,name])
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,19 @@
1
+ require "active_support/inflector"
2
+ module Foodie
3
+ class Food
4
+ def self.portray(food)
5
+ if food.downcase == "broccoli"
6
+ "Gross!"
7
+
8
+ else
9
+ "Delicious!"
10
+ end
11
+
12
+ end
13
+
14
+ def self.pluralize(word)
15
+ word.pluralize
16
+ end
17
+ end
18
+
19
+ end
@@ -0,0 +1,26 @@
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
+
22
+ end
23
+
24
+ end
25
+
26
+ end
@@ -0,0 +1,7 @@
1
+ #### Ingredients ####
2
+ Ingredients for delicious <%= name %> go here.
3
+
4
+
5
+
6
+ #### Instructions ####
7
+ Tips on how to make delicious <%= name %> go here.
@@ -0,0 +1,3 @@
1
+ module Foodie
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,16 @@
1
+ require "foodie"
2
+ describe Foodie::Food do
3
+ it "broccoli is gross" do
4
+ Foodie::Food.portray("Broccoli").should eql("Gross!")
5
+ end
6
+
7
+ it "anything else is delicious" do
8
+ Foodie::Food.portray("Not Broccoli").should eql("Delicious!")
9
+ end
10
+
11
+ it "pluralizes a word" do
12
+ Foodie::Food.pluralize("Tomato").should eql("Tomatoes")
13
+
14
+ end
15
+
16
+ end
metadata ADDED
@@ -0,0 +1,180 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: javy_foodie
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - javy_liu
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-07-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activesupport
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: thor
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '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: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: bundler
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: '1.5'
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: '1.5'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
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: rspec
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '2.6'
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: '2.6'
94
+ - !ruby/object:Gem::Dependency
95
+ name: cucumber
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: aruba
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
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: Test again to create rubygems width bundle.
127
+ email:
128
+ - javy_liu@163.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/generators/recipe/recipe.txt
149
+ - lib/foodie/version.rb
150
+ - spec/foodie_spec.rb
151
+ homepage: https://github.com/javyliu/foodie
152
+ licenses: []
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.24
172
+ signing_key:
173
+ specification_version: 3
174
+ summary: test create ruby gems with bundle
175
+ test_files:
176
+ - features/food.feature
177
+ - features/generator.feature
178
+ - features/support/setup.rb
179
+ - spec/foodie_spec.rb
180
+ has_rdoc: