Modernizin 🎉

This commit is contained in:
Dan Buch 2017-05-14 13:01:29 -04:00
parent 3a56880720
commit cef59ad534
7 changed files with 40 additions and 20 deletions

View File

@ -1,6 +1,6 @@
# This configuration was generated by # This configuration was generated by
# `rubocop --auto-gen-config` # `rubocop --auto-gen-config`
# on 2016-08-30 11:24:51 -0400 using RuboCop version 0.42.0. # on 2017-05-14 12:32:49 -0400 using RuboCop version 0.48.1.
# The point is for the user to remove these configuration records # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new

View File

@ -1,4 +1,4 @@
language: ruby language: ruby
rvm: 2.3.1 dist: trusty
rvm: 2.4.1
cache: bundler cache: bundler
script: bundle exec rubocop

View File

@ -1,8 +1,9 @@
source 'https://rubygems.org' source 'https://rubygems.org'
ruby '2.3.1' if ENV.key?('DYNO') ruby '2.4.1' if ENV.key?('DYNO')
gem 'aws-sdk', '~> 2' gem 'aws-sdk', '~> 2'
gem 'pry', group: %i(development test) gem 'pry', group: %i[development test]
gem 'rack' gem 'rack'
gem 'rubocop', group: %i(development test) gem 'rake'
gem 'rubocop', group: %i[development test]

View File

@ -2,33 +2,37 @@ GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
ast (2.3.0) ast (2.3.0)
aws-sdk (2.5.6) aws-sdk (2.9.17)
aws-sdk-resources (= 2.5.6) aws-sdk-resources (= 2.9.17)
aws-sdk-core (2.5.6) aws-sdk-core (2.9.17)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0) jmespath (~> 1.0)
aws-sdk-resources (2.5.6) aws-sdk-resources (2.9.17)
aws-sdk-core (= 2.5.6) aws-sdk-core (= 2.9.17)
aws-sigv4 (1.0.0)
coderay (1.1.1) coderay (1.1.1)
jmespath (1.3.1) jmespath (1.3.1)
method_source (0.8.2) method_source (0.8.2)
parser (2.3.1.2) parser (2.4.0.0)
ast (~> 2.2) ast (~> 2.2)
powerpack (0.1.1) powerpack (0.1.1)
pry (0.10.4) pry (0.10.4)
coderay (~> 1.1.0) coderay (~> 1.1.0)
method_source (~> 0.8.1) method_source (~> 0.8.1)
slop (~> 3.4) slop (~> 3.4)
rack (2.0.1) rack (2.0.2)
rainbow (2.1.0) rainbow (2.2.2)
rubocop (0.42.0) rake
parser (>= 2.3.1.1, < 3.0) rake (12.0.0)
rubocop (0.48.1)
parser (>= 2.3.3.1, < 3.0)
powerpack (~> 0.1) powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0) rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1) unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1) ruby-progressbar (1.8.1)
slop (3.6.0) slop (3.6.0)
unicode-display_width (1.1.0) unicode-display_width (1.2.1)
PLATFORMS PLATFORMS
ruby ruby
@ -37,7 +41,8 @@ DEPENDENCIES
aws-sdk (~> 2) aws-sdk (~> 2)
pry pry
rack rack
rake
rubocop rubocop
BUNDLED WITH BUNDLED WITH
1.12.5 1.14.6

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright © 2016 Dan Buch Copyright © 2017 Dan Buch
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

9
Rakefile Normal file
View File

@ -0,0 +1,9 @@
begin
require 'rubocop/rake_task'
rescue LoadError => e
warn e
end
RuboCop::RakeTask.new if defined?(RuboCop)
task default: %i[rubocop]

View File

@ -1,4 +1,5 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# frozen_string_literal: true
require 'json' require 'json'
require 'net/http' require 'net/http'
@ -6,7 +7,11 @@ require 'net/https'
require 'uri' require 'uri'
class CPIFetcher class CPIFetcher
DEFAULT_CPI_SERIES_URL = 'https://api.bls.gov/publicAPI/v2/timeseries/data/CUUSA210SA0'.freeze DEFAULT_CPI_SERIES_URL = File.join(
'https://api.bls.gov',
'publicAPI/v2/timeseries/data/CUUSA210SA0'
)
private_constant :DEFAULT_CPI_SERIES_URL
attr_reader :url, :bls_token attr_reader :url, :bls_token
def initialize def initialize