diff --git a/.rubocop.yml b/.rubocop.yml index 2a7d469..43b8acd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,7 +13,7 @@ AllCops: - db/schema.rb - node_modules/**/* NewCops: enable - TargetRubyVersion: 3.2 + TargetRubyVersion: 2.7 Gemspec/DevelopmentDependencies: EnforcedStyle: gemspec diff --git a/.ruby-version b/.ruby-version index e4604e3..1f7da99 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.1 +2.7.7 diff --git a/CHANGELOG.md b/CHANGELOG.md index f888bf7..6897e25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/learningtapestry/lcms-engine/compare/v0.5.0...HEAD) +## [Unreleased](https://github.com/learningtapestry/lcms-engine/compare/v0.6.0...HEAD) +## [0.6.0](https://github.com/learningtapestry/lt-lcms/compare/v0.5.0...v0.6.0) - 2023-12-23 ### Added - Added Docker support [@paranoicsan](https://github.com/paranoicsan) @@ -14,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Updated dependencies [@paranoicsan](https://github.com/paranoicsan) +- Ruby updated to 2.7.7 [@shlag3n](https://github.com/shlag3n) at the main branch, 3.x version will be at separate branch ruby-3-upgrade +- Bump lt-google-api to 0.3.0 to upgrade google api to 0.11 [@shlag3n](https://github.com/shlag3n) ## [0.5.0](https://github.com/learningtapestry/lt-lcms/compare/v0.4.4...v0.5.0) - 2023-07-07 diff --git a/Dockerfile b/Dockerfile index e37abef..ef79f64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.2.1 +FROM ruby:2.7.7 ENV APP_PATH /app/ ENV LANG C.UTF-8 @@ -9,7 +9,7 @@ WORKDIR $APP_PATH COPY . $APP_PATH -ENV BUNDLER_VERSION 2.4.6 +ENV BUNDLER_VERSION 2.4.22 RUN gem install bundler:"$BUNDLER_VERSION" \ && bundle install --jobs `expr $(cat /proc/cpuinfo | grep -c "cpu cores") - 1` --retry 3 \ && rm -rf /usr/local/bundle/cache/*.gem \ diff --git a/Gemfile b/Gemfile index 2c37e91..1e6bed0 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,3 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } # Specify your gem's dependencies in lt-lcms.gemspec gemspec - -gem 'lt-google-api', github: 'learningtapestry/lt-google-api', - branch: 'master', - ref: '74c9baa' diff --git a/Gemfile.lock b/Gemfile.lock index 24e581a..d61a76d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,19 +1,10 @@ -GIT - remote: https://github.com/learningtapestry/lt-google-api - revision: 74c9baa3cb73775ccb2f9dfeedce04baed163398 - ref: 74c9baa - branch: master - specs: - lt-google-api (0.2.4) - google-api-client (~> 0.46) - googleauth (~> 0.14) - PATH remote: . specs: - lt-lcms (0.5.0) - google-api-client (~> 0.38) + lt-lcms (0.6.0) + google-apis-core (~> 0.11, >= 0.11.1) httparty (~> 0.18) + lt-google-api (~> 0.3) nokogiri (~> 1.10, >= 1.10.8) rubyzip (~> 2) @@ -25,7 +16,7 @@ GEM i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.5) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) base64 (0.1.1) @@ -33,36 +24,14 @@ GEM concurrent-ruby (1.2.2) csv (3.2.7) declarative (0.0.20) - faraday (1.10.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) + faraday (2.7.12) + base64 + faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) + faraday-net_http (3.0.2) ffi (1.15.5) fileutils (1.7.1) - gems (1.2.0) - google-api-client (0.53.0) - google-apis-core (~> 0.1) - google-apis-generator (~> 0.1) - google-apis-core (0.11.1) + google-apis-core (0.11.2) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -71,21 +40,17 @@ GEM retriable (>= 2.0, < 4.a) rexml webrick - google-apis-discovery_v1 (0.14.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-generator (0.12.0) - activesupport (>= 5.0) - gems (~> 1.2) + google-apis-drive_v3 (0.46.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-discovery_v1 (~> 0.5) - thor (>= 0.20, < 2.a) - googleauth (0.17.1) - faraday (>= 0.17.3, < 2.0) + google-cloud-env (2.1.0) + faraday (>= 1.0, < 3.a) + googleauth (1.9.1) + faraday (>= 1.0, < 3.a) + google-cloud-env (~> 2.1) jwt (>= 1.4, < 3.0) - memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) - signet (~> 0.15) + signet (>= 0.16, < 2.a) httparty (0.21.0) mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) @@ -100,12 +65,13 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.5.3) - memoist (0.16.2) + lt-google-api (0.3.0) + google-apis-drive_v3 (~> 0.46) + googleauth (~> 1.9) mini_mime (1.1.5) minitest (5.19.0) multi_json (1.15.0) multi_xml (0.6.0) - multipart-post (2.3.0) nokogiri (1.15.4-aarch64-linux) racc (~> 1.4) nokogiri (1.15.4-x86_64-linux) @@ -119,14 +85,14 @@ GEM parser (3.2.2.3) ast (~> 2.4.1) racc - public_suffix (5.0.3) + public_suffix (5.0.4) racc (1.7.1) rainbow (3.1.1) rake (13.0.6) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rbs (3.2.1) + rbs (3.1.3) regexp_parser (2.8.1) representable (3.2.0) declarative (< 0.1.0) @@ -152,7 +118,7 @@ GEM ruby2_keywords (0.0.5) rubyzip (2.3.2) securerandom (0.2.2) - signet (0.17.0) + signet (0.18.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) @@ -175,7 +141,6 @@ GEM strscan (3.0.6) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.2.2) trailblazer-option (0.1.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) @@ -189,7 +154,6 @@ PLATFORMS DEPENDENCIES bundler (~> 2.4) - lt-google-api! lt-lcms! overcommit (~> 0.60) rake (~> 13.0) @@ -197,4 +161,4 @@ DEPENDENCIES steep (~> 1.5.3) BUNDLED WITH - 2.4.6 + 2.4.22 diff --git a/lib/lt/lcms/lesson/downloader/gdoc.rb b/lib/lt/lcms/lesson/downloader/gdoc.rb index 2086ad6..c542f51 100644 --- a/lib/lt/lcms/lesson/downloader/gdoc.rb +++ b/lib/lt/lcms/lesson/downloader/gdoc.rb @@ -7,8 +7,8 @@ module Lcms module Lesson module Downloader class Gdoc < Base - GOOGLE_DRAWING_RE = %r{https?://docs\.google\.com/?[^"]*/drawings/[^"]*}i - GOOGLE_URL_RE = %r{https://www\.google\.com/url\?q=([^&]*)&?.*}i + GOOGLE_DRAWING_RE = %r{https?://docs\.google\.com/?[^"]*/drawings/[^"]*}i.freeze + GOOGLE_URL_RE = %r{https://www\.google\.com/url\?q=([^&]*)&?.*}i.freeze MIME_TYPE = 'application/vnd.google-apps.document' MIME_TYPE_EXPORT = 'text/html' diff --git a/lib/lt/lcms/lesson/uploader/gdoc.rb b/lib/lt/lcms/lesson/uploader/gdoc.rb index 8e04a9a..bd1197d 100644 --- a/lib/lt/lcms/lesson/uploader/gdoc.rb +++ b/lib/lt/lcms/lesson/uploader/gdoc.rb @@ -11,7 +11,7 @@ def initialize(credentials) def upload(name, content, content_type, parent_folder_id = nil) file_metadata = { - name:, + name: name, mime_type: Lt::Google::Api::Drive::MIME_FILE } file_metadata[:parents] = Array.wrap(parent_folder_id) unless parent_folder_id.nil? @@ -19,7 +19,7 @@ def upload(name, content, content_type, parent_folder_id = nil) file_metadata, fields: 'id', upload_source: StringIO.new(content), - content_type:, + content_type: content_type, supports_all_drives: true ) file.id diff --git a/lib/lt/lcms/version.rb b/lib/lt/lcms/version.rb index 67c2bf0..d0bca9f 100644 --- a/lib/lt/lcms/version.rb +++ b/lib/lt/lcms/version.rb @@ -2,6 +2,6 @@ module Lt module Lcms - VERSION = '0.5.0' + VERSION = '0.6.0' end end diff --git a/lt-lcms.gemspec b/lt-lcms.gemspec index 54cf3aa..05fd188 100644 --- a/lt-lcms.gemspec +++ b/lt-lcms.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.description = '' spec.license = 'Apache-2.0' - spec.required_ruby_version = '>= 3.2' + spec.required_ruby_version = '>= 2.7' # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' # to allow pushing to a single host or delete this section to allow pushing to any host. @@ -34,10 +34,9 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_dependency 'google-api-client', '~> 0.38' + spec.add_dependency 'google-apis-core', '~> 0.11', '>= 0.11.1' spec.add_dependency 'httparty', '~> 0.18' - # NOTE: Temporary moved to Gemfile - # spec.add_dependency 'lt-google-api', '~> 0.2', '>= 0.2.4' + spec.add_dependency 'lt-google-api', '~> 0.3' spec.add_dependency 'nokogiri', '~> 1.10', '>= 1.10.8' spec.add_dependency 'rubyzip', '~> 2' diff --git a/rbs_collection.lock.yaml b/rbs_collection.lock.yaml index 4ea1cad..cf0a326 100644 --- a/rbs_collection.lock.yaml +++ b/rbs_collection.lock.yaml @@ -2,7 +2,7 @@ sources: - type: git name: ruby/gem_rbs_collection - revision: b42e4de88058603a34446942143b3ac197b9685c + revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8 remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems path: ".gem_rbs_collection" @@ -15,6 +15,14 @@ gems: revision: b42e4de88058603a34446942143b3ac197b9685c remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems +- name: addressable + version: '2.8' + source: + type: git + name: ruby/gem_rbs_collection + revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems - name: ast version: '2.4' source: @@ -43,6 +51,10 @@ gems: revision: b42e4de88058603a34446942143b3ac197b9685c remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems +- name: fileutils + version: '0' + source: + type: stdlib - name: forwardable version: '0' source: @@ -119,6 +131,14 @@ gems: revision: b42e4de88058603a34446942143b3ac197b9685c remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems +- name: parser + version: '3.2' + source: + type: git + name: ruby/gem_rbs_collection + revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems - name: rainbow version: '3.0' source: @@ -127,6 +147,38 @@ gems: revision: b42e4de88058603a34446942143b3ac197b9685c remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems +- name: rake + version: '13.0' + source: + type: git + name: ruby/gem_rbs_collection + revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: regexp_parser + version: '2.8' + source: + type: git + name: ruby/gem_rbs_collection + revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: rubocop + version: '1.57' + source: + type: git + name: ruby/gem_rbs_collection + revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: rubocop-ast + version: '1.30' + source: + type: git + name: ruby/gem_rbs_collection + revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems - name: rubyzip version: '2.3' source: @@ -143,6 +195,14 @@ gems: version: '0' source: type: stdlib +- name: thor + version: '1.2' + source: + type: git + name: ruby/gem_rbs_collection + revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems - name: time version: '0' source: