terminal_app 0.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +6 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +36 -0
- data/README.md +36 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/add_contact.rb +23 -0
- data/lib/index.rb +46 -0
- data/lib/terminal_app.rb +10 -0
- data/lib/terminal_app/version.rb +3 -0
- data/lib/test.rb +53 -0
- data/lib/view_contact.rb +0 -0
- data/terminal_app.gemspec +29 -0
- metadata +72 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6a8967c97a00794a55903aefff8007bb4048fcb3050dd373d07e5053b9607227
|
4
|
+
data.tar.gz: c66d5e162e521193e2057b82bf22b8c5f86a36ad469216c7f7fedae5322abd4a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 179d21b81ed764e2c89a056ec19d1bfdfe0b0d0e610730e2f5e3c32147f74b8227ff6ff2e92debfd9cb80b6168588686c96181aaee18731d49d5ae1c552ac86a
|
7
|
+
data.tar.gz: dddccfdd82aff1197f5db9ad8a9241833ae7902ac5280fefa4e8cabac12c319b9ab9bf46ee629cc59e5254a3c6e6cd143d567b922cadc9a1a5664cfec1112656
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
terminal_app (0.1.0)
|
5
|
+
colorize (~> 0.8.1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
colorize (0.8.1)
|
11
|
+
diff-lcs (1.3)
|
12
|
+
rake (12.3.3)
|
13
|
+
rspec (3.9.0)
|
14
|
+
rspec-core (~> 3.9.0)
|
15
|
+
rspec-expectations (~> 3.9.0)
|
16
|
+
rspec-mocks (~> 3.9.0)
|
17
|
+
rspec-core (3.9.1)
|
18
|
+
rspec-support (~> 3.9.1)
|
19
|
+
rspec-expectations (3.9.0)
|
20
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
+
rspec-support (~> 3.9.0)
|
22
|
+
rspec-mocks (3.9.1)
|
23
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
+
rspec-support (~> 3.9.0)
|
25
|
+
rspec-support (3.9.2)
|
26
|
+
|
27
|
+
PLATFORMS
|
28
|
+
ruby
|
29
|
+
|
30
|
+
DEPENDENCIES
|
31
|
+
rake (~> 12.0)
|
32
|
+
rspec (~> 3.0)
|
33
|
+
terminal_app!
|
34
|
+
|
35
|
+
BUNDLED WITH
|
36
|
+
2.1.4
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# TerminalApp
|
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/terminal_app`. 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 'terminal_app'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install terminal_app
|
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 tags, 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]/terminal_app.
|
36
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "terminal_app"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/lib/add_contact.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
contact_new = []
|
2
|
+
def add_contact
|
3
|
+
|
4
|
+
puts 'You have selected add contact, please type exit at any point to go back to the main menu.'
|
5
|
+
|
6
|
+
puts 'Please input a name.'
|
7
|
+
print '>'
|
8
|
+
name = gets.chomp
|
9
|
+
contact_new << name
|
10
|
+
|
11
|
+
puts 'Please input an address.'
|
12
|
+
print '>'
|
13
|
+
address = gets.chomp
|
14
|
+
contact_new << address
|
15
|
+
|
16
|
+
puts 'Please input a phone number.'
|
17
|
+
print '>'
|
18
|
+
phone = gets.chomp
|
19
|
+
contact_new << phone
|
20
|
+
|
21
|
+
p contact_new
|
22
|
+
end
|
23
|
+
|
data/lib/index.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'add_contact.rb'
|
4
|
+
counter = 0
|
5
|
+
|
6
|
+
address_book = [
|
7
|
+
{
|
8
|
+
name: 'Micah Rus',
|
9
|
+
Address: '3 silvan court, Emerald',
|
10
|
+
Number: '0423 882 863'
|
11
|
+
}
|
12
|
+
]
|
13
|
+
|
14
|
+
puts 'Hello and welcome to your address book!'
|
15
|
+
|
16
|
+
puts ''
|
17
|
+
|
18
|
+
puts 'What would you like to do today?'
|
19
|
+
puts ''
|
20
|
+
puts '1. Add a contact.'
|
21
|
+
puts '2. View a contact.'
|
22
|
+
puts '3. Update a contact.'
|
23
|
+
puts '4. Delete a contact.'
|
24
|
+
puts '5. View address book.'
|
25
|
+
print '>'
|
26
|
+
user_input = gets.chomp.to_i
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
case user_input
|
32
|
+
when 1
|
33
|
+
add_contact
|
34
|
+
when 2
|
35
|
+
view_contact
|
36
|
+
when 3
|
37
|
+
update_contact
|
38
|
+
when 4
|
39
|
+
delete_contact
|
40
|
+
when 5
|
41
|
+
pp address_book
|
42
|
+
else
|
43
|
+
p 'That\'s not a valid input, please select 1, 2, 3, 4 or 5.'
|
44
|
+
end
|
45
|
+
|
46
|
+
p contact_new
|
data/lib/terminal_app.rb
ADDED
data/lib/test.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
|
2
|
+
# def add_contact
|
3
|
+
# def initialize
|
4
|
+
# @name = name
|
5
|
+
# @address = address
|
6
|
+
# @phone = phone
|
7
|
+
# contact_new = []
|
8
|
+
# end
|
9
|
+
|
10
|
+
# puts 'You have selected add contact, please type exit at any point to go back to the main menu.'
|
11
|
+
# puts ""
|
12
|
+
|
13
|
+
# puts 'Please input a name.'
|
14
|
+
# print '>'
|
15
|
+
# name = gets.chomp.to_s
|
16
|
+
# contact_new << @name
|
17
|
+
|
18
|
+
# puts 'Please input an address.'
|
19
|
+
# print '>'
|
20
|
+
# address = gets.chomp
|
21
|
+
# contact_new << address
|
22
|
+
|
23
|
+
# puts 'Please input a phone number.'
|
24
|
+
# print '>'
|
25
|
+
# phone = gets.chomp
|
26
|
+
# contact_new << phone
|
27
|
+
|
28
|
+
# p contact_new
|
29
|
+
# end
|
30
|
+
|
31
|
+
# p add_contact
|
32
|
+
# p ""
|
33
|
+
# p contact_new
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
address_book = [
|
40
|
+
{
|
41
|
+
name: 'Micah Rus',
|
42
|
+
address: '3 silvan court, Emerald',
|
43
|
+
number: '0423 882 863'
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
newhash = {
|
49
|
+
|
50
|
+
'name' => '1',
|
51
|
+
}
|
52
|
+
|
53
|
+
p newhash
|
data/lib/view_contact.rb
ADDED
File without changes
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require_relative 'lib/terminal_app/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "terminal_app"
|
5
|
+
spec.version = TerminalApp::VERSION
|
6
|
+
spec.authors = ["Micah"]
|
7
|
+
spec.email = ["Hexicans@gmail.com"]
|
8
|
+
|
9
|
+
spec.summary = "fast-track gem."
|
10
|
+
spec.description = "A gem that I am using for my terminal app assessment."
|
11
|
+
spec.homepage = "https://github.com/Hexicans96/terminal_app"
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
|
+
|
14
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'https://rubygems.org/profiles/Hexicans'"
|
15
|
+
|
16
|
+
# spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
# spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
|
18
|
+
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
23
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
+
end
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
spec.add_dependency 'colorize', '~> 0.8.1'
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: terminal_app
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Micah
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: colorize
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.8.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.8.1
|
27
|
+
description: A gem that I am using for my terminal app assessment.
|
28
|
+
email:
|
29
|
+
- Hexicans@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".gitignore"
|
35
|
+
- ".rspec"
|
36
|
+
- ".travis.yml"
|
37
|
+
- Gemfile
|
38
|
+
- Gemfile.lock
|
39
|
+
- README.md
|
40
|
+
- Rakefile
|
41
|
+
- bin/console
|
42
|
+
- bin/setup
|
43
|
+
- lib/add_contact.rb
|
44
|
+
- lib/index.rb
|
45
|
+
- lib/terminal_app.rb
|
46
|
+
- lib/terminal_app/version.rb
|
47
|
+
- lib/test.rb
|
48
|
+
- lib/view_contact.rb
|
49
|
+
- terminal_app.gemspec
|
50
|
+
homepage: https://github.com/Hexicans96/terminal_app
|
51
|
+
licenses: []
|
52
|
+
metadata: {}
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.3.0
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
requirements: []
|
68
|
+
rubygems_version: 3.2.0.pre1
|
69
|
+
signing_key:
|
70
|
+
specification_version: 4
|
71
|
+
summary: fast-track gem.
|
72
|
+
test_files: []
|