diff --git a/Gemfile b/Gemfile index 39fcd1f..a1d5d09 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,5 @@ source 'https://rubygems.org' -ruby '2.4.1' - gem 'rails' gem 'sqlite3' gem 'puma', '~> 3.11' diff --git a/Gemfile.lock b/Gemfile.lock index 0628b56..3975a22 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -318,8 +318,5 @@ DEPENDENCIES uglifier web-console (>= 3.3.0) -RUBY VERSION - ruby 2.4.1p111 - BUNDLED WITH - 1.16.0 + 1.16.1 diff --git a/app/models/post.rb b/app/models/post.rb index d283462..e1cd1bd 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -21,10 +21,10 @@ class Post @words.join(" ") end def template_name - "#{date}-#{@words.join("-")}" + "#{year}-#{month.to_s.rjust(2, '0')}-#{day.to_s.rjust(2, '0')}-#{@words.join("-")}" end def date - "#{year}-#{month}-#{day}" + Date.new(year,month,day) end def parse_int( value , max) ret = value.to_i diff --git a/app/views/posts/_2014-4-10-official-start.haml b/app/views/posts/_2014-04-10-official-start.haml similarity index 100% rename from app/views/posts/_2014-4-10-official-start.haml rename to app/views/posts/_2014-04-10-official-start.haml diff --git a/app/views/posts/_2014-4-22-to-see-or-not-to_c.haml b/app/views/posts/_2014-04-22-to-see-or-not-to_c.haml similarity index 100% rename from app/views/posts/_2014-4-22-to-see-or-not-to_c.haml rename to app/views/posts/_2014-04-22-to-see-or-not-to_c.haml diff --git a/app/views/posts/_2014-4-24-asm-out.haml b/app/views/posts/_2014-04-24-asm-out.haml similarity index 100% rename from app/views/posts/_2014-4-24-asm-out.haml rename to app/views/posts/_2014-04-24-asm-out.haml diff --git a/app/views/posts/_2014-5-6-first-parses.haml b/app/views/posts/_2014-05-06-first-parses.haml similarity index 100% rename from app/views/posts/_2014-5-6-first-parses.haml rename to app/views/posts/_2014-05-06-first-parses.haml diff --git a/app/views/posts/_2014-5-20-first-fibo.haml b/app/views/posts/_2014-05-20-first-fibo.haml similarity index 100% rename from app/views/posts/_2014-5-20-first-fibo.haml rename to app/views/posts/_2014-05-20-first-fibo.haml diff --git a/app/views/posts/_2014-6-10-more-clarity.haml b/app/views/posts/_2014-06-10-more-clarity.haml similarity index 100% rename from app/views/posts/_2014-6-10-more-clarity.haml rename to app/views/posts/_2014-06-10-more-clarity.haml diff --git a/app/views/posts/_2014-6-27-an-exceptional-thought.haml b/app/views/posts/_2014-06-27-an-exceptional-thought.haml similarity index 100% rename from app/views/posts/_2014-6-27-an-exceptional-thought.haml rename to app/views/posts/_2014-06-27-an-exceptional-thought.haml diff --git a/app/views/posts/_2014-7-5-layers-vs-passes.haml b/app/views/posts/_2014-07-05-layers-vs-passes.haml similarity index 100% rename from app/views/posts/_2014-7-5-layers-vs-passes.haml rename to app/views/posts/_2014-07-05-layers-vs-passes.haml diff --git a/app/views/posts/_2014-7-17-framing.haml b/app/views/posts/_2014-07-17-framing.haml similarity index 100% rename from app/views/posts/_2014-7-17-framing.haml rename to app/views/posts/_2014-07-17-framing.haml diff --git a/app/views/posts/_2014-8-1-name-has-been-found.haml b/app/views/posts/_2014-08-01-name-has-been-found.haml similarity index 100% rename from app/views/posts/_2014-8-1-name-has-been-found.haml rename to app/views/posts/_2014-08-01-name-has-been-found.haml diff --git a/app/views/posts/_2014-8-19-object-storage.haml b/app/views/posts/_2014-08-19-object-storage.haml similarity index 100% rename from app/views/posts/_2014-8-19-object-storage.haml rename to app/views/posts/_2014-08-19-object-storage.haml diff --git a/app/views/posts/_2014-9-12-register-allocation-reviewed.haml b/app/views/posts/_2014-09-12-register-allocation-reviewed.haml similarity index 100% rename from app/views/posts/_2014-9-12-register-allocation-reviewed.haml rename to app/views/posts/_2014-09-12-register-allocation-reviewed.haml diff --git a/app/views/posts/_2014-9-30-a-better-register-machine.haml b/app/views/posts/_2014-09-30-a-better-register-machine.haml similarity index 100% rename from app/views/posts/_2014-9-30-a-better-register-machine.haml rename to app/views/posts/_2014-09-30-a-better-register-machine.haml diff --git a/app/views/posts/_2015-3-21-review-_2015.haml b/app/views/posts/_2015-03-21-review-_2015.haml similarity index 100% rename from app/views/posts/_2015-3-21-review-_2015.haml rename to app/views/posts/_2015-03-21-review-_2015.haml diff --git a/app/views/posts/_2015-5-20-expression-is-slot.haml b/app/views/posts/_2015-05-20-expression-is-slot.haml similarity index 100% rename from app/views/posts/_2015-5-20-expression-is-slot.haml rename to app/views/posts/_2015-05-20-expression-is-slot.haml diff --git a/app/views/posts/_2015-6-20-the-static-call-chain.haml b/app/views/posts/_2015-06-20-the-static-call-chain.haml similarity index 100% rename from app/views/posts/_2015-6-20-the-static-call-chain.haml rename to app/views/posts/_2015-06-20-the-static-call-chain.haml diff --git a/app/views/posts/_2015-7-1-hello-world-again.haml b/app/views/posts/_2015-07-01-hello-world-again.haml similarity index 100% rename from app/views/posts/_2015-7-1-hello-world-again.haml rename to app/views/posts/_2015-07-01-hello-world-again.haml diff --git a/app/views/posts/_2015-7-25-i-like-not-playing-computer.haml b/app/views/posts/_2015-07-25-i-like-not-playing-computer.haml similarity index 100% rename from app/views/posts/_2015-7-25-i-like-not-playing-computer.haml rename to app/views/posts/_2015-07-25-i-like-not-playing-computer.haml diff --git a/app/views/posts/_2015-9-3-a-new-language.haml b/app/views/posts/_2015-09-03-a-new-language.haml similarity index 100% rename from app/views/posts/_2015-9-3-a-new-language.haml rename to app/views/posts/_2015-09-03-a-new-language.haml diff --git a/app/views/posts/_2016-3-7-mixup-of-levels.haml b/app/views/posts/_2016-03-07-mixup-of-levels.haml similarity index 100% rename from app/views/posts/_2016-3-7-mixup-of-levels.haml rename to app/views/posts/_2016-03-07-mixup-of-levels.haml diff --git a/app/views/posts/_2016-7-26-the-road-ahead.haml b/app/views/posts/_2016-07-26-the-road-ahead.haml similarity index 100% rename from app/views/posts/_2016-7-26-the-road-ahead.haml rename to app/views/posts/_2016-07-26-the-road-ahead.haml diff --git a/app/views/posts/_2017-1-2-a-new-year-a-new-name.haml b/app/views/posts/_2017-01-02-a-new-year-a-new-name.haml similarity index 100% rename from app/views/posts/_2017-1-2-a-new-year-a-new-name.haml rename to app/views/posts/_2017-01-02-a-new-year-a-new-name.haml diff --git a/app/views/posts/_2017-1-10-integer-unification.haml b/app/views/posts/_2017-01-10-integer-unification.haml similarity index 100% rename from app/views/posts/_2017-1-10-integer-unification.haml rename to app/views/posts/_2017-01-10-integer-unification.haml diff --git a/app/views/posts/_2017-2-3-of-slopes-and-chains-and-changes-in-the-air.haml b/app/views/posts/_2017-02-03-of-slopes-and-chains-and-changes-in-the-air.haml similarity index 100% rename from app/views/posts/_2017-2-3-of-slopes-and-chains-and-changes-in-the-air.haml rename to app/views/posts/_2017-02-03-of-slopes-and-chains-and-changes-in-the-air.haml diff --git a/app/views/posts/_2017-3-3-layer-summary.haml b/app/views/posts/_2017-03-03-layer-summary.haml similarity index 100% rename from app/views/posts/_2017-3-3-layer-summary.haml rename to app/views/posts/_2017-03-03-layer-summary.haml diff --git a/app/views/posts/_2017-4-7-how-not-to-interpret.haml b/app/views/posts/_2017-04-07-how-not-to-interpret.haml similarity index 100% rename from app/views/posts/_2017-4-7-how-not-to-interpret.haml rename to app/views/posts/_2017-04-07-how-not-to-interpret.haml diff --git a/app/views/posts/_2017-9-5-more-types-will-come-but-later.haml b/app/views/posts/_2017-09-05-more-types-will-come-but-later.haml similarity index 100% rename from app/views/posts/_2017-9-5-more-types-will-come-but-later.haml rename to app/views/posts/_2017-09-05-more-types-will-come-but-later.haml diff --git a/app/views/posts/_2018-4-9-a-dynamic-hello-world.haml b/app/views/posts/_2018-04-09-a-dynamic-hello-world.haml similarity index 100% rename from app/views/posts/_2018-4-9-a-dynamic-hello-world.haml rename to app/views/posts/_2018-04-09-a-dynamic-hello-world.haml diff --git a/app/views/posts/_2018-5-1-four-years-and-going-strong.haml b/app/views/posts/_2018-05-01-four-years-and-going-strong.haml similarity index 100% rename from app/views/posts/_2018-5-1-four-years-and-going-strong.haml rename to app/views/posts/_2018-05-01-four-years-and-going-strong.haml diff --git a/lib/assets/.keep b/lib/assets/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/lib/tasks/.keep b/lib/tasks/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/models/blog_spec.rb b/spec/models/blog_spec.rb index 98eb647..2f8caf9 100644 --- a/spec/models/blog_spec.rb +++ b/spec/models/blog_spec.rb @@ -31,10 +31,10 @@ RSpec.describe Post, type: :model do expect(@post.month).to eq 2 end it "returns date" do - expect(@post.date).to eq "1993-2-4" + expect(@post.date).to eq Date.new(1993,2,4) end it "returns file_name" do - expect(@post.template_name).to eq "1993-2-4-title" + expect(@post.template_name).to eq "1993-02-04-title" end end