diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0fdd562..f213f4e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `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 # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new diff --git a/.travis.yml b/.travis.yml index 8e9e432..dfedc3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ language: ruby -rvm: 2.3.1 +dist: trusty +rvm: 2.4.1 cache: bundler -script: bundle exec rubocop diff --git a/Gemfile b/Gemfile index 748d429..e5307fc 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,9 @@ 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 'pry', group: %i(development test) +gem 'pry', group: %i[development test] gem 'rack' -gem 'rubocop', group: %i(development test) +gem 'rake' +gem 'rubocop', group: %i[development test] diff --git a/Gemfile.lock b/Gemfile.lock index 8157052..d97491b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,33 +2,37 @@ GEM remote: https://rubygems.org/ specs: ast (2.3.0) - aws-sdk (2.5.6) - aws-sdk-resources (= 2.5.6) - aws-sdk-core (2.5.6) + aws-sdk (2.9.17) + aws-sdk-resources (= 2.9.17) + aws-sdk-core (2.9.17) + aws-sigv4 (~> 1.0) jmespath (~> 1.0) - aws-sdk-resources (2.5.6) - aws-sdk-core (= 2.5.6) + aws-sdk-resources (2.9.17) + aws-sdk-core (= 2.9.17) + aws-sigv4 (1.0.0) coderay (1.1.1) jmespath (1.3.1) method_source (0.8.2) - parser (2.3.1.2) + parser (2.4.0.0) ast (~> 2.2) powerpack (0.1.1) pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - rack (2.0.1) - rainbow (2.1.0) - rubocop (0.42.0) - parser (>= 2.3.1.1, < 3.0) + rack (2.0.2) + rainbow (2.2.2) + rake + rake (12.0.0) + rubocop (0.48.1) + parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) ruby-progressbar (1.8.1) slop (3.6.0) - unicode-display_width (1.1.0) + unicode-display_width (1.2.1) PLATFORMS ruby @@ -37,7 +41,8 @@ DEPENDENCIES aws-sdk (~> 2) pry rack + rake rubocop BUNDLED WITH - 1.12.5 + 1.14.6 diff --git a/LICENSE b/LICENSE index ccd02ea..0dafe96 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ 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 of this software and associated documentation files (the "Software"), to deal diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..be86fd9 --- /dev/null +++ b/Rakefile @@ -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] diff --git a/cpi_fetcher.rb b/cpi_fetcher.rb index 5eb4408..cd712c0 100644 --- a/cpi_fetcher.rb +++ b/cpi_fetcher.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require 'json' require 'net/http' @@ -6,7 +7,11 @@ require 'net/https' require 'uri' 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 def initialize