Skip to content

Commit

Permalink
Upgrade to Rails 7 and Ruby 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ferblape committed Dec 24, 2023
1 parent e6299a6 commit 81bca52
Show file tree
Hide file tree
Showing 18 changed files with 698 additions and 225 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.4
3.2.2
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
source 'https://rubygems.org'

gem "pg", "~> 0.19"
gem "rails", "~> 5.2.0"
gem "pg", ">= 0.18", "< 2.0"
gem "rails"
gem "bootsnap"
gem 'listen'
gem "ine-places"

group :development, :test do
gem 'byebug'
gem 'irbtools'
end
315 changes: 217 additions & 98 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,129 +1,247 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.6)
actionpack (= 5.2.6)
actioncable (7.1.2)
actionpack (= 7.1.2)
activesupport (= 7.1.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
zeitwerk (~> 2.6)
actionmailbox (7.1.2)
actionpack (= 7.1.2)
activejob (= 7.1.2)
activerecord (= 7.1.2)
activestorage (= 7.1.2)
activesupport (= 7.1.2)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.2)
actionpack (= 7.1.2)
actionview (= 7.1.2)
activejob (= 7.1.2)
activesupport (= 7.1.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.6)
actionview (= 5.2.6)
activesupport (= 5.2.6)
rack (~> 2.0, >= 2.0.8)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.2)
actionpack (7.1.2)
actionview (= 7.1.2)
activesupport (= 7.1.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.6)
activesupport (= 5.2.6)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.2)
actionpack (= 7.1.2)
activerecord (= 7.1.2)
activestorage (= 7.1.2)
activesupport (= 7.1.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.2)
activesupport (= 7.1.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.6)
activesupport (= 5.2.6)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.2)
activesupport (= 7.1.2)
globalid (>= 0.3.6)
activemodel (5.2.6)
activesupport (= 5.2.6)
activerecord (5.2.6)
activemodel (= 5.2.6)
activesupport (= 5.2.6)
arel (>= 9.0)
activestorage (5.2.6)
actionpack (= 5.2.6)
activerecord (= 5.2.6)
marcel (~> 1.0.0)
activesupport (5.2.6)
activemodel (7.1.2)
activesupport (= 7.1.2)
activerecord (7.1.2)
activemodel (= 7.1.2)
activesupport (= 7.1.2)
timeout (>= 0.4.0)
activestorage (7.1.2)
actionpack (= 7.1.2)
activejob (= 7.1.2)
activerecord (= 7.1.2)
activesupport (= 7.1.2)
marcel (~> 1.0)
activesupport (7.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (9.0.0)
bootsnap (1.9.1)
msgpack (~> 1.0)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
base64 (0.2.0)
bigdecimal (3.1.5)
bootsnap (1.17.0)
msgpack (~> 1.2)
builder (3.2.4)
byebug (11.1.3)
concurrent-ruby (1.1.10)
cd (1.0.1)
clipboard (1.3.6)
code (0.9.4)
coderay (~> 1.1)
method_source (>= 0.9, < 2.0)
coderay (1.1.3)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
core_docs (0.9.9)
yard (~> 0.9.11)
crass (1.0.6)
erubi (1.10.0)
ffi (1.15.4)
globalid (1.0.1)
activesupport (>= 5.0)
i18n (1.12.0)
date (3.3.4)
debugging (2.1.0)
paint (>= 0.9, < 3.0)
drb (2.2.0)
ruby2_keywords
erubi (1.12.0)
every_day_irb (2.2.0)
cd (~> 1.0)
fancy_irb (2.1.1)
irb (>= 1.7, < 2.0)
paint (>= 0.9, < 3.0)
unicode-display_width (>= 2.5)
ffi (1.16.3)
globalid (1.2.1)
activesupport (>= 6.1)
hirb (0.7.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
ine-places (0.6.1)
activesupport (>= 4.2)
zeitwerk (>= 2.1.2)
listen (3.7.0)
interactive_editor (0.0.12)
spoon (~> 0.0.6)
io-console (0.7.1)
irb (1.11.0)
rdoc
reline (>= 0.3.8)
irbtools (4.0.6)
clipboard (~> 1.3)
code (>= 0.9.4, < 2.0)
coderay (~> 1.1)
core_docs (~> 0.9.9)
debugging (~> 2.1)
every_day_irb (~> 2.2)
fancy_irb (~> 2.1)
hirb (~> 0.7, >= 0.7.3)
interactive_editor (~> 0.0, >= 0.0.12)
irb (~> 1.8)
looksee (~> 5.0)
methodfinder (~> 2.2, >= 2.2.5)
object_shadow (~> 1.1)
os (~> 1.1, >= 1.1.4)
paint (>= 0.9, < 3.0)
ruby_engine (~> 2.0)
ruby_version (~> 1.0)
wirb (~> 2.0, >= 2.2.1)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.19.1)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
nokogiri (>= 1.12.0)
looksee (5.0.0)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_portile2 (2.8.1)
minitest (5.17.0)
msgpack (1.4.2)
nio4r (2.5.8)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
methodfinder (2.2.5)
mini_mime (1.1.5)
mini_portile2 (2.8.5)
minitest (5.20.0)
msgpack (1.7.2)
mutex_m (0.2.0)
net-imap (0.4.9)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.4.0)
net-protocol
nio4r (2.7.0)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
pg (0.21.0)
racc (1.6.2)
rack (2.2.6.4)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.6)
actioncable (= 5.2.6)
actionmailer (= 5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
activemodel (= 5.2.6)
activerecord (= 5.2.6)
activestorage (= 5.2.6)
activesupport (= 5.2.6)
bundler (>= 1.3.0)
railties (= 5.2.6)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
object_shadow (1.1.1)
os (1.1.4)
paint (2.3.0)
pg (1.5.4)
psych (5.1.2)
stringio
racc (1.7.3)
rack (3.0.8)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.1.2)
actioncable (= 7.1.2)
actionmailbox (= 7.1.2)
actionmailer (= 7.1.2)
actionpack (= 7.1.2)
actiontext (= 7.1.2)
actionview (= 7.1.2)
activejob (= 7.1.2)
activemodel (= 7.1.2)
activerecord (= 7.1.2)
activestorage (= 7.1.2)
activesupport (= 7.1.2)
bundler (>= 1.15.0)
railties (= 7.1.2)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.4)
loofah (~> 2.19, >= 2.19.1)
railties (5.2.6)
actionpack (= 5.2.6)
activesupport (= 5.2.6)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rake (13.0.6)
rb-fsevent (0.11.0)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.1.2)
actionpack (= 7.1.2)
activesupport (= 7.1.2)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
sprockets (4.0.2)
rdoc (6.6.2)
psych (>= 4.0.0)
reline (0.4.1)
io-console (~> 0.5)
ruby2_keywords (0.0.5)
ruby_engine (2.0.0)
ruby_version (1.0.3)
spoon (0.0.6)
ffi
stringio (3.1.0)
thor (1.3.0)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
thor (1.1.0)
thread_safe (0.3.6)
tzinfo (1.2.10)
thread_safe (~> 0.1)
websocket-driver (0.7.5)
unicode-display_width (2.5.0)
webrick (1.8.1)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.5.1)
wirb (2.2.2)
paint (>= 0.9, < 3.0)
yard (0.9.34)
zeitwerk (2.6.12)

PLATFORMS
ruby
Expand All @@ -132,9 +250,10 @@ DEPENDENCIES
bootsnap
byebug
ine-places
irbtools
listen
pg (~> 0.19)
rails (~> 5.2.0)
pg (>= 0.18, < 2.0)
rails

BUNDLED WITH
2.1.4
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ into a Postgres database. The data is from years 2010 to 2020 and includes plann

2 - Create a file `config/database.yml`. You can base it on `config/database.yml.example`

3 - Run `bundle install`
3 - Create the file `.rbenv-vars` and add `RAILS_ENV=development` to it.

4 - Create two databases, one for planned data, and other for executed data. In postgres you can
4 - Run `bundle install`

5 - Create two databases, one for planned data, and other for executed data. In postgres you can
do it using `createdb`. Example:
- `createdb budgets-planned`
- `createdb budgets-executed`

5 - Run the script:
6 - Run the script:
- To load the planned data: `$ bin/rails runner import.rb budgets-planned planned`
- To load the executed data: `$ bin/rails runner import.rb budgets-executed executed`
- To load the planned data for a specific year: `$ bin/rails runner import.rb budgets-planned planned 2021`
Expand Down
Loading

0 comments on commit 81bca52

Please sign in to comment.