go_blog 0.2.2 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9888579f7c35398f563800cd2d3684224bafa15
4
- data.tar.gz: 861ac9f2a32376d19bfc0f0dd846d7df983b4179
3
+ metadata.gz: 557818e78d8a1f0a0c5bc4019d5a69635ec947b9
4
+ data.tar.gz: 9afb1a566a911b32cae35b05c4ad0c50fef8d8cc
5
5
  SHA512:
6
- metadata.gz: 2d14a558cf7caf58ab0787163a0956b7945bef9457305713d66f6dba552a9e7179e2dd9100b53ed8014bf276de68f28e1b4cb4342acdc1f4041806e3f50ab948
7
- data.tar.gz: 2cc5b0761e56af9146f7186db04a0b3a5c1504f019ae153ce086b6b6b0c31d354dff902d9ab2f2d18e08585898369d930d4748671d9784306309d28504cc51c2
6
+ metadata.gz: 34b017327a92e922270c11563fababa9ab46341d23c742f3372f20c3a93ef3007b99a0af73ad34e11831d22e7a0de60115172bb887b076692d4f4182626bdf2e
7
+ data.tar.gz: '09e291fe2ab9c2b7691745a21a3361049df60381803ac2bbeed23092adf2631f8d1c1b6f6b3261a60780b07ac523948bb80b1e5311ddc73704df6336c07870d9'
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # GoBlog
2
- Short description and motivation.
2
+ Esse é o código fonte da engine GOBLOG.
3
3
 
4
4
  ## Usage
5
5
  How to use my plugin.
@@ -21,6 +21,8 @@ Or install it yourself as:
21
21
  $ gem install go_blog
22
22
  ```
23
23
 
24
+ ## Testes [![Build Status](https://travis-ci.org/gorails/go_blog.svg?branch=master)](https://travis-ci.org/gorails/go_blog) [![Coverage Status](https://coveralls.io/repos/github/gorails/go_blog/badge.svg?branch=master)](https://coveralls.io/github/gorails/go_blog?branch=master)
25
+
24
26
  ## Contributing
25
27
  Contribution directions go here.
26
28
 
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
- APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
17
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
18
18
  load 'rails/tasks/engine.rake'
19
19
 
20
20
 
@@ -13,7 +13,6 @@ module Blog
13
13
  end
14
14
 
15
15
  def list
16
-
17
16
  if params[:tag]
18
17
  @blog_posts = Post.tagged_with(params[:tag]).page params[:page]
19
18
  else
@@ -4,6 +4,7 @@ module Blog
4
4
  belongs_to :user
5
5
  has_many :taggings
6
6
  has_many :tags, through: :taggings
7
+ has_many :comments,class_name: 'Comment::Comment', as: :commentable
7
8
 
8
9
  def self.tagged_with(name)
9
10
  Tag.find_by_name!(name).posts.where('? >= published_at and draft = ?', DateTime.now, false).includes(:user)
@@ -0,0 +1,13 @@
1
+ json.array!(@blog_posts) do |post|
2
+ json.extract! post, :id, :title, :teaser, :body, :published_at
3
+ if post.custom_url
4
+ json.link post.custom_url
5
+ else
6
+ json.link Rails.application.routes.url_helpers.blog_post_url(id: post.id)
7
+ end
8
+ json.author do |jautor|
9
+ jautor.id post.user.id
10
+ jautor.name post.user.name
11
+ jautor.email post.user.email
12
+ end
13
+ end
@@ -22,6 +22,19 @@
22
22
  </div>
23
23
 
24
24
  </section>
25
+
26
+ <section class="content content-boxed">
27
+
28
+ <div class="row push-50-t push-50 nice-copy-story">
29
+ <div class="col-sm-8 col-sm-offset-2">
30
+
31
+
32
+ <%=render 'comment/comments/comments',comments:@blog_post.comments%>
33
+
34
+ </div>
35
+ </div>
36
+
37
+ </section>
25
38
  </div>
26
39
 
27
40
  <section class="content content-full content-boxed">
@@ -1,31 +1,10 @@
1
- #sqlite: &sqlite
2
- #adapter: sqlite3
3
- #database: db/<%= ENV['RAILS_ENV'] %>.sqlite3
4
-
5
- #mysql: &mysql
6
- #adapter: mysql2
7
- #username: root
8
- #password:
9
- #database: invoicer_<%= ENV['RAILS_ENV'] %>
10
-
11
- postgresql: &postgresql
1
+ default: &default
12
2
  adapter: postgresql
13
- username: postgres
14
- password:
15
- database: invoicer_<%= ENV['RAILS_ENV'] %>
16
- min_messages: ERROR
17
-
18
- defaults: &defaults
3
+ host: localhost
19
4
  pool: 5
20
5
  timeout: 5000
21
- host: localhost
22
- <<: *<%= ENV['DB'] || "sqlite" %>
23
-
24
- development:
25
- <<: *defaults
6
+ encoding: unicode
26
7
 
27
8
  test:
28
- <<: *defaults
29
-
30
- production:
31
- <<: *defaults
9
+ <<: *default
10
+ database: goblog_test
@@ -0,0 +1,6 @@
1
+ class CreateUsers < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :users do |t|
4
+ end
5
+ end
6
+ end
@@ -17,7 +17,10 @@ module GoBlog
17
17
  config.time_zone = 'Brasilia'
18
18
  config.i18n.load_path += Dir[config.root.join('config', 'locales','**', '*.{rb,yml}').to_s]
19
19
  config.encoding = "utf-8"
20
-
20
+ config.generators do |g|
21
+ g.test_framework :rspec
22
+ g.factory_bot dir: Dir[config.root.join('spec', 'factories').to_s]
23
+ end
21
24
 
22
25
  end
23
26
 
@@ -1,3 +1,3 @@
1
1
  module GoBlog
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Carlos Ottobboni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-29 00:00:00.000000000 Z
11
+ date: 2017-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: draper
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.7.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.7.1
41
55
  description: blog engine
42
56
  email:
43
57
  - jcottobboni@gmail.com
@@ -68,6 +82,7 @@ files:
68
82
  - app/views/blog/posts/edit.html.erb
69
83
  - app/views/blog/posts/index.html.erb
70
84
  - app/views/blog/posts/list.html.erb
85
+ - app/views/blog/posts/list.json.jbuilder
71
86
  - app/views/blog/posts/locales/model_locale.yml
72
87
  - app/views/blog/posts/locales/view_locale.yml
73
88
  - app/views/blog/posts/new.html.erb
@@ -80,6 +95,7 @@ files:
80
95
  - db/migrate/20171008203759_create_blog_posts.rb
81
96
  - db/migrate/20171012235935_create_blog_tags.rb
82
97
  - db/migrate/20171013000036_create_blog_taggings.rb
98
+ - db/migrate/20171205121408_create_users.rb
83
99
  - lib/go_blog.rb
84
100
  - lib/go_blog/engine.rb
85
101
  - lib/go_blog/version.rb