building_rocksolid 0.1.0

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
+ SHA256:
3
+ metadata.gz: 04b77f38f792300ec82efa6efdb230796f8edfd3c581997deef17a318422089c
4
+ data.tar.gz: e6342b00112bc42a965b6fe1d6edb644f2622145e126b56623665e55aab12e0d
5
+ SHA512:
6
+ metadata.gz: 202c7d7b57e2f0cc78de8465865eb9228b6d8b2176e4cc11036784828108b478023827525f85b5e55ad1c0a6e1042a392400cac5115ab6f723621f12d07cb0f7
7
+ data.tar.gz: 63ba3ba4d6dd69c9978a3658fbfcac5f5f86c461982de3ef707f347cd7b3ef5c05e213bd43e10c93d0ce56a401b0d4d129b71e985fb5f300094ca60fa4d390d1
data/.DS_Store ADDED
Binary file
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/CHANGELOG.md ADDED
File without changes
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+ gem 'http'
5
+ # gem 'rake (~> 10.0)'
6
+ # Specify your gem's dependencies in building_rocksolid.gemspec
7
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 mellowjoeys
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # BuildingRocksolid
2
+
3
+ Contains a building class that assists with CRUD methods. Using OOP to wrap the Architecture POROS API at 'localhost:3000/api/buildings
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'building_rocksolid'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install building_rocksolid
20
+
21
+ ## Usage
22
+
23
+ To be filled later. We will explain how to use this gem and Building methods.
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ 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).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/building_rocksolid.
34
+
35
+ ## License
36
+
37
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "building_rocksolid"
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
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,42 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "building_rocksolid/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "building_rocksolid"
8
+ spec.version = BuildingRocksolid::VERSION
9
+ spec.authors = ["mellowjoeys", "britt-sentiere", "jshin1223"]
10
+ spec.email = ["mellowjoeys@gmail.com", "britt.sentiere@gmail.com", "jshin1223@gmail.com"]
11
+
12
+ spec.summary = "Contains a building class that assists with CRUD methods. Using OOP to wrap the Architecture POROS API at 'localhost:3000/api/buildings'"
13
+ spec.homepage = 'https://github.com/mellowjoeys/building_rocksolid.git'
14
+ spec.license = "MIT"
15
+ # https://rubygems.org/gems/building_rocksolid
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ if spec.respond_to?(:metadata)
19
+ # spec.metadata["allowed_push_host"] = "'http://mygemserver.com'"
20
+
21
+ spec.metadata["homepage_uri"] = spec.homepage
22
+ spec.metadata["source_code_uri"] = 'https://github.com/mellowjoeys/building_rocksolid.git'
23
+ spec.metadata["changelog_uri"] = "https://github.com/mellowjoeys/building_rocksolid/blob/master/CHANGELOG.md"
24
+ else
25
+ raise "RubyGems 2.0 or newer is required to protect against " \
26
+ "public gem pushes."
27
+ end
28
+
29
+ # Specify which files should be added to the gem when it is released.
30
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
31
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
32
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
33
+ end
34
+ spec.bindir = "exe"
35
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
+ spec.require_paths = ["lib"]
37
+
38
+ spec.add_development_dependency "bundler", "~> 1.17"
39
+ spec.add_development_dependency "rake", "~> 10.0"
40
+ # spec.add_development_dependency "http"
41
+
42
+ end
@@ -0,0 +1,49 @@
1
+ require "building_rocksolid/version"
2
+
3
+ require 'http'
4
+
5
+ class Building
6
+ attr_accessor :name, :address, :height, :construction_date, :architect, :id
7
+ def initialize(input_options)
8
+ # add attributes here as instance variables
9
+ @name = input_options["name"]
10
+ @address = input_options["address"]
11
+ @height = input_options["height"]
12
+ @construction_date = input_options["construction_date"]
13
+ @architect = input_options["architect"]
14
+ @id = input_options["id"]
15
+ end
16
+
17
+ def self.all
18
+ response = HTTP.get("http://localhost:3000/api/buildings")
19
+ buildings_details = response.parse
20
+ buildings_details.map do |building_detail|
21
+ Building.find(building_detail["id"])
22
+ end
23
+ end
24
+
25
+ def self.create(building_details)
26
+ response = HTTP.post("http://localhost:3000/api/buildings", form: building_details)
27
+ building_details = response.parse
28
+ Building.new(building_details)
29
+ end
30
+
31
+ def self.find(input_id)
32
+ # write your logic for the method here
33
+ response = HTTP.get("http://localhost:3000/api/buildings/#{input_id}")
34
+ building_details = response.parse
35
+ Building.new(building_details)
36
+ end
37
+
38
+ def update(client_params)
39
+ response = HTTP.patch(
40
+ "http://localhost:3000/api/buildings/#{id}",
41
+ form: client_params
42
+ )
43
+
44
+ end
45
+
46
+ def self.destroy(building_id)
47
+ response = HTTP.delete("http://localhost:3000/api/buildings/#{building_id}")
48
+ end
49
+ end
@@ -0,0 +1,3 @@
1
+ module BuildingRocksolid
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: building_rocksolid
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - mellowjoeys
8
+ - britt-sentiere
9
+ - jshin1223
10
+ autorequire:
11
+ bindir: exe
12
+ cert_chain: []
13
+ date: 2019-09-25 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: bundler
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '1.17'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '1.17'
29
+ - !ruby/object:Gem::Dependency
30
+ name: rake
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '10.0'
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '10.0'
43
+ description:
44
+ email:
45
+ - mellowjoeys@gmail.com
46
+ - britt.sentiere@gmail.com
47
+ - jshin1223@gmail.com
48
+ executables: []
49
+ extensions: []
50
+ extra_rdoc_files: []
51
+ files:
52
+ - ".DS_Store"
53
+ - ".gitignore"
54
+ - CHANGELOG.md
55
+ - Gemfile
56
+ - LICENSE.txt
57
+ - README.md
58
+ - Rakefile
59
+ - bin/console
60
+ - bin/setup
61
+ - building_rocksolid.gemspec
62
+ - lib/building_rocksolid.rb
63
+ - lib/building_rocksolid/version.rb
64
+ homepage: https://github.com/mellowjoeys/building_rocksolid.git
65
+ licenses:
66
+ - MIT
67
+ metadata:
68
+ homepage_uri: https://github.com/mellowjoeys/building_rocksolid.git
69
+ source_code_uri: https://github.com/mellowjoeys/building_rocksolid.git
70
+ changelog_uri: https://github.com/mellowjoeys/building_rocksolid/blob/master/CHANGELOG.md
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubygems_version: 3.0.3
87
+ signing_key:
88
+ specification_version: 4
89
+ summary: Contains a building class that assists with CRUD methods. Using OOP to wrap
90
+ the Architecture POROS API at 'localhost:3000/api/buildings'
91
+ test_files: []