<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Carley Tripp</title>
    <description>The latest articles on DEV Community by Carley Tripp (@carleytripp).</description>
    <link>https://dev.to/carleytripp</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F31628%2F1879754d-79f7-41f4-8f9b-5fca13378055.jpg</url>
      <title>DEV Community: Carley Tripp</title>
      <link>https://dev.to/carleytripp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/carleytripp"/>
    <language>en</language>
    <item>
      <title>An Overview of My Sinatra Project for Flatiron</title>
      <dc:creator>Carley Tripp</dc:creator>
      <pubDate>Sun, 02 May 2021 05:59:34 +0000</pubDate>
      <link>https://dev.to/carleytripp/an-overview-of-my-sinatra-project-for-flatiron-4nbn</link>
      <guid>https://dev.to/carleytripp/an-overview-of-my-sinatra-project-for-flatiron-4nbn</guid>
      <description>&lt;p&gt;The second project in the Full Stack Web Development course at &lt;a href="http://www.flatironschool.com"&gt;Flatiron School&lt;/a&gt; is based on &lt;a href="http://rubygems.org/gems/sinatra"&gt;Sinatra&lt;/a&gt;. The task is to create a basic application centered around a topic of our own interest. It should include MVC architecture and allow users to create, read, update, and delete resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements 📋
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use ActiveRecord with Sinatra&lt;/li&gt;
&lt;li&gt;Use multiple models&lt;/li&gt;
&lt;li&gt;Use at least one has_many relationship on a User model and one belongs_to relationship on another model&lt;/li&gt;
&lt;li&gt;Must have user accounts - users must be able to sign up, sign in, and sign out&lt;/li&gt;
&lt;li&gt;Validate uniqueness of user login attribute (username or email)&lt;/li&gt;
&lt;li&gt;Once logged in, a user must have the ability to create, read, update, and delete the resource that belongs_to user&lt;/li&gt;
&lt;li&gt;Ensure that users can edit and delete only their own resources - not resources created by other users&lt;/li&gt;
&lt;li&gt;Validate user input so bad data cannot be persisted to the database&lt;/li&gt;
&lt;li&gt;BONUS: Display validation failures to user with error messages&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating CRUD Pokedex 🎉
&lt;/h2&gt;

&lt;p&gt;The concept behind my application is to allow users to create and add Pokemon to a global Pokedex. It's simply dubbed CRUD Pokedex. My inspiration was due partly to the Detective Pikachu trailer and mostly to the long hours I spent playing Pokemon Crystal Version on my bright green Game Boy Color.&lt;/p&gt;

&lt;h3&gt;
  
  
  Authentication
&lt;/h3&gt;

&lt;p&gt;CRUD Pokedex uses a SQLite3 database paired with ActiveRecord for object relational mapping. Since users must create an account to interact with the app, authentication is necessary. We achieve this with Sinatra sessions and &lt;a href="http://rubygems.org/gems/bcrypt"&gt;bcrypt&lt;/a&gt;, a password hashing gem. Sinatra also handles routing for our web application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Validations
&lt;/h3&gt;

&lt;p&gt;The application employs the use of validations for all form data submitted. This means that it will not allow any blank inputs, and all user accounts must be created with a unique username and password combination. If these validations fail, the form will not submit and an error message will appear at the top of the page detailing exactly what went wrong.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrapping It Up
&lt;/h3&gt;

&lt;p&gt;In order to pass the Sinatra project lab, all functionality listed in the requirements must be present - but this still leaves a lot of room for improvement. Specifically when it comes to application design. CRUD Pokedex is styled using a very basic CSS framework called &lt;a href="http://picturepan2.github.io/spectre/"&gt;Spectre.css&lt;/a&gt;, but it needs to be polished to achieve a more cohesive, professional look.&lt;/p&gt;

&lt;p&gt;Think of it as an alpha prototype. It includes basic functionality but needs a number of features in order to become a seriously engaging application for users. The addition of images, more user interaction, and detailed Pokemon information would help make it appealing for long-time use.&lt;/p&gt;

&lt;p&gt;Check out the Github repo for &lt;a href="http://github.com/jax05/crud-pokedex"&gt;CRUD Pokedex&lt;/a&gt; and feel free to submit your own pull requests. Your feedback and contributions are appreciated. ♥️&lt;/p&gt;

