From 1455ffa63ea9aa26a127f6a89e20de00b930baf6 Mon Sep 17 00:00:00 2001 From: mertkahyaoglu Date: Thu, 30 Mar 2017 01:04:19 +0300 Subject: [PATCH 1/2] replace unicode temporarily --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6330463fd..201d2134f 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "redux-logger": "2.6.1", "redux-thunk": "2.1.0", "simplemde": "1.11.2", - "slug": "0.9.1", + "slug": "git+https://git@github.com/180-g/node-slug", "sortablejs": "1.4.2", "underscore": "1.8.3" }, From ac646f2b4e176f0cff5cfee90c03b4aada4d6caf Mon Sep 17 00:00:00 2001 From: mertkahyaoglu Date: Thu, 30 Mar 2017 01:29:07 +0300 Subject: [PATCH 2/2] fix rubocop --- .rubocop.yml | 2 ++ lib/jekyll-admin/server/collection.rb | 2 +- spec/jekyll-admin/apiable_spec.rb | 2 +- spec/jekyll-admin/server/collection_spec.rb | 4 ++-- spec/jekyll-admin/server/page_spec.rb | 4 ++-- spec/jekyll-admin/server_spec.rb | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 94fb6302f..23db0e02f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,6 +6,8 @@ AllCops: - lib/jekyll-admin/public/**/* - src/**/* - node_modules/**/* + - Gemfile + - jekyll-admin.gemspec Metrics/BlockLength: Enabled: false diff --git a/lib/jekyll-admin/server/collection.rb b/lib/jekyll-admin/server/collection.rb index d3e8a79b7..d6afaa974 100644 --- a/lib/jekyll-admin/server/collection.rb +++ b/lib/jekyll-admin/server/collection.rb @@ -2,7 +2,7 @@ module JekyllAdmin class Server < Sinatra::Base namespace "/collections" do get do - json site.collections.map { |c| c[1].to_api } + json(site.collections.map { |c| c[1].to_api }) end get "/:collection_id" do diff --git a/spec/jekyll-admin/apiable_spec.rb b/spec/jekyll-admin/apiable_spec.rb index 2356fdea4..92ba9b348 100644 --- a/spec/jekyll-admin/apiable_spec.rb +++ b/spec/jekyll-admin/apiable_spec.rb @@ -1,5 +1,5 @@ describe JekyllAdmin::APIable do - [:page, :post].each do |type| + %i(page post).each do |type| context type do subject do documents = Jekyll.sites.first.send("#{type}s".to_sym) diff --git a/spec/jekyll-admin/server/collection_spec.rb b/spec/jekyll-admin/server/collection_spec.rb index 6c612e4cb..4ae394a1b 100644 --- a/spec/jekyll-admin/server/collection_spec.rb +++ b/spec/jekyll-admin/server/collection_spec.rb @@ -48,8 +48,8 @@ def app context "entries" do let(:entries) { last_response_parsed } let(:documents) do - entries.select do |entry| - !entry.key? "type" + entries.reject do |entry| + entry.key? "type" end end let(:first_document) { documents.first } diff --git a/spec/jekyll-admin/server/page_spec.rb b/spec/jekyll-admin/server/page_spec.rb index 9f5dc4bcc..3074e5256 100644 --- a/spec/jekyll-admin/server/page_spec.rb +++ b/spec/jekyll-admin/server/page_spec.rb @@ -16,8 +16,8 @@ def app context "page index" do let(:entries) { last_response_parsed } let(:pages) do - entries.select do |entry| - !entry.key? "type" + entries.reject do |entry| + entry.key? "type" end end let(:first_page) { pages.first } diff --git a/spec/jekyll-admin/server_spec.rb b/spec/jekyll-admin/server_spec.rb index 52375624c..b89002c34 100644 --- a/spec/jekyll-admin/server_spec.rb +++ b/spec/jekyll-admin/server_spec.rb @@ -9,8 +9,8 @@ def app get "/pages" expect(last_response).to be_ok entries = last_response_parsed - first_page = entries.select do |entry| - !entry.key? "type" + first_page = entries.reject do |entry| + entry.key? "type" end.first expect(first_page["path"]).to eq("page.md") end