From c18a6cbd8799bf4afed0773258cca7fbe7624474 Mon Sep 17 00:00:00 2001 From: Jonathan Loos Date: Wed, 15 Nov 2023 21:43:44 -0500 Subject: [PATCH] feat: add chartkick dependency --- README.md | 2 +- matey.gemspec | 1 + spec/sample/Gemfile | 3 +++ spec/sample/Gemfile.lock | 3 +++ spec/sample/app/javascript/application.js | 4 +++- spec/sample/config/application.rb | 2 +- spec/sample/config/importmap.rb | 2 ++ 7 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3106d8c..648f707 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ bundle install --gemfile spec/sample/Gemfile # run test cases and ensure everything is passing rake spec -# an interactive prompt that will allow you to experiment with matey (currently broken!) +# an interactive prompt that will allow you to experiment with matey bin/console ``` diff --git a/matey.gemspec b/matey.gemspec index f2687a6..8d95531 100644 --- a/matey.gemspec +++ b/matey.gemspec @@ -37,6 +37,7 @@ Gem::Specification.new do |spec| spec.add_dependency "view_component", "~> 2.74" spec.add_dependency "ahoy_matey", "~> 4.0" spec.add_dependency "groupdate", "~> 6.4.0" + spec.add_dependency "chartkick", "~>5.0.4" spec.add_development_dependency "rspec-rails", "~> 5.0" spec.add_development_dependency "factory_bot_rails", "~> 6.0" diff --git a/spec/sample/Gemfile b/spec/sample/Gemfile index 31abc67..9b6f3fd 100644 --- a/spec/sample/Gemfile +++ b/spec/sample/Gemfile @@ -44,6 +44,9 @@ gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] # Reduces boot times through caching; required in config/boot.rb gem "bootsnap", require: false +# include charting styles +gem "chartkick", "~>5.0.4" + # Use Sass to process CSS # gem "sassc-rails" diff --git a/spec/sample/Gemfile.lock b/spec/sample/Gemfile.lock index 38e10cd..21148ad 100644 --- a/spec/sample/Gemfile.lock +++ b/spec/sample/Gemfile.lock @@ -3,6 +3,7 @@ PATH specs: matey (0.1.5) ahoy_matey (~> 4.0) + chartkick (~> 5.0.4) groupdate (~> 6.4.0) view_component (~> 2.74) @@ -94,6 +95,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) + chartkick (5.0.4) concurrent-ruby (1.2.2) crass (1.0.6) date (3.3.3) @@ -295,6 +297,7 @@ PLATFORMS DEPENDENCIES bootsnap capybara + chartkick (~> 5.0.4) debug importmap-rails jbuilder diff --git a/spec/sample/app/javascript/application.js b/spec/sample/app/javascript/application.js index 059eab2..3e24937 100644 --- a/spec/sample/app/javascript/application.js +++ b/spec/sample/app/javascript/application.js @@ -1,3 +1,5 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails import "@hotwired/turbo-rails" -import "controllers" \ No newline at end of file +import "controllers" +import "chartkick" +import "Chart.bundle" \ No newline at end of file diff --git a/spec/sample/config/application.rb b/spec/sample/config/application.rb index 90ee93e..1934eea 100644 --- a/spec/sample/config/application.rb +++ b/spec/sample/config/application.rb @@ -26,7 +26,7 @@ class Application < Rails::Application # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") - config.action_controller.asset_host = "http://assets.example.com" + # config.action_controller.asset_host = "http://assets.example.com" end end diff --git a/spec/sample/config/importmap.rb b/spec/sample/config/importmap.rb index d7b455b..2534845 100644 --- a/spec/sample/config/importmap.rb +++ b/spec/sample/config/importmap.rb @@ -6,3 +6,5 @@ pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true pin_all_from "app/javascript/controllers", under: "controllers" +pin "chartkick", to: "chartkick.js" +pin "Chart.bundle", to: "Chart.bundle.js"