</description>
      <category>crud</category>
      <category>beginners</category>
      <category>sinatra</category>
      <category>bcrypt</category>
    </item>
    <item>
      <title>Creating a CLI Gem for My Flatiron School Project  </title>
      <dc:creator>Carley Tripp</dc:creator>
      <pubDate>Fri, 23 Apr 2021 00:49:22 +0000</pubDate>
      <link>https://dev.to/carleytripp/creating-a-cli-gem-for-my-flatiron-school-project-d25</link>
      <guid>https://dev.to/carleytripp/creating-a-cli-gem-for-my-flatiron-school-project-d25</guid>
      <description>&lt;p&gt;For my first portfolio project, I was challenged to program a CLI application with good object oriented code. I had to scrape a website and write a program that would offer a list of available data and information about that data that went at least one level deep. Sounds easy, right? Wrong. The task was actually quite daunting for a beginner like me.&lt;/p&gt;

&lt;p&gt;All of our previous lessons and labs offered pretty direct instructions on what we were supposed to do. Now that I was on my own, I started to panic. Which website would I choose? What kind of methods should I write? Do I really even know how to code?? Fortunately, my senses came back to me after a few minutes (or hours) of freaking out.&lt;/p&gt;

&lt;p&gt;I remembered that I had spent weeks preparing for this very moment. All the information I had absorbed from the lessons, labs, and lectures before was still there in my brain. I just needed to fish it out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;I was given a few requirements to meet:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Provide a CLI&lt;/li&gt;
&lt;li&gt;CLI must provide access to data from a web page.&lt;/li&gt;
&lt;li&gt;The data provided must go at least one level deep, generally by showing the user a list of available data and then being able to drill down into a specific item.&lt;/li&gt;
&lt;li&gt;The CLI application can not be a Music CLI application as that is too similiar to the other OO Ruby final project. Also please refrain from using Kickstarter as that was used for the scraping 'code along'.&lt;/li&gt;
&lt;li&gt;Use good OO design patterns. You should be creating a collection of objects - not hashes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There were also bonus points up for grab if I could create and publish a gem to &lt;a href="https://rubygems.org/" rel="noopener noreferrer"&gt;RubyGems&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparation
&lt;/h2&gt;

&lt;p&gt;After contemplating for some time, I decided on programming a science news reader. I quickly browsed my way over to the &lt;a href="http://www.sciencemag.org/" rel="noopener noreferrer"&gt;Science&lt;/a&gt; website in order to check it out. Bingo! It was perfect. The latest news was laid out in a nice order, and each story was contained within a list element that could easily be scraped. Now, I just had to figure out how to make a gem.&lt;/p&gt;

&lt;p&gt;There were a number of resources provided to help me get started. Among them was this &lt;a href="https://www.youtube.com/watch?v=_lDExWIhYKI" rel="noopener noreferrer"&gt;walkthrough video&lt;/a&gt; filmed by Avi. Admittedly, I had to start over a couple of times before getting everything in order, but I ended up successfully creating my first Ruby gem! Awesome.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing the code
&lt;/h2&gt;

&lt;p&gt;I began by creating two classes called CLI and Story. The CLI class would be responsible for greeting the user, listing the stories available to read, and providing menu options. I decided to include the scraper methods in my Story class rather than creating a separate class for scraping. This was because my scraper methods were rather small, and the class itself didn't contain much else.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FRaRZfDq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FRaRZfDq.png" alt="Imgur"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code quickly came together thanks to my earlier method stubs. If you don't know what method stubs are, they're basically little pieces of code that act as a placeholder for later functionality. For example, instead of the functional code written in the list method pictured above, I originally had something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;puts "Bees!"
puts "Volcano Story"
puts "Why Science Rocks"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After writing all the necessary code, I was finally ready to publish my gem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Launch 🎉
&lt;/h2&gt;

&lt;p&gt;Publishing my gem to RubyGems was super easy. Bundler created a rakefile when I made my gem so all I had to do was run 'rake install'. This allowed me to make sure everything was in working order before actually releasing my gem into the wild. When I was satisfied with the program, I used 'rake release' to publish.&lt;/p&gt;

&lt;p&gt;You can check the gem out &lt;a href="https://rubygems.org/gems/sciencemag_latest_news" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>gems</category>
      <category>ruby</category>
    </item>
  </channel>
</rss>
