miniblog 1.0.0.beta → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.4.1 +1 -0
- data/app/controllers/miniblog/admin/base_controller.rb +3 -0
- data/app/controllers/miniblog/admin/posts_controller.rb +2 -0
- data/app/controllers/miniblog/admin/states_controller.rb +2 -0
- data/app/controllers/miniblog/sitemap_controller.rb +5 -0
- data/app/views/miniblog/application/_notices.html.erb +10 -0
- data/app/views/miniblog/posts/_post.html.erb +6 -0
- data/app/views/miniblog/posts/index.html.erb +1 -0
- data/app/views/miniblog/posts/show.html.erb +1 -0
- data/app/views/miniblog/sitemap/show.xml.builder +9 -0
- data/config/initializers/date_formats.rb +2 -1
- data/config/routes.rb +4 -0
- data/lib/miniblog.rb +0 -1
- data/lib/miniblog/engine.rb +6 -0
- data/lib/miniblog/rspec/miniblog_shared_examples.rb +10 -0
- data/lib/miniblog/version.rb +1 -1
- data/miniblog.gemspec +0 -1
- data/spec/dummy/db/migrate/01_create_users.rb +8 -0
- data/spec/dummy/db/schema.rb +1 -9
- metadata +12 -21
- data/app/views/miniblog/application/_notices.html.slim +0 -6
- data/app/views/miniblog/posts/_post.html.slim +0 -4
- data/app/views/miniblog/posts/index.html.slim +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0de00bc2b3a06487a4deb34c9bff19200bc36a6a
|
4
|
+
data.tar.gz: 01d10d1d7ded2925a6ff1f50f034f67e63d1c902
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a9ab784dffac907b0ff05df85b6604e3154245a6f4b9ef90866faf103bac937c0c38b47d050e9cc08cd4b3eed6c04ca5afe5c96b2847e9c6266611fc0bb4d72
|
7
|
+
data.tar.gz: 62d5a647e2f4da72001f882c25619db82759029014dd1ac3ffd17e1cbc22d1789701a819f00f8dfb12ebb9fe52dbee5aa1ccecfb0872907c342633367418750a
|
data/Gemfile.4.1
CHANGED
@@ -21,6 +21,7 @@ module Miniblog
|
|
21
21
|
@post.author = current_user
|
22
22
|
@post.regenerate_permalink
|
23
23
|
if @post.save
|
24
|
+
after_post_is_saved
|
24
25
|
redirect_to miniblog.edit_admin_post_path(@post), notice: "Post created succesfully"
|
25
26
|
else
|
26
27
|
render action: :new
|
@@ -45,6 +46,7 @@ module Miniblog
|
|
45
46
|
@post.regenerate_permalink
|
46
47
|
@post.save!
|
47
48
|
end
|
49
|
+
after_post_is_saved
|
48
50
|
flash[:notice] = "Post updated succesfully"
|
49
51
|
end
|
50
52
|
render action: :edit
|
@@ -3,8 +3,10 @@ class Miniblog::Admin::StatesController < Miniblog::Admin::BaseController
|
|
3
3
|
@post = Miniblog::Post.find(params[:post_id])
|
4
4
|
if @post.published?
|
5
5
|
@post.draft
|
6
|
+
after_post_is_saved
|
6
7
|
else
|
7
8
|
@post.publish
|
9
|
+
after_post_is_saved
|
8
10
|
end
|
9
11
|
redirect_to admin_posts_path
|
10
12
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render @posts %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render @post %>
|
@@ -1 +1,2 @@
|
|
1
|
-
Time::DATE_FORMATS[:miniblog_short]
|
1
|
+
Time::DATE_FORMATS[:miniblog_short] = '%Y-%m-%d'
|
2
|
+
Time::DATE_FORMATS[:miniblog_sitemap] = '%Y-%m-%dT%H:%M%:z'
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
Miniblog::Engine.routes.draw do
|
2
2
|
root :to => 'posts#index'
|
3
3
|
|
4
|
+
resources :posts, only: :show
|
5
|
+
get 'sitemap.(:format)', to: 'sitemap#show'
|
6
|
+
|
4
7
|
namespace :admin do
|
5
8
|
resources :authors, only: :index
|
6
9
|
|
@@ -22,5 +25,6 @@ Miniblog::Engine.routes.draw do
|
|
22
25
|
resources :preview, only: :show
|
23
26
|
|
24
27
|
root :to => 'posts#index'
|
28
|
+
|
25
29
|
end
|
26
30
|
end
|
data/lib/miniblog.rb
CHANGED
data/lib/miniblog/engine.rb
CHANGED
@@ -5,5 +5,11 @@ module Miniblog
|
|
5
5
|
initializer :assets do |config|
|
6
6
|
Rails.application.config.assets.precompile += %w(miniblog.css miniblog.js)
|
7
7
|
end
|
8
|
+
|
9
|
+
config.to_prepare do
|
10
|
+
Dir.glob(Rails.root + "app/decorators/**/*_decorator*.rb").each do |c|
|
11
|
+
require_dependency(c)
|
12
|
+
end
|
13
|
+
end
|
8
14
|
end
|
9
15
|
end
|
@@ -51,6 +51,16 @@ shared_examples_for "a miniblog", :type => :feature do
|
|
51
51
|
expect(post.reload.title).to eq 'A NEW post title'
|
52
52
|
end
|
53
53
|
|
54
|
+
it "previews a post" do
|
55
|
+
visit admin_posts_path
|
56
|
+
within "#post_#{post.id}" do
|
57
|
+
click_link 'Edit', match: :first
|
58
|
+
end
|
59
|
+
|
60
|
+
click_link 'Preview'
|
61
|
+
expect(page.current_path).to eq admin_preview_path(post)
|
62
|
+
end
|
63
|
+
|
54
64
|
it "deletes a post" do
|
55
65
|
visit admin_posts_path
|
56
66
|
|
data/lib/miniblog/version.rb
CHANGED
data/miniblog.gemspec
CHANGED
@@ -25,7 +25,6 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_dependency 'jquery-rails'
|
26
26
|
s.add_dependency 'jbuilder'
|
27
27
|
s.add_dependency 'redcarpet', '~> 3.2.2'
|
28
|
-
s.add_dependency 'slim'
|
29
28
|
s.add_dependency 'state_machine', '~> 1.2.0'
|
30
29
|
|
31
30
|
s.add_development_dependency 'capybara-webkit', '~> 1.5.0'
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20120219071614) do
|
15
15
|
|
16
16
|
create_table "miniblog_assets", force: :cascade do |t|
|
17
17
|
t.integer "post_id"
|
@@ -34,14 +34,6 @@ ActiveRecord::Schema.define(version: 20140501164642) do
|
|
34
34
|
t.datetime "updated_at"
|
35
35
|
end
|
36
36
|
|
37
|
-
create_table "miniblog_status_change_records", force: :cascade do |t|
|
38
|
-
t.integer "user_id"
|
39
|
-
t.integer "post_id"
|
40
|
-
t.string "state"
|
41
|
-
t.datetime "created_at"
|
42
|
-
t.datetime "updated_at"
|
43
|
-
end
|
44
|
-
|
45
37
|
create_table "users", force: :cascade do |t|
|
46
38
|
t.string "email"
|
47
39
|
t.string "name"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miniblog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Padilla
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -108,20 +108,6 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 3.2.2
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: slim
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :runtime
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: state_machine
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -297,6 +283,7 @@ files:
|
|
297
283
|
- app/controllers/miniblog/admin/transitions_controller.rb
|
298
284
|
- app/controllers/miniblog/application_controller.rb
|
299
285
|
- app/controllers/miniblog/posts_controller.rb
|
286
|
+
- app/controllers/miniblog/sitemap_controller.rb
|
300
287
|
- app/helpers/miniblog/admin/posts_helper.rb
|
301
288
|
- app/helpers/miniblog/application_helper.rb
|
302
289
|
- app/models/miniblog/asset.rb
|
@@ -316,9 +303,11 @@ files:
|
|
316
303
|
- app/views/miniblog/admin/posts/new.html.erb
|
317
304
|
- app/views/miniblog/admin/posts/new.html.slim
|
318
305
|
- app/views/miniblog/application/_navbar.html.erb
|
319
|
-
- app/views/miniblog/application/_notices.html.
|
320
|
-
- app/views/miniblog/posts/_post.html.
|
321
|
-
- app/views/miniblog/posts/index.html.
|
306
|
+
- app/views/miniblog/application/_notices.html.erb
|
307
|
+
- app/views/miniblog/posts/_post.html.erb
|
308
|
+
- app/views/miniblog/posts/index.html.erb
|
309
|
+
- app/views/miniblog/posts/show.html.erb
|
310
|
+
- app/views/miniblog/sitemap/show.xml.builder
|
322
311
|
- config/cucumber.yml
|
323
312
|
- config/initializers/date_formats.rb
|
324
313
|
- config/initializers/state_machine.rb
|
@@ -372,6 +361,7 @@ files:
|
|
372
361
|
- spec/dummy/config/locales/en.yml
|
373
362
|
- spec/dummy/config/routes.rb
|
374
363
|
- spec/dummy/config/secrets.yml
|
364
|
+
- spec/dummy/db/migrate/01_create_users.rb
|
375
365
|
- spec/dummy/db/schema.rb
|
376
366
|
- spec/dummy/db/seed.rb
|
377
367
|
- spec/dummy/lib/assets/.gitkeep
|
@@ -403,9 +393,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
403
393
|
version: '0'
|
404
394
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
405
395
|
requirements:
|
406
|
-
- - "
|
396
|
+
- - ">="
|
407
397
|
- !ruby/object:Gem::Version
|
408
|
-
version:
|
398
|
+
version: '0'
|
409
399
|
requirements: []
|
410
400
|
rubyforge_project:
|
411
401
|
rubygems_version: 2.2.2
|
@@ -449,6 +439,7 @@ test_files:
|
|
449
439
|
- spec/dummy/config/locales/en.yml
|
450
440
|
- spec/dummy/config/routes.rb
|
451
441
|
- spec/dummy/config/secrets.yml
|
442
|
+
- spec/dummy/db/migrate/01_create_users.rb
|
452
443
|
- spec/dummy/db/schema.rb
|
453
444
|
- spec/dummy/db/seed.rb
|
454
445
|
- spec/dummy/lib/assets/.gitkeep
|
@@ -1 +0,0 @@
|
|
1
|
-
= render @posts
|