austin_crime 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3dec53207ca2de87e995280b343a7a5ec3985311
4
- data.tar.gz: 0b3e6aace345367d608b3471a66bae7054397926
3
+ metadata.gz: 5088f9a8eed78af72ed713a1c99fd64d51c52a7f
4
+ data.tar.gz: 2ab533825757ff43c0c7f6123002ef43c7223f24
5
5
  SHA512:
6
- metadata.gz: 526bfc5e9c64181fb29d3cfbde39feadbc0de7215c85ad8f6890f770b72c2968e943f9292e3d09b28d68ae10a189231f91f4a0546f93ba10734142eb25bd4e0b
7
- data.tar.gz: 2f6924f4a1692eeb795f59f375adbf8a63646e61dd1b382f5821a6063adc52df17e50b176a5d84cce3f7b5f3e5e3337945a68f2ffcd2e82d7706944c898a61fe
6
+ metadata.gz: f70fdae27b8625f9dd7f0a69406164a91e44b32b1b1e65ae7c40a8dbf91b164c6d8911043ecf075c08fb3bd524d0dca5c13961d46ff51e2660daacdd1387821b
7
+ data.tar.gz: f30283f26e89ba47bdac18731c50791b2083ebe26a28e66024e4dabf79a4fd52d4669eae61f59f03543fc93fb5459762b2c15b17739558909d9f230263ae94fd
@@ -4,29 +4,29 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'austin_crime/version'
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "austin_crime"
7
+ s.name = 'austin_crime'
8
8
  s.version = AustinCrime::VERSION
9
- s.authors = ["Tracy Holmes"]
10
- s.email = ["tracypholmes@gmail.com"]
9
+ s.authors = ['Tracy Holmes']
10
+ s.email = ['tracypholmes@gmail.com']
11
11
 
12
12
  s.summary = %q{Simple command line tool to view Austin crime stats.}
13
13
  s.description = %q{View crime reports on specific crime types!}
14
- s.homepage = "https://github.com/tracypholmes/austin_crime"
15
- s.license = "MIT"
14
+ s.homepage = 'https://github.com/tracypholmes/austin_crime'
15
+ s.license = 'MIT'
16
16
 
17
17
  s.files = `git ls-files -z`.split("\x0").reject do |f|
18
18
  f.match(%r{^(test|spec|features)/})
19
19
  end
20
- s.bindir = "bin"
20
+ s.bindir = 'bin'
21
21
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
22
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
23
- s.require_paths = ["lib"]
23
+ s.require_paths = ['lib']
24
24
 
25
25
  s.add_dependency 'thor', '~> 0'
26
26
  s.add_dependency 'httparty', '~> 0'
27
27
 
28
- s.add_development_dependency "bundler", "~> 1.14"
29
- s.add_development_dependency "pry", "~> 0.10"
30
- s.add_development_dependency "rake", "~> 10.0"
31
- s.add_development_dependency "rspec", "~> 3.0"
28
+ s.add_development_dependency 'bundler', '~> 1.14'
29
+ s.add_development_dependency 'pry', '~> 0.10'
30
+ s.add_development_dependency 'rake', '~> 10.0'
31
+ s.add_development_dependency 'rspec', '~> 3.0'
32
32
  end
@@ -1,3 +1,3 @@
1
- require_relative "./austin_crime/version"
1
+ require_relative './austin_crime/version'
2
2
  require_relative './austin_crime/crime'
3
3
  require_relative './austin_crime/cli'
@@ -1,9 +1,7 @@
1
1
  require 'httparty'
2
-
2
+ # this is my controller
3
3
  class AustinCrime::CLI
4
- def initialize
5
- # @inputs = inputs
6
- end
4
+ def initialize; end
7
5
 
8
6
  def call
9
7
  puts 'Welcome to Austin Crime Search!'
@@ -13,7 +11,6 @@ class AustinCrime::CLI
13
11
  end
14
12
 
15
13
  def inputs
16
- # inputs = ['DWI', 'HARASSMENT', 'CRUELTY TO ANIMALS', 'THEFT']
17
14
  # Select type of crime to view
18
15
  puts <<-DOC
19
16
  1. DWI
@@ -34,7 +31,7 @@ class AustinCrime::CLI
34
31
  puts "\nPlease enter the number of the crime type for more information. Or enter 'list' to see your list of options."
35
32
  puts "You may also enter 'q' to Quit."
36
33
  input = gets.strip.downcase
37
- # if input.to_i > 0 && input.to_i < 5
34
+ # if input.to_i > 0 && input.to_i < 5
38
35
  # puts AustinCrime::Crime.all
39
36
  case input
40
37
  when '1'
@@ -1,13 +1,13 @@
1
1
  require 'httparty'
2
2
  require 'pry'
3
-
3
+ # this is the core of my scraper - json lives here
4
4
  class AustinCrime::Crime
5
5
  def initialize
6
6
  @response = response
7
7
  end
8
8
 
9
9
  def self.url
10
- url = "https://data.austintexas.gov/resource/rkrg-9tez.json?$where=starts_with(crime_type,"
10
+ url = 'https://data.austintexas.gov/resource/rkrg-9tez.json?$where=starts_with(crime_type,'
11
11
  end
12
12
 
13
13
  def self.dwi
@@ -35,17 +35,18 @@ class AustinCrime::Crime
35
35
  @response.first.each do |k, v|
36
36
  puts "#{k}: #{v}"
37
37
  end
38
- puts "\nEnter 'more' if you'd like to browse more entries or 'menu' if you'd like to start over"
38
+ puts "\nEnter 'more' if you'd like to browse more entries or 'q' if you'd like Quit"
39
39
  input = gets.chomp
40
40
  if input == 'more'
41
41
  @response.collect do |hash|
42
42
  puts '--------------------'
43
- hash.collect do |k, v| # not supposed to use collect on hashes?
43
+ hash.collect do |k, v| # not supposed to use collect on hashes?
44
44
  puts "#{k}: #{v}"
45
45
  end.compact.reject(&:empty?) # c_cole on the assist
46
46
  end
47
- elsif input == 'menu'
48
- AustinCrime::CLI.inputs
47
+ elsif input == 'q'
48
+ puts "But you just got here! Thanks for viewing."
49
+ abort
49
50
  else
50
51
  puts 'Not sure what you want. Please try again.'
51
52
  end
@@ -1,3 +1,3 @@
1
1
  module AustinCrime
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: austin_crime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tracy Holmes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-21 00:00:00.000000000 Z
11
+ date: 2017-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor