foodie-ingmarsk 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +10 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +115 -0
- data/README.md +35 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/exe/foodie +3 -0
- data/features/food.feature +16 -0
- data/features/support/setup.rb +1 -0
- data/foodie.gemspec +41 -0
- data/lib/foodie/cli.rb +22 -0
- data/lib/foodie/food.rb +20 -0
- data/lib/foodie/version.rb +5 -0
- data/lib/foodie.rb +13 -0
- data/spec/foodie/food_spec.rb +11 -0
- data/spec/foodie_spec.rb +7 -0
- data/spec/spec_helper.rb +15 -0
- metadata +135 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: abe1ad21436defcba7adde5f169bdff76764f6a0bc7b14b982d6f00fc365f316
|
4
|
+
data.tar.gz: 92f92a7c4fb3a25855b6fac8521ee96d9d1656f22375ef0fe67cba0e412cc026
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 17590371c2f4171c052b0083a1fc351a22590f0269465a70fb8904d87a139afd0b185be1316c59dfbcff0e14bb0101c5246281dc01317040e6a48325513e34b7
|
7
|
+
data.tar.gz: c5fd91c7b89e9533039fd4ae35dda420a3c241856d081b19015f0ba24104f820a37aa0297da6257902990af51c40686da5309425c98a36bfdc3b8a9655630d41
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
foodie-ingmarsk (0.1.0)
|
5
|
+
activesupport
|
6
|
+
aruba
|
7
|
+
cucumber
|
8
|
+
rspec (~> 3.11)
|
9
|
+
thor
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
activesupport (6.1.6.1)
|
15
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
|
+
i18n (>= 1.6, < 2)
|
17
|
+
minitest (>= 5.1)
|
18
|
+
tzinfo (~> 2.0)
|
19
|
+
zeitwerk (~> 2.3)
|
20
|
+
aruba (2.1.0)
|
21
|
+
bundler (>= 1.17, < 3.0)
|
22
|
+
childprocess (>= 2.0, < 5.0)
|
23
|
+
contracts (>= 0.16.0, < 0.18.0)
|
24
|
+
cucumber (>= 4.0, < 9.0)
|
25
|
+
rspec-expectations (~> 3.4)
|
26
|
+
thor (~> 1.0)
|
27
|
+
ast (2.4.2)
|
28
|
+
builder (3.2.4)
|
29
|
+
childprocess (4.1.0)
|
30
|
+
concurrent-ruby (1.1.10)
|
31
|
+
contracts (0.16.1)
|
32
|
+
cucumber (8.0.0)
|
33
|
+
builder (~> 3.2, >= 3.2.4)
|
34
|
+
cucumber-ci-environment (~> 9.0, >= 9.0.4)
|
35
|
+
cucumber-core (~> 11.0, >= 11.0.0)
|
36
|
+
cucumber-cucumber-expressions (~> 15.1, >= 15.1.1)
|
37
|
+
cucumber-gherkin (~> 23.0, >= 23.0.1)
|
38
|
+
cucumber-html-formatter (~> 19.1, >= 19.1.0)
|
39
|
+
cucumber-messages (~> 18.0, >= 18.0.0)
|
40
|
+
diff-lcs (~> 1.5, >= 1.5.0)
|
41
|
+
mime-types (~> 3.4, >= 3.4.1)
|
42
|
+
multi_test (~> 1.1, >= 1.1.0)
|
43
|
+
sys-uname (~> 1.2, >= 1.2.2)
|
44
|
+
cucumber-ci-environment (9.1.0)
|
45
|
+
cucumber-core (11.0.0)
|
46
|
+
cucumber-gherkin (~> 23.0, >= 23.0.1)
|
47
|
+
cucumber-messages (~> 18.0, >= 18.0.0)
|
48
|
+
cucumber-tag-expressions (~> 4.1, >= 4.1.0)
|
49
|
+
cucumber-cucumber-expressions (15.2.0)
|
50
|
+
cucumber-gherkin (23.0.1)
|
51
|
+
cucumber-messages (~> 18.0, >= 18.0.0)
|
52
|
+
cucumber-html-formatter (19.2.0)
|
53
|
+
cucumber-messages (~> 18.0, >= 18.0.0)
|
54
|
+
cucumber-messages (18.0.0)
|
55
|
+
cucumber-tag-expressions (4.1.0)
|
56
|
+
diff-lcs (1.5.0)
|
57
|
+
ffi (1.15.5)
|
58
|
+
i18n (1.12.0)
|
59
|
+
concurrent-ruby (~> 1.0)
|
60
|
+
mime-types (3.4.1)
|
61
|
+
mime-types-data (~> 3.2015)
|
62
|
+
mime-types-data (3.2022.0105)
|
63
|
+
minitest (5.16.3)
|
64
|
+
multi_test (1.1.0)
|
65
|
+
parallel (1.22.1)
|
66
|
+
parser (3.1.2.1)
|
67
|
+
ast (~> 2.4.1)
|
68
|
+
rainbow (3.1.1)
|
69
|
+
rake (13.0.6)
|
70
|
+
regexp_parser (2.5.0)
|
71
|
+
rexml (3.2.5)
|
72
|
+
rspec (3.11.0)
|
73
|
+
rspec-core (~> 3.11.0)
|
74
|
+
rspec-expectations (~> 3.11.0)
|
75
|
+
rspec-mocks (~> 3.11.0)
|
76
|
+
rspec-core (3.11.0)
|
77
|
+
rspec-support (~> 3.11.0)
|
78
|
+
rspec-expectations (3.11.0)
|
79
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
80
|
+
rspec-support (~> 3.11.0)
|
81
|
+
rspec-mocks (3.11.1)
|
82
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
83
|
+
rspec-support (~> 3.11.0)
|
84
|
+
rspec-support (3.11.0)
|
85
|
+
rubocop (0.93.1)
|
86
|
+
parallel (~> 1.10)
|
87
|
+
parser (>= 2.7.1.5)
|
88
|
+
rainbow (>= 2.2.2, < 4.0)
|
89
|
+
regexp_parser (>= 1.8)
|
90
|
+
rexml
|
91
|
+
rubocop-ast (>= 0.6.0)
|
92
|
+
ruby-progressbar (~> 1.7)
|
93
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
94
|
+
rubocop-ast (1.21.0)
|
95
|
+
parser (>= 3.1.1.0)
|
96
|
+
ruby-progressbar (1.11.0)
|
97
|
+
sys-uname (1.2.2)
|
98
|
+
ffi (~> 1.1)
|
99
|
+
thor (1.2.1)
|
100
|
+
tzinfo (2.0.5)
|
101
|
+
concurrent-ruby (~> 1.0)
|
102
|
+
unicode-display_width (1.8.0)
|
103
|
+
zeitwerk (2.6.0)
|
104
|
+
|
105
|
+
PLATFORMS
|
106
|
+
x86_64-darwin-20
|
107
|
+
|
108
|
+
DEPENDENCIES
|
109
|
+
foodie-ingmarsk!
|
110
|
+
rake (~> 13.0)
|
111
|
+
rspec (~> 3.0)
|
112
|
+
rubocop (~> 0.80)
|
113
|
+
|
114
|
+
BUNDLED WITH
|
115
|
+
2.2.3
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Foodie
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/foodie`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'foodie'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install foodie
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/foodie.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "foodie"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/exe/foodie
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# These scenarios test the CLI our gem will provide.
|
2
|
+
|
3
|
+
Feature: Food
|
4
|
+
In order to portray or pluralize food
|
5
|
+
As a CLI
|
6
|
+
I want to be as objective as possible
|
7
|
+
|
8
|
+
# The first scenario ensures that we can call a specific task and pass it a single argument which then becomes the part of the text that is output.
|
9
|
+
Scenario: Broccoli is gross
|
10
|
+
When I run `foodie portray broccoli`
|
11
|
+
Then the output should contain "Gross!"
|
12
|
+
|
13
|
+
# The second scenario ensures effectively the same thing, but we pass that value in as an option rather than an argument.
|
14
|
+
Scenario: Tomato, or Tomato?
|
15
|
+
When I run `foodie pluralize --word Tomato`
|
16
|
+
Then the output should contain "Tomatoes"
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'aruba/cucumber'
|
data/foodie.gemspec
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/foodie/version"
|
4
|
+
|
5
|
+
# The Gem Specification file. This is where we provide information for Rubygems consumption such as the name,
|
6
|
+
# description and homepage of our gem. This is also where we specify the dependencies our gem needs to run.
|
7
|
+
|
8
|
+
Gem::Specification.new do |spec|
|
9
|
+
spec.name = "foodie-ingmarsk"
|
10
|
+
spec.version = Foodie::VERSION
|
11
|
+
spec.authors = ["Ingemar Andrade"]
|
12
|
+
spec.email = ["ingmar.lbs@gmail.com"]
|
13
|
+
|
14
|
+
spec.summary = "My first gem"
|
15
|
+
spec.homepage = "https://github.com/ingmarsk/foodie"
|
16
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
17
|
+
|
18
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
19
|
+
|
20
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
21
|
+
spec.metadata["source_code_uri"] = "https://github.com/ingmarsk/foodie"
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\^(?:test|spec|features)/}) }
|
27
|
+
end
|
28
|
+
spec.bindir = "exe"
|
29
|
+
spec.executables = spec.files.grep(%r{\^exe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ["lib"]
|
31
|
+
|
32
|
+
# Uncomment to register a new dependency of your gem
|
33
|
+
spec.add_dependency 'rspec', '~> 3.11'
|
34
|
+
spec.add_dependency 'activesupport'
|
35
|
+
spec.add_dependency 'cucumber'
|
36
|
+
spec.add_dependency 'aruba'
|
37
|
+
spec.add_dependency 'thor'
|
38
|
+
|
39
|
+
# For more information and examples about making a new gem, checkout our
|
40
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
41
|
+
end
|
data/lib/foodie/cli.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'foodie/food'
|
3
|
+
|
4
|
+
module Foodie
|
5
|
+
class CLI < Thor
|
6
|
+
|
7
|
+
# bundle exec exe/foodie portray broccoli => "Gross!"
|
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
|
+
# bundle exec exe/foodie pluralize -w Tomato => "Tomatoes"
|
14
|
+
desc 'pluralize', 'Pluralize a word'
|
15
|
+
method_option :word, aliases: '-w'
|
16
|
+
# Here there’s the new method_option method we use which defines, well, a method option.
|
17
|
+
# It takes a hash which indicates the details of an option how they should be returned to our task.
|
18
|
+
def pluralize
|
19
|
+
puts Foodie::Food.pluralize(options[:word])
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/foodie/food.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/inflector'
|
4
|
+
|
5
|
+
# To load this file, we’ll need to add a require line to 'lib/foodie.rb'
|
6
|
+
module Foodie
|
7
|
+
class Food
|
8
|
+
def self.portray(food)
|
9
|
+
if food.downcase == 'broccoli'
|
10
|
+
'Gross!'
|
11
|
+
else
|
12
|
+
'Delicious!'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.pluralize(word)
|
17
|
+
word.pluralize
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/foodie.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'foodie/version'
|
4
|
+
require 'foodie/food'
|
5
|
+
|
6
|
+
# The main file to define our gem’s code.
|
7
|
+
# This is the file that will be required by Bundler when our gem’s is loaded.
|
8
|
+
# This file defines a module which we can use as a namespace for all our gem’s code.
|
9
|
+
# It’s best practice to put our code (classes, etc.) for our gem in "lib/foodie"
|
10
|
+
module Foodie
|
11
|
+
class Error < StandardError; end
|
12
|
+
# Your code goes here...
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe Foodie::Food do
|
4
|
+
it 'broccoli is gross' do
|
5
|
+
expect(Foodie::Food.portray('Broccoli')).to eq('Gross!')
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'pluralizes a word' do
|
9
|
+
expect(Foodie::Food.pluralize('Tomato')).to eq('Tomatoes')
|
10
|
+
end
|
11
|
+
end
|
data/spec/foodie_spec.rb
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "foodie"
|
4
|
+
|
5
|
+
RSpec.configure do |config|
|
6
|
+
# Enable flags like --only-failures and --next-failure
|
7
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
8
|
+
|
9
|
+
# Disable RSpec exposing methods globally on `Module` and `main`
|
10
|
+
config.disable_monkey_patching!
|
11
|
+
|
12
|
+
config.expect_with :rspec do |c|
|
13
|
+
c.syntax = :expect
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: foodie-ingmarsk
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ingemar Andrade
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-09-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.11'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
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: cucumber
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
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'
|
62
|
+
type: :runtime
|
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: thor
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description:
|
84
|
+
email:
|
85
|
+
- ingmar.lbs@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".rubocop.yml"
|
93
|
+
- Gemfile
|
94
|
+
- Gemfile.lock
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- bin/console
|
98
|
+
- bin/setup
|
99
|
+
- exe/foodie
|
100
|
+
- features/food.feature
|
101
|
+
- features/support/setup.rb
|
102
|
+
- foodie.gemspec
|
103
|
+
- lib/foodie.rb
|
104
|
+
- lib/foodie/cli.rb
|
105
|
+
- lib/foodie/food.rb
|
106
|
+
- lib/foodie/version.rb
|
107
|
+
- spec/foodie/food_spec.rb
|
108
|
+
- spec/foodie_spec.rb
|
109
|
+
- spec/spec_helper.rb
|
110
|
+
homepage: https://github.com/ingmarsk/foodie
|
111
|
+
licenses: []
|
112
|
+
metadata:
|
113
|
+
allowed_push_host: https://rubygems.org
|
114
|
+
homepage_uri: https://github.com/ingmarsk/foodie
|
115
|
+
source_code_uri: https://github.com/ingmarsk/foodie
|
116
|
+
post_install_message:
|
117
|
+
rdoc_options: []
|
118
|
+
require_paths:
|
119
|
+
- lib
|
120
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.3.0
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
requirements: []
|
131
|
+
rubygems_version: 3.0.9
|
132
|
+
signing_key:
|
133
|
+
specification_version: 4
|
134
|
+
summary: My first gem
|
135
|
+
test_files: []
|