easycomments 1.0.1 → 1.0.2
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/.gitignore +2 -1
- data/Gemfile +0 -5
- data/Gemfile.dev +14 -0
- data/README.md +17 -3
- data/_config.yml +4 -1
- data/bin/ec +7 -4
- data/easycomments.gemspec +1 -4
- data/lib/easycomments/ec_configuration.rb +3 -0
- data/lib/easycomments/ec_model.rb +1 -1
- data/lib/easycomments.rb +1 -1
- metadata +3 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c4e7fb9a16243a48eee3be7cc2437dd33d4a262
|
4
|
+
data.tar.gz: d0835f6862727a41b739466ef5509b2d576184e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b0e68bea14ead823241412ef0d364f10b833f6b62f75609d9f657df6b7fd9fd80da52c7e963502adadc8d25f933c74802fb78ce1b8070a60f3af65a336e17be
|
7
|
+
data.tar.gz: 20aa83d33f54d3b1bc8646f2188e167867a1f574561e39033ea65a454a77d1aac3148e584801d6209ae45553e65385a5c43b053ef88f2bfd691105d6eb99bba2
|
data/.gitignore
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
Gemfile.lock
|
1
|
+
Gemfile.lock
|
2
|
+
blog.db
|
data/Gemfile
CHANGED
data/Gemfile.dev
ADDED
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# EasyComments
|
2
|
+
[](http://badge.fury.io/rb/easycomments)
|
3
|
+
|
2
4
|
EasyComments(EC) is an easy to use comment system with a simple api
|
3
5
|
for posting and retrieving comments.It also comes bundled with a dashboard
|
4
6
|
for moderating your comments.
|
@@ -12,8 +14,12 @@ and then(if you installed the gem) in a directory run
|
|
12
14
|
```ruby
|
13
15
|
ec install
|
14
16
|
```
|
15
|
-
(pass the --dev flag if you also want the spec suite)
|
16
|
-
|
17
|
+
(pass the --dev flag if you also want the spec suite)
|
18
|
+
Then
|
19
|
+
```ruby
|
20
|
+
bundle install
|
21
|
+
```
|
22
|
+
and you are ready.
|
17
23
|
##Configuring
|
18
24
|
Edit _config.yml and add your database (all adapters supported by sequel can be used)
|
19
25
|
and change any other option you need.
|
@@ -67,7 +73,10 @@ timestamp_format: "%d/%m/%Y - %H:%M"
|
|
67
73
|
allow_cors: false
|
68
74
|
|
69
75
|
#see available formats here https://github.com/cyu/rack-cors
|
70
|
-
cors_origin: "*"
|
76
|
+
cors_origin: "*"
|
77
|
+
|
78
|
+
#set to false to not automatically escape html in comment bodys
|
79
|
+
auto_escape_html: true
|
71
80
|
```
|
72
81
|
|
73
82
|
## Updating
|
@@ -81,6 +90,11 @@ It will recopy all the files but keeps your _config.yml and Gemfile.
|
|
81
90
|
'rake adduser' you should always run this and not adding new users in _config.yml
|
82
91
|
by hand since it also bcypts your passwords!
|
83
92
|
|
93
|
+
##TODO:
|
94
|
+
* pagination in GET /comments
|
95
|
+
* markdown support
|
96
|
+
* dynamic fields in POST /comment
|
97
|
+
|
84
98
|
## Contributing
|
85
99
|
1. Fork it
|
86
100
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
data/_config.yml
CHANGED
@@ -3,8 +3,9 @@ connection: "sqlite://blog.db"
|
|
3
3
|
approve_by_default: false
|
4
4
|
allow_anonymous_post: false
|
5
5
|
timestamp_format: "%d/%m/%Y - %H:%M"
|
6
|
-
allow_cors:
|
6
|
+
allow_cors: true
|
7
7
|
cors_origin: "*"
|
8
|
+
auto_escape_html: true
|
8
9
|
:users:
|
9
10
|
#
|
10
11
|
##connection : database connection url to be passed to sequel's connect method.
|
@@ -22,6 +23,8 @@ cors_origin: "*"
|
|
22
23
|
#
|
23
24
|
##cors_origin : see available formats here https://github.com/cyu/rack-cors
|
24
25
|
#
|
26
|
+
##auto_escape_html : automatically escape html in comment bodys
|
27
|
+
#
|
25
28
|
##users : do not edit this by hand use 'rake adduser' instead.
|
26
29
|
#
|
27
30
|
##if you edit this file after 'rake init' use 'rake update' for the changes to take effect.
|
data/bin/ec
CHANGED
@@ -5,7 +5,7 @@ require 'fileutils'
|
|
5
5
|
local_path = File.expand_path("../../", __FILE__)
|
6
6
|
users_path = Dir.pwd
|
7
7
|
|
8
|
-
files = %w(ec.rb dashboard.rb config.ru _config.yml Rakefile Gemfile)
|
8
|
+
files = %w(ec.rb dashboard.rb config.ru _config.yml Rakefile Gemfile README.md LICENSE)
|
9
9
|
|
10
10
|
def copy_files(local_path, users_path, files, dev=false)
|
11
11
|
files.each do |filename|
|
@@ -17,6 +17,9 @@ def copy_files(local_path, users_path, files, dev=false)
|
|
17
17
|
if dev
|
18
18
|
FileUtils.cp_r local_path + "/spec", users_path, :verbose => true
|
19
19
|
FileUtils.cp_r local_path + '/.rspec', users_path, :verbose => true
|
20
|
+
if ARGV[0] == 'install'
|
21
|
+
FileUtils.cp_r local_path + '/Gemfile.dev', users_path + "/Gemfile", :verbose => true
|
22
|
+
end
|
20
23
|
end
|
21
24
|
end
|
22
25
|
|
@@ -36,10 +39,10 @@ elsif ARGV[0] == 'update'
|
|
36
39
|
copy_files(local_path, users_path, files)
|
37
40
|
end
|
38
41
|
puts "done!"
|
39
|
-
|
40
|
-
|
41
|
-
if ARGV[0] == '--help' || ARGV[0] == '-h' || ARGV[0].nil?
|
42
|
+
elsif ARGV[0] == '--help' || ARGV[0] == '-h' || ARGV[0].nil?
|
42
43
|
puts 'ec install, copies all the required files in the current directory.'
|
43
44
|
puts 'ec update, same as install but skips _config.yml and Gemfile.'
|
44
45
|
puts 'pass the --dev flag to "ec install" or "ec update" to also copy the test suite.'
|
46
|
+
else
|
47
|
+
puts "Uknown command : #{ARGV[0]}, see ec --help for available commands."
|
45
48
|
end
|
data/easycomments.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'easycomments'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.2'
|
4
4
|
s.date = '2015-03-30'
|
5
5
|
s.summary = "Simple and easy to use comment system"
|
6
6
|
s.description = <<EOF
|
@@ -12,9 +12,6 @@ EOF
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
s.executables << 'ec'
|
14
14
|
|
15
|
-
s.add_development_dependency 'airborne', '~> 0.1', '>=0.1.15'
|
16
|
-
s.add_development_dependency "rake", '~> 10.4', '>= 10.4.2'
|
17
|
-
|
18
15
|
s.authors = ["Zisis Maras"]
|
19
16
|
s.email = 'zisismaras@gmail.com'
|
20
17
|
s.homepage = 'https://github.com/zisismaras/easycomments'
|
@@ -13,6 +13,7 @@ module Configuration
|
|
13
13
|
PASSWORD = CONFIG["password"]
|
14
14
|
ALLOW_CORS = CONFIG["allow_cors"]
|
15
15
|
CORS_ORIGIN = CONFIG["cors_origin"]
|
16
|
+
AUTO_ESCAPE_HTML = CONFIG["auto_escape_html"]
|
16
17
|
|
17
18
|
#wall of help text to be added in _config.yml
|
18
19
|
def comment_wall
|
@@ -33,6 +34,8 @@ comments = <<COMMENTS
|
|
33
34
|
#
|
34
35
|
##cors_origin : see available formats here https://github.com/cyu/rack-cors
|
35
36
|
#
|
37
|
+
##auto_escape_html : automatically escape html in comment bodys
|
38
|
+
#
|
36
39
|
##users : do not edit this by hand use 'rake adduser' instead.
|
37
40
|
#
|
38
41
|
##if you edit this file after 'rake init' use 'rake update' for the changes to take effect.
|
data/lib/easycomments.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easycomments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zisis Maras
|
@@ -9,47 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2015-03-30 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: airborne
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0.1'
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 0.1.15
|
23
|
-
type: :development
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0.1'
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 0.1.15
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: rake
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '10.4'
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 10.4.2
|
43
|
-
type: :development
|
44
|
-
prerelease: false
|
45
|
-
version_requirements: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '10.4'
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 10.4.2
|
12
|
+
dependencies: []
|
53
13
|
description: |
|
54
14
|
EasyComments(EC) is an easy to use comment system with a simple api
|
55
15
|
for posting and retrieving comments.It also comes bundled with a dashboard
|
@@ -63,6 +23,7 @@ files:
|
|
63
23
|
- ".gitignore"
|
64
24
|
- ".rspec"
|
65
25
|
- Gemfile
|
26
|
+
- Gemfile.dev
|
66
27
|
- LICENSE
|
67
28
|
- README.md
|
68
29
|
- Rakefile
|